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L,EAAUa,CAAUb,CAAAA,UAAV,CAAqBjL,CAArB,CAHA,CAItBsL,sBAAwBa,CAADb;AAASQ,CAAUR,CAAAA,qBAAV,CAAgCa,CAAhC,CAJV,CAKtBZ,qBAAuBY,CAADZ,EAASO,CAAUP,CAAAA,oBAAV,CAA+BY,CAA/B,CALT,CAMtBC,yBAA0B,CACxB3D,CADwB,CAExBN,CAFwB,CAGxBC,CAHwB,CAAAgE,EAItB,CACQ5D,EAAV,CAAAsD,CAAA,CACErD,CADF,CHaS4D,iBGbT,CAGElE,CAHF,CAIEC,CAJF,CADE,CAVkB,CAkBtBkE,uBAAwB,CACtB7D,CADsB,CAEtBN,CAFsB,CAGtBC,CAHsB,CAAAkE,EAIpB,CACQ9D,EAAV,CAAAsD,CAAA,CACErD,CADF,CHEM8D,cGFN,CAGEpE,CAHF,CAIEC,CAJF,CADE,CAtBkB,CA+BtBoE,wBAAyBnsB,IAAAA,EA/BH,CAAxB,CAboE,CADjC,CAAvC;",
"sources":["third_party/java_src/jscomp/java/com/google/javascript/jscomp/js/util/defineproperty.js","third_party/java_src/jscomp/java/com/google/javascript/jscomp/js/util/global.js","third_party/java_src/jscomp/java/com/google/javascript/jscomp/js/util/polyfill.js","third_party/java_src/jscomp/java/com/google/javascript/jscomp/js/es6/globalthis.js","javascript/closure/base.js","third_party/javascript/tslib/tslib_closure.js","java/com/google/devtools/gerritcodereview/plugins/comments2code/web/ai-code-review-references.ts","java/com/google/devtools/gerritcodereview/plugins/comments2code/web/ai-code-review.ts","third_party/javascript/polygerrit/api/rest-api.ts","java/com/google/devtools/gerritcodereview/plugins/comments2code/web/autocomplete-comment-util.ts","third_party/javascript/polygerrit/api/suggestions.ts","third_party/javascript/custom_elements/src/native-shim-impl.js","javascript/polymer/detect_transpilation/detect_transpilation.ts","third_party/javascript/lit/packages/reactive-element/src/css-tag.ts","third_party/javascript/lit/packages/reactive-element/src/polyfill-support.ts","third_party/javascript/lit/packages/reactive-element/src/reactive-element.ts","third_party/javascript/lit/packages/reactive-element/src/decorators/property.ts","third_party/javascript/lit/packages/lit-html/src/polyfill-support.ts","third_party/javascript/lit/packages/lit-element/src/polyfill-support.ts","third_party/javascript/safevalues/internals/trusted_types.ts","third_party/javascript/safevalues/internals/html_impl.ts","third_party/javascript/safevalues/internals/pure.ts","third_party/javascript/safevalues/internals/resource_url_impl.ts","third_party/javascript/lit/packages/lit-html/src/internal-security.ts","third_party/javascript/safevalues/builders/resource_url_builders.ts","third_party/javascript/lit/packages/lit-html/src/lit-html.ts","third_party/javascript/lit/packages/lit-element/src/lit-element.ts","java/com/google/devtools/gerritcodereview/plugins/comments2code/web/c2c-help-icon.ts","java/com/google/devtools/gerritcodereview/plugins/comments2code/web/constants.ts","third_party/javascript/lit/packages/reactive-element/src/decorators/custom-element.ts","java/com/google/devtools/gerritcodereview/plugins/comments2code/web/suggest-code-util.ts","java/com/google/devtools/gerritcodereview/plugins/comments2code/web/predictor.ts","third_party/javascript/polygerrit/utils/common-util.ts","java/com/google/devtools/gerritcodereview/plugins/comments2code/web/suggest-fix-util.ts","java/com/google/devtools/gerritcodereview/plugins/comments2code/web/plugin.ts"],
"sourcesContent":["","","","","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Bootstrap for the Google JS Library (Closure).\n *\n * Avoid including base.js more than once. This is strictly discouraged and not\n * supported. goog.require(...) won't work properly in that case.\n *\n * @suppress {deprecated} Users cannot remove deprecated uses here.\n * @provideGoog\n */\n\n\n/**\n * @define {boolean} Overridden to true by the compiler.\n */\nvar COMPILED = false;\n\n\n/**\n * Base namespace for the Closure library.  Checks to see goog is already\n * defined in the current scope before assigning to prevent clobbering if\n * base.js is loaded more than once.\n *\n * @const\n */\nvar goog = goog || {};\n\n/**\n * Reference to the global object.\n * https://www.ecma-international.org/ecma-262/9.0/index.html#sec-global-object\n *\n * More info on this implementation here:\n * https://docs.google.com/document/d/1NAeW4Wk7I7FV0Y2tcUFvQdGMc89k2vdgSXInw8_nvCI/edit\n *\n * @const\n * @suppress {undefinedVars} self won't be referenced unless `this` is falsy.\n * @type {!Global}\n */\ngoog.global =\n    // Check `this` first for backwards compatibility.\n    // Valid unless running as an ES module or in a function wrapper called\n    //   without setting `this` properly.\n    // Note that base.js can't usefully be imported as an ES module, but it may\n    // be compiled into bundles that are loadable as ES modules.\n    this ||\n    // https://developer.mozilla.org/en-US/docs/Web/API/Window/self\n    // For in-page browser environments and workers.\n    self;\n\n\n/**\n * A hook for overriding the define values in uncompiled mode.\n *\n * In uncompiled mode, `CLOSURE_UNCOMPILED_DEFINES` may be defined before\n * loading base.js.  If a key is defined in `CLOSURE_UNCOMPILED_DEFINES`,\n * `goog.define` will use the value instead of the default value.  This\n * allows flags to be overwritten without compilation (this is normally\n * accomplished with the compiler's \"define\" flag).\n *\n * Example:\n * <pre>\n *   var CLOSURE_UNCOMPILED_DEFINES = {'goog.DEBUG': false};\n * </pre>\n *\n * @type {Object<string, (string|number|boolean)>|undefined}\n */\ngoog.global.CLOSURE_UNCOMPILED_DEFINES;\n\n\n/**\n * A hook for overriding the define values in uncompiled or compiled mode,\n * like CLOSURE_UNCOMPILED_DEFINES but effective in compiled code.  In\n * uncompiled code CLOSURE_UNCOMPILED_DEFINES takes precedence.\n *\n * Also unlike CLOSURE_UNCOMPILED_DEFINES the values must be number, boolean or\n * string literals or the compiler will emit an error.\n *\n * While any @define value may be set, only those set with goog.define will be\n * effective for uncompiled code.\n *\n * Example:\n * <pre>\n *   var CLOSURE_DEFINES = {'goog.DEBUG': false} ;\n * </pre>\n *\n * Currently the Closure Compiler will only recognize very simple definitions of\n * this value when looking for values to apply to compiled code and ignore all\n * other references.  Specifically, it looks the value defined at the variable\n * declaration, as with the example above.\n *\n * TODO(b/202066289): Improve the recognized definitions.\n *\n * @type {!Object<string, (string|number|boolean)>|null|undefined}\n */\ngoog.global.CLOSURE_DEFINES;\n\n\n/**\n * Builds an object structure for the provided namespace path, ensuring that\n * names that already exist are not overwritten. For example:\n * \"a.b.c\" -> a = {};a.b={};a.b.c={};\n * Used by goog.provide and goog.exportSymbol.\n * @param {string} name The name of the object that this file defines.\n * @param {*=} object The object to expose at the end of the path.\n * @param {boolean=} overwriteImplicit If object is set and a previous call\n *     implicitly constructed the namespace given by name, this parameter\n *     controls whether object should overwrite the implicitly constructed\n *     namespace or be merged into it. Defaults to false.\n * @param {?Object=} objectToExportTo The object to add the path to; if this\n *     field is not specified, its value defaults to `goog.global`.\n * @private\n */\ngoog.exportPath_ = function(name, object, overwriteImplicit, objectToExportTo) {\n  var parts = name.split('.');\n  var cur = objectToExportTo || goog.global;\n\n  for (var part; parts.length && (part = parts.shift());) {\n    if (!parts.length && object !== undefined) {\n      if (!overwriteImplicit && goog.isObject(object) &&\n          goog.isObject(cur[part])) {\n        // Merge properties on object (the input parameter) with the existing\n        // implicitly defined namespace, so as to not clobber previously\n        // defined child namespaces.\n        for (var prop in object) {\n          if (object.hasOwnProperty(prop)) {\n            cur[part][prop] = object[prop];\n          }\n        }\n      } else {\n        // Either there is no existing implicit namespace, or overwriteImplicit\n        // is set to true, so directly assign object (the input parameter) to\n        // the namespace.\n        cur[part] = object;\n      }\n    } else if (cur[part] && cur[part] !== Object.prototype[part]) {\n      cur = cur[part];\n    } else {\n      cur = cur[part] = {};\n    }\n  }\n};\n\n/**\n * Defines local copies for isolation of multiple chunk set. These values must\n * be set before closure base in order to have goog.define properly work.\n *\n * @suppress {checkVars}\n */\ngoog.CLOSURE_DEFINES = typeof CLOSURE_DEFINES !== 'undefined' ?\n    CLOSURE_DEFINES :\n    goog.global.CLOSURE_DEFINES;\n/**\n * @suppress {checkVars}\n */\ngoog.CLOSURE_UNCOMPILED_DEFINES =\n    typeof CLOSURE_UNCOMPILED_DEFINES !== 'undefined' ?\n    CLOSURE_UNCOMPILED_DEFINES :\n    goog.global.CLOSURE_UNCOMPILED_DEFINES;\n\n/**\n * Defines a named value. In uncompiled mode, the value is retrieved from\n * CLOSURE_DEFINES or CLOSURE_UNCOMPILED_DEFINES if the object is defined and\n * has the property specified, and otherwise used the defined defaultValue.\n * When compiled the default can be overridden using the compiler options or the\n * value set in the CLOSURE_DEFINES object. Returns the defined value so that it\n * can be used safely in modules. Note that the value type MUST be either\n * boolean, number, or string.\n *\n * @suppress {checkVars|lintChecks}\n *\n * @param {string} name The distinguished name to provide.\n * @param {T} defaultValue\n * @return {T} The defined value.\n * @template T\n * @tsType (name: string, defaultValue: boolean): boolean\n * @tsType (name: string, defaultValue: number): number\n * @tsType (name: string, defaultValue: string): string\n */\ngoog.define = function(name, defaultValue) {\n  var value = defaultValue;\n  if (!COMPILED) {\n    // Fallback to goog.global.CLOSURE_UNCOMPILED_DEFINES in the\n    // case that the value is set after closure base. This keeps existing code\n    // working.\n    var uncompiledDefines = goog.CLOSURE_UNCOMPILED_DEFINES ?\n        goog.CLOSURE_UNCOMPILED_DEFINES :\n        goog.global.CLOSURE_UNCOMPILED_DEFINES;\n    // Fallback to goog.global.CLOSURE_DEFINES in the case that the\n    // value is set after closure base. This keeps existing code working.\n    var defines = goog.CLOSURE_DEFINES ? goog.CLOSURE_DEFINES :\n                                         goog.global.CLOSURE_DEFINES;\n    if (uncompiledDefines &&\n        // Anti DOM-clobbering runtime check (b/37736576).\n        /** @type {?} */ (uncompiledDefines).nodeType === undefined &&\n        Object.prototype.hasOwnProperty.call(uncompiledDefines, name)) {\n      value = uncompiledDefines[name];\n    } else if (\n        defines &&\n        // Anti DOM-clobbering runtime check (b/37736576).\n        /** @type {?} */ (defines).nodeType === undefined &&\n        Object.prototype.hasOwnProperty.call(defines, name)) {\n      value = defines[name];\n    }\n  }\n  return value;\n};\n\n\n/**\n * @define {number} Integer year indicating the set of browser features that are\n * guaranteed to be present.  This is defined to include exactly features that\n * work correctly on all \"modern\" browsers that are stable on January 1 of the\n * specified year.  For example,\n * ```js\n * if (goog.FEATURESET_YEAR >= 2019) {\n *   // use APIs known to be available on all major stable browsers Jan 1, 2019\n * } else {\n *   // polyfill for older browsers\n * }\n * ```\n * This is intended to be the primary define for removing\n * unnecessary browser compatibility code (such as ponyfills and workarounds),\n * and should inform the default value for most other defines:\n * ```js\n * const ASSUME_NATIVE_PROMISE =\n *     goog.define('ASSUME_NATIVE_PROMISE', goog.FEATURESET_YEAR >= 2016);\n * ```\n *\n * The default assumption is that IE9 is the lowest supported browser, which was\n * first available Jan 1, 2012.\n *\n * TODO(mathiasb): Reference more thorough documentation when it's available.\n */\ngoog.FEATURESET_YEAR = goog.define('goog.FEATURESET_YEAR', 2012);\n\n\n/**\n * @define {boolean} DEBUG is provided as a convenience so that debugging code\n * that should not be included in a production. It can be easily stripped\n * by specifying --define goog.DEBUG=false to the Closure Compiler aka\n * JSCompiler. For example, most toString() methods should be declared inside an\n * \"if (goog.DEBUG)\" conditional because they are generally used for debugging\n * purposes and it is difficult for the JSCompiler to statically determine\n * whether they are used.\n */\ngoog.DEBUG = goog.define('goog.DEBUG', true);\n\n\n/**\n * @define {string} LOCALE defines the locale being used for compilation. It is\n * used to select locale specific data to be compiled in js binary. BUILD rule\n * can specify this value by \"--define goog.LOCALE=<locale_name>\" as a compiler\n * option.\n *\n * Take into account that the locale code format is important. You should use\n * the canonical Unicode format with hyphen as a delimiter. Language must be\n * lowercase, Language Script - Capitalized, Region - UPPERCASE.\n * There are few examples: pt-BR, en, en-US, sr-Latin-BO, zh-Hans-CN.\n *\n * See more info about locale codes here:\n * http://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers\n *\n * For language codes you should use values defined by ISO 693-1. See it here\n * http://www.w3.org/WAI/ER/IG/ert/iso639.htm. There is only one exception from\n * this rule: the Hebrew language. For legacy reasons the old code (iw) should\n * be used instead of the new code (he).\n *\n * MOE:begin_intracomment_strip\n * See http://g3doc/i18n/identifiers/g3doc/synonyms.\n * MOE:end_intracomment_strip\n */\ngoog.LOCALE = goog.define('goog.LOCALE', 'en');  // default to en\n\n\n/**\n * @define {boolean} Whether this code is running on trusted sites.\n *\n * On untrusted sites, several native functions can be defined or overridden by\n * external libraries like Prototype, Datejs, and JQuery and setting this flag\n * to false forces closure to use its own implementations when possible.\n *\n * If your JavaScript can be loaded by a third party site and you are wary about\n * relying on non-standard implementations, specify\n * \"--define goog.TRUSTED_SITE=false\" to the compiler.\n */\ngoog.TRUSTED_SITE = goog.define('goog.TRUSTED_SITE', true);\n\n\n/**\n * @define {boolean} Whether code that calls {@link goog.setTestOnly} should\n *     be disallowed in the compilation unit.\n */\ngoog.DISALLOW_TEST_ONLY_CODE =\n    goog.define('goog.DISALLOW_TEST_ONLY_CODE', COMPILED && !goog.DEBUG);\n\n\n/**\n * @define {boolean} Whether to use a Chrome app CSP-compliant method for\n *     loading scripts via goog.require. @see appendScriptSrcNode_.\n */\ngoog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING =\n    goog.define('goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING', false);\n\n\n// MOE:begin_strip\n/**\n * Read a flag from the runtime flags object.\n * @param {number} googFlagId Enum ordinal\n * @param {boolean} defaultValue Value to return if the flag is not given\n * @return {boolean}\n */\ngoog.readFlagInternalDoNotUseOrElse = function(googFlagId, defaultValue) {\n  var obj = goog.getObjectByName(goog.FLAGS_OBJECT_);\n  var val = obj && obj[googFlagId];\n  return val != null ? val : defaultValue;\n};\n\n\n/**\n * Name of the object to look for when looking up runtime flag values.  May be a\n * fully qualified object name (e.g. 'foo.bar').\n * @define {string}\n * @private\n */\ngoog.FLAGS_OBJECT_ = goog.define('goog.FLAGS_OBJECT', 'CLOSURE_FLAGS');\n\n\n/**\n * Default value for the STAGING flag.  Defaults to `true`, indicating that\n * flags are enabled by default once they reach the STAGING lifecycle stage.\n * Risk-averse products should set this to `false` in their production builds.\n * This is only necessary for non-Boq products because Boq Web configures this\n * via the goog.flag system by default.\n *\n * @define {boolean}\n */\ngoog.FLAGS_STAGING_DEFAULT = goog.define('goog.FLAGS_STAGING_DEFAULT', true);\n\n/**\n * Defines a local copy for multiple chunk set namespace isolation.\n *\n * @suppress {checkVars}\n */\ngoog.CLOSURE_TOGGLE_ORDINALS = typeof CLOSURE_TOGGLE_ORDINALS === 'object' ?\n    CLOSURE_TOGGLE_ORDINALS :\n    goog.global.CLOSURE_TOGGLE_ORDINALS;\n\n/**\n * Read a toggle's value.  This should not be called directly.  Use the\n * `toggle_provider` build rule instead.  See go/toggle-provider.\n * @param {string} name\n * @return {boolean}\n */\ngoog.readToggleInternalDoNotCallDirectly = function(name) {\n  var ordinals = goog.CLOSURE_TOGGLE_ORDINALS;\n  var ordinal = ordinals && ordinals[name];\n  if (typeof ordinal !== 'number') return Boolean(ordinal);\n  return Boolean(\n      goog.TOGGLES_[Math.floor(ordinal / 30)] & (1 << (ordinal % 30)));\n};\n\n\n/**\n * Bootstrap variable mapping toggle names to ordinals.  This is intended to be\n * read by JSCompiler to replace goog.readToggle...() calls with direct lookups,\n * but is also used by the debug-mode version of the toggle reader.\n * @const {!Object<string, number|boolean>|undefined}\n */\ngoog.global.CLOSURE_TOGGLE_ORDINALS;\n\n\n/**\n * @define {string} Global variable to check for toggles.\n * @private\n */\ngoog.TOGGLE_VAR_ = goog.define('goog.TOGGLE_VAR', '_F_toggles');\n\n\n/** @private @const {!Array<number>} */\ngoog.TOGGLES_ = goog.global[goog.TOGGLE_VAR_] || [];\n// MOE:end_strip\n\n/** @define {boolean} */\ngoog.GENDERED_MESSAGES_ENABLED =\n    goog.define('goog.GENDERED_MESSAGES_ENABLED', true);\n\n/** @private @enum {number} */\ngoog.GrammaticalGender_ = {\n  OTHER: 0,\n  MASCULINE: 1,\n  FEMININE: 2,\n  NEUTER: 3,\n};\n\n/**\n * See go/grammatical-gender-in-capabilities and\n * go/gender-appropriate-ui-jscompiler\n * @private @const {!Object<string, !goog.GrammaticalGender_>}\n */\ngoog.GRAMMATICAL_GENDER_MAP_ = {\n  'FEMININE': goog.GrammaticalGender_.FEMININE,\n  'MASCULINE': goog.GrammaticalGender_.MASCULINE,\n  'NEUTER': goog.GrammaticalGender_.NEUTER,\n};\n\n/**\n * Defines a local copy of viewers grammatical gender for use in gendered\n * messages.  Unknown values are mapped to `OTHER`\n * @private @const {!goog.GrammaticalGender_}\n */\ngoog.viewerGrammaticalGender_ =\n    goog.GRAMMATICAL_GENDER_MAP_[goog.GENDERED_MESSAGES_ENABLED && goog.global['_F_VIEWER_GRAMMATICAL_GENDER']] ||\n    goog.GrammaticalGender_.OTHER;\n\n/**\n * Shared constants for gendered messages based on the value of\n * `goog.viewerGrammaticalGender`\n */\n/** @const */\ngoog.msgKind = {};\n\n/**\n * @const\n * @noinline\n */\ngoog.msgKind.MASCULINE =\n    (goog.viewerGrammaticalGender_ === goog.GrammaticalGender_.MASCULINE);\n\n/**\n * @const\n * @noinline\n */\ngoog.msgKind.FEMININE =\n    (goog.viewerGrammaticalGender_ === goog.GrammaticalGender_.FEMININE);\n\n/**\n * @const\n * @noinline\n */\ngoog.msgKind.NEUTER =\n    (goog.viewerGrammaticalGender_ === goog.GrammaticalGender_.NEUTER);\n\nif (COMPILED && goog.LOCALE == '') {\n  // This code should never execute.  It is here to ensure that the compiler\n  // does not remove the values until goog.LOCALE is defined.\n  goog.logToConsole_('' + [\n    goog.msgKind.MASCULINE, goog.msgKind.FEMININE, goog.msgKind.NEUTER\n  ]);\n}\n\n/**\n * A hook for providing an object that should be used to track the \"legacy\n * namespaces\". The legacy namespace is where symbols from `goog.provide` as\n * well as symbols from `goog.module` with\n * `goog.module.declareLegacyNamespace` are placed.\n *\n * If this isn't specified, `goog.global` will be considered the legacy\n * namespace object.\n *\n * @type {!Object|undefined}\n */\ngoog.global.CLOSURE_UNCOMPILED_LEGACY_NAMESPACE_OBJECT;\n\n\n/**\n * @type {!Object}\n * @private\n */\ngoog.LEGACY_NAMESPACE_OBJECT_ =\n    (!COMPILED &&\n     typeof CLOSURE_UNCOMPILED_LEGACY_NAMESPACE_OBJECT !== 'undefined') ?\n    CLOSURE_UNCOMPILED_LEGACY_NAMESPACE_OBJECT :\n    goog.global;\n\n\n/**\n * Defines a namespace in Closure.\n *\n * A namespace may only be defined once in a codebase. It may be defined using\n * goog.provide() or goog.module().\n *\n * The presence of one or more goog.provide() calls in a file indicates\n * that the file defines the given objects/namespaces.\n * Provided symbols must not be null or undefined.\n *\n * In addition, goog.provide() creates the object stubs for a namespace\n * (for example, goog.provide(\"goog.foo.bar\") will create the object\n * goog.foo.bar if it does not already exist).\n *\n * Build tools also scan for provide/require/module statements\n * to discern dependencies, build dependency files (see deps.js), etc.\n *\n * @see goog.require\n * @see goog.module\n * @param {string} name Namespace provided by this file in the form\n *     \"goog.package.part\".\n * deprecated Use goog.module (see b/159289405)\n */\ngoog.provide = function(name) {\n  if (goog.isInModuleLoader_()) {\n    throw new Error('goog.provide cannot be used within a module.');\n  }\n  if (!COMPILED) {\n    // Ensure that the same namespace isn't provided twice.\n    // A goog.module/goog.provide maps a goog.require to a specific file\n    if (goog.isProvided_(name)) {\n      throw new Error('Namespace \"' + name + '\" already declared.');\n    }\n  }\n\n  goog.constructNamespace_(name);\n};\n\n\n/**\n * @param {string} name Namespace provided by this file in the form\n *     \"goog.package.part\".\n * @param {?Object=} object The object to embed in the namespace.\n * @param {boolean=} overwriteImplicit If object is set and a previous call\n *     implicitly constructed the namespace given by name, this parameter\n *     controls whether opt_obj should overwrite the implicitly constructed\n *     namespace or be merged into it. Defaults to false.\n * @private\n */\ngoog.constructNamespace_ = function(name, object, overwriteImplicit) {\n  if (!COMPILED) {\n    delete goog.implicitNamespaces_[name];\n\n    var namespace = name;\n    while ((namespace = namespace.substring(0, namespace.lastIndexOf('.')))) {\n      if (goog.getObjectByName(namespace, goog.LEGACY_NAMESPACE_OBJECT_)) {\n        break;\n      }\n      goog.implicitNamespaces_[namespace] = true;\n    }\n  }\n\n  goog.exportPath_(\n      name, object, overwriteImplicit, goog.LEGACY_NAMESPACE_OBJECT_);\n};\n\n\n/**\n * According to the CSP3 spec a nonce must be a valid base64 string.\n * @see https://www.w3.org/TR/CSP3/#grammardef-base64-value\n * @private @const\n */\ngoog.NONCE_PATTERN_ = /^[\\w+/_-]+[=]{0,2}$/;\n\n\n/**\n * Returns CSP nonce, if set for any script tag.\n * @param {?Window=} opt_window The window context used to retrieve the nonce.\n *     Defaults to global context.\n * @return {string} CSP nonce or empty string if no nonce is present.\n * @private\n */\ngoog.getScriptNonce_ = function(opt_window) {\n  var doc = (opt_window || goog.global).document;\n  var script = doc.querySelector && doc.querySelector('script[nonce]');\n  if (script) {\n    // Try to get the nonce from the IDL property first, because browsers that\n    // implement additional nonce protection features (currently only Chrome) to\n    // prevent nonce stealing via CSS do not expose the nonce via attributes.\n    // See https://github.com/whatwg/html/issues/2369\n    var nonce = script['nonce'] || script.getAttribute('nonce');\n    if (nonce && goog.NONCE_PATTERN_.test(nonce)) {\n      return nonce;\n    }\n  }\n  return '';\n};\n\n\n/**\n * Module identifier validation regexp.\n * Note: This is a conservative check, it is very possible to be more lenient,\n *   the primary exclusion here is \"/\" and \"\\\" and a leading \".\", these\n *   restrictions are intended to leave the door open for using goog.require\n *   with relative file paths rather than module identifiers.\n * @private\n */\ngoog.VALID_MODULE_RE_ = /^[a-zA-Z_$][a-zA-Z0-9._$]*$/;\n\n\n/**\n * Defines a module in Closure.\n *\n * Marks that this file must be loaded as a module and claims the namespace.\n *\n * A namespace may only be defined once in a codebase. It may be defined using\n * goog.provide() or goog.module().\n *\n * goog.module() has three requirements:\n * - goog.module may not be used in the same file as goog.provide.\n * - goog.module must be the first statement in the file.\n * - only one goog.module is allowed per file.\n *\n * When a goog.module annotated file is loaded, it is enclosed in\n * a strict function closure. This means that:\n * - any variables declared in a goog.module file are private to the file\n * (not global), though the compiler is expected to inline the module.\n * - The code must obey all the rules of \"strict\" JavaScript.\n * - the file will be marked as \"use strict\"\n *\n * NOTE: unlike goog.provide, goog.module does not declare any symbols by\n * itself. If declared symbols are desired, use\n * goog.module.declareLegacyNamespace().\n *\n * MOE:begin_intracomment_strip\n * See the goog.module announcement at http://go/goog.module-announce\n * MOE:end_intracomment_strip\n *\n * See the public goog.module proposal: http://goo.gl/Va1hin\n *\n * @param {string} name Namespace provided by this file in the form\n *     \"goog.package.part\", is expected but not required.\n * @return {void}\n */\ngoog.module = function(name) {\n  if (COMPILED) {\n    // In the optimized code, goog.module calls are complete removed but\n    // due to b/389129315 the function itself is retained.\n    return;\n  }\n  if (typeof name !== 'string' || !name ||\n      name.search(goog.VALID_MODULE_RE_) == -1) {\n    throw new Error('Invalid module identifier');\n  }\n  if (!goog.isInGoogModuleLoader_()) {\n    throw new Error(\n        'Module ' + name + ' has been loaded incorrectly. Note, ' +\n        'modules cannot be loaded as normal scripts. They require some kind of ' +\n        'pre-processing step. You\\'re likely trying to load a module via a ' +\n        'script tag or as a part of a concatenated bundle without rewriting the ' +\n        'module. For more info see: ' +\n        'https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide.');\n  }\n  if (goog.moduleLoaderState_.moduleName) {\n    throw new Error('goog.module may only be called once per module.');\n  }\n\n  // Store the module name for the loader.\n  goog.moduleLoaderState_.moduleName = name;\n  // Ensure that the same namespace isn't provided twice.\n  // A goog.module/goog.provide maps a goog.require to a specific file\n  if (goog.isProvided_(name)) {\n    throw new Error('Namespace \"' + name + '\" already declared.');\n  }\n  delete goog.implicitNamespaces_[name];\n};\n\n\n/**\n * @param {string} name The module identifier.\n * @return {?} The module exports for an already loaded module or null.\n *\n * Note: This is not an alternative to goog.require, it does not\n * indicate a hard dependency, instead it is used to indicate\n * an optional dependency or to access the exports of a module\n * that has already been loaded.\n * @suppress {missingProvide}\n */\ngoog.module.get = function(name) {\n  return COMPILED ? null : goog.module.getInternal_(name);\n};\n\n\n/**\n * @param {string} name The module identifier.\n * @return {?} The module exports for an already loaded module or null.\n * @private\n */\ngoog.module.getInternal_ = function(name) {\n  if (!COMPILED) {\n    if (name in goog.loadedModules_) {\n      return goog.loadedModules_[name].exports;\n    } else if (!goog.implicitNamespaces_[name]) {\n      var ns = goog.getObjectByName(name, goog.LEGACY_NAMESPACE_OBJECT_);\n      return ns != null ? ns : null;\n    }\n  }\n  return null;\n};\n\n// MOE:begin_strip\n/**\n * Defines dynamic import execution path for uncompiled mode.\n *\n * @param {string} name The module identifier.\n * @return {?} The module exports for an already loaded module or null.\n *\n * NOTE: In compiled code, JsCompiler will transpile this function call.\n * DO NOT OPENSOURCE\n */\ngoog.requireDynamic = function(name) {\n  if (!COMPILED) {\n    if (!goog.importHandler_ || !goog.uncompiledChunkIdHandler_) {\n      throw new Error('Need to setup import handler and chunk id handler.');\n    }\n    return goog.importHandler_(goog.uncompiledChunkIdHandler_(name))\n        .then(function() {\n          var module = goog.module.getInternal_(name);\n          if (module == null) {\n            throw new Error('Module ' + name + ' is not loaded.');\n          }\n          return module;\n        });\n  }\n  return null;\n};\n\n\n/**\n * Handler for dynamic import.\n * DO NOT OPENSOURCE\n */\ngoog.importHandler_ = null;\n\n\n/**\n * Chunk ID calculator.\n * @private {?function(string)}\n * DO NOT OPENSOURCE\n */\ngoog.uncompiledChunkIdHandler_ = null;\n\n\n/**\n * Sets import handler.\n * @param {function(string)} fn\n * DO NOT OPENSOURCE\n */\ngoog.setImportHandlerInternalDoNotCallOrElse = function(fn) {\n  goog.importHandler_ = fn;\n};\n\n\n/**\n * Sets chunk ID calculator.\n * @param {function(string)} fn\n * NOTE: The chunk ID calculator is only used in uncompiled mode.\n * DO NOT OPENSOURCE\n */\ngoog.setUncompiledChunkIdHandlerInternalDoNotCallOrElse = function(fn) {\n  goog.uncompiledChunkIdHandler_ = fn;\n};\n\n\n/**\n * This exists purely as a hint to JsTrimmer, so that it can convert it to\n * goog.require in certain circumstances.\n *\n * @param {string} namespace\n * DO NOT OPENSOURCE\n */\ngoog.maybeRequireFrameworkInternalOnlyDoNotCallOrElse = function(namespace) {};\n// MOE:end_strip\n\n/**\n * Types of modules the debug loader can load.\n * @enum {string}\n */\ngoog.ModuleType = {\n  ES6: 'es6',\n  GOOG: 'goog'\n};\n\n\n/**\n * @private {?{\n *   moduleName: (string|undefined),\n *   declareLegacyNamespace:boolean,\n *   preventModuleExportSealing:boolean,\n *   type: ?goog.ModuleType\n * }}\n */\ngoog.moduleLoaderState_ = null;\n\n\n/**\n * @private\n * @return {boolean} Whether a goog.module or an es6 module is currently being\n *     initialized.\n */\ngoog.isInModuleLoader_ = function() {\n  return goog.isInGoogModuleLoader_() || goog.isInEs6ModuleLoader_();\n};\n\n\n/**\n * @private\n * @return {boolean} Whether a goog.module is currently being initialized.\n */\ngoog.isInGoogModuleLoader_ = function() {\n  return !!goog.moduleLoaderState_ &&\n      goog.moduleLoaderState_.type == goog.ModuleType.GOOG;\n};\n\n\n/**\n * @private\n * @return {boolean} Whether an es6 module is currently being initialized.\n */\ngoog.isInEs6ModuleLoader_ = function() {\n  var inLoader = !!goog.moduleLoaderState_ &&\n      goog.moduleLoaderState_.type == goog.ModuleType.ES6;\n\n  if (inLoader) {\n    return true;\n  }\n\n  var jscomp = goog.LEGACY_NAMESPACE_OBJECT_['$jscomp'];\n\n  if (jscomp) {\n    // jscomp may not have getCurrentModulePath if this is a compiled bundle\n    // that has some of the runtime, but not all of it. This can happen if\n    // optimizations are turned on so the unused runtime is removed but renaming\n    // and Closure pass are off (so $jscomp is still named $jscomp and the\n    // goog.provide/require calls still exist).\n    if (typeof jscomp.getCurrentModulePath != 'function') {\n      return false;\n    }\n\n    // Bundled ES6 module.\n    return !!jscomp.getCurrentModulePath();\n  }\n\n  return false;\n};\n\n\n/**\n * Provide the module's exports as a globally accessible object under the\n * module's declared name.  This is intended to ease migration to goog.module\n * for files that have existing usages.\n * @suppress {missingProvide}\n */\ngoog.module.declareLegacyNamespace = function() {\n  if (!COMPILED && !goog.isInGoogModuleLoader_()) {\n    throw new Error(\n        'goog.module.declareLegacyNamespace must be called from ' +\n        'within a goog.module');\n  }\n  if (!COMPILED && !goog.moduleLoaderState_.moduleName) {\n    throw new Error(\n        'goog.module must be called prior to ' +\n        'goog.module.declareLegacyNamespace.');\n  }\n  goog.moduleLoaderState_.declareLegacyNamespace = true;\n};\n\n\n/**\n * Ensures that a module's exports object is not sealed after the module is\n * evaluated.\n * @suppress {missingProvide}\n */\ngoog.module.preventModuleExportSealing = function() {\n  if (!COMPILED && !goog.isInGoogModuleLoader_()) {\n    throw new Error(\n        'goog.module.preventModuleExportSealing must be called from ' +\n        'within a goog.module');\n  }\n  if (!COMPILED && !goog.moduleLoaderState_.moduleName) {\n    throw new Error(\n        'goog.module must be called prior to ' +\n        'goog.module.preventModuleExportSealing.');\n  }\n  goog.moduleLoaderState_.preventModuleExportSealing = true;\n};\n\n\n/**\n * Associates an ES6 module with a Closure module ID so that is available via\n * goog.require. The associated ID  acts like a goog.module ID - it does not\n * create any global names, it is merely available via goog.require /\n * goog.module.get / goog.forwardDeclare / goog.requireType. goog.require and\n * goog.module.get will return the entire module as if it was import *'d. This\n * allows Closure files to reference ES6 modules for the sake of migration.\n *\n * @param {string} namespace\n * @suppress {missingProvide}\n */\ngoog.declareModuleId = function(namespace) {\n  if (!COMPILED) {\n    if (!goog.isInEs6ModuleLoader_()) {\n      throw new Error(\n          'goog.declareModuleId may only be called from ' +\n          'within an ES6 module');\n    }\n    if (goog.moduleLoaderState_ && goog.moduleLoaderState_.moduleName) {\n      throw new Error(\n          'goog.declareModuleId may only be called once per module.');\n    }\n    if (namespace in goog.loadedModules_) {\n      throw new Error(\n          'Module with namespace \"' + namespace + '\" already exists.');\n    }\n  }\n  if (goog.moduleLoaderState_) {\n    // Not bundled - debug loading.\n    goog.moduleLoaderState_.moduleName = namespace;\n  } else {\n    // Bundled - not debug loading, no module loader state.\n    var jscomp = goog.LEGACY_NAMESPACE_OBJECT_['$jscomp'];\n    if (!jscomp || typeof jscomp.getCurrentModulePath != 'function') {\n      throw new Error(\n          'Module with namespace \"' + namespace +\n          '\" has been loaded incorrectly.');\n    }\n    var exports = jscomp.require(jscomp.getCurrentModulePath());\n    goog.loadedModules_[namespace] = {\n      exports: exports,\n      type: goog.ModuleType.ES6,\n      moduleId: namespace\n    };\n  }\n};\n\n\n/**\n * Marks that the current file should only be used for testing, and never for\n * live code in production.\n *\n * In the case of unit tests, the message may optionally be an exact namespace\n * for the test (e.g. 'goog.stringTest'). The linter will then ignore the extra\n * provide (if not explicitly defined in the code).\n *\n * @param {string=} opt_message Optional message to add to the error that's\n *     raised when used in production code.\n */\ngoog.setTestOnly = function(opt_message) {\n  if (goog.DISALLOW_TEST_ONLY_CODE) {\n    opt_message = opt_message || '';\n    throw new Error(\n        'Importing test-only code into non-debug environment' +\n        (opt_message ? ': ' + opt_message : '.'));\n  }\n};\n\n\n/**\n * Forward declares a symbol. This is an indication to the compiler that the\n * symbol may be used in the source yet is not required and may not be provided\n * in compilation.\n *\n * The most common usage of forward declaration is code that takes a type as a\n * function parameter but does not need to require it. By forward declaring\n * instead of requiring, no hard dependency is made, and (if not required\n * elsewhere) the namespace may never be required and thus, not be pulled\n * into the JavaScript binary. If it is required elsewhere, it will be type\n * checked as normal.\n *\n * Before using goog.forwardDeclare, please read the documentation at\n * https://github.com/google/closure-compiler/wiki/Bad-Type-Annotation to\n * understand the options and tradeoffs when working with forward declarations.\n *\n * @param {string} name The namespace to forward declare in the form of\n *     \"goog.package.part\".\n * @deprecated See go/noforwarddeclaration, Use `goog.requireType` instead.\n */\ngoog.forwardDeclare = function(name) {};\n\nif (!COMPILED) {\n  /**\n   * Check if the given name has been goog.provided. This will return false for\n   * names that are available only as implicit namespaces.\n   * @param {string} name name of the object to look for.\n   * @return {boolean} Whether the name has been provided.\n   * @private\n   */\n  goog.isProvided_ = function(name) {\n    return (name in goog.loadedModules_) ||\n        (!goog.implicitNamespaces_[name] &&\n         goog.getObjectByName(name, goog.LEGACY_NAMESPACE_OBJECT_) != null);\n  };\n\n  /**\n   * Namespaces implicitly defined by goog.provide. For example,\n   * goog.provide('goog.events.Event') implicitly declares that 'goog' and\n   * 'goog.events' must be namespaces.\n   *\n   * @type {!Object<string, (boolean|undefined)>}\n   * @private\n   */\n  goog.implicitNamespaces_ = {'goog.module': true};\n\n  // NOTE: We add goog.module as an implicit namespace as goog.module is defined\n  // here and because the existing module package has not been moved yet out of\n  // the goog.module namespace. This satisfies both the debug loader and\n  // ahead-of-time dependency management.\n}\n\n\n/**\n * Returns an object based on its fully qualified external name.  The object\n * is not found if null or undefined.  If you are using a compilation pass that\n * renames property names beware that using this function will not find renamed\n * properties.\n *\n * @param {string} name The fully qualified name.\n * @param {Object=} opt_obj The object within which to look; default is\n *     |goog.global|.\n * @return {?} The value (object or primitive) or, if not found, null.\n */\ngoog.getObjectByName = function(name, opt_obj) {\n  var parts = name.split('.');\n  var cur = opt_obj || goog.global;\n  for (var i = 0; i < parts.length; i++) {\n    cur = cur[parts[i]];\n    if (cur == null) {\n      return null;\n    }\n  }\n  return cur;\n};\n\n\n/**\n * Adds a dependency from a file to the files it requires.\n * @param {string} relPath The path to the js file.\n * @param {!Array<string>} provides An array of strings with\n *     the names of the objects this file provides.\n * @param {!Array<string>} requires An array of strings with\n *     the names of the objects this file requires.\n * @param {boolean|!Object<string>=} opt_loadFlags Parameters indicating\n *     how the file must be loaded.  The boolean 'true' is equivalent\n *     to {'module': 'goog'} for backwards-compatibility.  Valid properties\n *     and values include {'module': 'goog'} and {'lang': 'es6'}.\n */\ngoog.addDependency = function(relPath, provides, requires, opt_loadFlags) {\n  if (!COMPILED && goog.DEPENDENCIES_ENABLED) {\n    goog.debugLoader_.addDependency(relPath, provides, requires, opt_loadFlags);\n  }\n};\n\n\n// NOTE(nnaze): The debug DOM loader was included in base.js as an original way\n// to do \"debug-mode\" development.  The dependency system can sometimes be\n// confusing, as can the debug DOM loader's asynchronous nature.\n//\n// With the DOM loader, a call to goog.require() is not blocking -- the script\n// will not load until some point after the current script.  If a namespace is\n// needed at runtime, it needs to be defined in a previous script, or loaded via\n// require() with its registered dependencies.\n//\n// User-defined namespaces may need their own deps file. For a reference on\n// creating a deps file, see:\n// MOE:begin_strip\n// Internally: http://go/deps-files and http://go/be#js_deps\n// MOE:end_strip\n// Externally: https://developers.google.com/closure/library/docs/depswriter\n//\n// Because of legacy clients, the DOM loader can't be easily removed from\n// base.js.  Work was done to make it disableable or replaceable for\n// different environments (DOM-less JavaScript interpreters like Rhino or V8,\n// for example). See bootstrap/ for more information.\n\n\n/**\n * @define {boolean} Whether to enable the debug loader.\n *\n * If enabled, a call to goog.require() will attempt to load the namespace by\n * appending a script tag to the DOM (if the namespace has been registered).\n *\n * If disabled, goog.require() will simply assert that the namespace has been\n * provided (and depend on the fact that some outside tool correctly ordered\n * the script).\n */\ngoog.ENABLE_DEBUG_LOADER = goog.define('goog.ENABLE_DEBUG_LOADER', false);\n\n\n/**\n * @param {string} msg\n * @private\n */\ngoog.logToConsole_ = function(msg) {\n  if (goog.global.console) {\n    goog.global.console['error'](msg);\n  }\n};\n\n\n/**\n * Implements a system for the dynamic resolution of dependencies that works in\n * parallel with the BUILD system.\n *\n * Note that all calls to goog.require will be stripped by the compiler.\n *\n * @see goog.provide\n * @param {string} namespace Namespace (as was given in goog.provide,\n *     goog.module, or goog.declareModuleId) in the form\n *     \"goog.package.part\".\n * @return {?} If called within a goog.module or ES6 module file, the associated\n *     namespace or module otherwise null.\n */\ngoog.require = function(namespace) {\n  if (!COMPILED) {\n    // Might need to lazy load on old IE.\n    if (goog.ENABLE_DEBUG_LOADER) {\n      goog.debugLoader_.requested(namespace);\n    }\n\n    // If the object already exists we do not need to do anything.\n    if (goog.isProvided_(namespace)) {\n      if (goog.isInModuleLoader_()) {\n        return goog.module.getInternal_(namespace);\n      }\n    } else if (goog.ENABLE_DEBUG_LOADER) {\n      var moduleLoaderState = goog.moduleLoaderState_;\n      goog.moduleLoaderState_ = null;\n      try {\n        goog.debugLoader_.load_(namespace);\n      } finally {\n        goog.moduleLoaderState_ = moduleLoaderState;\n      }\n    }\n\n    return null;\n  }\n};\n\n\n/**\n * Requires a symbol for its type information. This is an indication to the\n * compiler that the symbol may appear in type annotations, yet it is not\n * referenced at runtime.\n *\n * When called within a goog.module or ES6 module file, the return value may be\n * assigned to or destructured into a variable, but it may not be otherwise used\n * in code outside of a type annotation.\n *\n * Note that all calls to goog.requireType will be stripped by the compiler.\n *\n * @param {string} namespace Namespace (as was given in goog.provide,\n *     goog.module, or goog.declareModuleId) in the form\n *     \"goog.package.part\".\n * @return {?}\n */\ngoog.requireType = function(namespace) {\n  // Return an empty object so that single-level destructuring of the return\n  // value doesn't crash at runtime when using the debug loader. Multi-level\n  // destructuring isn't supported.\n  return {};\n};\n\n\n/**\n * Path for included scripts.\n * @type {string}\n */\ngoog.basePath = '';\n\n\n/**\n * A hook for overriding the base path.\n * @type {string|undefined}\n */\ngoog.global.CLOSURE_BASE_PATH;\n\n\n/**\n * A function to import a single script. This is meant to be overridden when\n * Closure is being run in non-HTML contexts, such as web workers. It's defined\n * in the global scope so that it can be set before base.js is loaded, which\n * allows deps.js to be imported properly.\n *\n * The first parameter the script source, which is a relative URI. The second,\n * optional parameter is the script contents, in the event the script needed\n * transformation. It should return true if the script was imported, false\n * otherwise.\n * @type {(function(string, string=): boolean)|undefined}\n */\ngoog.global.CLOSURE_IMPORT_SCRIPT;\n\n\n/**\n * When defining a class Foo with an abstract method bar(), you can do:\n * Foo.prototype.bar = goog.abstractMethod\n *\n * Now if a subclass of Foo fails to override bar(), an error will be thrown\n * when bar() is invoked.\n *\n * @type {!Function}\n * @throws {Error} when invoked to indicate the method should be overridden.\n * @deprecated Use \"@abstract\" annotation instead of goog.abstractMethod in new\n *     code. See\n *     https://github.com/google/closure-compiler/wiki/@abstract-classes-and-methods\n */\ngoog.abstractMethod = function() {\n  throw new Error('unimplemented abstract method');\n};\n\n\n/**\n * Adds a `getInstance` static method that always returns the same\n * instance object.\n * @param {!Function} ctor The constructor for the class to add the static\n *     method to.\n * @suppress {missingProperties} 'instance_' isn't a property on 'Function'\n *     but we don't have a better type to use here.\n */\ngoog.addSingletonGetter = function(ctor) {\n  // instance_ is immediately set to prevent issues with sealed constructors\n  // such as are encountered when a constructor is returned as the export object\n  // of a goog.module in unoptimized code.\n  // Declare type to avoid conformance violations that ctor.instance_ is unknown\n  /** @type {undefined|!Object} @suppress {underscore} */\n  ctor.instance_ = undefined;\n  ctor.getInstance = function() {\n    if (ctor.instance_) {\n      return ctor.instance_;\n    }\n    if (goog.DEBUG) {\n      // NOTE: JSCompiler can't optimize away Array#push.\n      goog.instantiatedSingletons_[goog.instantiatedSingletons_.length] = ctor;\n    }\n    // Cast to avoid conformance violations that ctor.instance_ is unknown\n    return /** @type {!Object|undefined} */ (ctor.instance_) = new ctor;\n  };\n};\n\n\n/**\n * All singleton classes that have been instantiated, for testing. Don't read\n * it directly, use the `goog.testing.singleton` module. The compiler\n * removes this variable if unused.\n * @type {!Array<!Function>}\n * @private\n */\ngoog.instantiatedSingletons_ = [];\n\n\n/**\n * @define {boolean} Whether to load goog.modules using `eval` when using\n * the debug loader.  This provides a better debugging experience as the\n * source is unmodified and can be edited using Chrome Workspaces or similar.\n * However in some environments the use of `eval` is banned\n * so we provide an alternative.\n */\ngoog.LOAD_MODULE_USING_EVAL = goog.define('goog.LOAD_MODULE_USING_EVAL', true);\n\n\n/**\n * @define {boolean} Whether the exports of goog.modules should be sealed when\n * possible.\n */\ngoog.SEAL_MODULE_EXPORTS = goog.define('goog.SEAL_MODULE_EXPORTS', goog.DEBUG);\n\n\n/**\n * The registry of initialized modules:\n * The module identifier or path to module exports map.\n * @private @const {!Object<string, {exports:?,type:string,moduleId:string}>}\n */\ngoog.loadedModules_ = {};\n\n\n/**\n * True if the debug loader enabled and used.\n * @const {boolean}\n */\ngoog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER;\n\n\n\n/**\n * @define {boolean} If true assume that ES modules have already been\n * transpiled by the jscompiler (in the same way that transpile.js would\n * transpile them - to jscomp modules). Useful only for servers that wish to use\n * the debug loader and transpile server side. Thus this is only respected if\n * goog.TRANSPILE is \"never\".\n */\ngoog.ASSUME_ES_MODULES_TRANSPILED =\n    goog.define('goog.ASSUME_ES_MODULES_TRANSPILED', false);\n\n\n/**\n * @define {string} Trusted Types policy name. If non-empty then Closure will\n * use Trusted Types.\n */\ngoog.TRUSTED_TYPES_POLICY_NAME =\n    goog.define('goog.TRUSTED_TYPES_POLICY_NAME', 'goog');\n\n\n/**\n * @param {function(?):?|string} moduleDef The module definition.\n */\ngoog.loadModule = function(moduleDef) {\n  // NOTE: we allow function definitions to be either in the from\n  // of a string to eval (which keeps the original source intact) or\n  // in a eval forbidden environment (CSP) we allow a function definition\n  // which in its body must call `goog.module`, and return the exports\n  // of the module.\n  var previousState = goog.moduleLoaderState_;\n  try {\n    goog.moduleLoaderState_ = {\n      moduleName: '',\n      declareLegacyNamespace: false,\n      preventModuleExportSealing: false,\n      type: goog.ModuleType.GOOG\n    };\n    var origExports = {};\n    var exports = origExports;\n    if (typeof moduleDef === 'function') {\n      exports = moduleDef.call(undefined, exports);\n    } else if (typeof moduleDef === 'string') {\n      exports = goog.loadModuleFromSource_.call(undefined, exports, moduleDef);\n    } else {\n      throw new Error('Invalid module definition');\n    }\n\n    var moduleName = goog.moduleLoaderState_.moduleName;\n    if (typeof moduleName === 'string' && moduleName) {\n      // Don't seal legacy namespaces as they may be used as a parent of\n      // another namespace\n      if (goog.moduleLoaderState_.declareLegacyNamespace) {\n        // Whether exports was overwritten via default export assignment.\n        // This is important for legacy namespaces as it dictates whether\n        // previously a previously loaded implicit namespace should be clobbered\n        // or not.\n        var isDefaultExport = origExports !== exports;\n        goog.constructNamespace_(moduleName, exports, isDefaultExport);\n      } else if (\n          goog.SEAL_MODULE_EXPORTS && Object.seal &&\n          typeof exports == 'object' && exports != null &&\n          !goog.moduleLoaderState_.preventModuleExportSealing) {\n        Object.seal(exports);\n      }\n\n      var data = {\n        exports: exports,\n        type: goog.ModuleType.GOOG,\n        moduleId: goog.moduleLoaderState_.moduleName\n      };\n      goog.loadedModules_[moduleName] = data;\n    } else {\n      throw new Error('Invalid module name \\\"' + moduleName + '\\\"');\n    }\n  } finally {\n    goog.moduleLoaderState_ = previousState;\n  }\n};\n\n\n/**\n * @private @const\n */\ngoog.loadModuleFromSource_ =\n    /** @type {function(!Object, string):?} */ (function(exports) {\n      // NOTE: we avoid declaring parameters or local variables here to avoid\n      // masking globals or leaking values into the module definition.\n      'use strict';\n      eval(goog.CLOSURE_EVAL_PREFILTER_.createScript(arguments[1]));\n      return exports;\n    });\n\n\n/**\n * Normalize a file path by removing redundant \"..\" and extraneous \".\" file\n * path components.\n * @param {string} path\n * @return {string}\n * @private\n */\ngoog.normalizePath_ = function(path) {\n  var components = path.split('/');\n  var i = 0;\n  while (i < components.length) {\n    if (components[i] == '.') {\n      components.splice(i, 1);\n    } else if (\n        i && components[i] == '..' && components[i - 1] &&\n        components[i - 1] != '..') {\n      components.splice(--i, 2);\n    } else {\n      i++;\n    }\n  }\n  return components.join('/');\n};\n\n\n/**\n * Provides a hook for loading a file when using Closure's goog.require() API\n * with goog.modules.  In particular this hook is provided to support Node.js.\n *\n * @type {(function(string):string)|undefined}\n */\ngoog.global.CLOSURE_LOAD_FILE_SYNC;\n\n\n/**\n * Loads file by synchronous XHR. Should not be used in production environments.\n * @param {string} src Source URL.\n * @return {?string} File contents, or null if load failed.\n * @private\n */\ngoog.loadFileSync_ = function(src) {\n  if (goog.global.CLOSURE_LOAD_FILE_SYNC) {\n    return goog.global.CLOSURE_LOAD_FILE_SYNC(src);\n  } else {\n    try {\n      /** @type {XMLHttpRequest} */\n      var xhr = new goog.global['XMLHttpRequest']();\n      xhr.open('get', src, false);\n      xhr.send();\n      // NOTE: Successful http: requests have a status of 200, but successful\n      // file: requests may have a status of zero.  Any other status, or a\n      // thrown exception (particularly in case of file: requests) indicates\n      // some sort of error, which we treat as a missing or unavailable file.\n      return xhr.status == 0 || xhr.status == 200 ? xhr.responseText : null;\n    } catch (err) {\n      // No need to rethrow or log, since errors should show up on their own.\n      return null;\n    }\n  }\n};\n\n//==============================================================================\n// Language Enhancements\n//==============================================================================\n\n\n/**\n * This is a \"fixed\" version of the typeof operator.  It differs from the typeof\n * operator in such a way that null returns 'null' and arrays return 'array'.\n * @param {?} value The value to get the type of.\n * @return {string} The name of the type.\n */\ngoog.typeOf = function(value) {\n  var s = typeof value;\n\n  if (s != 'object') {\n    return s;\n  }\n\n  if (!value) {\n    return 'null';\n  }\n\n  if (Array.isArray(value)) {\n    return 'array';\n  }\n  return s;\n};\n\n\n/**\n * Returns true if the object looks like an array. To qualify as array like\n * the value needs to be either a NodeList or an object with a Number length\n * property. Note that for this function neither strings nor functions are\n * considered \"array-like\".\n *\n * @param {?} val Variable to test.\n * @return {boolean} Whether variable is an array.\n */\ngoog.isArrayLike = function(val) {\n  var type = goog.typeOf(val);\n  // We do not use goog.isObject here in order to exclude function values.\n  return type == 'array' || type == 'object' && typeof val.length == 'number';\n};\n\n\n/**\n * Returns true if the object looks like a Date. To qualify as Date-like the\n * value needs to be an object and have a getFullYear() function.\n * @param {?} val Variable to test.\n * @return {boolean} Whether variable is a like a Date.\n */\ngoog.isDateLike = function(val) {\n  return goog.isObject(val) && typeof val.getFullYear == 'function';\n};\n\n\n/**\n * Returns true if the specified value is an object.  This includes arrays and\n * functions.\n * @param {?} val Variable to test.\n * @return {boolean} Whether variable is an object.\n */\ngoog.isObject = function(val) {\n  var type = typeof val;\n  return type == 'object' && val != null || type == 'function';\n  // return Object(val) === val also works, but is slower, especially if val is\n  // not an object.\n};\n\n\n/**\n * Gets a unique ID for an object. This mutates the object so that further calls\n * with the same object as a parameter returns the same value. The unique ID is\n * guaranteed to be unique across the current session amongst objects that are\n * passed into `getUid`. There is no guarantee that the ID is unique or\n * consistent across sessions. It is unsafe to generate unique ID for function\n * prototypes.\n *\n * @param {Object} obj The object to get the unique ID for.\n * @return {number} The unique ID for the object.\n */\ngoog.getUid = function(obj) {\n  // TODO(arv): Make the type stricter, do not accept null.\n  return Object.prototype.hasOwnProperty.call(obj, goog.UID_PROPERTY_) &&\n      obj[goog.UID_PROPERTY_] ||\n      (obj[goog.UID_PROPERTY_] = ++goog.uidCounter_);\n};\n\n\n/**\n * Whether the given object is already assigned a unique ID.\n *\n * This does not modify the object.\n *\n * @param {!Object} obj The object to check.\n * @return {boolean} Whether there is an assigned unique id for the object.\n */\ngoog.hasUid = function(obj) {\n  return !!obj[goog.UID_PROPERTY_];\n};\n\n\n/**\n * Removes the unique ID from an object. This is useful if the object was\n * previously mutated using `goog.getUid` in which case the mutation is\n * undone.\n * @param {Object} obj The object to remove the unique ID field from.\n */\ngoog.removeUid = function(obj) {\n  // TODO(arv): Make the type stricter, do not accept null.\n\n  // In IE, DOM nodes are not instances of Object and throw an exception if we\n  // try to delete.  Instead we try to use removeAttribute.\n  if (obj !== null && 'removeAttribute' in obj) {\n    obj.removeAttribute(goog.UID_PROPERTY_);\n  }\n\n  try {\n    delete obj[goog.UID_PROPERTY_];\n  } catch (ex) {\n  }\n};\n\n\n/**\n * Name for unique ID property. Initialized in a way to help avoid collisions\n * with other closure JavaScript on the same page.\n * @type {string}\n * @private\n */\ngoog.UID_PROPERTY_ = 'closure_uid_' + ((Math.random() * 1e9) >>> 0);\n\n\n/**\n * Counter for UID.\n * @type {number}\n * @private\n */\ngoog.uidCounter_ = 0;\n\n\n/**\n * Clones a value. The input may be an Object, Array, or basic type. Objects and\n * arrays will be cloned recursively.\n *\n * WARNINGS:\n * <code>goog.cloneObject</code> does not detect reference loops. Objects that\n * refer to themselves will cause infinite recursion.\n *\n * <code>goog.cloneObject</code> is unaware of unique identifiers, and copies\n * UIDs created by <code>getUid</code> into cloned results.\n *\n * @param {*} obj The value to clone.\n * @return {*} A clone of the input value.\n * @deprecated goog.cloneObject is unsafe. Prefer the goog.object methods.\n */\ngoog.cloneObject = function(obj) {\n  var type = goog.typeOf(obj);\n  if (type == 'object' || type == 'array') {\n    if (typeof obj.clone === 'function') {\n      return obj.clone();\n    }\n    if (typeof Map !== 'undefined' && obj instanceof Map) {\n      return new Map(obj);\n    } else if (typeof Set !== 'undefined' && obj instanceof Set) {\n      return new Set(obj);\n    }\n    var clone = type == 'array' ? [] : {};\n    for (var key in obj) {\n      clone[key] = goog.cloneObject(obj[key]);\n    }\n    return clone;\n  }\n\n  return obj;\n};\n\n\n/**\n * A native implementation of goog.bind.\n * @param {?function(this:T, ...)} fn A function to partially apply.\n * @param {T} selfObj Specifies the object which this should point to when the\n *     function is run.\n * @param {...*} var_args Additional arguments that are partially applied to the\n *     function.\n * @return {!Function} A partially-applied form of the function goog.bind() was\n *     invoked as a method of.\n * @template T\n * @private\n */\ngoog.bindNative_ = function(fn, selfObj, var_args) {\n  return /** @type {!Function} */ (fn.call.apply(fn.bind, arguments));\n};\n\n\n/**\n * A pure-JS implementation of goog.bind.\n * @param {?function(this:T, ...)} fn A function to partially apply.\n * @param {T} selfObj Specifies the object which this should point to when the\n *     function is run.\n * @param {...*} var_args Additional arguments that are partially applied to the\n *     function.\n * @return {!Function} A partially-applied form of the function goog.bind() was\n *     invoked as a method of.\n * @template T\n * @private\n */\ngoog.bindJs_ = function(fn, selfObj, var_args) {\n  if (!fn) {\n    throw new Error();\n  }\n\n  if (arguments.length > 2) {\n    var boundArgs = Array.prototype.slice.call(arguments, 2);\n    return function() {\n      // Prepend the bound arguments to the current arguments.\n      var newArgs = Array.prototype.slice.call(arguments);\n      Array.prototype.unshift.apply(newArgs, boundArgs);\n      return fn.apply(selfObj, newArgs);\n    };\n\n  } else {\n    return function() {\n      return fn.apply(selfObj, arguments);\n    };\n  }\n};\n\n\n/**\n * Partially applies this function to a particular 'this object' and zero or\n * more arguments. The result is a new function with some arguments of the first\n * function pre-filled and the value of this 'pre-specified'.\n *\n * Remaining arguments specified at call-time are appended to the pre-specified\n * ones.\n *\n * Also see: {@link #partial}.\n *\n * Usage:\n * <pre>var barMethBound = goog.bind(myFunction, myObj, 'arg1', 'arg2');\n * barMethBound('arg3', 'arg4');</pre>\n *\n * @param {?function(this:T, ...)} fn A function to partially apply.\n * @param {T} selfObj Specifies the object which this should point to when the\n *     function is run.\n * @param {...*} var_args Additional arguments that are partially applied to the\n *     function.\n * @return {!Function} A partially-applied form of the function goog.bind() was\n *     invoked as a method of.\n * @template T\n * @suppress {deprecated} See above.\n * @deprecated use `=> {}` or Function.prototype.bind instead.\n */\ngoog.bind = function(fn, selfObj, var_args) {\n  // TODO(nicksantos): narrow the type signature.\n  if ((goog.TRUSTED_SITE && goog.FEATURESET_YEAR > 2012) ||\n      (Function.prototype.bind &&\n       // NOTE(nicksantos): Somebody pulled base.js into the default Chrome\n       // extension environment. This means that for Chrome extensions, they get\n       // the implementation of Function.prototype.bind that calls goog.bind\n       // instead of the native one. Even worse, we don't want to introduce a\n       // circular dependency between goog.bind and Function.prototype.bind, so\n       // we have to hack this to make sure it works correctly.\n       Function.prototype.bind.toString().indexOf('native code') != -1)) {\n    goog.bind = goog.bindNative_;\n  } else {\n    goog.bind = goog.bindJs_;\n  }\n  return goog.bind.apply(null, arguments);\n};\n\n\n/**\n * Like goog.bind(), except that a 'this object' is not required. Useful when\n * the target function is already bound.\n *\n * Usage:\n * var g = goog.partial(f, arg1, arg2);\n * g(arg3, arg4);\n *\n * @param {Function} fn A function to partially apply.\n * @param {...*} var_args Additional arguments that are partially applied to fn.\n * @return {!Function} A partially-applied form of the function goog.partial()\n *     was invoked as a method of.\n */\ngoog.partial = function(fn, var_args) {\n  var args = Array.prototype.slice.call(arguments, 1);\n  return function() {\n    // Clone the array (with slice()) and append additional arguments\n    // to the existing arguments.\n    var newArgs = args.slice();\n    newArgs.push.apply(newArgs, arguments);\n    return fn.apply(/** @type {?} */ (this), newArgs);\n  };\n};\n\n\n/**\n * @return {number} An integer value representing the number of milliseconds\n *     between midnight, January 1, 1970 and the current time.\n * @deprecated Use Date.now\n */\ngoog.now = function() {\n  return Date.now();\n};\n\n\n/**\n * Evals JavaScript in the global scope.\n *\n * Throws an exception if eval is not defined.\n * @param {string|!TrustedScript} script JavaScript string.\n */\ngoog.globalEval = function(script) {\n  (0, eval)(script);\n};\n\n\n/**\n * Optional map of CSS class names to obfuscated names used with\n * goog.getCssName().\n * @private {!Object<string, string>|undefined}\n * @see goog.setCssNameMapping\n */\ngoog.cssNameMapping_;\n\n\n/**\n * Optional obfuscation style for CSS class names. Should be set to either\n * 'BY_WHOLE' or 'BY_PART' if defined.\n * @type {string|undefined}\n * @private\n * @see goog.setCssNameMapping\n */\ngoog.cssNameMappingStyle_;\n\n\n\n/**\n * A hook for modifying the default behavior goog.getCssName. The function\n * if present, will receive the standard output of the goog.getCssName as\n * its input.\n *\n * @type {(function(string):string)|undefined}\n */\ngoog.global.CLOSURE_CSS_NAME_MAP_FN;\n\n\n/**\n * Handles strings that are intended to be used as CSS class names.\n *\n * This function works in tandem with @see goog.setCssNameMapping.\n *\n * Without any mapping set, the arguments are simple joined with a hyphen and\n * passed through unaltered.\n *\n * When there is a mapping, there are two possible styles in which these\n * mappings are used. In the BY_PART style, each part (i.e. in between hyphens)\n * of the passed in css name is rewritten according to the map. In the BY_WHOLE\n * style, the full css name is looked up in the map directly. If a rewrite is\n * not specified by the map, the compiler will output a warning.\n *\n * When the mapping is passed to the compiler, it will replace calls to\n * goog.getCssName with the strings from the mapping, e.g.\n *     var x = goog.getCssName('foo');\n *     var y = goog.getCssName(this.baseClass, 'active');\n *  becomes:\n *     var x = 'foo';\n *     var y = this.baseClass + '-active';\n *\n * If one argument is passed it will be processed, if two are passed only the\n * modifier will be processed, as it is assumed the first argument was generated\n * as a result of calling goog.getCssName.\n *\n * @param {string} className The class name.\n * @param {string=} opt_modifier A modifier to be appended to the class name.\n * @return {string} The class name or the concatenation of the class name and\n *     the modifier.\n */\ngoog.getCssName = function(className, opt_modifier) {\n  // String() is used for compatibility with compiled soy where the passed\n  // className can be non-string objects.\n  if (String(className).charAt(0) == '.') {\n    throw new Error(\n        'className passed in goog.getCssName must not start with \".\".' +\n        ' You passed: ' + className);\n  }\n\n  var getMapping = function(cssName) {\n    return goog.cssNameMapping_[cssName] || cssName;\n  };\n\n  var renameByParts = function(cssName) {\n    // Remap all the parts individually.\n    var parts = cssName.split('-');\n    var mapped = [];\n    for (var i = 0; i < parts.length; i++) {\n      mapped.push(getMapping(parts[i]));\n    }\n    return mapped.join('-');\n  };\n\n  var rename;\n  if (goog.cssNameMapping_) {\n    rename =\n        goog.cssNameMappingStyle_ == 'BY_WHOLE' ? getMapping : renameByParts;\n  } else {\n    rename = function(a) {\n      return a;\n    };\n  }\n\n  var result =\n      opt_modifier ? className + '-' + rename(opt_modifier) : rename(className);\n\n  // The special CLOSURE_CSS_NAME_MAP_FN allows users to specify further\n  // processing of the class name.\n  if (goog.global.CLOSURE_CSS_NAME_MAP_FN) {\n    return goog.global.CLOSURE_CSS_NAME_MAP_FN(result);\n  }\n\n  return result;\n};\n\n\n/**\n * Sets the map to check when returning a value from goog.getCssName(). Example:\n * <pre>\n * goog.setCssNameMapping({\n *   \"goog\": \"a\",\n *   \"disabled\": \"b\",\n * });\n *\n * var x = goog.getCssName('goog');\n * // The following evaluates to: \"a a-b\".\n * goog.getCssName('goog') + ' ' + goog.getCssName(x, 'disabled')\n * </pre>\n * When declared as a map of string literals to string literals, the JSCompiler\n * will replace all calls to goog.getCssName() using the supplied map if the\n * --process_closure_primitives flag is set.\n *\n * @param {!Object} mapping A map of strings to strings where keys are possible\n *     arguments to goog.getCssName() and values are the corresponding values\n *     that should be returned.\n * @param {string=} opt_style The style of css name mapping. There are two valid\n *     options: 'BY_PART', and 'BY_WHOLE'.\n * @see goog.getCssName for a description.\n */\ngoog.setCssNameMapping = function(mapping, opt_style) {\n  goog.cssNameMapping_ = mapping;\n  goog.cssNameMappingStyle_ = opt_style;\n};\n\n\n/**\n * To use CSS renaming in compiled mode, one of the input files should have a\n * call to goog.setCssNameMapping() with an object literal that the JSCompiler\n * can extract and use to replace all calls to goog.getCssName(). In uncompiled\n * mode, JavaScript code should be loaded before this base.js file that declares\n * a global variable, CLOSURE_CSS_NAME_MAPPING, which is used below. This is\n * to ensure that the mapping is loaded before any calls to goog.getCssName()\n * are made in uncompiled mode.\n *\n * A hook for overriding the CSS name mapping.\n * @type {!Object<string, string>|undefined}\n */\ngoog.global.CLOSURE_CSS_NAME_MAPPING;\n\n\nif (!COMPILED && goog.global.CLOSURE_CSS_NAME_MAPPING) {\n  // This does not call goog.setCssNameMapping() because the JSCompiler\n  // requires that goog.setCssNameMapping() be called with an object literal.\n  goog.cssNameMapping_ = goog.global.CLOSURE_CSS_NAME_MAPPING;\n}\n\n/**\n * Options bag type for `goog.getMsg()` third argument.\n *\n * It is important to note that these options need to be known at compile time,\n * so they must always be provided to `goog.getMsg()` as an actual object\n * literal in the function call. Otherwise, closure-compiler will report an\n * error.\n * @record\n */\ngoog.GetMsgOptions = function() {};\n\n/**\n * If `true`, escape '<' in the message string to '&lt;'.\n *\n * Used by Closure Templates where the generated code size and performance is\n * critical which is why {@link goog.html.SafeHtmlFormatter} is not used.\n * The value must be literal `true` or `false`.\n * @type {boolean|undefined}\n */\ngoog.GetMsgOptions.prototype.html;\n\n/**\n * If `true`, unescape common html entities: &gt;, &lt;, &apos;, &quot; and\n * &amp;.\n *\n * Used for messages not in HTML context, such as with the `textContent`\n * property.\n * The value must be literal `true` or `false`.\n * @type {boolean|undefined}\n */\ngoog.GetMsgOptions.prototype.unescapeHtmlEntities;\n\n/**\n * Associates placeholder names with strings showing how their values are\n * obtained.\n *\n * This field is intended for use in automatically generated JS code.\n * Human-written code should use meaningful placeholder names instead.\n *\n * closure-compiler uses this as the contents of the `<ph>` tag in the\n * XMB file it generates or defaults to `-` for historical reasons.\n *\n * Must be an object literal.\n * Ignored at runtime.\n * Keys are placeholder names.\n * Values are string literals indicating how the value is obtained.\n * Typically this is a snippet of source code.\n * @type {!Object<string, string>|undefined}\n */\ngoog.GetMsgOptions.prototype.original_code;\n\n/**\n * Associates placeholder names with example values.\n *\n * closure-compiler uses this as the contents of the `<ex>` tag in the\n * XMB file it generates or defaults to `-` for historical reasons.\n *\n * Must be an object literal.\n * Ignored at runtime.\n * Keys are placeholder names.\n * Values are string literals containing example placeholder values.\n * (e.g. \"George McFly\" for a name placeholder)\n * @type {!Object<string, string>|undefined}\n */\ngoog.GetMsgOptions.prototype.example;\n\n/**\n * A hook for providing a custom message retrieval function to\n * augment `goog.getMsg`.\n *\n * If an object is assigned to `CLOSURE_P16N_GET_MSG` in the global scope\n * *before* base.js is loaded, `goog.getMsg` will use the function provided\n * under the key 'goog.getMsg' on this object instead of its default\n * implementation. This allows a \"p16n library\" to take over the message\n * localization process.\n *\n * The provided object is expected to have the following structure:\n * <pre>\n *   {\n *     'goog.getMsg': function(string, !Object<string, string>=,\n * !goog.GetMsgOptions=): string, 'declareIcuTemplate': function(string, string,\n * !Object<string, string>=, !goog.GetMsgOptions=): string\n *   }\n * </pre>\n *\n * Example:\n * <pre>\n *   // In a script loaded *before* base.js:\n *   window.CLOSURE_P16N_GET_MSG = {\n *     'goog.getMsg': function(str, opt_values, opt_options) {\n *       // Custom logic to fetch and format the message from a p16n system.\n *       // 'str' is the original message string.\n *       // 'opt_values' is the placeholder map.\n *       // 'opt_options' are options like html/unescapeHtmlEntities.\n *       return p16nLibrary.getLocalizedMessage(str, opt_values, opt_options);\n *     },\n *     'declareIcuTemplate': function(templateString, name, opt_values,\n * opt_options) {\n *       // Custom logic to declare an ICU template.\n *       return p16nLibrary.declareIcuTemplate(templateString, name, opt_values,\n * opt_options);\n *     }\n *   };\n * </pre>\n *\n *\n * @type {({\n *   'goog.getMsg': (function(string, !Object<string, string>=,\n * !goog.GetMsgOptions=): string), 'declareIcuTemplate': (function(string,\n * string, !Object<string, string>=, !goog.GetMsgOptions=): string)\n * }|undefined)}\n */\ngoog.global.CLOSURE_P16N_GET_MSG;\n\n/**\n * @define {boolean} Whether to use the global CLOSURE_P16N_GET_MSG override for\n * goog.getMsg.\n */\ngoog.USE_GET_MSG_OVERRIDE = goog.define('goog.USE_GET_MSG_OVERRIDE', false);\n\n/**\n * Gets a localized message.\n *\n * This function is a compiler primitive. If you give the compiler a localized\n * message bundle, it will replace the string at compile-time with a localized\n * version, and expand goog.getMsg call to a concatenated string.\n *\n * Messages must be initialized in the form:\n * <code>\n * var MSG_NAME = goog.getMsg('Hello {$placeholder}', {'placeholder': 'world'});\n * </code>\n *\n * This function produces a string which should be treated as plain text. Use\n * {@link goog.html.SafeHtmlFormatter} in conjunction with goog.getMsg to\n * produce SafeHtml.\n *\n * @param {string} str Translatable string, places holders in the form {$foo}.\n * @param {!Object<string, string>=} opt_values Maps place holder name to value.\n * @param {!goog.GetMsgOptions=} opt_options see `goog.GetMsgOptions`\n * @return {string} message with placeholders filled.\n */\ngoog.getMsg = function(str, opt_values, opt_options) {\n  if (goog.USE_GET_MSG_OVERRIDE && !COMPILED) {\n    if (goog.global.CLOSURE_P16N_GET_MSG &&\n        goog.global.CLOSURE_P16N_GET_MSG['goog.getMsg'] != undefined) {\n      str = goog.global.CLOSURE_P16N_GET_MSG['goog.getMsg'](\n          str, opt_values, opt_options);\n    } else {\n      throw new Error('Closure p16n getMsg override is not available.');\n    }\n  }\n  if (opt_options && opt_options.html) {\n    // Note that '&' is not replaced because the translation can contain HTML\n    // entities.\n    str = str.replace(/</g, '&lt;');\n  }\n  if (opt_options && opt_options.unescapeHtmlEntities) {\n    // Note that \"&amp;\" must be the last to avoid \"creating\" new entities.\n    str = str.replace(/&lt;/g, '<')\n              .replace(/&gt;/g, '>')\n              .replace(/&apos;/g, '\\'')\n              .replace(/&quot;/g, '\"')\n              .replace(/&amp;/g, '&');\n  }\n  if (opt_values) {\n    str = str.replace(/\\{\\$([^}]+)}/g, function(match, key) {\n      return (opt_values != null && key in opt_values) ? opt_values[key] :\n                                                         match;\n    });\n  }\n  return str;\n};\n\n\n/**\n * Gets a localized message. If the message does not have a translation, gives a\n * fallback message.\n *\n * This is useful when introducing a new message that has not yet been\n * translated into all languages.\n *\n * This function is a compiler primitive. Must be used in the form:\n * <code>var x = goog.getMsgWithFallback(MSG_A, MSG_B);</code>\n * where MSG_A and MSG_B were initialized with goog.getMsg.\n *\n * @param {string} a The preferred message.\n * @param {string} b The fallback message.\n * @return {string} The best translated message.\n */\ngoog.getMsgWithFallback = function(a, b) {\n  return a;\n};\n\n\n/**\n * Exposes an unobfuscated global namespace path for the given object.\n * Note that fields of the exported object *will* be obfuscated, unless they are\n * exported in turn via this function or goog.exportProperty.\n *\n * Also handy for making public items that are defined in anonymous closures.\n *\n * ex. goog.exportSymbol('public.path.Foo', Foo);\n *\n * ex. goog.exportSymbol('public.path.Foo.staticFunction', Foo.staticFunction);\n *     public.path.Foo.staticFunction();\n *\n * ex. goog.exportSymbol('public.path.Foo.prototype.myMethod',\n *                       Foo.prototype.myMethod);\n *     new public.path.Foo().myMethod();\n *\n * @param {string} publicPath Unobfuscated name to export.\n * @param {*} object Object the name should point to.\n * @param {?Object=} objectToExportTo The object to add the path to; default\n *     is goog.global.\n */\ngoog.exportSymbol = function(publicPath, object, objectToExportTo) {\n  goog.exportPath_(\n      publicPath, object, /* overwriteImplicit= */ true, objectToExportTo);\n};\n\n\n/**\n * Exports a property unobfuscated into the object's namespace.\n * ex. goog.exportProperty(Foo, 'staticFunction', Foo.staticFunction);\n * ex. goog.exportProperty(Foo.prototype, 'myMethod', Foo.prototype.myMethod);\n * @param {Object} object Object whose static property is being exported.\n * @param {string} publicName Unobfuscated name to export.\n * @param {*} symbol Object the name should point to.\n */\ngoog.exportProperty = function(object, publicName, symbol) {\n  object[publicName] = symbol;\n};\n\n\n/**\n * Returns the value of a given name, or undefined if there are no other\n * references to the name.\n *\n * This function is evaluated statically, at compile time, as long as the\n * appropriate compiler passes are enabled.  If these compiler passes are not\n * enabled, the function is a no-op, and will just return its argument\n * unmodified.\n *\n * Usage:\n * <pre>\n * // If there are other references to `x`, `xOrUndefined` will be `x`.\n * // Otherwise, `xOrUndefined` will be `undefined`.\n * var xOrUndefined = goog.weakUsage(x);\n * </pre>\n *\n * It is an error to call `goog.weakUsage` with an argument that is not a name.\n *\n * @param {T} name A symbol name to reference weakly.\n * @return {T|undefined} The object or undefined.\n * @template T\n * @noinline\n */\ngoog.weakUsage = function(name) {\n  return name;\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * Usage:\n * <pre>\n * function ParentClass(a, b) { }\n * ParentClass.prototype.foo = function(a) { };\n *\n * function ChildClass(a, b, c) {\n *   ChildClass.base(this, 'constructor', a, b);\n * }\n * goog.inherits(ChildClass, ParentClass);\n *\n * var child = new ChildClass('a', 'b', 'see');\n * child.foo(); // This works.\n * </pre>\n *\n * @param {!Function} childCtor Child class.\n * @param {!Function} parentCtor Parent class.\n * @suppress {strictMissingProperties} superClass_ and base is not defined on\n *    Function.\n * @deprecated Use ECMAScript class syntax instead.\n */\ngoog.inherits = function(childCtor, parentCtor) {\n  /** @constructor */\n  function tempCtor() {}\n  tempCtor.prototype = parentCtor.prototype;\n  childCtor.superClass_ = parentCtor.prototype;\n  childCtor.prototype = new tempCtor();\n  /** @override */\n  childCtor.prototype.constructor = childCtor;\n\n  /**\n   * Calls superclass constructor/method.\n   *\n   * This function is only available if you use goog.inherits to\n   * express inheritance relationships between classes.\n   *\n   * NOTE: This is a replacement for goog.base and for superClass_\n   * property defined in childCtor.\n   *\n   * @param {!Object} me Should always be \"this\".\n   * @param {string} methodName The method name to call. Calling\n   *     superclass constructor can be done with the special string\n   *     'constructor'.\n   * @param {...*} var_args The arguments to pass to superclass\n   *     method/constructor.\n   * @return {*} The return value of the superclass method/constructor.\n   */\n  childCtor.base = function(me, methodName, var_args) {\n    // Copying using loop to avoid deop due to passing arguments object to\n    // function. This is faster in many JS engines as of late 2014.\n    var args = new Array(arguments.length - 2);\n    for (var i = 2; i < arguments.length; i++) {\n      args[i - 2] = arguments[i];\n    }\n    return parentCtor.prototype[methodName].apply(me, args);\n  };\n};\n\n\n/**\n * Allow for aliasing within scope functions.  This function exists for\n * uncompiled code - in compiled code the calls will be inlined and the aliases\n * applied.  In uncompiled code the function is simply run since the aliases as\n * written are valid JavaScript.\n *\n * MOE:begin_intracomment_strip\n * See the goog.scope document at http://go/goog.scope\n *\n * For more on goog.scope deprecation, see the style guide entry:\n * http://go/jsstyle#appendices-legacy-exceptions-goog-scope\n * MOE:end_intracomment_strip\n *\n * @param {function()} fn Function to call.  This function can contain aliases\n *     to namespaces (e.g. \"var dom = goog.dom\") or classes\n *     (e.g. \"var Timer = goog.Timer\").\n * @deprecated Use goog.module instead.\n */\ngoog.scope = function(fn) {\n  if (goog.isInModuleLoader_()) {\n    throw new Error('goog.scope is not supported within a module.');\n  }\n  fn.call(goog.global);\n};\n\n\n/*\n * To support uncompiled, strict mode bundles that use eval to divide source\n * like so:\n *    eval('someSource;//# sourceUrl sourcefile.js');\n * We need to export the globally defined symbols \"goog\" and \"COMPILED\".\n * Exporting \"goog\" breaks the compiler optimizations, so we required that\n * be defined externally.\n * NOTE: We don't use goog.exportSymbol here because we don't want to trigger\n * extern generation when that compiler option is enabled.\n */\nif (!COMPILED) {\n  goog.LEGACY_NAMESPACE_OBJECT_['COMPILED'] = COMPILED;\n}\n\n/**\n * Returns the parameter.\n * @param {string} s\n * @return {string}\n * @private\n */\ngoog.identity_ = function(s) {\n  return s;\n};\n\n\n/**\n * Creates Trusted Types policy if Trusted Types are supported by the browser.\n * The policy just blesses any string as a Trusted Type. It is not visibility\n * restricted because anyone can also call trustedTypes.createPolicy directly.\n * However, the allowed names should be restricted by a HTTP header and the\n * reference to the created policy should be visibility restricted.\n * @param {string} name\n * @return {?TrustedTypePolicy}\n */\ngoog.createTrustedTypesPolicy = function(name) {\n  var policy = null;\n  var policyFactory = goog.global.trustedTypes;\n  if (!policyFactory || !policyFactory.createPolicy) {\n    return policy;\n  }\n  // trustedTypes.createPolicy throws if called with a name that is already\n  // registered, even in report-only mode. Until the API changes, catch the\n  // error not to break the applications functionally. In such case, the code\n  // will fall back to using regular Safe Types.\n  // TODO(koto): Remove catching once createPolicy API stops throwing.\n  try {\n    policy = policyFactory.createPolicy(name, {\n      createHTML: goog.identity_,\n      createScript: goog.identity_,\n      createScriptURL: goog.identity_\n    });\n  } catch (e) {\n    goog.logToConsole_(e.message);\n  }\n  return policy;\n};\n\n// There's a bug in the compiler where without collapse properties the\n// Closure namespace defines do not guard code correctly. To help reduce code\n// size also check for !COMPILED even though it redundant until this is fixed.\nif (!COMPILED && goog.DEPENDENCIES_ENABLED) {\n  // MOE:begin_strip\n  // TODO(b/67050526) This object is obsolete but some people are relying on\n  // it internally. Keep it around until we migrate them.\n  /**\n   * @private\n   * @type {{\n   *   loadFlags: !Object<string, !Object<string, string>>,\n   *   nameToPath: !Object<string, string>,\n   *   requires: !Object<string, !Object<string, boolean>>,\n   *   visited: !Object<string, boolean>,\n   *   written: !Object<string, boolean>,\n   *   deferred: !Object<string, string>\n   * }}\n   */\n  goog.dependencies_ = {\n    loadFlags: {},  // 1 to 1\n\n    nameToPath: {},  // 1 to 1\n\n    requires: {},  // 1 to many\n\n    // Used when resolving dependencies to prevent us from visiting file\n    // twice.\n    visited: {},\n\n    written: {},  // Used to keep track of script files we have written.\n\n    deferred: {}  // Used to track deferred module evaluations in old IEs\n  };\n\n  /**\n   * @return {!Object}\n   * @private\n   */\n  goog.getLoader_ = function() {\n    return {\n      dependencies_: goog.dependencies_,\n      writeScriptTag_: goog.writeScriptTag_\n    };\n  };\n\n\n  /**\n   * @param {string} src The script url.\n   * @param {string=} opt_sourceText The optionally source text to evaluate\n   * @return {boolean} True if the script was imported, false otherwise.\n   * @private\n   */\n  goog.writeScriptTag_ = function(src, opt_sourceText) {\n    if (goog.inHtmlDocument_()) {\n      /** @type {!HTMLDocument} */\n      var doc = goog.global.document;\n\n      // If the user tries to require a new symbol after document load,\n      // something has gone terribly wrong. Doing a document.write would\n      // wipe out the page. This does not apply to the CSP-compliant method\n      // of writing script tags.\n      if (!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING &&\n          doc.readyState == 'complete') {\n        // Certain test frameworks load base.js multiple times, which tries\n        // to write deps.js each time. If that happens, just fail silently.\n        // These frameworks wipe the page between each load of base.js, so this\n        // is OK.\n        var isDeps = /\\bdeps.js$/.test(src);\n        if (isDeps) {\n          return false;\n        } else {\n          throw Error('Cannot write \"' + src + '\" after document load');\n        }\n      }\n\n      var nonceAttr = '';\n      var nonce = goog.getScriptNonce_();\n      if (nonce) {\n        nonceAttr = ' nonce=\"' + nonce + '\"';\n      }\n\n      if (opt_sourceText === undefined) {\n        var script = '<script src=\"' + src + '\"' + nonceAttr + '></' +\n            'script>';\n        doc.write(\n            goog.TRUSTED_TYPES_POLICY_ ?\n                goog.TRUSTED_TYPES_POLICY_.createHTML(script) :\n                script);\n      } else {\n        var script = '<script' + nonceAttr + '>' +\n            goog.protectScriptTag_(opt_sourceText) + '</' +\n            'script>';\n        doc.write(\n            goog.TRUSTED_TYPES_POLICY_ ?\n                goog.TRUSTED_TYPES_POLICY_.createHTML(script) :\n                script);\n      }\n      return true;\n    } else {\n      return false;\n    }\n  };\n  // MOE:end_strip\n\n\n  /**\n   * Tries to detect whether is in the context of an HTML document.\n   * @return {boolean} True if it looks like HTML document.\n   * @private\n   */\n  goog.inHtmlDocument_ = function() {\n    /** @type {!Document} */\n    var doc = goog.global.document;\n    return doc != null && 'write' in doc;  // XULDocument misses write.\n  };\n\n\n  /**\n   * We'd like to check for if the document readyState is 'loading'; however\n   * there are bugs on IE 10 and below where the readyState being anything other\n   * than 'complete' is not reliable.\n   * @return {boolean}\n   * @private\n   */\n  goog.isDocumentLoading_ = function() {\n    // attachEvent is available on IE 6 thru 10 only, and thus can be used to\n    // detect those browsers.\n    /** @type {!HTMLDocument} */\n    var doc = goog.global.document;\n    return doc.attachEvent ? doc.readyState != 'complete' :\n                             doc.readyState == 'loading';\n  };\n\n\n  /**\n   * Tries to detect the base path of base.js script that bootstraps Closure.\n   * @private\n   */\n  goog.findBasePath_ = function() {\n    if (goog.global.CLOSURE_BASE_PATH != undefined &&\n        // Anti DOM-clobbering runtime check (b/37736576).\n        typeof goog.global.CLOSURE_BASE_PATH === 'string') {\n      goog.basePath = goog.global.CLOSURE_BASE_PATH;\n      return;\n    } else if (!goog.inHtmlDocument_()) {\n      return;\n    }\n    /** @type {!Document} */\n    var doc = goog.global.document;\n    // If we have a currentScript available, use it exclusively.\n    var currentScript = doc.currentScript;\n    if (currentScript) {\n      var scripts = [currentScript];\n    } else {\n      var scripts = doc.getElementsByTagName('SCRIPT');\n    }\n    // Search backwards since the current script is in almost all cases the one\n    // that has base.js.\n    for (var i = scripts.length - 1; i >= 0; --i) {\n      var script = /** @type {!HTMLScriptElement} */ (scripts[i]);\n      var src = script.src;\n      var qmark = src.lastIndexOf('?');\n      var l = qmark == -1 ? src.length : qmark;\n      if (src.slice(l - 7, l) == 'base.js') {\n        goog.basePath = src.slice(0, l - 7);\n        return;\n      }\n    }\n  };\n\n  goog.findBasePath_();\n\n  /**\n   * Rewrites closing script tags in input to avoid ending an enclosing script\n   * tag.\n   *\n   * @param {string} str\n   * @return {string}\n   * @private\n   */\n  goog.protectScriptTag_ = function(str) {\n    return str.replace(/<\\/(SCRIPT)/ig, '\\\\x3c/$1');\n  };\n\n\n  /**\n   * A debug loader is responsible for downloading and executing javascript\n   * files in an unbundled, uncompiled environment.\n   *\n   * This can be custimized via the setDependencyFactory method, or by\n   * CLOSURE_IMPORT_SCRIPT/CLOSURE_LOAD_FILE_SYNC.\n   *\n   * @struct @constructor @final @private\n   */\n  goog.DebugLoader_ = function() {\n    /** @private @const {!Object<string, !goog.Dependency>} */\n    this.dependencies_ = {};\n    /** @private @const {!Object<string, string>} */\n    this.idToPath_ = {};\n    /** @private @const {!Object<string, boolean>} */\n    this.written_ = {};\n    /** @private @const {!Array<!goog.Dependency>} */\n    this.loadingDeps_ = [];\n    /** @private {!Array<!goog.Dependency>} */\n    this.depsToLoad_ = [];\n    /** @private {boolean} */\n    this.paused_ = false;\n    /** @private {!goog.DependencyFactory} */\n    this.factory_ = new goog.DependencyFactory();\n    /** @private @const {!Object<string, !Function>} */\n    this.deferredCallbacks_ = {};\n    /** @private @const {!Array<string>} */\n    this.deferredQueue_ = [];\n  };\n\n\n  /**\n   * Loads the Closure deps.js file.\n   *\n   * Exposed a function so after base is loaded, and\n   * then this can be called to load the closure deps.js file.\n   */\n  goog.DebugLoader_.prototype.loadClosureDeps = function() {\n    // Circumvent addDependency, which would try to transpile deps.js if\n    // transpile is set to always.\n    var relPath = 'deps.js';\n    this.depsToLoad_.push(this.factory_.createDependency(\n        goog.normalizePath_(goog.basePath + relPath), relPath, [], [], {}));\n    this.loadDeps_();\n  };\n\n\n  /**\n   * Notifies the debug loader when a dependency has been requested.\n   *\n   * @param {string} absPathOrId Path of the dependency or goog id.\n   * @param {boolean=} opt_force\n   */\n  goog.DebugLoader_.prototype.requested = function(absPathOrId, opt_force) {\n    var path = this.getPathFromDeps_(absPathOrId);\n    if (path &&\n        (opt_force || this.areDepsLoaded_(this.dependencies_[path].requires))) {\n      var callback = this.deferredCallbacks_[path];\n      if (callback) {\n        delete this.deferredCallbacks_[path];\n        callback();\n      }\n    }\n  };\n\n\n  /**\n   * Sets the dependency factory, which can be used to create custom\n   * goog.Dependency implementations to control how dependencies are loaded.\n   *\n   * @param {!goog.DependencyFactory} factory\n   */\n  goog.DebugLoader_.prototype.setDependencyFactory = function(factory) {\n    this.factory_ = factory;\n  };\n\n\n  /**\n   * Travserses the dependency graph and queues the given dependency, and all of\n   * its transitive dependencies, for loading and then starts loading if not\n   * paused.\n   *\n   * @param {string} namespace\n   * @private\n   */\n  goog.DebugLoader_.prototype.load_ = function(namespace) {\n    if (!this.getPathFromDeps_(namespace)) {\n      var errorMessage = 'goog.require could not find: ' + namespace;\n      goog.logToConsole_(errorMessage);\n    } else {\n      var loader = this;\n\n      var deps = [];\n\n      /** @param {string} namespace */\n      var visit = function(namespace) {\n        var path = loader.getPathFromDeps_(namespace);\n\n        if (!path) {\n          throw new Error('Bad dependency path or symbol: ' + namespace);\n        }\n\n        if (loader.written_[path]) {\n          return;\n        }\n\n        loader.written_[path] = true;\n\n        var dep = loader.dependencies_[path];\n        // MOE:begin_strip\n        if (goog.dependencies_.written[dep.relativePath]) {\n          return;\n        }\n        // MOE:end_strip\n        for (var i = 0; i < dep.requires.length; i++) {\n          if (!goog.isProvided_(dep.requires[i])) {\n            visit(dep.requires[i]);\n          }\n        }\n\n        deps.push(dep);\n      };\n\n      visit(namespace);\n\n      var wasLoading = !!this.depsToLoad_.length;\n      this.depsToLoad_ = this.depsToLoad_.concat(deps);\n\n      if (!this.paused_ && !wasLoading) {\n        this.loadDeps_();\n      }\n    }\n  };\n\n\n  /**\n   * Loads any queued dependencies until they are all loaded or paused.\n   *\n   * @private\n   */\n  goog.DebugLoader_.prototype.loadDeps_ = function() {\n    var loader = this;\n    var paused = this.paused_;\n\n    while (this.depsToLoad_.length && !paused) {\n      (function() {\n        var loadCallDone = false;\n        var dep = loader.depsToLoad_.shift();\n\n        var loaded = false;\n        loader.loading_(dep);\n\n        var controller = {\n          pause: function() {\n            if (loadCallDone) {\n              throw new Error('Cannot call pause after the call to load.');\n            } else {\n              paused = true;\n            }\n          },\n          resume: function() {\n            if (loadCallDone) {\n              loader.resume_();\n            } else {\n              // Some dep called pause and then resume in the same load call.\n              // Just keep running this same loop.\n              paused = false;\n            }\n          },\n          loaded: function() {\n            if (loaded) {\n              throw new Error('Double call to loaded.');\n            }\n\n            loaded = true;\n            loader.loaded_(dep);\n          },\n          pending: function() {\n            // Defensive copy.\n            var pending = [];\n            for (var i = 0; i < loader.loadingDeps_.length; i++) {\n              pending.push(loader.loadingDeps_[i]);\n            }\n            return pending;\n          },\n          /**\n           * @param {goog.ModuleType} type\n           */\n          setModuleState: function(type) {\n            goog.moduleLoaderState_ = {\n              type: type,\n              moduleName: '',\n              declareLegacyNamespace: false,\n              preventModuleExportSealing: false,\n            };\n          },\n          /** @type {function(string, string, string=)} */\n          registerEs6ModuleExports: function(\n              path, exports, opt_closureNamespace) {\n            if (opt_closureNamespace) {\n              goog.loadedModules_[opt_closureNamespace] = {\n                exports: exports,\n                type: goog.ModuleType.ES6,\n                moduleId: opt_closureNamespace || ''\n              };\n            }\n          },\n          /** @type {function(string, ?)} */\n          registerGoogModuleExports: function(moduleId, exports) {\n            goog.loadedModules_[moduleId] = {\n              exports: exports,\n              type: goog.ModuleType.GOOG,\n              moduleId: moduleId\n            };\n          },\n          clearModuleState: function() {\n            goog.moduleLoaderState_ = null;\n          },\n          defer: function(callback) {\n            if (loadCallDone) {\n              throw new Error(\n                  'Cannot register with defer after the call to load.');\n            }\n            loader.defer_(dep, callback);\n          },\n          areDepsLoaded: function() {\n            return loader.areDepsLoaded_(dep.requires);\n          }\n        };\n\n        try {\n          dep.load(controller);\n        } finally {\n          loadCallDone = true;\n        }\n      })();\n    }\n\n    if (paused) {\n      this.pause_();\n    }\n  };\n\n\n  /** @private */\n  goog.DebugLoader_.prototype.pause_ = function() {\n    this.paused_ = true;\n  };\n\n\n  /** @private */\n  goog.DebugLoader_.prototype.resume_ = function() {\n    if (this.paused_) {\n      this.paused_ = false;\n      this.loadDeps_();\n    }\n  };\n\n\n  /**\n   * Marks the given dependency as loading (load has been called but it has not\n   * yet marked itself as finished). Useful for dependencies that want to know\n   * what else is loading. Example: goog.modules cannot eval if there are\n   * loading dependencies.\n   *\n   * @param {!goog.Dependency} dep\n   * @private\n   */\n  goog.DebugLoader_.prototype.loading_ = function(dep) {\n    this.loadingDeps_.push(dep);\n  };\n\n\n  /**\n   * Marks the given dependency as having finished loading and being available\n   * for require.\n   *\n   * @param {!goog.Dependency} dep\n   * @private\n   */\n  goog.DebugLoader_.prototype.loaded_ = function(dep) {\n    for (var i = 0; i < this.loadingDeps_.length; i++) {\n      if (this.loadingDeps_[i] == dep) {\n        this.loadingDeps_.splice(i, 1);\n        break;\n      }\n    }\n\n    for (var i = 0; i < this.deferredQueue_.length; i++) {\n      if (this.deferredQueue_[i] == dep.path) {\n        this.deferredQueue_.splice(i, 1);\n        break;\n      }\n    }\n\n    if (this.loadingDeps_.length == this.deferredQueue_.length &&\n        !this.depsToLoad_.length) {\n      // Something has asked to load these, but they may not be directly\n      // required again later, so load them now that we know we're done loading\n      // everything else. e.g. a goog module entry point.\n      while (this.deferredQueue_.length) {\n        this.requested(this.deferredQueue_.shift(), true);\n      }\n    }\n\n    dep.loaded();\n  };\n\n\n  /**\n   * @param {!Array<string>} pathsOrIds\n   * @return {boolean}\n   * @private\n   */\n  goog.DebugLoader_.prototype.areDepsLoaded_ = function(pathsOrIds) {\n    for (var i = 0; i < pathsOrIds.length; i++) {\n      var path = this.getPathFromDeps_(pathsOrIds[i]);\n      if (!path ||\n          (!(path in this.deferredCallbacks_) &&\n           !goog.isProvided_(pathsOrIds[i]))) {\n        return false;\n      }\n    }\n\n    return true;\n  };\n\n\n  /**\n   * @param {string} absPathOrId\n   * @return {?string}\n   * @private\n   */\n  goog.DebugLoader_.prototype.getPathFromDeps_ = function(absPathOrId) {\n    if (absPathOrId in this.idToPath_) {\n      return this.idToPath_[absPathOrId];\n    } else if (absPathOrId in this.dependencies_) {\n      return absPathOrId;\n    } else {\n      return null;\n    }\n  };\n\n\n  /**\n   * @param {!goog.Dependency} dependency\n   * @param {!Function} callback\n   * @private\n   */\n  goog.DebugLoader_.prototype.defer_ = function(dependency, callback) {\n    this.deferredCallbacks_[dependency.path] = callback;\n    this.deferredQueue_.push(dependency.path);\n  };\n\n\n  /**\n   * Interface for goog.Dependency implementations to have some control over\n   * loading of dependencies.\n   *\n   * @record\n   */\n  goog.LoadController = function() {};\n\n\n  /**\n   * Tells the controller to halt loading of more dependencies.\n   */\n  goog.LoadController.prototype.pause = function() {};\n\n\n  /**\n   * Tells the controller to resume loading of more dependencies if paused.\n   */\n  goog.LoadController.prototype.resume = function() {};\n\n\n  /**\n   * Tells the controller that this dependency has finished loading.\n   *\n   * This causes this to be removed from pending() and any load callbacks to\n   * fire.\n   */\n  goog.LoadController.prototype.loaded = function() {};\n\n\n  /**\n   * List of dependencies on which load has been called but which have not\n   * called loaded on their controller. This includes the current dependency.\n   *\n   * @return {!Array<!goog.Dependency>}\n   */\n  goog.LoadController.prototype.pending = function() {};\n\n\n  /**\n   * Registers an object as an ES6 module's exports so that goog.modules may\n   * require it by path.\n   *\n   * @param {string} path Full path of the module.\n   * @param {?} exports\n   * @param {string=} opt_closureNamespace Closure namespace to associate with\n   *     this module.\n   */\n  goog.LoadController.prototype.registerEs6ModuleExports = function(\n      path, exports, opt_closureNamespace) {};\n\n\n  /**\n   * Sets the current module state.\n   *\n   * @param {goog.ModuleType} type Type of module.\n   */\n  goog.LoadController.prototype.setModuleState = function(type) {};\n\n\n  /**\n   * Clears the current module state.\n   */\n  goog.LoadController.prototype.clearModuleState = function() {};\n\n\n  /**\n   * Registers a callback to call once the dependency is actually requested\n   * via goog.require + all of the immediate dependencies have been loaded or\n   * all other files have been loaded. Allows for lazy loading until\n   * require'd without pausing dependency loading, which is needed on old IE.\n   *\n   * @param {!Function} callback\n   */\n  goog.LoadController.prototype.defer = function(callback) {};\n\n\n  /**\n   * @return {boolean}\n   */\n  goog.LoadController.prototype.areDepsLoaded = function() {};\n\n\n  /**\n   * Basic super class for all dependencies Closure Library can load.\n   *\n   * This default implementation is designed to load untranspiled, non-module\n   * scripts in a web broswer.\n   *\n   * For goog.modules see {@see goog.GoogModuleDependency}.\n   * For untranspiled ES6 modules {@see goog.Es6ModuleDependency}.\n   *\n   * @param {string} path Absolute path of this script.\n   * @param {string} relativePath Path of this script relative to goog.basePath.\n   * @param {!Array<string>} provides goog.provided or goog.module symbols\n   *     in this file.\n   * @param {!Array<string>} requires goog symbols or relative paths to Closure\n   *     this depends on.\n   * @param {!Object<string, string>} loadFlags\n   * @struct @constructor\n   */\n  goog.Dependency = function(\n      path, relativePath, provides, requires, loadFlags) {\n    /** @const */\n    this.path = path;\n    /** @const */\n    this.relativePath = relativePath;\n    /** @const */\n    this.provides = provides;\n    /** @const */\n    this.requires = requires;\n    /** @const */\n    this.loadFlags = loadFlags;\n    /** @private {boolean} */\n    this.loaded_ = false;\n    /** @private {!Array<function()>} */\n    this.loadCallbacks_ = [];\n  };\n\n\n  /**\n   * @return {string} The pathname part of this dependency's path if it is a\n   *     URI.\n   */\n  goog.Dependency.prototype.getPathName = function() {\n    var pathName = this.path;\n    var protocolIndex = pathName.indexOf('://');\n    if (protocolIndex >= 0) {\n      pathName = pathName.substring(protocolIndex + 3);\n      var slashIndex = pathName.indexOf('/');\n      if (slashIndex >= 0) {\n        pathName = pathName.substring(slashIndex + 1);\n      }\n    }\n    return pathName;\n  };\n\n\n  /**\n   * @param {function()} callback Callback to fire as soon as this has loaded.\n   * @final\n   */\n  goog.Dependency.prototype.onLoad = function(callback) {\n    if (this.loaded_) {\n      callback();\n    } else {\n      this.loadCallbacks_.push(callback);\n    }\n  };\n\n\n  /**\n   * Marks this dependency as loaded and fires any callbacks registered with\n   * onLoad.\n   * @final\n   */\n  goog.Dependency.prototype.loaded = function() {\n    this.loaded_ = true;\n    var callbacks = this.loadCallbacks_;\n    this.loadCallbacks_ = [];\n    for (var i = 0; i < callbacks.length; i++) {\n      callbacks[i]();\n    }\n  };\n\n\n  /**\n   * Whether or not document.written / appended script tags should be deferred.\n   *\n   * @private {boolean}\n   */\n  goog.Dependency.defer_ = false;\n\n\n  /**\n   * Map of script ready / state change callbacks. Old IE cannot handle putting\n   * these properties on goog.global.\n   *\n   * @private @const {!Object<string, function(?):undefined>}\n   */\n  goog.Dependency.callbackMap_ = {};\n\n\n  /**\n   * @param {function(...?):?} callback\n   * @return {string}\n   * @private\n   */\n  goog.Dependency.registerCallback_ = function(callback) {\n    var key = Math.random().toString(32);\n    goog.Dependency.callbackMap_[key] = callback;\n    return key;\n  };\n\n\n  /**\n   * @param {string} key\n   * @private\n   */\n  goog.Dependency.unregisterCallback_ = function(key) {\n    delete goog.Dependency.callbackMap_[key];\n  };\n\n\n  /**\n   * @param {string} key\n   * @param {...?} var_args\n   * @private\n   */\n  goog.Dependency.callback_ = function(key, var_args) {\n    if (key in goog.Dependency.callbackMap_) {\n      var callback = goog.Dependency.callbackMap_[key];\n      var args = [];\n      for (var i = 1; i < arguments.length; i++) {\n        args.push(arguments[i]);\n      }\n      callback.apply(undefined, args);\n    } else {\n      var errorMessage = 'Callback key ' + key +\n          ' does not exist (was base.js loaded more than once?).';\n      // MOE:begin_strip\n      // TODO(johnplaisted): Some people internally are mistakenly loading\n      // base.js twice, and this can happen while a dependency is loading,\n      // wiping out state.\n      goog.logToConsole_(errorMessage);\n      // MOE:end_strip\n      // MOE:insert throw Error(errorMessage);\n    }\n  };\n\n\n  /**\n   * Starts loading this dependency. This dependency can pause loading if it\n   * needs to and resume it later via the controller interface.\n   *\n   * When this is loaded it should call controller.loaded(). Note that this will\n   * end up calling the loaded method of this dependency; there is no need to\n   * call it explicitly.\n   *\n   * @param {!goog.LoadController} controller\n   */\n  goog.Dependency.prototype.load = function(controller) {\n    if (goog.global.CLOSURE_IMPORT_SCRIPT) {\n      if (goog.global.CLOSURE_IMPORT_SCRIPT(this.path)) {\n        controller.loaded();\n      } else {\n        controller.pause();\n      }\n      return;\n    }\n\n    if (!goog.inHtmlDocument_()) {\n      goog.logToConsole_(\n          'Cannot use default debug loader outside of HTML documents.');\n      if (this.relativePath == 'deps.js') {\n        // CLOSURE_IMPORT_SCRIPT should be set *before* base.js is loaded.\n        goog.logToConsole_(\n            'Consider setting CLOSURE_IMPORT_SCRIPT before loading base.js.');\n        controller.loaded();\n      } else {\n        controller.pause();\n      }\n      return;\n    }\n\n    /** @type {!HTMLDocument} */\n    var doc = goog.global.document;\n\n    // If the user tries to require a new symbol after document load,\n    // something has gone terribly wrong. Doing a document.write would\n    // wipe out the page. This does not apply to the CSP-compliant method\n    // of writing script tags.\n    if (doc.readyState == 'complete' &&\n        !goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING) {\n      // Certain test frameworks load base.js multiple times, which tries\n      // to write deps.js each time. If that happens, just fail silently.\n      // These frameworks wipe the page between each load of base.js, so this\n      // is OK.\n      var isDeps = /\\bdeps.js$/.test(this.path);\n      if (isDeps) {\n        controller.loaded();\n        return;\n      } else {\n        throw Error('Cannot write \"' + this.path + '\" after document load');\n      }\n    }\n\n    var nonce = goog.getScriptNonce_();\n    if (!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING &&\n        goog.isDocumentLoading_()) {\n      var key;\n      var callback = function(script) {\n        if (script.readyState && script.readyState != 'complete') {\n          script.onload = callback;\n          return;\n        }\n        goog.Dependency.unregisterCallback_(key);\n        controller.loaded();\n      };\n      key = goog.Dependency.registerCallback_(callback);\n\n      var defer = goog.Dependency.defer_ ? ' defer' : '';\n      var nonceAttr = nonce ? ' nonce=\"' + nonce + '\"' : '';\n      var script = '<script src=\"' + this.path + '\"' + nonceAttr + defer +\n          ' id=\"script-' + key + '\"><\\/script>';\n\n      script += '<script' + nonceAttr + '>';\n\n      if (goog.Dependency.defer_) {\n        script += 'document.getElementById(\\'script-' + key +\n            '\\').onload = function() {\\n' +\n            '  goog.Dependency.callback_(\\'' + key + '\\', this);\\n' +\n            '};\\n';\n      } else {\n        script += 'goog.Dependency.callback_(\\'' + key +\n            '\\', document.getElementById(\\'script-' + key + '\\'));';\n      }\n\n      script += '<\\/script>';\n\n      doc.write(\n          goog.TRUSTED_TYPES_POLICY_ ?\n              goog.TRUSTED_TYPES_POLICY_.createHTML(script) :\n              script);\n    } else {\n      var scriptEl =\n          /** @type {!HTMLScriptElement} */ (doc.createElement('script'));\n      scriptEl.defer = goog.Dependency.defer_;\n      scriptEl.async = false;\n\n      // If CSP nonces are used, propagate them to dynamically created scripts.\n      // This is necessary to allow nonce-based CSPs without 'strict-dynamic'.\n      if (nonce) {\n        scriptEl.nonce = nonce;\n      }\n\n      scriptEl.onload = function() {\n        scriptEl.onload = null;\n        controller.loaded();\n      };\n\n      scriptEl.src = goog.TRUSTED_TYPES_POLICY_ ?\n          goog.TRUSTED_TYPES_POLICY_.createScriptURL(this.path) :\n          this.path;\n      doc.head.appendChild(scriptEl);\n    }\n  };\n\n\n  /**\n   * @param {string} path Absolute path of this script.\n   * @param {string} relativePath Path of this script relative to goog.basePath.\n   * @param {!Array<string>} provides Should be an empty array.\n   *     TODO(johnplaisted) add support for adding closure namespaces to ES6\n   *     modules for interop purposes.\n   * @param {!Array<string>} requires goog symbols or relative paths to Closure\n   *     this depends on.\n   * @param {!Object<string, string>} loadFlags\n   * @struct @constructor\n   * @extends {goog.Dependency}\n   */\n  goog.Es6ModuleDependency = function(\n      path, relativePath, provides, requires, loadFlags) {\n    goog.Es6ModuleDependency.base(\n        this, 'constructor', path, relativePath, provides, requires, loadFlags);\n  };\n  goog.inherits(goog.Es6ModuleDependency, goog.Dependency);\n\n\n  /**\n   * @override\n   * @param {!goog.LoadController} controller\n   */\n  goog.Es6ModuleDependency.prototype.load = function(controller) {\n    if (goog.global.CLOSURE_IMPORT_SCRIPT) {\n      if (goog.global.CLOSURE_IMPORT_SCRIPT(this.path)) {\n        controller.loaded();\n      } else {\n        controller.pause();\n      }\n      return;\n    }\n\n    if (!goog.inHtmlDocument_()) {\n      goog.logToConsole_(\n          'Cannot use default debug loader outside of HTML documents.');\n      controller.pause();\n      return;\n    }\n\n    /** @type {!HTMLDocument} */\n    var doc = goog.global.document;\n\n    var dep = this;\n\n    // TODO(johnplaisted): Does document.writing really speed up anything? Any\n    // difference between this and just waiting for interactive mode and then\n    // appending?\n    function write(src, contents) {\n      var nonceAttr = '';\n      var nonce = goog.getScriptNonce_();\n      if (nonce) {\n        nonceAttr = ' nonce=\"' + nonce + '\"';\n      }\n\n      if (contents) {\n        var script = '<script type=\"module\" crossorigin' + nonceAttr + '>' +\n            contents + '</' +\n            'script>';\n        doc.write(\n            goog.TRUSTED_TYPES_POLICY_ ?\n                goog.TRUSTED_TYPES_POLICY_.createHTML(script) :\n                script);\n      } else {\n        var script = '<script type=\"module\" crossorigin src=\"' + src + '\"' +\n            nonceAttr + '></' +\n            'script>';\n        doc.write(\n            goog.TRUSTED_TYPES_POLICY_ ?\n                goog.TRUSTED_TYPES_POLICY_.createHTML(script) :\n                script);\n      }\n    }\n\n    function append(src, contents) {\n      var scriptEl =\n          /** @type {!HTMLScriptElement} */ (doc.createElement('script'));\n      scriptEl.defer = true;\n      scriptEl.async = false;\n      scriptEl.type = 'module';\n      scriptEl.setAttribute('crossorigin', true);\n\n      // If CSP nonces are used, propagate them to dynamically created scripts.\n      // This is necessary to allow nonce-based CSPs without 'strict-dynamic'.\n      var nonce = goog.getScriptNonce_();\n      if (nonce) {\n        scriptEl.nonce = nonce;\n      }\n\n      if (contents) {\n        scriptEl.text = goog.TRUSTED_TYPES_POLICY_ ?\n            goog.TRUSTED_TYPES_POLICY_.createScript(contents) :\n            contents;\n      } else {\n        scriptEl.src = goog.TRUSTED_TYPES_POLICY_ ?\n            goog.TRUSTED_TYPES_POLICY_.createScriptURL(src) :\n            src;\n      }\n\n      doc.head.appendChild(scriptEl);\n    }\n\n    var create;\n\n    if (goog.isDocumentLoading_()) {\n      create = write;\n      // We can ONLY call document.write if we are guaranteed that any\n      // non-module script tags document.written after this are deferred.\n      // Small optimization, in theory document.writing is faster.\n      goog.Dependency.defer_ = true;\n    } else {\n      create = append;\n    }\n\n    // Write 4 separate tags here:\n    // 1) Sets the module state at the correct time (just before execution).\n    // 2) A src node for this, which just hopefully lets the browser load it a\n    //    little early (no need to parse #3).\n    // 3) Import the module and register it.\n    // 4) Clear the module state at the correct time. Guaranteed to run even\n    //    if there is an error in the module (#3 will not run if there is an\n    //    error in the module).\n    var beforeKey = goog.Dependency.registerCallback_(function() {\n      goog.Dependency.unregisterCallback_(beforeKey);\n      controller.setModuleState(goog.ModuleType.ES6);\n    });\n    create(undefined, 'goog.Dependency.callback_(\"' + beforeKey + '\")');\n\n    // TODO(johnplaisted): Does this really speed up anything?\n    create(this.path, undefined);\n\n    var registerKey = goog.Dependency.registerCallback_(function(exports) {\n      goog.Dependency.unregisterCallback_(registerKey);\n      controller.registerEs6ModuleExports(\n          dep.path, exports, goog.moduleLoaderState_.moduleName);\n    });\n    create(\n        undefined,\n        'import * as m from \"' + this.path + '\"; goog.Dependency.callback_(\"' +\n            registerKey + '\", m)');\n\n    var afterKey = goog.Dependency.registerCallback_(function() {\n      goog.Dependency.unregisterCallback_(afterKey);\n      controller.clearModuleState();\n      controller.loaded();\n    });\n    create(undefined, 'goog.Dependency.callback_(\"' + afterKey + '\")');\n  };\n\n\n  /**\n   * Superclass of any dependency that needs to be loaded into memory,\n   * transformed, and then eval'd (goog.modules and transpiled files).\n   *\n   * @param {string} path Absolute path of this script.\n   * @param {string} relativePath Path of this script relative to goog.basePath.\n   * @param {!Array<string>} provides goog.provided or goog.module symbols\n   *     in this file.\n   * @param {!Array<string>} requires goog symbols or relative paths to Closure\n   *     this depends on.\n   * @param {!Object<string, string>} loadFlags\n   * @struct @constructor @abstract\n   * @extends {goog.Dependency}\n   */\n  goog.TransformedDependency = function(\n      path, relativePath, provides, requires, loadFlags) {\n    goog.TransformedDependency.base(\n        this, 'constructor', path, relativePath, provides, requires, loadFlags);\n    /** @private {?string} */\n    this.contents_ = null;\n\n    /**\n     * Whether to lazily make the synchronous XHR (when goog.require'd) or make\n     * the synchronous XHR when initially loading. On FireFox 61 there is a bug\n     * where an ES6 module cannot make a synchronous XHR (rather, it can, but if\n     * it does then no other ES6 modules will load after).\n     *\n     * tl;dr we lazy load due to bugs on older browsers and eager load due to\n     * bugs on newer ones.\n     *\n     * https://bugzilla.mozilla.org/show_bug.cgi?id=1477090\n     *\n     * @private @const {boolean}\n     */\n    this.lazyFetch_ = !goog.inHtmlDocument_() ||\n        !('noModule' in goog.global.document.createElement('script'));\n  };\n  goog.inherits(goog.TransformedDependency, goog.Dependency);\n\n\n  /**\n   * @override\n   * @param {!goog.LoadController} controller\n   */\n  goog.TransformedDependency.prototype.load = function(controller) {\n    var dep = this;\n\n    function fetch() {\n      dep.contents_ = goog.loadFileSync_(dep.path);\n\n      if (dep.contents_) {\n        dep.contents_ = dep.transform(dep.contents_);\n        if (dep.contents_) {\n          dep.contents_ += '\\n//# sourceURL=' + dep.path;\n        }\n      }\n    }\n\n    if (goog.global.CLOSURE_IMPORT_SCRIPT) {\n      fetch();\n      if (this.contents_ &&\n          goog.global.CLOSURE_IMPORT_SCRIPT('', this.contents_)) {\n        this.contents_ = null;\n        controller.loaded();\n      } else {\n        controller.pause();\n      }\n      return;\n    }\n\n\n    var isEs6 = this.loadFlags['module'] == goog.ModuleType.ES6;\n\n    if (!this.lazyFetch_) {\n      fetch();\n    }\n\n    function load() {\n      if (dep.lazyFetch_) {\n        fetch();\n      }\n\n      if (!dep.contents_) {\n        // loadFileSync_ or transform are responsible. Assume they logged an\n        // error.\n        return;\n      }\n\n      if (isEs6) {\n        controller.setModuleState(goog.ModuleType.ES6);\n      }\n\n      var namespace;\n\n      try {\n        var contents = dep.contents_;\n        dep.contents_ = null;\n        goog.globalEval(goog.CLOSURE_EVAL_PREFILTER_.createScript(contents));\n        if (isEs6) {\n          namespace = goog.moduleLoaderState_.moduleName;\n        }\n      } finally {\n        if (isEs6) {\n          controller.clearModuleState();\n        }\n      }\n\n      if (isEs6) {\n        // Due to circular dependencies this may not be available for require\n        // right now.\n        goog.LEGACY_NAMESPACE_OBJECT_['$jscomp']['require']['ensure'](\n            [dep.getPathName()], function() {\n              controller.registerEs6ModuleExports(\n                  dep.path,\n                  goog.LEGACY_NAMESPACE_OBJECT_['$jscomp']['require'](\n                      dep.getPathName()),\n                  namespace);\n            });\n      }\n\n      controller.loaded();\n    }\n\n    // Do not fetch now; in FireFox 47 the synchronous XHR doesn't block all\n    // events. If we fetched now and then document.write'd the contents the\n    // document.write would be an eval and would execute too soon! Instead write\n    // a script tag to fetch and eval synchronously at the correct time.\n    function fetchInOwnScriptThenLoad() {\n      /** @type {!HTMLDocument} */\n      var doc = goog.global.document;\n\n      var key = goog.Dependency.registerCallback_(function() {\n        goog.Dependency.unregisterCallback_(key);\n        load();\n      });\n\n      var nonce = goog.getScriptNonce_();\n      var nonceAttr = nonce ? ' nonce=\"' + nonce + '\"' : '';\n      var script = '<script' + nonceAttr + '>' +\n          goog.protectScriptTag_('goog.Dependency.callback_(\"' + key + '\");') +\n          '</' +\n          'script>';\n      doc.write(\n          goog.TRUSTED_TYPES_POLICY_ ?\n              goog.TRUSTED_TYPES_POLICY_.createHTML(script) :\n              script);\n    }\n\n    // If one thing is pending it is this.\n    var anythingElsePending = controller.pending().length > 1;\n\n    // Additionally if we are meant to defer scripts but the page is still\n    // loading (e.g. an ES6 module is loading) then also defer. Or if we are\n    // meant to defer and anything else is pending then defer (those may be\n    // scripts that did not need transformation and are just script tags with\n    // defer set to true, and we need to evaluate after that deferred script).\n    var needsAsyncLoading = goog.Dependency.defer_ &&\n        (anythingElsePending || goog.isDocumentLoading_());\n\n    if (needsAsyncLoading) {\n      // Note that we only defer when we have to rather than 100% of the time.\n      // Always defering would work, but then in theory the order of\n      // goog.require calls would then matter. We want to enforce that most of\n      // the time the order of the require calls does not matter.\n      controller.defer(function() {\n        load();\n      });\n      return;\n    }\n    // TODO(johnplaisted): Externs are missing onreadystatechange for\n    // HTMLDocument.\n    /** @type {?} */\n    var doc = goog.global.document;\n\n    if (isEs6 && goog.inHtmlDocument_() && goog.isDocumentLoading_()) {\n      goog.Dependency.defer_ = true;\n      // Transpiled ES6 modules still need to load like regular ES6 modules,\n      // aka only after the document is interactive.\n      controller.pause();\n      var oldCallback = doc.onreadystatechange;\n      doc.onreadystatechange = function() {\n        if (doc.readyState == 'interactive') {\n          doc.onreadystatechange = oldCallback;\n          load();\n          controller.resume();\n        }\n        if (typeof oldCallback === 'function') {\n          oldCallback.apply(undefined, arguments);\n        }\n      };\n    } else {\n      // Always eval on old IE.\n      if (!goog.inHtmlDocument_() || !goog.isDocumentLoading_()) {\n        load();\n      } else {\n        fetchInOwnScriptThenLoad();\n      }\n    }\n  };\n\n\n  /**\n   * @param {string} contents\n   * @return {string}\n   * @abstract\n   */\n  goog.TransformedDependency.prototype.transform = function(contents) {};\n\n\n  /**\n   * An ES6 module dependency that was transpiled to a jscomp module outside\n   * of the debug loader, e.g. server side.\n   *\n   * @param {string} path Absolute path of this script.\n   * @param {string} relativePath Path of this script relative to goog.basePath.\n   * @param {!Array<string>} provides goog.provided or goog.module symbols\n   *     in this file.\n   * @param {!Array<string>} requires goog symbols or relative paths to Closure\n   *     this depends on.\n   * @param {!Object<string, string>} loadFlags\n   * @struct @constructor\n   * @extends {goog.TransformedDependency}\n   */\n  goog.PreTranspiledEs6ModuleDependency = function(\n      path, relativePath, provides, requires, loadFlags) {\n    goog.PreTranspiledEs6ModuleDependency.base(\n        this, 'constructor', path, relativePath, provides, requires, loadFlags);\n  };\n  goog.inherits(\n      goog.PreTranspiledEs6ModuleDependency, goog.TransformedDependency);\n\n\n  /**\n   * @override\n   * @param {string} contents\n   * @return {string}\n   */\n  goog.PreTranspiledEs6ModuleDependency.prototype.transform = function(\n      contents) {\n    return contents;\n  };\n\n\n  /**\n   * A goog.module, transpiled or not. Will always perform some minimal\n   * transformation even when not transpiled to wrap in a goog.loadModule\n   * statement.\n   *\n   * @param {string} path Absolute path of this script.\n   * @param {string} relativePath Path of this script relative to goog.basePath.\n   * @param {!Array<string>} provides goog.provided or goog.module symbols\n   *     in this file.\n   * @param {!Array<string>} requires goog symbols or relative paths to Closure\n   *     this depends on.\n   * @param {!Object<string, string>} loadFlags\n   * @struct @constructor\n   * @extends {goog.TransformedDependency}\n   */\n  goog.GoogModuleDependency = function(\n      path, relativePath, provides, requires, loadFlags) {\n    goog.GoogModuleDependency.base(\n        this, 'constructor', path, relativePath, provides, requires, loadFlags);\n  };\n  goog.inherits(goog.GoogModuleDependency, goog.TransformedDependency);\n\n\n  /**\n   * @override\n   * @param {string} contents\n   * @return {string}\n   */\n  goog.GoogModuleDependency.prototype.transform = function(contents) {\n    if (!goog.LOAD_MODULE_USING_EVAL || goog.global.JSON === undefined) {\n      return '' +\n          'goog.loadModule(function(exports) {' +\n          '\"use strict\";' + contents +\n          '\\n' +  // terminate any trailing single line comment.\n          ';return exports' +\n          '});' +\n          '\\n//# sourceURL=' + this.path + '\\n';\n    } else {\n      return '' +\n          'goog.loadModule(' +\n          goog.global.JSON.stringify(\n              contents + '\\n//# sourceURL=' + this.path + '\\n') +\n          ');';\n    }\n  };\n\n\n  /**\n   * @param {string} relPath\n   * @param {!Array<string>|undefined} provides\n   * @param {!Array<string>} requires\n   * @param {boolean|!Object<string>=} opt_loadFlags\n   * @see goog.addDependency\n   */\n  goog.DebugLoader_.prototype.addDependency = function(\n      relPath, provides, requires, opt_loadFlags) {\n    provides = provides || [];\n    relPath = relPath.replace(/\\\\/g, '/');\n    var path = goog.normalizePath_(goog.basePath + relPath);\n    if (!opt_loadFlags || typeof opt_loadFlags === 'boolean') {\n      opt_loadFlags = opt_loadFlags ? {'module': goog.ModuleType.GOOG} : {};\n    }\n    var dep = this.factory_.createDependency(\n        path, relPath, provides, requires, opt_loadFlags);\n    this.dependencies_[path] = dep;\n    for (var i = 0; i < provides.length; i++) {\n      this.idToPath_[provides[i]] = path;\n    }\n    this.idToPath_[relPath] = path;\n  };\n\n\n  /**\n   * Creates goog.Dependency instances for the debug loader to load.\n   *\n   * Should be overridden to have the debug loader use custom subclasses of\n   * goog.Dependency.\n   *\n   * @struct @constructor\n   */\n  goog.DependencyFactory = function() {};\n\n\n  /**\n   * @param {string} path Absolute path of the file.\n   * @param {string} relativePath Path relative to closure\u2019s base.js.\n   * @param {!Array<string>} provides Array of provided goog.provide/module ids.\n   * @param {!Array<string>} requires Array of required goog.provide/module /\n   *     relative ES6 module paths.\n   * @param {!Object<string, string>} loadFlags\n   * @return {!goog.Dependency}\n   */\n  goog.DependencyFactory.prototype.createDependency = function(\n      path, relativePath, provides, requires, loadFlags) {\n    // MOE:begin_strip\n    var provide, require;\n    for (var i = 0; provide = provides[i]; i++) {\n      goog.dependencies_.nameToPath[provide] = relativePath;\n      goog.dependencies_.loadFlags[relativePath] = loadFlags;\n    }\n    for (var j = 0; require = requires[j]; j++) {\n      if (!(relativePath in goog.dependencies_.requires)) {\n        goog.dependencies_.requires[relativePath] = {};\n      }\n      goog.dependencies_.requires[relativePath][require] = true;\n    }\n    // MOE:end_strip\n\n    if (loadFlags['module'] == goog.ModuleType.GOOG) {\n      return new goog.GoogModuleDependency(\n          path, relativePath, provides, requires, loadFlags);\n    } else {\n      if (loadFlags['module'] == goog.ModuleType.ES6) {\n        if (goog.ASSUME_ES_MODULES_TRANSPILED) {\n          return new goog.PreTranspiledEs6ModuleDependency(\n              path, relativePath, provides, requires, loadFlags);\n        } else {\n          return new goog.Es6ModuleDependency(\n              path, relativePath, provides, requires, loadFlags);\n        }\n      } else {\n        return new goog.Dependency(\n            path, relativePath, provides, requires, loadFlags);\n      }\n    }\n  };\n\n\n  /** @private @const */\n  goog.debugLoader_ = new goog.DebugLoader_();\n\n\n  /**\n   * Loads the Closure deps.js file.\n   *\n   * Exposed a public function so after base is loaded, and\n   * then this can be called to load the closure deps.js file.\n   */\n  goog.loadClosureDeps = function() {\n    goog.debugLoader_.loadClosureDeps();\n  };\n\n\n  /**\n   * Sets the dependency factory, which can be used to create custom\n   * goog.Dependency implementations to control how dependencies are loaded.\n   *\n   * Note:\n   * You can call goog.loadClosureDeps to load the Closure dependency file\n   * later, after your factory is injected.\n   *\n   * @param {!goog.DependencyFactory} factory\n   */\n  goog.setDependencyFactory = function(factory) {\n    goog.debugLoader_.setDependencyFactory(factory);\n  };\n\n\n  /**\n   * Trusted Types policy for the debug loader.\n   * @private @const {?TrustedTypePolicy}\n   */\n  goog.TRUSTED_TYPES_POLICY_ = goog.TRUSTED_TYPES_POLICY_NAME ?\n      goog.createTrustedTypesPolicy(goog.TRUSTED_TYPES_POLICY_NAME + '#base') :\n      null;\n}\n\n\nif (!COMPILED) {\n  /**\n   * Trusted Types for running dev servers.\n   *\n   * @private @const\n   */\n  goog.CLOSURE_EVAL_PREFILTER_ = goog.global.trustedTypes &&\n          goog.createTrustedTypesPolicy('goog#base#devonly#eval') ||\n      {createScript: goog.identity_};\n}\n\n/**\n * go/goog-code-location-design\n * @enum {string}\n */\ngoog.CodeLocation = {\n  // Enums cannot be empty,\n  DO_NOT_USE: '',\n  // and need multiple distinct values so TS doesn't think `goog.CodeLocation`\n  // returns a unique singleton value.\n  DO_NOT_USE_ME_EITHER: '.',\n};\n\n/**\n * Returns the stack location of this function's caller's caller.\n * e.g:\n *   1| function foo() {\n *   2|    console.log(goog.callerLocation());\n *   3| }\n *   4| function bar() {\n *   5|    foo(); // this is the code location that goog.callerLocation returns\n *   6| }\n *   7| bar();\n *\n *  -> prints \"at bar (...filepath.ts:5:4)\" (i.e. foo() call on line 5)\n *\n * @return {!goog.CodeLocation}\n */\ngoog.callerLocation = function() {\n  if (!COMPILED) {\n    var err = new Error();\n    var stack = err.stack;\n    /**\n     * We\u2019re using index 3 for the stack split because:\n     * - index [1] returns `const err = new Error();` in base.js (above line)\n     * - index [2] returns function annotated with a goog.CodeLocation default\n     * parameter, which does the call to goog.callerLocation\n     * - index [3] returns\n     * the users call to the function which calls goog.callerLocation\n     */\n    if (stack) stack = stack.split(/\\n/g)[3];\n    if (stack) stack = stack.trim();\n    return /** @type {!goog.CodeLocation} */ (stack || '');\n  }\n  return /** @type {!goog.CodeLocation} */ ('');\n};\n\n\n/**\n * Returns a stable relatively short obfuscated string for a given input\n * string literal.\n *\n * It is guaranteed that:\n * 1. goog.callerLocationIdInternalDoNotCallOrElse(\"foo\") !=\n * goog.callerLocationIdInternalDoNotCallOrElse(\"bar\")\n * 2. goog.callerLocationIdInternalDoNotCallOrElse(\"foo\") ==\n * goog.callerLocationIdInternalDoNotCallOrElse(\"foo\")\n *\n * In unobfuscated mode, the string is just returned with '_' appended to mark\n * the processing. Unobfuscated mode is the \"u\"  and \"du\" modes in MSS, or\n * running a web dev server.\n * @param {string} id The identifier to obfuscate.\n * @return {!goog.CodeLocation}\n *\n * @idGenerator {consistent}\n */\ngoog.callerLocationIdInternalDoNotCallOrElse = function(id) {\n  return /** @type {!goog.CodeLocation} */ (id);\n};\n","/**\n * @fileoverview\n * Hand-modified Closure version of tslib.js.\n * These use the literal space optimized code from TypeScript for\n * compatibility.\n *\n * @suppress {undefinedVars}\n */\n\n// Do not use @license\n\n/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n\ngoog.module('google3.third_party.javascript.tslib.tslib');\n\n/** @suppress {missingPolyfill} the code below intentionally feature-tests. */\nvar extendStatics = Object.setPrototypeOf ||\n    // LOCAL MODIFICATION: b/241217304. Remove usages of __proto__.\n    function(d, b) {\n      for (var p in b)\n        if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n    };\n\n/**\n * @param {?} d\n * @param {?} b\n */\nexports.__extends = function(d, b) {\n  // LOCAL MODIFICATION: In Cobalt 11 `typeof Event` is 'object' not 'function'.\n  // In addition, YouTube Mobile JavaScript bans usage of `Event` via a\n  // conformance test so we check it via goog.global. We first verify that the\n  // parent class, b, is not undefined (i.e. when `Event` is not present).\n  if (typeof b !== 'function' && b !== null && (b === undefined || b !== goog.global['Event']))\n    throw new TypeError(\n        'Class extends value ' + String(b) + ' is not a constructor or null');\n  extendStatics(d, b);\n  /** @constructor */\n  function __() {\n    /** @type {?} */ (this).constructor = d;\n  }\n  d.prototype =\n      b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n\n/** @type {typeof Object.assign} */\nexports.__assign = Object.assign || /** @return {?} */ function(/** ? */ t) {\n  for (var s, i = 1, n = arguments.length; i < n; i++) {\n    s = arguments[i];\n    for (var p in s)\n      if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n  }\n  return t;\n};\n\n/**\n * @param {?} s\n * @param {?} e\n * @return {?}\n */\nexports.__rest = function(s, e) {\n  var t = {};\n  for (var p in s)\n    if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n      t[p] = s[p];\n  if (s != null && typeof Object.getOwnPropertySymbols === 'function')\n    for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n      if (e.indexOf(p[i]) < 0 &&\n          Object.prototype.propertyIsEnumerable.call(s, p[i]))\n        t[p[i]] = s[p[i]];\n    }\n  return t;\n};\n\n/**\n * @param {?} decorators\n * @param {T} target\n * @param {?=} key\n * @param {?=} desc\n * @return {T}\n * @template T\n */\nexports.__decorate = function(decorators, target, key, desc) {\n  var c = arguments.length,\n      r = c < 3     ? target :\n      desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) :\n                      desc,\n      d;\n  // LOCAL MODIFICATION: use quoted property access to work around b/77140019.\n  if (Reflect && typeof Reflect === 'object' &&\n      typeof Reflect['decorate'] === 'function')\n    r = Reflect['decorate'](decorators, target, key, desc);\n  else\n    for (var i = decorators.length - 1; i >= 0; i--)\n      if (d = decorators[i])\n        r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n  return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n\n/**\n * @param {?} paramIndex\n * @param {?} decorator\n * @return {?}\n */\nexports.__param = function(paramIndex, decorator) {\n  return function(target, key) {\n    decorator(target, key, paramIndex);\n  };\n};\n\n// LOCAL MODIFICATION: Exclude the following functions:\n// __esDecorate\n// __runInitializers\n// __propKey\n\nexports.__setFunctionName = function(f, name, prefix) {\n  if (typeof name === 'symbol')\n    name = name.description ? '['.concat(name.description, ']') : '';\n  return Object.defineProperty(f, 'name', {\n    configurable: true,\n    value: prefix ? ''.concat(prefix, ' ', name) : name\n  });\n};\n\n/**\n * @param {?} metadataKey\n * @param {?} metadataValue\n * @return {?}\n */\nexports.__metadata = function(metadataKey, metadataValue) {\n  // LOCAL MODIFICATION: use quoted property access to work around b/77140019.\n  if (Reflect && typeof Reflect === 'object' &&\n      typeof Reflect['metadata'] === 'function')\n    return Reflect['metadata'](metadataKey, metadataValue);\n};\n\n/**\n * @template T\n * @param {T} thisArg\n * @param {?} _arguments\n * @param {?} P\n * @param {function(this:T)} generator\n * @return {?}\n */\nexports.__awaiter = function(thisArg, _arguments, P, generator) {\n  function adopt(value) {\n    return value instanceof P ? value : new P(function(resolve) {\n      resolve(value);\n    });\n  }\n  return new (P || (P = Promise))(function(resolve, reject) {\n    function fulfilled(value) {\n      try {\n        // LOCAL MODIFICATION: Cannot express the function + keys pattern in the\n        // Closure Compiler, so we escape generator.next with the `?` type.\n        step(/** @type {?} */ (generator).next(value));\n      } catch (e) {\n        reject(e);\n      }\n    }\n    function rejected(value) {\n      try {\n        step(generator['throw'](value));\n      } catch (e) {\n        reject(e);\n      }\n    }\n    function step(result) {\n      result.done ? resolve(result.value) :\n                    adopt(result.value).then(fulfilled, rejected);\n    }\n    step((generator = generator.apply(thisArg, _arguments || [])).next());\n  });\n};\n\n/**\n * @param {?} thisArg\n * @param {?} body\n * @return {?}\n */\nexports.__generator = function(thisArg, body) {\n  var _ = {\n    label: 0,\n    sent: function() {\n      if (t[0] & 1) throw /** @type {!Error} */ (t[1]);\n      return t[1];\n    },\n    trys: [],\n    ops: []\n  },\n      f, y, t,\n      g = Object.create(\n          (typeof Iterator === 'function' ? Iterator : Object).prototype);\n  // LOCAL MODIFICATION: access property quoted to compile and prevent renaming.\n  return g['next'] = verb(0), g['throw'] = verb(1), g['return'] = verb(2),\n         typeof Symbol === 'function' && (g[Symbol.iterator] = function() {\n           return /** @type {?} */ (this);\n         }), g;\n  function verb(n) {\n    return function(v) {\n      return step([n, v]);\n    };\n  }\n  /**\n   * @suppress {strictMissingProperties} TODO(b/214874268): Remove\n   * strictMissingProperties suppression after b/214427036 is fixed\n   */\n  function step(op) {\n    if (f) throw new TypeError('Generator is already executing.');\n    while (g && (g = 0, op[0] && (_ = 0)), _) try {\n        if (f = 1,\n            y &&\n                (t = op[0] & 2 ? y['return'] :\n                     op[0] ? y['throw'] || ((t = y['return']) && t.call(y), 0) :\n                             y.next) &&\n                !(t = t.call(y, op[1])).done)\n          return t;\n        if (y = 0, t) op = [op[0] & 2, t.value];\n        switch (op[0]) {\n          case 0:\n          case 1:\n            t = op;\n            break;\n          case 4:\n            _.label++;\n            return {value: op[1], done: false};\n          case 5:\n            _.label++;\n            y = op[1];\n            op = [0];\n            continue;\n          case 7:\n            op = _.ops.pop();\n            _.trys.pop();\n            continue;\n          default:\n            if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) &&\n                (op[0] === 6 || op[0] === 2)) {\n              _ = 0;\n              continue;\n            }\n            if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {\n              _.label = op[1];\n              break;\n            }\n            if (op[0] === 6 && _.label < t[1]) {\n              _.label = t[1];\n              t = op;\n              break;\n            }\n            if (t && _.label < t[2]) {\n              _.label = t[2];\n              _.ops.push(op);\n              break;\n            }\n            if (t[2]) _.ops.pop();\n            _.trys.pop();\n            continue;\n        }\n        op = body.call(thisArg, _);\n      } catch (e) {\n        op = [6, e];\n        y = 0;\n      } finally {\n        f = t = 0;\n      }\n    if (op[0] & 5) throw /** @type {!Error} */ (op[1]);\n    return {value: op[0] ? op[1] : void 0, done: true};\n  }\n};\n\n/**\n * @param {?} m\n * @param {?} o\n */\nexports.__exportStar = function(m, o) {\n  for (var p in m)\n    if (p !== 'default' && !Object.prototype.hasOwnProperty.call(o, p))\n      // LOCAL MODIFICATION: Using __createBinding makes o[p] non-settable which\n      // breaks code like the following (valid for ESM modules):\n      // # file1.ts\n      //   export const foo = 'foo';\n      //   export const bar = 'bar';\n      // # file2.ts\n      //   export * as m from './file1';\n      //   export const foo = 'a new foo value';\n      o[p] = m[p];\n};\n\n// LOCAL MODIFICATION: Exclude the following function:\n// __createBinding\n\n/**\n * @param {?} o\n * @return {?}\n */\nexports.__values = function(o) {\n  var s = typeof Symbol === 'function' && Symbol.iterator, m = s && o[/** @type {symbol} */ (s)], i = 0;\n  if (m) return m.call(o);\n  if (o && typeof o.length === 'number')\n    return {\n      next: function() {\n        if (o && i >= o.length) o = void 0;\n        return {value: o && o[i++], done: !o};\n      }\n    };\n  throw new TypeError(\n      s ? 'Object is not iterable.' : 'Symbol.iterator is not defined.');\n};\n\n/**\n * @param {?} o\n * @param {?=} n\n * @return {?}\n */\nexports.__read = function(o, n) {\n  var m = typeof Symbol === 'function' && o[Symbol.iterator];\n  if (!m) return o;\n  var i = m.call(o), r, ar = [], e;\n  try {\n    while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n  } catch (error) {\n    e = {error: error};\n  } finally {\n    try {\n      if (r && !r.done && (m = i['return'])) m.call(i);\n    } finally {\n      if (e) throw /** @type {!Error} */ (e.error);\n    }\n  }\n  return ar;\n};\n\n/** @deprecated */\nexports.__spread = function() {\n  for (var ar = [], i = 0; i < arguments.length; i++)\n    ar = ar.concat(exports.__read(arguments[i]));\n  return ar;\n};\n\n/** @deprecated */\nexports.__spreadArrays = function() {\n  for (var s = 0, i = 0, il = arguments.length; i < il; i++)\n    s += arguments[i].length;\n  for (var r = Array(s), k = 0, i = 0; i < il; i++)\n    for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n      r[k] = a[j];\n  return r;\n};\n\n/**\n * @param {!Array<?>} to\n * @param {!Array<?>} from\n * @param {!Array<?>} pack\n * @return {!Array<?>}\n */\nexports.__spreadArray = function(to, from, pack) {\n  if (pack || arguments.length === 2)\n    for (var i = 0, l = from.length, ar; i < l; i++) {\n      if (ar || !(i in from)) {\n        if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n        ar[i] = from[i];\n      }\n    }\n  return to.concat(ar || Array.prototype.slice.call(from));\n};\n\n/**\n * @constructor\n * @this {?}\n * @param {?} v\n * @return {?}\n */\nexports.__await = function(v) {\n  return this instanceof exports.__await ? (this.v = v, this) :\n                                           new exports.__await(v);\n};\n\n/**\n * @template T\n * @param {T} thisArg\n * @param {?} _arguments\n * @param {function(this:T)} generator\n * @return {?}\n */\nexports.__asyncGenerator = function(thisArg, _arguments, generator) {\n  if (!Symbol.asyncIterator)\n    throw new TypeError('Symbol.asyncIterator is not defined.');\n  var g = generator.apply(thisArg, _arguments || []), i, q = [];\n  return i = Object.create(\n             (typeof AsyncIterator === 'function' ? AsyncIterator : Object)\n                 .prototype),\n         verb('next'), verb('throw'), verb('return', awaitReturn),\n         i[Symbol.asyncIterator] = function() {\n           return /** @type {?} */ (this);\n         }, i;\n  function awaitReturn(f) {\n    return function(v) {\n      return Promise.resolve(v).then(f, reject);\n    };\n  }\n  /**\n   * @param {?} n\n   * @param {?=} f\n   * @return {?}\n   */\n  function verb(n, f) {\n    if (g[n]) {\n      i[n] = function(v) {\n        return new Promise(function(a, b) {\n          q.push([n, v, a, b]) > 1 || resume(n, v);\n        });\n      };\n      if (f) i[n] = f(i[n]);\n    }\n  }\n  function resume(n, v) {\n    try {\n      step(g[n](v));\n    } catch (e) {\n      settle(q[0][3], e);\n    }\n  }\n  function step(r) {\n    r.value instanceof exports.__await ?\n        Promise.resolve(/** @type {?} */ (r.value).v).then(fulfill, reject) :\n        settle(q[0][2], r);\n  }\n  function fulfill(value) {\n    resume('next', value);\n  }\n  function reject(value) {\n    resume('throw', value);\n  }\n  function settle(f, v) {\n    if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);\n  }\n};\n\n/**\n * @param {?} o\n * @return {?}\n */\nexports.__asyncDelegator = function(o) {\n  var i, p;\n  return i = {}, verb('next'), verb('throw', function(e) {\n           throw e;\n         }), verb('return'), i[Symbol.iterator] = function() {\n    return /** @type {?} */ (this);\n  }, i;\n  /**\n   * @param {?} n\n   * @param {?=} f\n   * @return {?}\n   */\n  function verb(n, f) {\n    i[n] = o[n] ? function(v) {\n      // LOCAL MODIFICATION: If __await is called without new, it calls itself\n      // again with new. We mark __await as a constructor above so need to\n      // directly call new to appease the compiler. Same behavior though.\n      return (p = !p) ? {value: new exports.__await(o[n](v)), done: false} : f ? f(v) : v;\n    } : f;\n  }\n};\n\n/**\n * @param {?} o\n * @return {?}\n */\nexports.__asyncValues = function(o) {\n  if (!Symbol.asyncIterator)\n    throw new TypeError('Symbol.asyncIterator is not defined.');\n  var m = o[Symbol.asyncIterator], i;\n  return m ?\n      m.call(o) :\n      (o = typeof __values === 'function' ? __values(o) : o[Symbol.iterator](),\n       i = {}, verb('next'), verb('throw'), verb('return'),\n       i[Symbol.asyncIterator] = function() {\n         return /** @type {?} */ (this);\n       }, i);\n  function verb(n) {\n    i[n] = o[n] && function(v) {\n      return new Promise(function(resolve, reject) {\n        v = o[n](v), settle(resolve, reject, v.done, v.value);\n      });\n    };\n  }\n  function settle(resolve, reject, d, v) {\n    Promise.resolve(v).then(function(v) {\n      resolve({value: v, done: d});\n    }, reject);\n  }\n};\n\n/**\n * @param {?=} cooked\n * @param {?=} raw\n * @return {?}\n */\nexports.__makeTemplateObject = function(cooked, raw) {\n  if (Object.defineProperty) {\n    Object.defineProperty(cooked, 'raw', {value: raw});\n  } else {\n    cooked.raw = raw;\n  }\n  return cooked;\n};\n\n// LOCAL MODIFICATION: Exclude the following functions:\n// __importStar\n// __importDefault\n\n/**\n * @param {?} receiver\n * @param {?} state\n * @param {?} kind\n * @param {?} f\n * @return {?}\n */\nexports.__classPrivateFieldGet = function(receiver, state, kind, f) {\n  if (kind === 'a' && !f)\n    throw new TypeError('Private accessor was defined without a getter');\n  if (typeof state === 'function' ? receiver !== state || !f :\n                                    !state.has(receiver))\n    throw new TypeError(\n        'Cannot read private member from an object whose class did not declare it');\n  return kind === 'm' ? f :\n      kind === 'a'    ? f.call(receiver) :\n      f               ? f.value :\n                        state.get(receiver);\n};\n\n/**\n * @param {?} receiver\n * @param {?} state\n * @param {?} value\n * @param {?} kind\n * @param {?} f\n * @return {?}\n */\nexports.__classPrivateFieldSet = function(receiver, state, value, kind, f) {\n  if (kind === 'm') throw new TypeError('Private method is not writable');\n  if (kind === 'a' && !f)\n    throw new TypeError('Private accessor was defined without a setter');\n  if (typeof state === 'function' ? receiver !== state || !f :\n                                    !state.has(receiver))\n    throw new TypeError(\n        'Cannot write private member to an object whose class did not declare it');\n  return (kind === 'a' ? f.call(receiver, value) :\n              f        ? f.value = value :\n                         state.set(receiver, value)),\n         value;\n};\n\n/**\n * @param {?} state\n * @param {?} receiver\n * @return {?}\n */\nexports.__classPrivateFieldIn = function(state, receiver) {\n  if (receiver === null ||\n      (typeof receiver !== 'object' && typeof receiver !== 'function'))\n    throw new TypeError('Cannot use \\'in\\' operator on non-object');\n  return typeof state === 'function' ? receiver === state : state.has(receiver);\n};\n\n/**\n * @param {?} env\n * @param {?} value\n * @param {?} async\n * @return {?}\n */\nexports.__addDisposableResource = function(env, value, async) {\n  if (value !== null && value !== void 0) {\n    if (typeof value !== 'object' && typeof value !== 'function')\n      throw new TypeError('Object expected.');\n    var dispose, inner;\n    // LOCAL MODIFICATION: Cast to `valueObject` to explain to the Closure\n    // Compiler that `value` can't be `null` nor `undefined` here.\n    var valueObject = /** @type {!Object} */ (value);\n    if (async) {\n      if (!Symbol.asyncDispose)\n        throw new TypeError('Symbol.asyncDispose is not defined.');\n      dispose = valueObject[Symbol.asyncDispose];\n    }\n    if (dispose === void 0) {\n      if (!Symbol.dispose)\n        throw new TypeError('Symbol.dispose is not defined.');\n      dispose = valueObject[Symbol.dispose];\n      if (async) inner = dispose;\n    }\n    if (typeof dispose !== 'function')\n      throw new TypeError('Object not disposable.');\n    if (inner)\n      dispose = function() {\n        try {\n          inner.call(/** @type {?} */ (this));\n        } catch (e) {\n          return Promise.reject(e);\n        }\n      };\n    env.stack.push({value: value, dispose: dispose, async: async});\n  } else if (async) {\n    env.stack.push({async: true});\n  }\n  return value;\n};\n\n// LOCAL MODIFICATION: Not polyfilling SuppressedError here. It's polyfilled at\n// google3/third_party/java_src/jscomp/java/com/google/javascript/jscomp/js/es6/dispose.js\n\n/**\n * @param {?} env\n * @return {?}\n */\nexports.__disposeResources = function(env) {\n  function fail(e) {\n    env.error = env.hasError ?\n        // LOCAL MODIFICATION: Use SuppressedError instead of _SuppressedError.\n        new SuppressedError(\n            e, env.error, 'An error was suppressed during disposal.') :\n        e;\n    env.hasError = true;\n  }\n  var r, s = 0;\n  function next() {\n    while (r = env.stack.pop()) {\n      try {\n        if (!r.async && s === 1)\n          return s = 0, env.stack.push(r), Promise.resolve().then(next);\n        if (r.dispose) {\n          var result = r.dispose.call(r.value);\n          if (r.async)\n            return s |= 2, Promise.resolve(result).then(next, function(e) {\n              fail(e);\n              return next();\n            });\n        } else\n          s |= 1;\n      } catch (e) {\n        fail(e);\n      }\n    }\n    if (s === 1)\n      return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n    if (env.hasError) throw env.error;\n  }\n  return next();\n};\n\n// LOCAL MODIFICATION: Not including __rewriteRelativeImportExtension\n","import {Reference as GerritReference} from 'google3/third_party/javascript/polygerrit/api/ai-code-review';\n\n/** Corresponds to SymbolLookup in devtools/codereview/services/assistance/proto/chat.proto */\nexport declare interface SymbolLookupRef {\n  symbolName: string;\n  externalUrl: string;\n}\n\n/** Corresponds to Critique in devtools/codereview/services/assistance/proto/chat.proto */\nexport declare interface CritiqueRef {\n  clNumber?: number;\n  clUrl?: string;\n  error?: string;\n}\n\n/** Corresponds to Gerrit in devtools/codereview/services/assistance/proto/chat.proto */\nexport declare interface GerritRef {\n  gerritUrl: string;\n  error?: string;\n}\n\n/** Corresponds to Buganizer in devtools/codereview/services/assistance/proto/chat.proto */\nexport declare interface BuganizerRef {\n  issueId: number;\n  error?: string;\n}\n\n/** Corresponds to Codesearch in devtools/codereview/services/assistance/proto/chat.proto */\nexport declare interface CodesearchRef {\n  url: string;\n  error?: string;\n}\n\n/** Corresponds to G3Doc in devtools/codereview/services/assistance/proto/chat.proto */\nexport declare interface G3DocRef {\n  url: string;\n  error?: string;\n}\n\n/** Corresponds to Document in devtools/codereview/services/assistance/proto/chat.proto */\nexport declare interface DocumentRef {\n  url: string;\n  error?: string;\n}\n\n/** Corresponds to Yaqs in devtools/codereview/services/assistance/proto/chat.proto */\nexport declare interface YaqsRef {\n  url: string;\n}\n\n/** Corresponds to FileDiffStatus in devtools/codereview/services/assistance/proto/chat.proto */\nexport declare interface FileDiffStatusRef {\n  path: string;\n  error?: string;\n}\n\n/** Corresponds to CurrentCl in devtools/codereview/services/assistance/proto/chat.proto */\nexport declare interface CurrentClRef {\n  errorClDescription?: string;\n  fileDiffStatus?: FileDiffStatusRef[];\n}\n\n/** Corresponds to CurrentGerritChange in devtools/codereview/services/assistance/proto/chat.proto */\nexport declare interface CurrentGerritChangeRef {\n  errorCommitMessage?: string;\n  fileDiffStatus?: FileDiffStatusRef[];\n}\n\n/** Corresponds to CommentData in devtools/codereview/services/assistance/proto/chat.proto */\nexport declare interface CommentDataRef {\n  error?: string;\n}\n\n/** Corresponds to Reference in devtools/codereview/services/assistance/proto/chat.proto */\nexport declare interface Reference {\n  symbolLookup?: SymbolLookupRef;\n  critique?: CritiqueRef;\n  buganizer?: BuganizerRef;\n  codesearch?: CodesearchRef;\n  g3doc?: G3DocRef;\n  document?: DocumentRef;\n  currentCl?: CurrentClRef;\n  currentGerritChange?: CurrentGerritChangeRef;\n  commentData?: CommentDataRef;\n  yaqs?: YaqsRef;\n  gerrit?: GerritRef;\n}\n\n/**\n * Converts a Reference to a Gerrit Reference.\n * This code is copied from\n * google3/devtools/codereview/webclient/model/current_cl/chat/chat_util.ts\n */\nexport function referenceToGerritReference(\n  reference: Reference,\n): GerritReference | undefined {\n  if (reference.symbolLookup) {\n    return {\n      type: 'symbol_lookup',\n      displayText: reference.symbolLookup.symbolName,\n      secondaryText: 'Code Search',\n      externalUrl: reference.symbolLookup.externalUrl,\n    };\n  }\n  if (reference.buganizer) {\n    const id = String(reference.buganizer.issueId);\n    return {\n      type: 'buganizer',\n      displayText: `b/${id}`,\n      externalUrl: `https://b.corp.google.com/issues/${id}`,\n      errorMsg: reference.buganizer.error,\n    };\n  }\n  if (reference.critique) {\n    if (reference.critique.clNumber) {\n      const id = String(reference.critique.clNumber);\n      return {\n        type: 'critique_cl',\n        displayText: `cl/${id}`,\n        externalUrl: `https://critique.corp.google.com/cl/${id}`,\n        errorMsg: reference.critique.error,\n      };\n    }\n    if (reference.critique.clUrl) {\n      return {\n        type: 'critique_cl',\n        displayText: reference.critique.clUrl,\n        externalUrl: reference.critique.clUrl,\n        errorMsg: reference.critique.error,\n      };\n    }\n  }\n  if (reference.codesearch) {\n    return {\n      type: 'codesearch',\n      displayText: reference.codesearch.url,\n      externalUrl: reference.codesearch.url,\n      errorMsg: reference.codesearch.error,\n    };\n  }\n  if (reference.g3doc) {\n    const url = reference.g3doc.url;\n    let displayText = url;\n    try {\n      const parsedUrl = new URL(url);\n      const pathParts = parsedUrl.pathname.split('/');\n      displayText = pathParts[pathParts.length - 1];\n      if (parsedUrl.hash) {\n        displayText += parsedUrl.hash;\n      }\n    } catch (e) {\n      // TypeError is thrown by `new URL()` if the URL is invalid.\n      // We can ignore it and fall back to displaying the full URL.\n      if (!(e instanceof TypeError)) {\n        throw e;\n      }\n    }\n    return {\n      type: 'g3doc',\n      displayText,\n      externalUrl: url,\n      tooltip: url,\n      errorMsg: reference.g3doc.error,\n    };\n  }\n  if (reference.document) {\n    return {\n      type: 'gdoc',\n      displayText: reference.document.url,\n      externalUrl: reference.document.url,\n      errorMsg: reference.document.error,\n    };\n  }\n  if (reference.yaqs) {\n    return {\n      type: 'yaqs',\n      displayText: reference.yaqs.url,\n      externalUrl: reference.yaqs.url,\n    };\n  }\n  if (reference.gerrit) {\n    return {\n      type: 'gerrit',\n      displayText: reference.gerrit.gerritUrl,\n      externalUrl: reference.gerrit.gerritUrl,\n      errorMsg: reference.gerrit.error,\n    };\n  }\n  return undefined;\n}\n","import 'google3/third_party/javascript/polygerrit/api/gerrit';\n\nimport {\n  Reference,\n  referenceToGerritReference,\n} from 'google3/java/com/google/devtools/gerritcodereview/plugins/comments2code/web/ai-code-review-references';\nimport {\n  Actions,\n  AiCodeReviewProvider,\n  ChatRequest,\n  ChatResponse,\n  ChatResponseListener,\n  ContextItem,\n  ContextItemType,\n  Conversation,\n  ConversationTurn,\n  Reference as GerritReference,\n  Models,\n} from 'google3/third_party/javascript/polygerrit/api/ai-code-review';\nimport {PluginApi} from 'google3/third_party/javascript/polygerrit/api/plugin';\nimport {\n  ChangeInfo,\n  FileInfoStatus,\n} from 'google3/third_party/javascript/polygerrit/api/rest-api';\n\ndeclare interface GeminiChatResponse extends Omit<ChatResponse, 'references'> {\n  references?: Reference[];\n}\n\n/**\n * The response from the backend plugin to the listChatConversations request.\n */\nexport declare interface ListConversationsResponse {\n  conversations: Conversation[];\n}\n\n/**\n * The response from the backend plugin to the getChatConversation request.\n */\nexport declare interface GetConversationResponse {\n  turns: ConversationTurn[];\n}\n\n/**\n * The payload for the chat request.\n */\nexport declare interface RequestPayload {\n  action: number;\n  user_question: string;\n  conversation_id: string;\n  turn_index: number;\n  regeneration_index: number;\n  client_data: string;\n  model_name?: string;\n  files: RequestFile[];\n}\n\n/**\n * The file information for the chat request.\n */\nexport declare interface RequestFile {\n  path: string;\n  operation: number;\n  base_file: {base_commit: string};\n}\n\nclass Buganizer implements ContextItemType {\n  id = 'buganizer';\n  name = 'Buganizer';\n  icon = 'bug_report';\n  placeholder = 'b/...';\n  regex =\n    /(?:^|\\s)(?:https:\\/\\/(?:b|buganizer)\\.corp\\.google\\.com\\/issues\\/|b\\/)([1-9]\\d*)(?:\\/.*)?/;\n\n  parse(link: string) {\n    const buganizerMatch = link.match(this.regex);\n    if (!buganizerMatch) return undefined;\n    const identifier = buganizerMatch[1] ?? undefined;\n    return {\n      type_id: this.id,\n      identifier,\n      link,\n      title: identifier ? `b/${identifier}` : '',\n    };\n  }\n}\n\nclass Codesearch implements ContextItemType {\n  id = 'codesearch';\n  name = 'Code Search';\n  icon = 'search';\n  placeholder = 'cs/...';\n  regex =\n    /(?:^|\\s)(?:https:\\/\\/source\\.corp\\.google\\.com\\/piper\\/\\/\\/depot\\/|cs\\/)([\\w\\/\\.\\-]+)(?:\\?.*)?/;\n\n  parse(link: string): ContextItem | undefined {\n    const csMatch = link.match(this.regex);\n    if (!csMatch) return undefined;\n    const identifier = csMatch[1] ?? undefined;\n    return {\n      type_id: this.id,\n      identifier,\n      link,\n      title: identifier ? `${identifier}` : '',\n    };\n  }\n}\n\nclass Critique implements ContextItemType {\n  id = 'critique_cl';\n  name = 'Critique CL';\n  icon = 'check_circle';\n  placeholder = 'cl/...';\n  regex =\n    /(?:^|\\s)(?:https:\\/\\/critique(?:-staging)?\\.corp\\.google\\.com\\/)?cl\\/([1-9]\\d*)(?:\\/.*)?/;\n\n  parse(link: string): ContextItem | undefined {\n    const clMatch = link.match(this.regex);\n    if (!clMatch) return undefined;\n    const identifier = clMatch[1] ?? undefined;\n    return {\n      type_id: this.id,\n      identifier,\n      link,\n      title: identifier ? `cl/${identifier}` : '',\n    };\n  }\n}\n\nclass G3Doc implements ContextItemType {\n  id = 'g3doc';\n  name = 'g3doc';\n  icon = 'history_edu';\n  placeholder = 'g3doc/...';\n  regex =\n    /(?:^|\\s)(?:https:\\/\\/(?:g3doc|engdoc)\\.corp\\.google\\.com\\/|(?:g3doc|engdoc)\\/)([\\w\\/\\.\\-]+\\.md)(\\?[\\w\\/\\.\\-\\=]+)?(\\#.*)?/;\n\n  parse(link: string): ContextItem | undefined {\n    const g3docMatch = link.match(this.regex);\n    if (!g3docMatch) return undefined;\n    const filePath = g3docMatch[1];\n    if (!filePath) return undefined;\n    const parameters = g3docMatch[2] || '';\n    const anchor = g3docMatch[3] || '';\n    const identifier = `${filePath}${parameters}${anchor}`;\n    const fileParts = filePath.split('/');\n    const fileName = fileParts[fileParts.length - 1];\n    return {\n      type_id: this.id,\n      identifier,\n      link,\n      title: fileName + anchor,\n      tooltip: link,\n    };\n  }\n}\n\nclass GDoc implements ContextItemType {\n  id = 'gdoc';\n  name = 'Google Doc';\n  icon = 'docs';\n  placeholder = 'doc/...';\n  regex =\n    /(?:^|\\s)(?:https:\\/\\/docs\\.google\\.com\\/document\\/d\\/|doc\\/)([\\w\\.\\-]+)(\\/edit)?(?:\\?.*)?/;\n\n  parse(link: string): ContextItem | undefined {\n    const gdocMatch = link.match(this.regex);\n    if (!gdocMatch) return undefined;\n    const identifier = gdocMatch[1] ?? undefined;\n    return {\n      type_id: this.id,\n      identifier,\n      link,\n      title: identifier ? `${identifier}` : '',\n    };\n  }\n}\n\n/**\n * Provides AI code review features.\n */\nexport class AiCodeReview implements AiCodeReviewProvider {\n  constructor(private readonly plugin: PluginApi) {}\n\n  chat(req: ChatRequest, listener: ChatResponseListener) {\n    const change = req.change;\n    if (!change.current_revision) {\n      listener.emitError('Change does not have current_revision.');\n      listener.done();\n      return;\n    }\n    const url =\n      `/changes/${change._number}/revisions/${change.current_revision}/` +\n      `chat?trace=issue/437944720`;\n    const payload: RequestPayload = {\n      action: 1,\n      user_question: req.prompt,\n      conversation_id: req.conversation_id,\n      turn_index: req.turn_index,\n      regeneration_index: req.regeneration_index,\n      client_data: req.client_data,\n      model_name: req.model_name,\n      files: getFiles(change, req.files),\n    };\n    this.plugin\n      .restApi()\n      .post<GeminiChatResponse>(url, payload)\n      .then((res) => {\n        const {references, ...rest} = res;\n        const response: ChatResponse = {\n          ...rest,\n          references:\n            references\n              ?.map(referenceToGerritReference)\n              .filter((x): x is GerritReference => x !== undefined) ?? [],\n        };\n        listener.emitResponse(response);\n        listener.done();\n      })\n      .catch((e: unknown) => {\n        listener.emitError(`Unknown error: ${e}`);\n        listener.done();\n      });\n  }\n\n  listChatConversations(change: ChangeInfo): Promise<Conversation[]> {\n    const url = `/changes/${change._number}/conversations?trace=issue/437944720`;\n    return this.plugin\n      .restApi()\n      .get<ListConversationsResponse>(url)\n      .then((res) => {\n        return res.conversations;\n      });\n  }\n\n  getChatConversation(\n    change: ChangeInfo,\n    conversation_id: string,\n  ): Promise<ConversationTurn[]> {\n    const url = `/changes/${change._number}/conversations/${conversation_id}?trace=issue/437944720`;\n    return this.plugin\n      .restApi()\n      .get<GetConversationResponse>(url)\n      .then((res) => {\n        return res.turns;\n      });\n  }\n\n  getModels(change: ChangeInfo): Promise<Models> {\n    const url = `/changes/${change._number}/chat_get_parameters?trace=issue/437944720`;\n    return this.plugin\n      .restApi()\n      .post<Models>(url)\n      .then((res) => {\n        return {\n          ...res,\n          documentation_url: 'http://go/gob/users/ai-features',\n          citation_url: 'https://support.google.com/legal/answer/13505487',\n          privacy_url: 'https://goto.google.com/code-ai-policy',\n        };\n      });\n  }\n\n  getActions(change: ChangeInfo): Promise<Actions> {\n    return Promise.resolve({\n      actions: [\n        {\n          id: 'freeform',\n          display_text: 'Free form chat',\n        },\n        {\n          id: 'check_change',\n          display_text: 'Check this change',\n          initial_user_prompt:\n            'Check this CL for mistakes and unintended changes',\n          icon: 'star_shine',\n          enable_splash_page_card: true,\n          enable_send_without_input: true,\n        },\n        {\n          id: 'summarize',\n          display_text: 'Summarize',\n          initial_user_prompt: 'Summarize the change',\n          icon: 'summarize',\n          enable_splash_page_card: true,\n          enable_send_without_input: true,\n        },\n      ],\n      default_action_id: 'freeform',\n    });\n  }\n\n  getContextItemTypes(): Promise<ContextItemType[]> {\n    return Promise.resolve([\n      new Buganizer(),\n      new Codesearch(),\n      new Critique(),\n      new G3Doc(),\n      new GDoc(),\n    ]);\n  }\n}\n\nfunction getCurrentRevision(change?: ChangeInfo) {\n  if (!change?.revisions || !change?.current_revision) return undefined;\n  return change.revisions[change.current_revision];\n}\n\nfunction getOperation(status: FileInfoStatus) {\n  switch (status) {\n    case FileInfoStatus.ADDED:\n      return 1;\n    case FileInfoStatus.DELETED:\n      return 2;\n    default:\n      return 3;\n  }\n}\n\nfunction getFiles(\n  change: ChangeInfo,\n  filesIn: Array<{path: string; status: FileInfoStatus}>,\n) {\n  const revision = getCurrentRevision(change);\n  const base_commit: string | undefined =\n    revision?.commit?.parents?.[0]?.commit;\n  if (!filesIn || !base_commit) return [];\n\n  const filesOut: RequestFile[] = [];\n  for (const fileIn of filesIn) {\n    filesOut.push({\n      path: fileIn.path,\n      operation: getOperation(fileIn.status),\n      base_file: {base_commit},\n    });\n  }\n  return filesOut;\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * rest-api.ts contains all entities from the Gerrit REST API that are also\n * relevant to plugins and gr-diff users. These entities should be exactly what\n * the backend defines and returns and should eventually be generated.\n *\n * Sorting order:\n * - enums in alphabetical order\n * - types and interfaces in alphabetical order\n *   - type checking functions after their corresponding type\n */\n\n/**\n * enums =======================================================================\n */\n\n/**\n * The authentication type that is configured on the server.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#auth-info\n */\nexport enum AuthType {\n  OPENID = 'OPENID',\n  OPENID_SSO = 'OPENID_SSO',\n  OAUTH = 'OAUTH',\n  HTTP = 'HTTP',\n  HTTP_LDAP = 'HTTP_LDAP',\n  CLIENT_SSL_CERT_LDAP = 'CLIENT_SSL_CERT_LDAP',\n  LDAP = 'LDAP',\n  LDAP_BIND = 'LDAP_BIND',\n  CUSTOM_EXTENSION = 'CUSTOM_EXTENSION',\n  DEVELOPMENT_BECOME_ANY_ACCOUNT = 'DEVELOPMENT_BECOME_ANY_ACCOUNT',\n}\n\n/**\n * Specifies status for a change\n */\nexport enum ChangeStatus {\n  ABANDONED = 'ABANDONED',\n  MERGED = 'MERGED',\n  NEW = 'NEW',\n}\n\n/**\n * The type in ConfigParameterInfo entity.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#config-parameter-info\n */\nexport enum ConfigParameterInfoType {\n  // Should be kept in sync with\n  // gerrit/java/com/google/gerrit/extensions/api/projects/ProjectConfigEntryType.java.\n  STRING = 'STRING',\n  INT = 'INT',\n  LONG = 'LONG',\n  BOOLEAN = 'BOOLEAN',\n  LIST = 'LIST',\n  ARRAY = 'ARRAY',\n}\n\n/**\n * Used for server config of accounts\n */\nexport enum DefaultDisplayNameConfig {\n  USERNAME = 'USERNAME',\n  FIRST_NAME = 'FIRST_NAME',\n  FULL_NAME = 'FULL_NAME',\n}\n\n/**\n * Account fields that are editable\n * https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#auth-info\n */\nexport enum EditableAccountField {\n  FULL_NAME = 'FULL_NAME',\n  USER_NAME = 'USER_NAME',\n  REGISTER_NEW_EMAIL = 'REGISTER_NEW_EMAIL',\n}\n\n/**\n * The status of the file\n */\nexport enum FileInfoStatus {\n  ADDED = 'A',\n  DELETED = 'D',\n  RENAMED = 'R',\n  COPIED = 'C',\n  REWRITTEN = 'W',\n  MODIFIED = 'M', // Not returned by BE, M is the default\n  UNMODIFIED = 'U', // Not returned by BE, but added by UI for certain files\n  REVERTED = 'X', // Not returned by BE, but added by UI for certain files\n}\n\n/**\n * The status of the file\n */\nexport enum GpgKeyInfoStatus {\n  BAD = 'BAD',\n  OK = 'OK',\n  TRUSTED = 'TRUSTED',\n}\n\n/**\n * Enum for all http methods used in Gerrit.\n */\nexport enum HttpMethod {\n  HEAD = 'HEAD',\n  POST = 'POST',\n  GET = 'GET',\n  DELETE = 'DELETE',\n  PUT = 'PUT',\n}\n\n/**\n * Enum for possible configured value in InheritedBooleanInfo.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#inherited-boolean-info\n */\nexport enum InheritedBooleanInfoConfiguredValue {\n  TRUE = 'TRUE',\n  FALSE = 'FALSE',\n  INHERIT = 'INHERIT',\n}\n\n/**\n * This setting determines when Gerrit computes if a change is mergeable or not.\n * https://gerrit-review.googlesource.com/Documentation/config-gerrit.html#change.mergeabilityComputationBehavior\n */\nexport enum MergeabilityComputationBehavior {\n  API_REF_UPDATED_AND_CHANGE_REINDEX = 'API_REF_UPDATED_AND_CHANGE_REINDEX',\n  REF_UPDATED_AND_CHANGE_REINDEX = 'REF_UPDATED_AND_CHANGE_REINDEX',\n  NEVER = 'NEVER',\n}\n\n/**\n * The status of fixing the problem\n */\nexport enum ProblemInfoStatus {\n  FIXED = 'FIXED',\n  FIX_FAILED = 'FIX_FAILED',\n}\n\n/**\n * The state of the repository\n */\nexport enum RepoState {\n  ACTIVE = 'ACTIVE',\n  READ_ONLY = 'READ_ONLY',\n  HIDDEN = 'HIDDEN',\n}\n\n/**\n * The reviewer state\n */\nexport enum RequirementStatus {\n  OK = 'OK',\n  NOT_READY = 'NOT_READY',\n  RULE_ERROR = 'RULE_ERROR',\n}\n\n/**\n * The reviewer state\n */\nexport enum ReviewerState {\n  REVIEWER = 'REVIEWER',\n  CC = 'CC',\n  REMOVED = 'REMOVED',\n}\n\n/**\n * The patchset kind\n */\nexport enum RevisionKind {\n  REWORK = 'REWORK',\n  TRIVIAL_REBASE = 'TRIVIAL_REBASE',\n  TRIVIAL_REBASE_WITH_MESSAGE_UPDATE = 'TRIVIAL_REBASE_WITH_MESSAGE_UPDATE',\n  MERGE_FIRST_PARENT_UPDATE = 'MERGE_FIRST_PARENT_UPDATE',\n  NO_CODE_CHANGE = 'NO_CODE_CHANGE',\n  NO_CHANGE = 'NO_CHANGE',\n}\n\n/**\n * All supported submit types.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#submit-type-info\n */\nexport enum SubmitType {\n  MERGE_IF_NECESSARY = 'MERGE_IF_NECESSARY',\n  FAST_FORWARD_ONLY = 'FAST_FORWARD_ONLY',\n  REBASE_IF_NECESSARY = 'REBASE_IF_NECESSARY',\n  REBASE_ALWAYS = 'REBASE_ALWAYS',\n  MERGE_ALWAYS = 'MERGE_ALWAYS ',\n  CHERRY_PICK = 'CHERRY_PICK',\n  INHERIT = 'INHERIT',\n}\n\n/**\n * The state of a flow stage.\n */\nexport enum FlowStageState {\n  DONE = 'DONE',\n  FAILED = 'FAILED',\n  PENDING = 'PENDING',\n  TERMINATED = 'TERMINATED',\n}\n\n/**\n * types and interfaces ========================================================\n */\n\n// This is a \"meta type\", so it comes first and is not sored alphabetically with\n// the other types.\nexport type BrandType<T, BrandName extends string> = T & {\n  [__brand in BrandName]: never;\n};\n\nexport type AccountId = BrandType<number, '_accountId'>;\n\n/**\n * The AccountInfo entity contains information about an account.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#account-info\n */\nexport declare interface AccountInfo {\n  // Normally _account_id is defined (for known Gerrit users), but users can\n  // also be CCed just with their email address. So you have to be prepared that\n  // _account_id is undefined, but then email must be set.\n  _account_id?: AccountId;\n  name?: string;\n  display_name?: string;\n  // Must be set, if _account_id is undefined.\n  email?: EmailAddress;\n  secondary_emails?: string[];\n  username?: string;\n  avatars?: AvatarInfo[];\n  _more_accounts?: boolean; // not set if false\n  status?: string; // status message of the account\n  inactive?: boolean; // not set if false\n  tags?: string[];\n  deleted?: boolean; // not set if false\n}\n\n/**\n * The AccountDetailInfo entity contains detailed information about an account.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#account-detail-info\n */\nexport declare interface AccountDetailInfo extends AccountInfo {\n  registered_on: Timestamp;\n}\n\n/**\n * The AccountsConfigInfo entity contains information about Gerrit configuration\n * from the accounts section.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#accounts-config-info\n */\nexport declare interface AccountsConfigInfo {\n  visibility: string;\n  default_display_name: DefaultDisplayNameConfig;\n}\n\n/**\n * The ActionInfo entity describes a REST API call the client can make to\n * manipulate a resource. These are frequently implemented by plugins and may\n * be discovered at runtime.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#action-info\n */\nexport declare interface ActionInfo {\n  method?: HttpMethod; // Most actions use POST, PUT or DELETE to cause state changes.\n  label?: string; // Short title to display to a user describing the action\n  title?: string; // Longer text to display describing the action\n  enabled?: boolean; // not set if false\n}\n\nexport declare interface ActionNameToActionInfoMap {\n  [actionType: string]: ActionInfo | undefined;\n  // List of actions explicitly used in code:\n  wip?: ActionInfo;\n  publishEdit?: ActionInfo;\n  rebaseEdit?: ActionInfo;\n  deleteEdit?: ActionInfo;\n  edit?: ActionInfo;\n  stopEdit?: ActionInfo;\n  download?: ActionInfo;\n  rebase?: ActionInfo;\n  cherrypick?: ActionInfo;\n  move?: ActionInfo;\n  revert?: ActionInfo;\n  revert_submission?: ActionInfo;\n  abandon?: ActionInfo;\n  submit?: ActionInfo;\n  topic?: ActionInfo;\n  hashtags?: ActionInfo;\n  ready?: ActionInfo;\n  includedIn?: ActionInfo;\n}\n\n/**\n * The ApprovalInfo entity contains information about an approval from auser\n * for a label on a change.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#approval-info\n */\nexport declare interface ApprovalInfo extends AccountInfo {\n  value?: number;\n  permitted_voting_range?: VotingRangeInfo;\n  date?: Timestamp;\n  tag?: ReviewInputTag;\n  post_submit?: boolean; // not set if false\n}\n\n/**\n * The AttentionSetInfo entity contains details of users that are in the attention set.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#attention-set-info\n */\nexport declare interface AttentionSetInfo {\n  account: AccountInfo;\n  last_update?: Timestamp;\n  reason?: string;\n  reason_account?: AccountInfo;\n}\n\n/**\n * The AuthInfo entity contains information about the authentication\n * configuration of the Gerrit server.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#auth-info\n */\nexport declare interface AuthInfo {\n  auth_type: AuthType; // docs incorrectly names it 'type'\n  use_contributor_agreements?: boolean;\n  contributor_agreements?: ContributorAgreementInfo[];\n  editable_account_fields: EditableAccountField[];\n  login_url?: string;\n  login_text?: string;\n  switch_account_url?: string;\n  register_url?: string;\n  register_text?: string;\n  edit_full_name_url?: string;\n  http_password_url?: string;\n  git_basic_auth_policy?: string;\n  max_token_lifetime?: string;\n}\n\n/**\n * The AvatarInfo entity contains information about an avatar image of an\n * account.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#avatar-info\n */\nexport declare interface AvatarInfo {\n  url: string;\n  height: number;\n}\n\n// The refs/heads/ prefix is omitted in Branch name\nexport type BranchName = BrandType<string, '_branchName'>;\n\n/**\n * The ChangeConfigInfo entity contains information about Gerrit configuration\n * from the change section.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#change-config-info\n */\nexport declare interface ChangeConfigInfo {\n  allow_blame?: boolean;\n  large_change: number;\n  update_delay: number;\n  submit_whole_topic?: boolean;\n  disable_private_changes?: boolean;\n  mergeability_computation_behavior: MergeabilityComputationBehavior;\n  conflicts_predicate_enabled?: boolean;\n  allow_markdown_base64_images_in_comments?: boolean;\n}\n\nexport type ChangeId = BrandType<string, '_changeId'>;\n\n/**\n * The ChangeInfo entity contains information about a change.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#change-info\n */\nexport declare interface ChangeInfo {\n  id: ChangeInfoId;\n  project: RepoName;\n  branch: BranchName;\n  topic?: TopicName;\n  attention_set?: IdToAttentionSetMap;\n  hashtags?: Hashtag[];\n  custom_keyed_values?: CustomKeyedValues;\n  change_id: ChangeId;\n  subject: string;\n  status: ChangeStatus;\n  created: Timestamp;\n  updated: Timestamp;\n  submitted?: Timestamp;\n  submitter?: AccountInfo;\n  starred?: boolean; // not set if false\n  submit_type?: SubmitType;\n  mergeable?: boolean;\n  submittable?: boolean;\n  insertions: number; // Number of inserted lines\n  deletions: number; // Number of deleted lines\n  total_comment_count?: number;\n  unresolved_comment_count?: number;\n  _number: NumericChangeId;\n  owner: AccountInfo;\n  actions?: ActionNameToActionInfoMap;\n  requirements?: Requirement[];\n  labels?: LabelNameToInfoMap;\n  permitted_labels?: LabelNameToValuesMap;\n  removable_reviewers?: AccountInfo[];\n  removable_labels?: {\n    [labelName: string]: {[labelValue: string]: AccountInfo[]};\n  };\n  // This is documented as optional, but actually always set.\n  reviewers: Reviewers;\n  pending_reviewers?: AccountInfo[];\n  reviewer_updates?: ReviewerUpdateInfo[];\n  messages?: ChangeMessageInfo[];\n  current_revision_number: PatchSetNumber;\n  current_revision?: CommitId;\n  revisions?: {[revisionId: string]: RevisionInfo};\n  tracking_ids?: TrackingIdInfo[];\n  _more_changes?: boolean; // not set if false\n  problems?: ProblemInfo[];\n  is_private?: boolean; // not set if false\n  work_in_progress?: boolean; // not set if false\n  has_review_started?: boolean; // not set if false\n  revert_of?: NumericChangeId;\n  submission_id?: ChangeSubmissionId;\n  cherry_pick_of_change?: NumericChangeId;\n  cherry_pick_of_patch_set?: RevisionPatchSetNum;\n  contains_git_conflicts?: boolean;\n  submit_requirements?: SubmitRequirementResultInfo[];\n  submit_records?: SubmitRecordInfo[];\n}\n\n// The ID of the change in the format \"'<project>~<branch>~<Change-Id>'\"\nexport type ChangeInfoId = BrandType<string, '_changeInfoId'>;\n\nexport type ChangeMessageId = BrandType<string, '_changeMessageId'>;\n\n/**\n * The ChangeMessageInfo entity contains information about a message attached\n * to a change.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#change-message-info\n */\nexport declare interface ChangeMessageInfo {\n  id: ChangeMessageId;\n  author?: AccountInfo;\n  reviewer?: AccountInfo;\n  updated_by?: AccountInfo;\n  real_author?: AccountInfo;\n  date: Timestamp;\n  message: string;\n  accounts_in_message?: AccountInfo[];\n  tag?: ReviewInputTag;\n  _revision_number?: PatchSetNum;\n}\n\n// This ID is equal to the numeric ID of the change that triggered the\n// submission. If the change that triggered the submission also has a topic, it\n// will be \"<id>-<topic>\" of the change that triggered the submission\n// The callers must not rely on the format of the submission ID.\nexport type ChangeSubmissionId = BrandType<\n  string | number,\n  '_changeSubmissionId'\n>;\n\nexport type CloneCommandMap = {[name: string]: string};\n\n/**\n * The CommentLinkInfo entity describes acommentlink.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#commentlink-info\n */\nexport declare interface CommentLinkInfo {\n  match: string;\n  link: string;\n  prefix?: string;\n  suffix?: string;\n  text?: string;\n  enabled?: boolean;\n}\n\nexport declare interface CommentLinks {\n  [name: string]: CommentLinkInfo;\n}\n\n/** 40 char string, see shorten() util, if you want 7 chars. */\nexport type CommitId = BrandType<string, '_commitId'>;\n\n/**\n * The CommitInfo entity contains information about a commit.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#commit-info\n */\nexport declare interface CommitInfo {\n  commit?: CommitId;\n  parents: ParentCommitInfo[];\n  author: GitPersonInfo;\n  committer: GitPersonInfo;\n  subject: string;\n  message: string;\n  web_links?: WebLinkInfo[];\n  resolve_conflicts_web_links?: WebLinkInfo[];\n}\n\nexport declare interface ConfigArrayParameterInfo\n  extends ConfigParameterInfoBase {\n  type: ConfigParameterInfoType.ARRAY;\n  values: string[];\n}\n\n/**\n * The ConfigInfo entity contains information about the effective\n * repository configuration.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#config-info\n */\nexport declare interface ConfigInfo {\n  description?: string;\n  use_contributor_agreements?: InheritedBooleanInfo;\n  use_content_merge?: InheritedBooleanInfo;\n  use_signed_off_by?: InheritedBooleanInfo;\n  create_new_change_for_all_not_in_target?: InheritedBooleanInfo;\n  require_change_id?: InheritedBooleanInfo;\n  enable_signed_push?: InheritedBooleanInfo;\n  require_signed_push?: InheritedBooleanInfo;\n  reject_implicit_merges?: InheritedBooleanInfo;\n  private_by_default: InheritedBooleanInfo;\n  work_in_progress_by_default: InheritedBooleanInfo;\n  max_object_size_limit: MaxObjectSizeLimitInfo;\n  default_submit_type: SubmitTypeInfo;\n  submit_type: SubmitType;\n  match_author_to_committer_date?: InheritedBooleanInfo;\n  state?: RepoState;\n  commentlinks: CommentLinks;\n  plugin_config?: PluginNameToPluginParametersMap;\n  actions?: {[viewName: string]: ActionInfo};\n  reject_empty_commit?: InheritedBooleanInfo;\n  enable_reviewer_by_email: InheritedBooleanInfo;\n}\n\n/**\n * The CommentInfo entity contains information about an inline comment.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#comment-info\n */\nexport declare interface CommentInfo {\n  id: UrlEncodedCommentId;\n  updated: Timestamp;\n  // TODO(TS): Make this required. Every comment must have patch_set set.\n  patch_set?: RevisionPatchSetNum;\n  path?: string;\n  side?: CommentSide;\n  parent?: number;\n  line?: number;\n  range?: CommentRange;\n  in_reply_to?: UrlEncodedCommentId;\n  message?: string;\n  author?: AccountInfo;\n  tag?: string;\n  unresolved?: boolean;\n  change_message_id?: string;\n  commit_id?: string;\n  context_lines?: ContextLine[];\n  source_content_type?: string;\n  fix_suggestions?: FixSuggestionInfo[];\n}\n\n/**\n * The CommentRange entity describes the range of an inline comment.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#comment-range\n *\n * The range includes all characters from the start position, specified by\n * start_line and start_character, to the end position, specified by end_line\n * and end_character. The start position is inclusive and the end position is\n * exclusive.\n *\n * So, a range over part of a line will have start_line equal to end_line;\n * however a range with end_line set to 5 and end_character equal to 0 will not\n * include any characters on line 5.\n */\nexport declare interface CommentRange {\n  /** The start line number of the range. (1-based) */\n  start_line: number;\n\n  /** The character position in the start line. (0-based) */\n  start_character: number;\n\n  /** The end line number of the range. (1-based) */\n  end_line: number;\n\n  /** The character position in the end line. (0-based) */\n  end_character: number;\n}\n\n/**\n * The side on which the comment was added\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#comment-info\n */\nexport enum CommentSide {\n  REVISION = 'REVISION',\n  PARENT = 'PARENT',\n}\n\nexport declare interface ConfigListParameterInfo\n  extends ConfigParameterInfoBase {\n  type: ConfigParameterInfoType.LIST;\n  permitted_values?: string[];\n}\n\nexport type ConfigParameterInfo =\n  | ConfigParameterInfoBase\n  | ConfigArrayParameterInfo\n  | ConfigListParameterInfo;\n\n/**\n * The ConfigParameterInfo entity describes a project configurationparameter.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#config-parameter-info\n */\nexport declare interface ConfigParameterInfoBase {\n  display_name?: string;\n  description?: string;\n  warning?: string;\n  type: ConfigParameterInfoType;\n  value?: string;\n  values?: string[];\n  editable?: boolean;\n  permitted_values?: string[];\n  inheritable?: boolean;\n  configured_value?: string;\n  inherited_value?: string;\n}\n\n/**\n * The ContextLine entity contains the line number and line text of a single line of the source file content.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#context-line\n */\nexport declare interface ContextLine {\n  line_number: number;\n  context_line: string;\n}\n\n// https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#contributor-agreement-info\nexport declare interface ContributorAgreementInfo {\n  name: string;\n  description: string;\n  url?: string;\n  auto_verify_group?: GroupInfo;\n}\n\n/**\n * LabelInfo when DETAILED_LABELS are requested.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#_fields_set_by_code_detailed_labels_code\n */\nexport declare interface DetailedLabelInfo extends LabelCommonInfo {\n  // This is not set when the change has no reviewers.\n  all?: ApprovalInfo[];\n  // Docs claim that 'values' is optional, but it is actually always set.\n  values?: LabelValueToDescriptionMap; // A map of all values that are allowed for this label\n  default_value?: number;\n}\n\nexport function isDetailedLabelInfo(\n  label: LabelInfo\n): label is DetailedLabelInfo | (QuickLabelInfo & DetailedLabelInfo) {\n  return !!(label as DetailedLabelInfo).values;\n}\n\n/**\n * The DownloadInfo entity contains information about supported download\n * options.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#download-info\n */\nexport declare interface DownloadInfo {\n  schemes: SchemesInfoMap;\n  archives: string[];\n}\n\n/**\n * The DownloadSchemeInfo entity contains information about a supported download\n * scheme and its commands.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-config.html\n */\nexport declare interface DownloadSchemeInfo {\n  url: string;\n  description?: string;\n  is_auth_required: boolean;\n  is_auth_supported: boolean;\n  commands: string;\n  clone_commands: CloneCommandMap;\n}\n\nexport type EmailAddress = BrandType<string, '_emailAddress'>;\n\n/**\n * The EmailInfo entity contains information about an email address of a user\n * https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#email-info\n */\nexport declare interface EmailInfo {\n  email: EmailAddress;\n  preferred?: boolean;\n  pending_confirmation?: boolean;\n}\n\n/**\n * The FetchInfo entity contains information about how to fetch a patchset via\n * a certain protocol.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#fetch-info\n */\nexport declare interface FetchInfo {\n  url: string;\n  ref: string;\n  commands?: {[commandName: string]: string};\n}\n\n/**\n * The FlowActionInfo entity contains information about a flow action.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#flow-action-info\n */\nexport declare interface FlowActionInfo {\n  name: string;\n  parameters?: string[];\n}\n\n/**\n * The FlowExpressionInfo entity contains information about a flow expression.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#flow-expression-info\n */\nexport declare interface FlowExpressionInfo {\n  condition: string;\n  action?: FlowActionInfo;\n}\n\n/**\n * The FlowInfo entity contains information about a flow.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#flow-info\n */\nexport declare interface FlowInfo {\n  uuid: string;\n  owner: AccountInfo;\n  created: Timestamp;\n  last_evaluated?: Timestamp;\n  stages: FlowStageInfo[];\n}\n\n/**\n * The FlowInput entity is used for creating a new flow.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#flow-input\n */\nexport declare interface FlowInput {\n  stage_expressions: FlowExpressionInfo[];\n}\n\n/**\n * The FlowStageInfo entity contains information about a flow stage.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#flow-stage-info\n */\nexport declare interface FlowStageInfo {\n  expression: FlowExpressionInfo;\n  state: FlowStageState;\n  message?: string;\n}\n\n/**\n * The FileInfo entity contains information about a file in a patch set.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#file-info\n */\nexport declare interface FileInfo {\n  status?: FileInfoStatus;\n  binary?: boolean; // not set if false\n  old_path?: string;\n  lines_inserted?: number;\n  lines_deleted?: number;\n  size_delta?: number; // in bytes\n  size?: number; // in bytes\n  old_mode?: number;\n  new_mode?: number;\n  old_sha?: string;\n  new_sha?: string;\n}\n\n/**\n * The GerritInfo entity contains information about Gerrit configuration from\n * the gerrit section.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#gerrit-info\n */\nexport declare interface GerritInfo {\n  all_projects: string; // Doc contains incorrect name\n  all_users: string; // Doc contains incorrect name\n  doc_search: boolean;\n  doc_url?: string;\n  edit_gpg_keys?: boolean;\n  project_state_predicate_enabled: boolean;\n  report_bug_url?: string;\n  // The following property is missed in doc\n  primary_weblink_name?: string;\n  instance_id?: string;\n  default_branch?: string;\n}\n\nexport type GitRef = BrandType<string, '_gitRef'>;\n// The 40-char (plus spaces) hex GPG key fingerprint\n\nexport type GpgKeyFingerprint = BrandType<string, '_gpgKeyFingerprint'>;\n// The 8-char hex GPG key ID.\n\nexport type GpgKeyId = BrandType<string, '_gpgKeyId'>;\n\n/**\n * The GpgKeyInfo entity contains information about a GPG public key.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#gpg-key-info\n */\nexport declare interface GpgKeyInfo {\n  id?: GpgKeyId;\n  fingerprint?: GpgKeyFingerprint;\n  user_ids?: OpenPgpUserIds[];\n  key?: string; // ASCII armored public key material\n  status?: GpgKeyInfoStatus;\n  problems?: string[];\n}\n\n/**\n * The GitPersonInfo entity contains information about theauthor/committer of\n * a commit.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#git-person-info\n */\nexport declare interface GitPersonInfo {\n  name: string;\n  email: EmailAddress;\n  date: Timestamp;\n}\n\nexport type GroupId = BrandType<string, '_groupId'>;\n\n/**\n * The GroupInfo entity contains information about a group. This can be a\n * Gerrit internal group, or an external group that is known to Gerrit.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#group-info\n */\nexport declare interface GroupInfo {\n  id: GroupId;\n  name?: GroupName;\n  url?: string;\n  options?: GroupOptionsInfo;\n  description?: string;\n  group_id?: number;\n  owner?: string;\n  owner_id?: string;\n  created_on?: string;\n  _more_groups?: boolean;\n  members?: AccountInfo[];\n  includes?: GroupInfo[];\n}\n\n/**\n * The GroupsInfo entity contains information about Gerrit configuration from\n * the gerrit section.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#groups-info\n */\nexport declare interface GroupsConfigInfo {\n  enable_delete_group?: boolean;\n}\n\nexport type GroupName = BrandType<string, '_groupName'>;\n\n/**\n * Options of the group.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html\n */\nexport declare interface GroupOptionsInfo {\n  visible_to_all: boolean;\n}\n\nexport type Hashtag = BrandType<string, '_hashtag'>;\n\nexport type CustomKey = BrandType<string, '_custom_key'>;\nexport type CustomValue = BrandType<string, '_custom_value'>;\n\n// A map from CustomKey to CustomValue\nexport type CustomKeyedValues = {[key: CustomKey]: CustomValue};\n\nexport type IdToAttentionSetMap = {[accountId: string]: AttentionSetInfo};\n\n/**\n * A boolean value that can also be inherited.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#inherited-boolean-info\n */\nexport declare interface InheritedBooleanInfo {\n  value: boolean;\n  configured_value: InheritedBooleanInfoConfiguredValue;\n  inherited_value?: boolean;\n}\n\nexport declare interface LabelCommonInfo {\n  optional?: boolean; // not set if false\n  description?: string;\n}\n\nexport type LabelNameToInfoMap = {[labelName: string]: LabelInfo};\n\n// {Verified: [\"-1\", \" 0\", \"+1\"]}\nexport type LabelNameToValuesMap = {[labelName: string]: string[]};\n\n/**\n * The LabelInfo entity contains information about a label on a change, always\n * corresponding to the current patch set.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#label-info\n */\nexport type LabelInfo =\n  | QuickLabelInfo\n  | DetailedLabelInfo\n  | (QuickLabelInfo & DetailedLabelInfo);\n\nexport type LabelNameToLabelTypeInfoMap = {[labelName: string]: LabelTypeInfo};\n\n/**\n * The LabelTypeInfo entity contains metadata about the labels that a repository\n * has.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#label-type-info\n */\nexport declare interface LabelTypeInfo {\n  values: LabelTypeInfoValues;\n  default_value: number;\n}\n\nexport type LabelTypeInfoValues = {[value: string]: string};\n\n// The map maps the values (\u201c-2\u201d, \u201c-1\u201d, \" `0`\", \u201c+1\u201d, \u201c+2\u201d) to the value descriptions.\nexport type LabelValueToDescriptionMap = {[labelValue: string]: string};\n\n/**\n * The MaxObjectSizeLimitInfo entity contains information about the max object\n * size limit of a repository.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#max-object-size-limit-info\n */\nexport declare interface MaxObjectSizeLimitInfo {\n  value?: string;\n  configured_value?: string;\n  summary?: string;\n}\n\nexport type NumericChangeId = BrandType<number, '_numericChangeId'>;\n// OpenPGP User IDs (https://tools.ietf.org/html/rfc4880#section-5.11).\n\nexport type OpenPgpUserIds = BrandType<string, '_openPgpUserIds'>;\n\n/**\n * The parent commits of this commit as a list of CommitInfo entities.\n * In each parent only the commit and subject fields are populated.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#commit-info\n */\nexport declare interface ParentCommitInfo {\n  commit: CommitId;\n  subject: string;\n}\n\nexport type PatchSetNumber = BrandType<number, '_patchSet'>;\n\nexport type EditPatchSet = BrandType<'edit', '_patchSet'>;\n\nexport const EDIT = 'edit' as EditPatchSet;\n\nexport type ParentPatchSet = BrandType<'PARENT', '_patchSet'>;\n\nexport const PARENT = 'PARENT' as ParentPatchSet;\n\nexport type PatchSetNum = PatchSetNumber | ParentPatchSet | EditPatchSet;\n\n// for the \"left\" side of a diff or the base of a patch range\nexport type BasePatchSetNum = PatchSetNumber | ParentPatchSet;\n\n// for the \"right\" side of a diff or the revision of a patch range\nexport type RevisionPatchSetNum = PatchSetNumber | EditPatchSet;\n\n/**\n * The PluginConfigInfo entity contains information about Gerrit extensions by\n * plugins.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#plugin-config-info\n */\nexport declare interface PluginConfigInfo {\n  has_avatars: boolean;\n  // Exists in Java class, but not mentioned in docs.\n  js_resource_paths: string[];\n}\n\n/**\n * Plugin configuration values as map which maps the plugin name to a map of parameter names to values\n * https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#config-input\n */\nexport type PluginNameToPluginParametersMap = {\n  [pluginName: string]: PluginParameterToConfigParameterInfoMap;\n};\n\nexport type PluginParameterToConfigParameterInfoMap = {\n  [parameterName: string]: ConfigParameterInfo;\n};\n\n/**\n * The ProblemInfo entity contains a description of a potential consistency\n * problem with a change. These are not related to the code review process,\n * but rather indicate some inconsistency in Gerrit\u2019s database or repository\n * metadata related to the enclosing change.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#problem-info\n */\nexport declare interface ProblemInfo {\n  message: string;\n  status?: ProblemInfoStatus; // Only set if a fix was attempted\n  outcome?: string;\n}\n\n/**\n * The ProjectInfo entity contains information about a repository\n * https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#project-info\n */\nexport declare interface ProjectInfo {\n  id: UrlEncodedRepoName;\n  // name is not set if returned in a map where the repo name is used as\n  // map key\n  name?: RepoName;\n  // ?-<n> if the parent repository is not visible (<n> is a number which\n  // is increased for each non-visible repository).\n  parent?: RepoName;\n  description?: string;\n  state?: RepoState;\n  branches?: {[branchName: string]: CommitId};\n  // labels is filled for Create Repo and Get Repo calls.\n  labels?: LabelNameToLabelTypeInfoMap;\n  // Links to the repository in external sites\n  web_links?: WebLinkInfo[];\n}\n\nexport declare interface ProjectInfoWithName extends ProjectInfo {\n  name: RepoName;\n}\n\n/**\n * The PushCertificateInfo entity contains information about a pushcertificate\n * provided when the user pushed for review with git push\n * --signed HEAD:refs/for/<branch>. Only used when signed push is\n * enabled on the server.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#push-certificate-info\n */\nexport declare interface PushCertificateInfo {\n  certificate: string;\n  key: GpgKeyInfo;\n}\n\nexport declare interface QuickLabelInfo extends LabelCommonInfo {\n  approved?: AccountInfo;\n  rejected?: AccountInfo;\n  recommended?: AccountInfo;\n  disliked?: AccountInfo;\n  blocking?: boolean; // not set if false\n  value?: number; // The voting value of the user who recommended/disliked this label on the change if it is not \u201c+1\u201d/\u201c-1\u201d.\n  default_value?: number;\n}\n\nexport function isQuickLabelInfo(\n  l: LabelInfo\n): l is QuickLabelInfo | (QuickLabelInfo & DetailedLabelInfo) {\n  const quickLabelInfo = l as QuickLabelInfo;\n  return (\n    quickLabelInfo.approved !== undefined ||\n    quickLabelInfo.rejected !== undefined ||\n    quickLabelInfo.recommended !== undefined ||\n    quickLabelInfo.disliked !== undefined ||\n    quickLabelInfo.blocking !== undefined ||\n    quickLabelInfo.blocking !== undefined ||\n    quickLabelInfo.value !== undefined\n  );\n}\n\n/**\n * The ReceiveInfo entity contains information about the configuration of\n * git-receive-pack behavior on the server.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#receive-info\n */\nexport declare interface ReceiveInfo {\n  enable_signed_push?: string;\n}\n\nexport type RepoName = BrandType<string, '_repoName'>;\n\n/**\n * The Requirement entity contains information about a requirement relative to\n * a change.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#requirement\n */\nexport declare interface Requirement {\n  status: RequirementStatus;\n  fallbackText: string; // A human readable reason\n  type: RequirementType;\n}\n\nexport type RequirementType = BrandType<string, '_requirementType'>;\n\n/**\n * The reviewers as a map that maps a reviewer state to a list of AccountInfo\n * entities. Possible reviewer states are REVIEWER, CC and REMOVED.\n * REVIEWER: Users with at least one non-zero vote on the change.\n * CC: Users that were added to the change, but have not voted.\n * REMOVED: Users that were previously reviewers on the change, but have been removed.\n */\nexport type Reviewers = Partial<Record<ReviewerState, AccountInfo[]>>;\n\n/**\n * The ReviewerUpdateInfo entity contains information about updates to change\u2019s\n * reviewers set.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#review-update-info\n */\nexport declare interface ReviewerUpdateInfo {\n  updated: Timestamp;\n  updated_by: AccountInfo;\n  reviewer: AccountInfo;\n  state: ReviewerState;\n}\n\nexport type ReviewInputTag = BrandType<string, '_reviewInputTag'>;\n\n/**\n * The RevisionInfo entity contains information about a patch set.Not all\n * fields are returned by default.  Additional fields can be obtained by\n * adding o parameters as described in Query Changes.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#revision-info\n */\nexport declare interface RevisionInfo {\n  kind: RevisionKind;\n  _number: RevisionPatchSetNum;\n  created: Timestamp;\n  uploader: AccountInfo;\n  ref: GitRef;\n  fetch?: {[protocol: string]: FetchInfo};\n  commit?: CommitInfo;\n  files?: {[filename: string]: FileInfo};\n  reviewed?: boolean;\n  commit_with_footers?: string;\n  push_certificate?: PushCertificateInfo;\n  description?: string;\n  parents_data?: ParentInfo[];\n}\n\n/**\n * The ParentInfo entity contains detailed information the parent commit of a revision.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#parent-info\n * basePatchNum is present in case RevisionInfo is of type 'edit'\n */\nexport declare interface ParentInfo {\n  branch_name?: string;\n  commit_id?: CommitId;\n  is_merged_in_target_branch?: boolean;\n  change_id?: ChangeId;\n  change_number?: NumericChangeId;\n  patch_set_number?: PatchSetNumber;\n  change_status?: ChangeStatus;\n}\n\nexport type SchemesInfoMap = {[name: string]: DownloadSchemeInfo};\n\n/**\n * The ServerInfo entity contains information about the configuration of the\n * Gerrit server.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#server-info\n */\nexport declare interface ServerInfo {\n  accounts: AccountsConfigInfo;\n  auth: AuthInfo;\n  change: ChangeConfigInfo;\n  download: DownloadInfo;\n  gerrit: GerritInfo;\n  groups: GroupsConfigInfo;\n  note_db_enabled?: boolean;\n  plugin: PluginConfigInfo;\n  receive?: ReceiveInfo;\n  sshd?: SshdInfo;\n  suggest: SuggestInfo;\n  user: UserConfigInfo;\n  default_theme?: string;\n  submit_requirement_dashboard_columns?: string[];\n  dashboard_show_all_labels?: boolean;\n  metadata?: MetadataInfo[];\n}\n\n/**\n * Contains the list of Validation options applicable to a change.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#validation-options\n */\nexport declare interface ValidationOptionsInfo {\n  validation_options: ValidationOptionInfo[];\n}\n\n/**\n * The push options that can be specified by the user on push\n * https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#validation-option-info\n */\nexport declare interface ValidationOptionInfo {\n  name: string;\n  description: string;\n}\n\n/**\n * The SshdInfo entity contains information about Gerrit configuration from the sshd section.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#sshd-info\n * This entity doesn\u2019t contain any data, but the presence of this (empty) entity\n * in the ServerInfo entity means that SSHD is enabled on the server.\n */\nexport type SshdInfo = {};\n\n/**\n * The MetadataInfo entity contains contains metadata provided by plugins.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#metadata-info\n */\nexport declare interface MetadataInfo {\n  name: string;\n  value?: string;\n  description?: string;\n  web_links?: WebLinkInfo[];\n}\n\n// Timestamps are given in UTC and have the format\n// \"'yyyy-mm-dd hh:mm:ss.fffffffff'\"\n// where \"'ffffffffff'\" represents nanoseconds.\n\n/**\n * Information about the default submittype of a repository, taking into account\n * repository inheritance.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#submit-type-info\n */\nexport declare interface SubmitTypeInfo {\n  value: Exclude<SubmitType, SubmitType.INHERIT>;\n  configured_value: SubmitType;\n  inherited_value: Exclude<SubmitType, SubmitType.INHERIT>;\n}\n\n/**\n * The SuggestInfo entity contains information about Gerritconfiguration from\n * the suggest section.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#suggest-info\n */\nexport declare interface SuggestInfo {\n  from: number;\n}\n\nexport type Timestamp = BrandType<string, '_timestamp'>;\n// The timezone offset from UTC in minutes\n\nexport type TopicName = BrandType<string, '_topicName'>;\n\nexport type TrackingId = BrandType<string, '_trackingId'>;\n\n/**\n * The TrackingIdInfo entity describes a reference to an external tracking\n * system.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#tracking-id-info\n */\nexport declare interface TrackingIdInfo {\n  system: string;\n  id: TrackingId;\n}\n\n/**\n * The UserConfigInfo entity contains information about Gerrit configuration\n * from the user section.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#user-config-info\n */\nexport declare interface UserConfigInfo {\n  anonymous_coward_name: string;\n}\n\n/**\n * The VotingRangeInfo entity describes the continuous voting range from minto\n * max values.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#voting-range-info\n */\nexport declare interface VotingRangeInfo {\n  min: number;\n  max: number;\n}\n\n/**\n * The WebLinkInfo entity describes a link to an external site.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#web-link-info\n */\nexport declare interface WebLinkInfo {\n  /** The text to be linkified. */\n  name: string;\n  /** Tooltip to show when hovering over the link. */\n  tooltip?: string;\n  /** The link URL. */\n  url: string;\n  /** URL to the icon of the link. */\n  image_url?: string;\n}\n\n/**\n * The SubmitRequirementResultInfo describes the result of evaluating\n * a submit requirement on a change.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#submit-requirement-result-info\n */\nexport declare interface SubmitRequirementResultInfo {\n  name: string;\n  description?: string;\n  status: SubmitRequirementStatus;\n  applicability_expression_result?: SubmitRequirementExpressionInfo;\n  submittability_expression_result: SubmitRequirementExpressionInfo;\n  override_expression_result?: SubmitRequirementExpressionInfo;\n  is_legacy?: boolean;\n}\n\n/**\n * The SubmitRequirementExpressionInfo describes the result of evaluating\n * a single submit requirement expression, for example label:code-review=+2.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#submit-requirement-expression-info\n */\nexport declare interface SubmitRequirementExpressionInfo {\n  expression: string;\n  fulfilled?: boolean;\n  status?: SubmitRequirementExpressionInfoStatus;\n  passing_atoms?: string[];\n  failing_atoms?: string[];\n  atom_explanations?: {[atom: string]: string};\n  error_message?: string;\n}\n\nexport enum SubmitRequirementExpressionInfoStatus {\n  PASS = 'PASS',\n  FAIL = 'FAIL',\n  ERROR = 'ERROR',\n  NOT_EVALUATED = 'NOT_EVALUATED',\n}\n\n/**\n * Status describing the result of evaluating the submit requirement.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#submit-requirement-result-info\n */\nexport enum SubmitRequirementStatus {\n  SATISFIED = 'SATISFIED',\n  UNSATISFIED = 'UNSATISFIED',\n  OVERRIDDEN = 'OVERRIDDEN',\n  NOT_APPLICABLE = 'NOT_APPLICABLE',\n  ERROR = 'ERROR',\n  FORCED = 'FORCED',\n}\n\nexport type UrlEncodedRepoName = BrandType<string, '_urlEncodedRepoName'>;\n\n/**\n * The SubmitRecordInfo entity describes results from a submit_rule.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#submit-record-info\n */\nexport declare interface SubmitRecordInfo {\n  rule_name: string;\n  status?: SubmitRecordInfoStatus;\n  labels?: SubmitRecordInfoLabel[];\n  requirements?: Requirement[];\n  error_message?: string;\n}\n\nexport enum SubmitRecordInfoStatus {\n  OK = 'OK',\n  NOT_READY = 'NOT_READY',\n  CLOSED = 'CLOSED',\n  FORCED = 'FORCED',\n  RULE_ERROR = 'RULE_ERROR',\n}\n\nexport enum LabelStatus {\n  /**\n   * This label provides what is necessary for submission.\n   */\n  OK = 'OK',\n  /**\n   * This label prevents the change from being submitted.\n   */\n  REJECT = 'REJECT',\n  /**\n   * The label may be set, but it's neither necessary for submission\n   * nor does it block submission if set.\n   */\n  MAY = 'MAY',\n  /**\n   * The label is required for submission, but has not been satisfied.\n   */\n  NEED = 'NEED',\n  /**\n   * The label is required for submission, but is impossible to complete.\n   * The likely cause is access has not been granted correctly by the\n   * repository owner or site administrator.\n   */\n  IMPOSSIBLE = 'IMPOSSIBLE',\n  OPTIONAL = 'OPTIONAL',\n}\n\n/**\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#submit-record-info\n */\nexport declare interface SubmitRecordInfoLabel {\n  label: string;\n  status: LabelStatus;\n  appliedBy: AccountInfo;\n}\n\n/**\n * Represent a file in a base64 encoding; GrRestApiInterface returns\n * it from some methods\n */\nexport declare interface Base64FileContent {\n  content: string | null;\n  type: string | null;\n  ok: true;\n}\n\nexport function isBase64FileContent(\n  res: Response | Base64FileContent\n): res is Base64FileContent {\n  return (res as Base64FileContent).ok;\n}\n\n// The URL encoded UUID of the comment\nexport type UrlEncodedCommentId = BrandType<string, '_urlEncodedCommentId'>;\n\n/**\n * The FixSuggestionInfo entity represents a suggested fix\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#fix-suggestion-info\n */\nexport declare interface FixSuggestionInfoInput {\n  description: string;\n  replacements: FixReplacementInfo[];\n}\n\n/**\n * The FixReplacementInfo entity describes how the content of a file should be replaced by another content\n * https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#fix-replacement-info\n */\nexport declare interface FixReplacementInfo {\n  path: string;\n  range: CommentRange;\n  replacement: string;\n}\n// The UUID of the suggested fix.\nexport type FixId = BrandType<string, '_fixId'>;\n\nexport declare interface FixSuggestionInfo extends FixSuggestionInfoInput {\n  fix_id: FixId;\n  description: string;\n  replacements: FixReplacementInfo[];\n  log_probability?: number;\n}\n\n/**\n * The LabelDefinitionInfo entity describes a review label.\n *\n * https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#label-definition-info\n */\nexport interface LabelDefinitionInfo {\n  name: string;\n  description?: string;\n  project_name: string;\n  function: LabelDefinitionInfoFunction;\n  values: LabelValueToDescriptionMap;\n  default_value: number;\n  branches?: string[];\n  can_override?: boolean;\n  copy_condition?: string;\n  allow_post_submit?: boolean;\n  ignore_self_approval?: boolean;\n}\n\nexport enum LabelDefinitionInfoFunction {\n  MaxWithBlock = 'MaxWithBlock',\n  AnyWithBlock = 'AnyWithBlock',\n  MaxNoBlock = 'MaxNoBlock',\n  NoBlock = 'NoBlock',\n  Noop = 'Noop',\n  PatchSetLock = 'PatchSetLock',\n}\n\n/**\n * The LabelDefinitionInput entity describes a label definition input.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#label-definition-input\n */\nexport interface LabelDefinitionInput {\n  commit_message?: string;\n  name?: string;\n  description?: string;\n  function?: LabelDefinitionInfoFunction;\n  values?: LabelValueToDescriptionMap;\n  default_value?: number;\n  branches?: string[];\n  can_override?: boolean;\n  copy_condition?: string;\n  unset_copy_condition?: boolean;\n  allow_post_submit?: boolean;\n  ignore_self_approval?: boolean;\n}\n\n/*\n * The DeleteLabelInput entity describes a delete label input\n * https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#delete-label-input\n */\nexport interface DeleteLabelInput {\n  commit_message?: string;\n}\n\n/**\n * The BatchLabelInput entity describes a batch label input\n * https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#batch-label-input\n */\nexport interface BatchLabelInput {\n  create?: LabelDefinitionInput[];\n  update?: {[labelName: string]: Partial<LabelDefinitionInput>};\n  delete?: string[];\n}\n\n/**\n * The SubmitRequirementInput entity describes a submit requirement input.\n * https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#submit-requirement-input\n */\nexport interface SubmitRequirementInput {\n  name: string;\n  description?: string;\n  applicability_expression?: string;\n  submittability_expression: string;\n  override_expression?: string;\n  allow_override_in_child_projects?: boolean;\n}\n\n/**\n * The BatchSubmitRequirementInput entity describes a batch submit requirement input\n * https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#batch-submit-requirement-input\n */\nexport interface BatchSubmitRequirementInput {\n  create?: SubmitRequirementInput[];\n  update?: {[submitRequirementName: string]: Partial<SubmitRequirementInput>};\n  delete?: string[];\n  commit_message?: string;\n}\n\n/**\n * The IsFlowsEnabledInfo entity contains information about whether flows are\n * enabled.\n */\nexport declare interface IsFlowsEnabledInfo {\n  enabled: boolean;\n}\n","import {ResponseCode} from 'google3/third_party/javascript/polygerrit/api/suggestions';\n/**\n * convert {@link CommentAutocompletionPostResponse.outcome} into {@link ResponseCode}\n * //depot/google3/devtools/codereview/services/assistance/proto/autocomplete_comment.proto\n */\nexport function outcomeToResponseCode(\n  outcome: number | undefined,\n): ResponseCode {\n  if (outcome === undefined) {\n    return ResponseCode.ERROR;\n  }\n  switch (outcome) {\n    case 1: // SUCCESS\n    case 21: // SMART_CHOICES_NO_SHOW_LOG_ONLY\n      return ResponseCode.OK;\n    case 0: // OUTCOME_UNSPECIFIED\n    case 2: // NO_SUGGESTION\n      return ResponseCode.NO_SUGGESTION;\n    case 7: // FILE_TOO_LARGE\n      return ResponseCode.FILE_TOO_LARGE;\n    case 8: // INVALID_RANGE\n      return ResponseCode.INVALID_RANGE;\n    case 9: // UNSUPPORTED_FILE_TYPE\n      return ResponseCode.UNSUPPORTED_FILE_TYPE;\n    case 15: // USER_QUOTA_EXCEEDED\n      return ResponseCode.USER_QUOTA_EXCEEDED;\n    case 20: // NO_SHOW\n      return ResponseCode.OK_LOW_CONFIDENCE;\n\n    default:\n      return ResponseCode.ERROR;\n  }\n}\n","/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n  ChangeInfo,\n  CommentRange,\n  FixSuggestionInfo,\n  RevisionPatchSetNum,\n} from './rest-api';\n\nexport declare interface SuggestionsPluginApi {\n  /**\n   * Must only be called once. You cannot register twice. You cannot unregister.\n   */\n  register(provider: SuggestionsProvider): void;\n}\n\nexport declare interface SuggestCodeRequest {\n  prompt: string;\n  changeInfo: ChangeInfo;\n  patchsetNumber: RevisionPatchSetNum;\n  filePath: string;\n  range?: CommentRange;\n  lineNumber?: number;\n}\n\nexport declare interface AutocompleteCommentRequest {\n  id: string;\n  commentText: string;\n  changeInfo: ChangeInfo;\n  patchsetNumber: RevisionPatchSetNum;\n  filePath: string;\n  range?: CommentRange;\n  lineNumber?: number;\n}\n\nexport declare interface SuggestionsProvider {\n  autocompleteComment?(\n    req: AutocompleteCommentRequest\n  ): Promise<AutocompleteCommentResponse>;\n\n  /**\n   * Gerrit calls these methods when ...\n   * - ... user types a comment draft\n   */\n  suggestCode?(commentData: SuggestCodeRequest): Promise<SuggestCodeResponse>;\n  suggestFix?(commentData: SuggestCodeRequest): Promise<SuggestedFixResponse>;\n  /**\n   * Gets the title to display on the fix suggestion preview.\n   *\n   * @param fix_suggestions A list of suggested fixes.\n   * @return The title string or empty to use the default title.\n   */\n  getFixSuggestionTitle?(fix_suggestions?: FixSuggestionInfo[]): string;\n  /**\n   * Gets a link to documentation for icon help next to title\n   *\n   * @param fix_suggestions A list of suggested fixes.\n   * @return The documentation URL string or empty to use the default link to\n   * gerrit documentation about fix suggestions.\n   */\n  getDocumentationLink?(fix_suggestions?: FixSuggestionInfo[]): string;\n  /**\n   * List of supported file extensions. If undefined, all file extensions supported.\n   */\n  supportedFileExtensions?: string[];\n  /**\n   * Sends feedback on autocompletion suggestions.\n   * This method allows the plugin to report which suggestions were accepted or\n   * rejected by the user, which can be used for improving future suggestions.\n   */\n  sendAutocompleteFeedback?(feedbackEntries: SuggestionFeedbackEntry[]): void;\n  /**\n   * Sends feedback on 'suggest fix' (code repair) suggestions.\n   * This method allows the plugin to report which suggestions were accepted or\n   * rejected by the user, which can be used for improving future suggestions.\n   *\n   */\n  sendSuggestFixFeedback?(feedbackEntries: SuggestionFeedbackEntry[]): void;\n}\n\n/**\n * Represents a 128-bit unique identifier for a suggestion, used for tracking feedback.\n * The ID is split into two 64-bit BigInt components.\n */\nexport declare interface Feedback {\n  /** The least significant 64 bits of the 128-bit identifier. */\n  id1: bigint;\n  /** The most significant 64 bits of the 128-bit identifier. */\n  id2: bigint;\n}\n\nexport declare interface SuggestionFeedbackEntry {\n  /** The unique identifier for the suggestion. */\n  feedbackId: Feedback;\n  /** True if the suggestion was accepted by the user, false otherwise. */\n  accepted: boolean;\n}\n\nexport declare interface AutocompleteCommentResponse {\n  responseCode: ResponseCode;\n  completion?: string;\n  modelVersion?: string;\n  outcome?: number;\n  feedback?: Feedback;\n}\n\nexport declare interface SuggestCodeResponse {\n  responseCode: ResponseCode;\n  suggestions: Suggestion[];\n}\n\nexport declare interface SuggestedFixResponse {\n  responseCode: ResponseCode;\n  fix_suggestions: FixSuggestionInfo[];\n}\n\nexport declare interface Suggestion {\n  replacement: string;\n  newRange?: CommentRange;\n}\n\nexport enum ResponseCode {\n  OK = 'OK',\n  NO_SUGGESTION = 'NO_SUGGESTION',\n  OUT_OF_RANGE = 'OUT_OF_RANGE',\n  ERROR = 'ERROR',\n  FILE_TOO_LARGE = 'FILE_TOO_LARGE',\n  INVALID_RANGE = 'INVALID_RANGE',\n  UNSUPPORTED_FILE_TYPE = 'UNSUPPORTED_FILE_TYPE',\n  USER_QUOTA_EXCEEDED = 'USER_QUOTA_EXCEEDED',\n  OK_LOW_CONFIDENCE = 'OK_LOW_CONFIDENCE',\n}\n","/**\n * @license\n * Copyright 2016 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Patches the built-in HTMLElement constructor to work around a compiler bug.\n *\n * For more info, see http://go/es5-custom-elements\n */\n\ngoog.module('webcomponentsjs.custom_elements.es5_shim_implementation');\nconst detectTranspilation = goog.require('google3.javascript.polymer.detect_transpilation.detect_transpilation');\n// Side-effect require the dom shim for NODE_MODE. Should be a noop unless\n// NODE_MODE is true.\n/** @suppress {extraRequire} */\ngoog.require('google3.third_party.javascript.lit.packages.labs.ssr$2ddom$2dshim.src.index');\n\n/**\n * If you use the fast shim, you can save a few bytes by setting this to true.\n *\n * Very few users use the fast shim (or should). If you're looking for faster\n * instantiation, we'd instead recommend serving ES2015+.\n *\n * @define {boolean}\n */\nconst DISABLE_AUTO_CE_ES5_SHIM = goog.define('DISABLE_AUTO_CE_ES5_SHIM', false);\n\n/** @type {boolean} */\nconst shimNotNeeded = DISABLE_AUTO_CE_ES5_SHIM ||\n    !detectTranspilation.wasTranspiledToEs5 ||\n    // An es5 shim is already loaded, don't load again.\n    HTMLElement['es5Shimmed'] ||\n    // No Reflect, no classes, no need for shim because native custom\n    // elements require ES2015 classes or Reflect.\n    goog.global.Reflect === undefined ||\n    goog.global.customElements === undefined ||\n    // The webcomponentsjs custom elements polyfill doesn't require\n    // ES2015-compatible construction (`super()` or `Reflect.construct`).\n    goog.global.customElements['polyfillWrapFlushCallback'] || false;\n\nlet useGlobalsForDev = false;\nexports.devOnlyForceGlobals = () => {\n  if (!goog.DEBUG) {\n    throw new Error('devOnlyForceGlobals can only be called in DEBUG builds');\n  }\n  if (useGlobalsForDev === true) {\n    return;\n  }\n  useGlobalsForDev = true;\n  exports.applyShim();\n};\n\n/**\n * @type {?}\n */\nlet patchedHTMLElement;\n\n/**\n * A ponyfill. You can reference this instead of the global HTMLElement in order\n * to get the shim's behavior without patching the global HTMLElement.\n */\nexports.getHTMLElement = () => {\n  const BuiltInHTMLElement = HTMLElement;\n  if (shimNotNeeded) {\n    return BuiltInHTMLElement;\n  }\n  if (useGlobalsForDev) {\n    // Might be patched, e.g. for go/hot-elements\n    return HTMLElement;\n  }\n\n  if (patchedHTMLElement !== undefined) {\n    return patchedHTMLElement;\n  }\n\n  // So that we can access the page's Reflect, rather than any polyfilled\n  // reflect. We know that the page has a Reflect implementation, because\n  // otherwise shimNotNeeded would be true and we wouldn't have reached\n  // this point.\n  // This is needed for compat with --isolate_polyfills.\n  // TODO(b/276312149): just reference Reflect directly.\n  const reflect = goog.global.Reflect;\n  /**\n   * With jscompiler's RECOMMENDED_FLAGS the function name will be optimized\n   * away. However, if we declare the function as a property on an object\n   * literal, and use quotes for the property name, then closure will leave that\n   * much intact, which is enough for the JS VM to correctly set\n   * Function.prototype.name.\n   */\n  const wrapperForTheName = {\n    'HTMLElement': /** @this {!Object} */ function HTMLElement() {\n      if (goog.DEBUG) {\n        try {\n          return reflect.construct(\n              BuiltInHTMLElement, [],\n              /** @type {!Function} */ (this.constructor));\n        } catch (e) {\n          if (/Illegal constructor/i.test(e.message)) {\n            const className = this.constructor.name || 'the class';\n            e.message += ` - Did you register ${\n                className} in the custom elements registry?`;\n          }\n          throw e;\n        }\n      }\n      return reflect.construct(\n          BuiltInHTMLElement, [], /** @type {!Function} */ (this.constructor));\n    }\n  };\n  const shim = wrapperForTheName['HTMLElement'];\n  shim.prototype = BuiltInHTMLElement.prototype;\n  shim.prototype.constructor = shim;\n  shim.es5Shimmed = true;\n  Object.setPrototypeOf(shim, BuiltInHTMLElement);\n  patchedHTMLElement = shim;\n  return patchedHTMLElement;\n};\n\n\nlet applied = false;\n\n/**\n * Applies the shim globally if needed, overwriting the global HTMLElement.\n */\nexports.applyShim = () => {\n  if (!useGlobalsForDev && shimNotNeeded) {\n    return;\n  }\n  if (applied) {\n    return;\n  }\n  applied = true;\n  goog.global['HTMLElement'] = exports.getHTMLElement();\n};\n","// goog.FEATURESET_YEAR is a common way to opt into compiling for modern\n// browsers. We assume here that if you target FEATURESET_YEAR >= 2019 then\n// you're also going to be transpiling to ES2015 or greater.\nconst isModernFeaturesetYear = goog.FEATURESET_YEAR >= 2019;\n\n// A runtime check that looks for ES2015 classes.\n//\n// Will be true if and only if basic class syntax is not transpiled to ES5.\n// Unlike isModernFeaturesetYear this can't be evaluated at compile time.\nconst servingRawClasses = /^\\s*class\\s*\\{\\s*\\}\\s*$/.test(class {}.toString());\n\n/**\n * This constant should be true if and only if some code in the current\n * runtime environment has been transpiled to ES5.\n *\n * This file is written in TypeScript because ts_development_sources will\n * (in some configurations) transpile TypeScript but not JavaScript.\n * I'm not aware of any cases of the reverse.\n *\n * When compiled with a --browser_featureset_year of 2019 or greater (the first\n * featureset_year above 2012), this will be a compile-time constant, suitable\n * for dead code elimination.\n */\nexport const wasTranspiledToEs5: boolean =\n  isModernFeaturesetYear === true ? false : !servingRawClasses;\n","/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {IS_SERVERSIDE as NODE_MODE} from 'google3/javascript/lit/is_serverside';\n\n// Allows minifiers to rename references to globalThis\nconst global = goog.global;\n\n/**\n * Whether the current browser supports `adoptedStyleSheets`.\n */\nexport const supportsAdoptingStyleSheets: boolean =\n  // Safari got it in 16.4 which by go/bfy means 2024.\n  goog.FEATURESET_YEAR >= 2024 ||\n  (global.ShadowRoot &&\n    (global.ShadyCSS === undefined || global.ShadyCSS.nativeShadow) &&\n    'adoptedStyleSheets' in Document.prototype &&\n    'replace' in CSSStyleSheet.prototype);\n\n/**\n * A CSSResult or native CSSStyleSheet.\n *\n * In browsers that support constructible CSS style sheets, CSSStyleSheet\n * object can be used for styling along side CSSResult from the `css`\n * template tag.\n */\nexport type CSSResultOrNative = CSSResult | CSSStyleSheet;\n\nexport type CSSResultArray = Array<CSSResultOrNative | CSSResultArray>;\n\n/**\n * A single CSSResult, CSSStyleSheet, or an array or nested arrays of those.\n */\nexport type CSSResultGroup = CSSResultOrNative | CSSResultArray;\n\nconst constructionToken = Symbol();\n\nconst cssTagCache = new WeakMap<TemplateStringsArray, CSSStyleSheet>();\n\n/**\n * A container for a string of CSS text, that may be used to create a CSSStyleSheet.\n *\n * CSSResult is the return value of `css`-tagged template literals and\n * `unsafeCSS()`. In order to ensure that CSSResults are only created via the\n * `css` tag and `unsafeCSS()`, CSSResult cannot be constructed directly.\n */\nexport class CSSResult {\n  // This property needs to remain unminified.\n  ['_$cssResult$'] = true;\n  readonly cssText: string;\n  private _styleSheet?: CSSStyleSheet;\n  private _strings: TemplateStringsArray | undefined;\n\n  private constructor(\n    cssText: string,\n    strings: TemplateStringsArray | undefined,\n    safeToken: symbol\n  ) {\n    if (safeToken !== constructionToken) {\n      throw new Error(\n        'CSSResult is not constructable. Use `unsafeCSS` or `css` instead.'\n      );\n    }\n    this.cssText = cssText;\n    this._strings = strings;\n  }\n\n  private debugOnlyCachedStyleSheet: CSSStyleSheet|undefined = undefined;\n  // This is a getter so that it's lazy. In practice, this means stylesheets\n  // are not created until the first element instance is made.\n  get styleSheet(): CSSStyleSheet | undefined {\n    if (goog.DEBUG) {\n      // In prod mode, a CSSResult is immutable, and we never change a\n      // CSSStyleSheet's text\n      // In debug mode though, a hot module reload might update our cssText\n      // so we don't want to share a CSSStyleSheet across different CSSResults\n      if (supportsAdoptingStyleSheets &&\n          this.debugOnlyCachedStyleSheet === undefined) {\n        this.debugOnlyCachedStyleSheet = new CSSStyleSheet();\n        this.debugOnlyCachedStyleSheet.replaceSync(this.cssText);\n      }\n      return this.debugOnlyCachedStyleSheet;\n    }\n    // If `supportsAdoptingStyleSheets` is true then we assume CSSStyleSheet is\n    // constructable.\n    let styleSheet = this._styleSheet;\n    const strings = this._strings;\n    if (supportsAdoptingStyleSheets && styleSheet === undefined) {\n      const cacheable = strings !== undefined && strings.length === 1;\n      if (cacheable) {\n        styleSheet = cssTagCache.get(strings);\n      }\n      if (styleSheet === undefined) {\n        (this._styleSheet = styleSheet = new CSSStyleSheet()).replaceSync(\n          this.cssText\n        );\n        if (cacheable) {\n          cssTagCache.set(strings, styleSheet);\n        }\n      }\n    }\n    return styleSheet;\n  }\n\n  toString(): string {\n    return this.cssText;\n  }\n\n  /**\n   * Used in the generated output of lit_css_module to implement\n   * hot module reloading for css modules.\n   *\n   * Does nothing in production, and doesn't replace existing references\n   * unless the current browser supports adopting stylesheets (at time of\n   * writing that Chrome only).\n   */\n  notifyOnHotReplace(newVal: CSSResult) {\n    if (goog.DEBUG) {\n      const sheet = this.styleSheet;\n      // Only works with constructable stylesheets\n      if (!sheet) {\n        return;\n      }\n      (this as any).cssText = newVal.cssText;\n      sheet.replaceSync(newVal.cssText);\n    }\n  }\n}\n\ntype ConstructableCSSResult = CSSResult & {\n  new (\n    cssText: string,\n    strings: TemplateStringsArray | undefined,\n    safeToken: symbol\n  ): CSSResult;\n};\n\nconst textFromCSSResult = (value: CSSResultGroup | number) => {\n  // This property needs to remain unminified.\n  if ((value as CSSResult)['_$cssResult$'] === true) {\n    return (value as CSSResult).cssText;\n  } else if (typeof value === 'number') {\n    return value;\n  } else {\n    throw new Error(\n      `Value passed to 'css' function must be a 'css' function result: ` +\n        `${value}. Use 'unsafeCSS' to pass non-literal values, but take care ` +\n        `to ensure page security.`\n    );\n  }\n};\n\n/**\n * Wrap a value for interpolation in a {@linkcode css} tagged template literal.\n *\n * This is unsafe because untrusted CSS text can be used to phone home\n * or exfiltrate data to an attacker controlled site. Take care to only use\n * this with trusted input.\n */\nconst unsafeCSS = (value: unknown) =>\n  new (CSSResult as ConstructableCSSResult)(\n    typeof value === 'string' ? value : String(value),\n    undefined,\n    constructionToken\n  );\n\n/**\n * A template literal tag which can be used with LitElement's\n * {@linkcode LitElement.styles} property to set element styles.\n *\n * For security reasons, only literal string values and number may be used in\n * embedded expressions. To incorporate non-literal values {@linkcode unsafeCSS}\n * may be used inside an expression.\n */\nexport const css = (\n  strings: TemplateStringsArray,\n  ...values: (CSSResultGroup | number)[]\n): CSSResult => {\n  return {valueOf() {\n  const cssText =\n    strings.length === 1\n      ? strings[0]\n      : values.reduce(\n          (acc, v, idx) => acc + textFromCSSResult(v) + strings[idx + 1],\n          strings[0]\n        );\n  return new (CSSResult as ConstructableCSSResult)(\n    cssText,\n    strings,\n    constructionToken\n  )}}.valueOf();\n};\n\n/**\n * Applies the given styles to a `shadowRoot`. When Shadow DOM is\n * available but `adoptedStyleSheets` is not, styles are appended to the\n * `shadowRoot` to [mimic the native feature](https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/adoptedStyleSheets).\n * Note, when shimming is used, any styles that are subsequently placed into\n * the shadowRoot should be placed *before* any shimmed adopted styles. This\n * will match spec behavior that gives adopted sheets precedence over styles in\n * shadowRoot.\n */\nexport const adoptStyles = (\n  renderRoot: ShadowRoot,\n  styles: Array<CSSResultOrNative>\n) => {\n  if (supportsAdoptingStyleSheets) {\n    (renderRoot as ShadowRoot).adoptedStyleSheets = styles.map((s) =>\n      s instanceof CSSStyleSheet ? s : s.styleSheet!\n    );\n  } else {\n    for (const s of styles) {\n      const style = document.createElement('style');\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      const nonce = (global as any)['litNonce'];\n      if (nonce !== undefined) {\n        style.setAttribute('nonce', nonce);\n      }\n      style.textContent = (s as CSSResult).cssText;\n      renderRoot.appendChild(style);\n    }\n  }\n};\n\nconst cssResultFromStyleSheet = (sheet: CSSStyleSheet) => {\n  let cssText = '';\n  for (const rule of sheet.cssRules) {\n    cssText += rule.cssText;\n  }\n  return unsafeCSS(cssText);\n};\n\nexport const getCompatibleStyle =\n  supportsAdoptingStyleSheets ||\n  (NODE_MODE && global.CSSStyleSheet === undefined)\n    ? (s: CSSResultOrNative) => s\n    : (s: CSSResultOrNative) =>\n        s instanceof CSSStyleSheet ? cssResultFromStyleSheet(s) : s;\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * ReactiveElement patch to support browsers without native web components.\n *\n * This module should be used in addition to loading the web components\n * polyfills via @webcomponents/webcomponentjs. When using those polyfills\n * support for polyfilled Shadow DOM is automatic via the ShadyDOM polyfill, but\n * support for Shadow DOM like css scoping is opt-in. This module uses ShadyCSS\n * to scope styles defined via the `static styles` property.\n *\n * (COPYBARA: packageDocumentation)\n */\n\nexport {};\n\ninterface RenderOptions {\n  readonly renderBefore?: ChildNode | null;\n  scope?: string;\n}\n\nconst SCOPED = '__scoped';\n\ntype CSSResults = Array<{cssText: string} | CSSStyleSheet>;\n\ninterface PatchableReactiveElementConstructor {\n  [SCOPED]: boolean;\n  elementStyles: CSSResults;\n  shadowRootOptions: ShadowRootInit;\n  _$handlesPrepareStyles?: boolean;\n}\n\ninterface PatchableReactiveElement extends HTMLElement {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-misused-new\n  new (...args: any[]): PatchableReactiveElement;\n  constructor: PatchableReactiveElementConstructor;\n  connectedCallback(): void;\n  hasUpdated: boolean;\n  _$didUpdate(changedProperties: unknown): void;\n  createRenderRoot(): Element | ShadowRoot;\n  renderOptions: RenderOptions;\n}\n\n// Note, explicitly use `var` here so that this can be re-defined when\n// bundled.\n// eslint-disable-next-line no-var\nimport {DEV_MODE} from '@lit/reactive-element/dev-mode'; // COPYBARA: var\n\nconst polyfillSupport = ({\n  ReactiveElement,\n}: {\n  ReactiveElement: PatchableReactiveElement;\n}) => {\n  // polyfill-support is only needed if ShadyCSS or the ApplyShim is in use\n  // We test at the point of patching, which makes it safe to load\n  // webcomponentsjs and polyfill-support in either order\n  if (\n    globalThis.ShadyCSS === undefined ||\n    (globalThis.ShadyCSS.nativeShadow && !globalThis.ShadyCSS.ApplyShim)\n  ) {\n    return;\n  }\n\n  // console.log(\n  //   '%c Making ReactiveElement compatible with ShadyDOM/CSS.',\n  //   'color: lightgreen; font-style: italic'\n  // );\n\n  const elementProto = ReactiveElement.prototype;\n\n  // In noPatch mode, patch the ReactiveElement prototype so that no\n  // ReactiveElements must be wrapped.\n  if (\n    globalThis.ShadyDOM &&\n    globalThis.ShadyDOM.inUse &&\n    globalThis.ShadyDOM.noPatch === true\n  ) {\n    globalThis.ShadyDOM.patchElementProto(elementProto);\n  }\n\n  /**\n   * Patch to apply adoptedStyleSheets via ShadyCSS\n   */\n  const createRenderRoot = elementProto.createRenderRoot;\n  elementProto.createRenderRoot = function (this: PatchableReactiveElement) {\n    // Pass the scope to render options so that it gets to lit-html for proper\n    // scoping via ShadyCSS.\n    const name = this.localName;\n    // If using native Shadow DOM must adoptStyles normally,\n    // otherwise do nothing.\n    if (globalThis.ShadyCSS!.nativeShadow) {\n      return createRenderRoot.call(this);\n    } else {\n      if (!this.constructor.hasOwnProperty(SCOPED)) {\n        (this.constructor as PatchableReactiveElementConstructor)[SCOPED] =\n          true;\n        // Use ShadyCSS's `prepareAdoptedCssText` to shim adoptedStyleSheets.\n        const css = (\n          this.constructor as PatchableReactiveElementConstructor\n        ).elementStyles.map((v) =>\n          v instanceof CSSStyleSheet\n            ? Array.from(v.cssRules).reduce(\n                (a: string, r: CSSRule) => (a += r.cssText),\n                '',\n              )\n            : v.cssText,\n        );\n        globalThis.ShadyCSS?.ScopingShim?.prepareAdoptedCssText(css, name);\n        if (this.constructor._$handlesPrepareStyles === undefined) {\n          globalThis.ShadyCSS!.prepareTemplateStyles(\n            document.createElement('template'),\n            name,\n          );\n        }\n      }\n      return (\n        this.shadowRoot ??\n        this.attachShadow(\n          (this.constructor as PatchableReactiveElementConstructor)\n            .shadowRootOptions,\n        )\n      );\n    }\n  };\n\n  /**\n   * Patch connectedCallback to apply ShadyCSS custom properties shimming.\n   */\n  const connectedCallback = elementProto.connectedCallback;\n  elementProto.connectedCallback = function (this: PatchableReactiveElement) {\n    connectedCallback.call(this);\n    // Note, must do first update separately so that we're ensured\n    // that rendering has completed before calling this.\n    if (this.hasUpdated) {\n      globalThis.ShadyCSS!.styleElement(this);\n    }\n  };\n\n  /**\n   * Patch update to apply ShadyCSS custom properties shimming for first\n   * update.\n   */\n  const didUpdate = elementProto._$didUpdate;\n  elementProto._$didUpdate = function (\n    this: PatchableReactiveElement,\n    changedProperties: unknown,\n  ) {\n    // Note, must do first update here so rendering has completed before\n    // calling this and styles are correct by updated/firstUpdated.\n    if (!this.hasUpdated) {\n      globalThis.ShadyCSS!.styleElement(this);\n    }\n    didUpdate.call(this, changedProperties);\n  };\n};\n\nif (DEV_MODE) {\n  globalThis.reactiveElementPolyfillSupportDevMode ??= polyfillSupport;\n} else if (goog.FEATURESET_YEAR < 2020) {\n  globalThis.reactiveElementPolyfillSupport ??= polyfillSupport;\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport './polyfill-support';\nimport {noAwait} from 'google3/javascript/typescript/contrib/async';\nimport {objectProperty} from 'google3/third_party/javascript/closure/reflect/reflect';\n\n\n/**\n * Use this module if you want to create your own base class extending\n * {@link ReactiveElement}.\n * (COPYBARA: packageDocumentation)\n */\n\nimport {\n  getCompatibleStyle,\n  adoptStyles,\n  CSSResultGroup,\n  CSSResultOrNative,\n} from './css-tag.js';\nimport type {\n  ReactiveController,\n  ReactiveControllerHost,\n} from './reactive-controller.js';\n\n// So that custom elements work after compilation to es5.\nimport {getHTMLElement, applyShim} from 'google3/third_party/javascript/custom_elements/src/native-shim-impl';\nif (goog.TRUSTED_SITE) {\n  applyShim();\n}\nconst HTMLElement = getHTMLElement() as unknown as typeof globalThis.HTMLElement;\ntype HTMLElement = globalThis.HTMLElement;\n\n// In the Node build, this import will be injected by Rollup:\n// import {HTMLElement, customElements} from '@lit-labs/ssr-dom-shim';\n\nexport * from './css-tag.js';\nexport /* COPYBARA: type */ {\n  ReactiveController,\n  ReactiveControllerHost,\n} from './reactive-controller.js';\n\n/**\n * Removes the `readonly` modifier from properties in the union K.\n *\n * This is a safer way to cast a value to a type with a mutable version of a\n * readonly field, than casting to an interface with the field re-declared\n * because it preserves the type of all the fields and warns on typos.\n */\ntype Mutable<T, K extends keyof T> = Omit<T, K> & {\n  -readonly [P in keyof Pick<T, K>]: P extends K ? T[P] : never;\n};\n\n// TODO (justinfagnani): Add `hasOwn` here when we ship ES2022\nconst {\n  is,\n  defineProperty,\n  getOwnPropertyDescriptor,\n  getOwnPropertyNames,\n  getOwnPropertySymbols,\n  getPrototypeOf,\n} = Object;\n\nimport {IS_SERVERSIDE as NODE_MODE} from 'google3/javascript/lit/is_serverside';\n\n// Lets a minifier replace globalThis references with a minified name\nconst global = goog.global;\n\nif (NODE_MODE) {\n  global.customElements ??= customElements;\n}\n\nimport {DEV_MODE} from '@lit/reactive-element/dev-mode'; // COPYBARA: const\n\nlet issueWarning: (code: string, warning: string) => void;\n\nconst trustedTypes = (global as unknown as {trustedTypes?: {emptyScript: ''}})\n  .trustedTypes;\n\n// Temporary workaround for https://crbug.com/993268\n// Currently, any attribute starting with \"on\" is considered to be a\n// TrustedScript source. Such boolean attributes must be set to the equivalent\n// trusted emptyScript value.\nconst emptyStringForBooleanAttribute = trustedTypes\n  ? (trustedTypes.emptyScript as unknown as '')\n  : '';\n\nconst polyfillSupport = DEV_MODE\n  ? global.reactiveElementPolyfillSupportDevMode\n  : global.reactiveElementPolyfillSupport;\n\nif (DEV_MODE) {\n  // Ensure warnings are issued only 1x, even if multiple versions of Lit\n  // are loaded.\n  global.litIssuedWarnings ??= new Set();\n\n  /**\n   * Issue a warning if we haven't already, based either on `code` or `warning`.\n   * Warnings are disabled automatically only by `warning`; disabling via `code`\n   * can be done by users.\n   */\n  issueWarning = (code: string, warning: string) => {\n    warning += ` See https://lit.dev/msg/${code} for more information.`;\n    if (\n      !global.litIssuedWarnings!.has(warning) &&\n      !global.litIssuedWarnings!.has(code)\n    ) {\n      console.warn(warning);\n      global.litIssuedWarnings!.add(warning);\n    }\n  };\n\n  Promise.resolve().then(() => {\n\n    // Issue polyfill support warning.\n    if (global.ShadyDOM?.inUse && polyfillSupport === undefined) {\n      issueWarning(\n        'polyfill-support-missing',\n        `Shadow DOM is being polyfilled via \\`ShadyDOM\\` but ` +\n          `the \\`polyfill-support\\` module has not been loaded.`\n      );\n    }\n  });\n}\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ReactiveUnstable {\n  /**\n   * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n   * we will emit 'lit-debug' events to window, with live details about the update and render\n   * lifecycle. These can be useful for writing debug tooling and visualizations.\n   *\n   * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n   * making certain operations that are normally very cheap (like a no-op render) much slower,\n   * because we must copy data and dispatch events.\n   */\n  // eslint-disable-next-line @typescript-eslint/no-namespace\n  export namespace DebugLog {\n    export type Entry = Update;\n    export interface Update {\n      kind: 'update';\n    }\n  }\n}\n\ninterface DebugLoggingWindow {\n  // Even in dev mode, we generally don't want to emit these events, as that's\n  // another level of cost, so only emit them when DEV_MODE is true _and_ when\n  // window.emitLitDebugEvents is true.\n  emitLitDebugLogEvents?: boolean;\n}\n\n/**\n * Useful for visualizing and logging insights into what the Lit template system is doing.\n *\n * Compiled out of prod mode builds.\n */\nconst debugLogEvent = DEV_MODE\n  ? (event: ReactiveUnstable.DebugLog.Entry) => {\n      const shouldEmit = (global as unknown as DebugLoggingWindow)\n        .emitLitDebugLogEvents;\n      if (!shouldEmit) {\n        return;\n      }\n      global.dispatchEvent(\n        new CustomEvent<ReactiveUnstable.DebugLog.Entry>('lit-debug', {\n          detail: event,\n        })\n      );\n    }\n  : undefined;\n\n// COPYBARA: JSCompiler_renameProperty\n\n/**\n * Converts property values to and from attribute values.\n */\nexport interface ComplexAttributeConverter<Type = unknown, TypeHint = unknown> {\n  /**\n   * Called to convert an attribute value to a property\n   * value.\n   */\n  fromAttribute?(value: string | null, type?: TypeHint): Type;\n\n  /**\n   * Called to convert a property value to an attribute\n   * value.\n   *\n   * It returns unknown instead of string, to be compatible with\n   * https://github.com/WICG/trusted-types (and similar efforts).\n   */\n  toAttribute?(value: Type, type?: TypeHint): unknown;\n}\n\ntype AttributeConverter<Type = unknown, TypeHint = unknown> =\n  | ComplexAttributeConverter<Type>\n  | ((value: string | null, type?: TypeHint) => Type);\n\n/**\n * Defines options for a property accessor.\n */\nexport interface PropertyDeclaration<Type = unknown, TypeHint = unknown> {\n  /**\n   * When set to `true`, indicates the property is internal private state. The\n   * property should not be set by users. When using TypeScript, this property\n   * should be marked as `private` or `protected`, and it is also a common\n   * practice to use a leading `_` in the name. The property is not added to\n   * `observedAttributes`.\n   */\n  readonly state?: boolean;\n\n  /**\n   * Indicates how and whether the property becomes an observed attribute.\n   * If the value is `false`, the property is not added to `observedAttributes`.\n   * If true or absent, the lowercased property name is observed (e.g. `fooBar`\n   * becomes `foobar`). If a string, the string value is observed (e.g\n   * `attribute: 'foo-bar'`).\n   */\n  readonly attribute?: boolean | string;\n\n  /**\n   * Indicates the type of the property. This is used only as a hint for the\n   * `converter` to determine how to convert the attribute\n   * to/from a property.\n   */\n  readonly type?: TypeHint;\n\n  /**\n   * Indicates how to convert the attribute to/from a property. If this value\n   * is a function, it is used to convert the attribute value a the property\n   * value. If it's an object, it can have keys for `fromAttribute` and\n   * `toAttribute`. If no `toAttribute` function is provided and\n   * `reflect` is set to `true`, the property value is set directly to the\n   * attribute. A default `converter` is used if none is provided; it supports\n   * `Boolean`, `String`, `Number`, `Object`, and `Array`. Note,\n   * when a property changes and the converter is used to update the attribute,\n   * the property is never updated again as a result of the attribute changing,\n   * and vice versa.\n   */\n  readonly converter?: AttributeConverter<Type, TypeHint>;\n\n  /**\n   * Indicates if the property should reflect to an attribute.\n   * If `true`, when the property is set, the attribute is set using the\n   * attribute name determined according to the rules for the `attribute`\n   * property option and the value of the property converted using the rules\n   * from the `converter` property option.\n   */\n  readonly reflect?: boolean;\n\n  /**\n   * A function that indicates if a property should be considered changed when\n   * it is set. The function should take the `newValue` and `oldValue` and\n   * return `true` if an update should be requested.\n   */\n  hasChanged?(value: Type, oldValue: Type): boolean;\n\n  /**\n   * Indicates whether an accessor will be created for this property. By\n   * default, an accessor will be generated for this property that requests an\n   * update when set. If this flag is `true`, no accessor will be created, and\n   * it will be the user's responsibility to call\n   * `this.requestUpdate(propertyName, oldValue)` to request an update when\n   * the property changes.\n   */\n  readonly noAccessor?: boolean;\n\n  /**\n   * Whether this property is wrapping accessors. This is set by `@property`\n   * to control the initial value change and reflection logic.\n   *\n   * @internal\n   */\n  wrapped?: boolean;\n\n  /**\n   * When `true`, uses the initial value of the property as the default value,\n   * which changes how attributes are handled:\n   *  - The initial value does *not* reflect, even if the `reflect` option is `true`.\n   *    Subsequent changes to the property will reflect, even if they are equal to the\n   *     default value.\n   *  - When the attribute is removed, the property is set to the default value\n   *  - The initial value will not trigger an old value in the `changedProperties` map\n   *    argument to update lifecycle methods.\n   *\n   * When set, properties must be initialized, either with a field initializer, or an\n   * assignment in the constructor. Not initializing the property may lead to\n   * improper handling of subsequent property assignments.\n   *\n   * While this behavior is opt-in, most properties that reflect to attributes should\n   * use `useDefault: true` so that their initial values do not reflect.\n   */\n  useDefault?: boolean;\n}\n\n/**\n * Map of properties to PropertyDeclaration options. For each property an\n * accessor is made, and the property is processed according to the\n * PropertyDeclaration options.\n */\nexport interface PropertyDeclarations {\n  readonly [key: string]: PropertyDeclaration;\n}\n\ntype PropertyDeclarationMap = Map<PropertyKey, PropertyDeclaration>;\n\ntype AttributeMap = Map<string, PropertyKey>;\n\n/**\n * A Map of property keys to values.\n *\n * Takes an optional type parameter T, which when specified as a non-any,\n * non-unknown type, will make the Map more strongly-typed, associating the map\n * keys with their corresponding value type on T.\n *\n * Use `PropertyValues<this>` when overriding ReactiveElement.update() and\n * other lifecycle methods in order to get stronger type-checking on keys\n * and values.\n */\n// This type is conditional so that if the parameter T is not specified, or\n// is `any`, the type will include `Map<PropertyKey, unknown>`. Since T is not\n// given in the uses of PropertyValues in this file, all uses here fallback to\n// meaning `Map<PropertyKey, unknown>`, but if a developer uses\n// `PropertyValues<this>` (or any other value for T) they will get a\n// strongly-typed Map type.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type PropertyValues<T = any> = T extends object\n  ? PropertyValueMap<T>\n  : Map<PropertyKey, unknown>;\n\n/**\n * Do not use, instead prefer {@linkcode PropertyValues}.\n */\n// This type must be exported such that JavaScript generated by the Google\n// Closure Compiler can import a type reference.\nexport interface PropertyValueMap<T> extends Map<PropertyKey, unknown> {\n  get<K extends keyof T>(k: K): T[K] | undefined;\n  set<K extends keyof T>(key: K, value: T[K]): this;\n  has<K extends keyof T>(k: K): boolean;\n  delete<K extends keyof T>(k: K): boolean;\n}\n\nexport const defaultConverter: ComplexAttributeConverter = {\n  toAttribute(value: unknown, type?: unknown): unknown {\n    switch (type) {\n      case Boolean:\n        value = value ? emptyStringForBooleanAttribute : null;\n        break;\n      case Object:\n      case Array:\n        // if the value is `null` or `undefined` pass this through\n        // to allow removing/no change behavior.\n        value = value == null ? value : JSON.stringify(value);\n        break;\n    }\n    return value;\n  },\n\n  fromAttribute(value: string | null, type?: unknown) {\n    let fromValue: unknown = value;\n    switch (type) {\n      case Boolean:\n        fromValue = value !== null;\n        break;\n      case Number:\n        fromValue = value === null ? null : Number(value);\n        break;\n      case Object:\n      case Array:\n        // Do *not* generate exception when invalid JSON is set as elements\n        // don't normally complain on being mis-configured.\n        // TODO(sorvell): Do generate exception in *dev mode*.\n        try {\n          // Assert to adhere to Bazel's \"must type assert JSON parse\" rule.\n          fromValue = JSON.parse(value!) as unknown;\n        } catch (e) {\n          fromValue = null;\n        }\n        break;\n    }\n    return fromValue;\n  },\n};\n\nexport interface HasChanged {\n  (value: unknown, old: unknown): boolean;\n}\n\n/**\n * Change function that returns true if `value` is different from `oldValue`.\n * This method is used as the default for a property's `hasChanged` function.\n */\nexport const notEqual: HasChanged = (value: unknown, old: unknown): boolean =>\n  !is(value, old);\n\nconst defaultPropertyDeclaration: PropertyDeclaration = {\n  attribute: true,\n  type: String,\n  converter: defaultConverter,\n  reflect: false,\n  useDefault: false,\n  hasChanged: notEqual,\n};\n\n/**\n * A string representing one of the supported dev mode warning categories.\n */\nexport type WarningKind =\n  | 'change-in-update'\n  | 'migration'\n  | 'async-perform-update';\n\nexport type Initializer = (element: ReactiveElement) => void;\n\n// Temporary, until google3 is on TypeScript 5.2\ndeclare global {\n  interface SymbolConstructor {\n    readonly metadata: unique symbol;\n  }\n}\n\n// Ensure metadata is enabled. TypeScript does not polyfill\n// symbolMetadata, so we must ensure that it exists.\nconst symbolMetadata: unique symbol =\n    ({\n      valueOf() {\n        if (Symbol.metadata == null) {\n          (Symbol as {metadata: symbol}).metadata = Symbol('metadata');\n        }\n        return Symbol.metadata;\n      }\n    }).valueOf() as any;\n\nexport const litPropertyMetadata =\n    new WeakMap<object, Map<PropertyKey, PropertyDeclaration>>();\n\n/**\n * Base element class which manages element properties and attributes. When\n * properties change, the `update` method is asynchronously called. This method\n * should be supplied by subclasses to render updates as desired.\n * @noInheritDoc\n */\nexport abstract class ReactiveElement\n  // In the Node build, this `extends` clause will be substituted with\n  // `(globalThis.HTMLElement ?? HTMLElement)`.\n  //\n  // This way, we will first prefer any global `HTMLElement` polyfill that the\n  // user has assigned, and then fall back to the `HTMLElement` shim which has\n  // been imported (see note at the top of this file about how this import is\n  // generated by Rollup). Note that the `HTMLElement` variable has been\n  // shadowed by this import, so it no longer refers to the global.\n  extends HTMLElement\n  implements ReactiveControllerHost\n{\n  // Note: these are patched in only in DEV_MODE.\n  /**\n   * Read or set all the enabled warning categories for this class.\n   *\n   * This property is only used in development builds.\n   *\n   * @nocollapse\n   * @category dev-mode\n   */\n  static enabledWarnings?: WarningKind[];\n\n  /**\n   * Enable the given warning category for this class.\n   *\n   * This method only exists in development builds, so it should be accessed\n   * with a guard like:\n   *\n   * ```ts\n   * // Enable for all ReactiveElement subclasses\n   * ReactiveElement.enableWarning?.('migration');\n   *\n   * // Enable for only MyElement and subclasses\n   * MyElement.enableWarning?.('migration');\n   * ```\n   *\n   * @nocollapse\n   * @category dev-mode\n   */\n  static enableWarning?: (warningKind: WarningKind) => void;\n\n  /**\n   * Disable the given warning category for this class.\n   *\n   * This method only exists in development builds, so it should be accessed\n   * with a guard like:\n   *\n   * ```ts\n   * // Disable for all ReactiveElement subclasses\n   * ReactiveElement.disableWarning?.('migration');\n   *\n   * // Disable for only MyElement and subclasses\n   * MyElement.disableWarning?.('migration');\n   * ```\n   *\n   * @nocollapse\n   * @category dev-mode\n   */\n  static disableWarning?: (warningKind: WarningKind) => void;\n\n  /**\n   * Adds an initializer function to the class that is called during instance\n   * construction.\n   *\n   * This is useful for code that runs against a `ReactiveElement`\n   * subclass, such as a decorator, that needs to do work for each\n   * instance, such as setting up a `ReactiveController`.\n   *\n   * ```ts\n   * const myDecorator = (target: typeof ReactiveElement, key: string) => {\n   *   target.addInitializer((instance: ReactiveElement) => {\n   *     // This is run during construction of the element\n   *     new MyController(instance);\n   *   });\n   * }\n   * ```\n   *\n   * Decorating a field will then cause each instance to run an initializer\n   * that adds a controller:\n   *\n   * ```ts\n   * class MyElement extends LitElement {\n   *   @myDecorator foo;\n   * }\n   * ```\n   *\n   * Initializers are stored per-constructor. Adding an initializer to a\n   * subclass does not add it to a superclass. Since initializers are run in\n   * constructors, initializers will run in order of the class hierarchy,\n   * starting with superclasses and progressing to the instance's class.\n   *\n   * @nocollapse\n   */\n  static addInitializer(initializer: Initializer) {\n    this.__prepare();\n    (this._initializers ??= []).push(initializer);\n  }\n\n  static _initializers?: Initializer[];\n\n  /*\n   * Due to closure compiler ES6 compilation bugs, @nocollapse is required on\n   * all static methods and properties with initializers.  Reference:\n   * - https://github.com/google/closure-compiler/issues/1776\n   */\n\n  /**\n   * Maps attribute names to properties; for example `foobar` attribute to\n   * `fooBar` property. Created lazily on user subclasses when finalizing the\n   * class.\n   * @nocollapse\n   */\n  private static __attributeToPropertyMap: AttributeMap;\n\n  /**\n   * Marks class as having been finalized, which includes creating properties\n   * from `static properties`, but does *not* include all properties created\n   * from decorators.\n   * @nocollapse\n   */\n  protected static finalized: true | undefined;\n\n  /**\n   * Memoized list of all element properties, including any superclass\n   * properties. Created lazily on user subclasses when finalizing the class.\n   *\n   * @nocollapse\n   * @category properties\n   */\n  static elementProperties: PropertyDeclarationMap;\n\n  /**\n   * User-supplied object that maps property names to `PropertyDeclaration`\n   * objects containing options for configuring reactive properties. When\n   * a reactive property is set the element will update and render.\n   *\n   * By default properties are public fields, and as such, they should be\n   * considered as primarily settable by element users, either via attribute or\n   * the property itself.\n   *\n   * Generally, properties that are changed by the element should be private or\n   * protected fields and should use the `state: true` option. Properties\n   * marked as `state` do not reflect from the corresponding attribute\n   *\n   * However, sometimes element code does need to set a public property. This\n   * should typically only be done in response to user interaction, and an event\n   * should be fired informing the user; for example, a checkbox sets its\n   * `checked` property when clicked and fires a `changed` event. Mutating\n   * public properties should typically not be done for non-primitive (object or\n   * array) properties. In other cases when an element needs to manage state, a\n   * private property set with the `state: true` option should be used. When\n   * needed, state properties can be initialized via public properties to\n   * facilitate complex interactions.\n   * @nocollapse\n   * @category properties\n   */\n  static properties: PropertyDeclarations;\n\n  /**\n   * Memoized list of all element styles.\n   * Created lazily on user subclasses when finalizing the class.\n   * @nocollapse\n   * @category styles\n   */\n  static elementStyles: Array<CSSResultOrNative> = [];\n\n  /**\n   * Array of styles to apply to the element. The styles should be defined\n   * using the {@linkcode css} tag function, via constructible stylesheets, or\n   * imported from native CSS module scripts.\n   *\n   * Note on Content Security Policy:\n   *\n   * Element styles are implemented with `<style>` tags when the browser doesn't\n   * support adopted StyleSheets. To use such `<style>` tags with the style-src\n   * CSP directive, the style-src value must either include 'unsafe-inline' or\n   * `nonce-<base64-value>` with `<base64-value>` replaced be a server-generated\n   * nonce.\n   *\n   * To provide a nonce to use on generated `<style>` elements, set\n   * `window.litNonce` to a server-generated nonce in your page's HTML, before\n   * loading application code:\n   *\n   * ```html\n   * <script>\n   *   // Generated and unique per request:\n   *   window.litNonce = 'a1b2c3d4';\n   * \u003c/script>\n   * ```\n   * @nocollapse\n   * @category styles\n   */\n  static styles?: CSSResultGroup;\n\n  /**\n   * Returns a list of attributes corresponding to the registered properties.\n   * @nocollapse\n   * @category attributes\n   */\n  static get observedAttributes() {\n    // Ensure we've created all properties\n    this.finalize();\n    // this.__attributeToPropertyMap is only undefined after finalize() in\n    // ReactiveElement itself. ReactiveElement.observedAttributes is only\n    // accessed with ReactiveElement as the receiver when a subclass or mixin\n    // calls super.observedAttributes\n    return (\n      this.__attributeToPropertyMap && [...this.__attributeToPropertyMap.keys()]\n    );\n  }\n\n  private __instanceProperties?: PropertyValues = undefined;\n\n  /**\n   * Creates a property accessor on the element prototype if one does not exist\n   * and stores a {@linkcode PropertyDeclaration} for the property with the\n   * given options. The property setter calls the property's `hasChanged`\n   * property option or uses a strict identity check to determine whether or not\n   * to request an update.\n   *\n   * This method may be overridden to customize properties; however,\n   * when doing so, it's important to call `super.createProperty` to ensure\n   * the property is setup correctly. This method calls\n   * `getPropertyDescriptor` internally to get a descriptor to install.\n   * To customize what properties do when they are get or set, override\n   * `getPropertyDescriptor`. To customize the options for a property,\n   * implement `createProperty` like this:\n   *\n   * ```ts\n   * static createProperty(name, options) {\n   *   options = Object.assign(options, {myOption: true});\n   *   super.createProperty(name, options);\n   * }\n   * ```\n   *\n   * @nocollapse\n   * @category properties\n   */\n  static createProperty(\n    name: PropertyKey,\n    options: PropertyDeclaration = defaultPropertyDeclaration\n  ) {\n    // If this is a state property, force the attribute to false.\n    if (options.state) {\n      (options as Mutable<PropertyDeclaration, 'attribute'>).attribute = false;\n    }\n    this.__prepare();\n    // Whether this property is wrapping accessors.\n    // Helps control the initial value change and reflection logic.\n    if (this.prototype.hasOwnProperty(name)) {\n      options = Object.create(options);\n      options.wrapped = true;\n    }\n    this.elementProperties.set(name, options);\n    if (!options.noAccessor) {\n      const key = DEV_MODE\n        ? // Use Symbol.for in dev mode to make it easier to maintain state\n          // when doing HMR.\n          `${String(name)} (@property() cache)`\n        : Symbol();\n      const descriptor = this.getPropertyDescriptor(name, key, options);\n      if (descriptor !== undefined) {\n        defineProperty(this.prototype, name, descriptor);\n      }\n    }\n  }\n\n  /**\n   * Returns a property descriptor to be defined on the given named property.\n   * If no descriptor is returned, the property will not become an accessor.\n   * For example,\n   *\n   * ```ts\n   * class MyElement extends LitElement {\n   *   static getPropertyDescriptor(name, key, options) {\n   *     const defaultDescriptor =\n   *         super.getPropertyDescriptor(name, key, options);\n   *     const setter = defaultDescriptor.set;\n   *     return {\n   *       get: defaultDescriptor.get,\n   *       set(value) {\n   *         setter.call(this, value);\n   *         // custom action.\n   *       },\n   *       configurable: true,\n   *       enumerable: true\n   *     }\n   *   }\n   * }\n   * ```\n   *\n   * @nocollapse\n   * @category properties\n   */\n  protected static getPropertyDescriptor(\n    name: PropertyKey,\n    key: string | symbol,\n    options: PropertyDeclaration\n  ): PropertyDescriptor | undefined {\n    const {get, set} = getOwnPropertyDescriptor(this.prototype, name) ?? {\n      get(this: ReactiveElement) {\n        return this[key as keyof typeof this];\n      },\n      set(this: ReactiveElement, v: unknown) {\n        (this as unknown as Record<string | symbol, unknown>)[key] = v;\n      },\n    };\n    if (DEV_MODE && get == null) {\n      if ('value' in (getOwnPropertyDescriptor(this.prototype, name) ?? {})) {\n        throw new Error(\n          `Field ${JSON.stringify(String(name))} on ` +\n            `${this.name} was declared as a reactive property ` +\n            `but it's actually declared as a value on the prototype. ` +\n            `Usually this is due to using @property or @state on a method.`\n        );\n      }\n      issueWarning(\n        'reactive-property-without-getter',\n        `Field ${JSON.stringify(String(name))} on ` +\n          `${this.name} was declared as a reactive property ` +\n          `but it does not have a getter. This will be an error in a ` +\n          `future version of Lit.`\n      );\n    }\n    return {\n      get,\n      set(this: ReactiveElement, value: unknown) {\n        const oldValue = get?.call(this);\n        set?.call(this, value);\n        this.requestUpdate(name, oldValue, options);\n      },\n      configurable: true,\n      enumerable: true,\n    };\n  }\n\n  /**\n   * Returns the property options associated with the given property.\n   * These options are defined with a `PropertyDeclaration` via the `properties`\n   * object or the `@property` decorator and are registered in\n   * `createProperty(...)`.\n   *\n   * Note, this method should be considered \"final\" and not overridden. To\n   * customize the options for a given property, override\n   * {@linkcode createProperty}.\n   *\n   * @nocollapse\n   * @final\n   * @category properties\n   */\n  static getPropertyOptions(name: PropertyKey) {\n    return this.elementProperties.get(name) ?? defaultPropertyDeclaration;\n  }\n\n  // Temporary, until google3 is on TypeScript 5.2\n  declare static [symbolMetadata]: object & Record<PropertyKey, unknown>;\n\n  /**\n   * Initializes static own properties of the class used in bookkeeping\n   * for element properties, initializers, etc.\n   *\n   * Can be called multiple times by code that needs to ensure these\n   * properties exist before using them.\n   *\n   * This method ensures the superclass is finalized so that inherited\n   * property metadata can be copied down.\n   * @nocollapse\n   */\n  private static __prepare() {\n    if (\n      this.hasOwnProperty(objectProperty('elementProperties', this))\n    ) {\n      // Already prepared\n      return;\n    }\n    // Finalize any superclasses\n    const superCtor = getPrototypeOf(this) as typeof ReactiveElement;\n    superCtor.finalize();\n\n    // Create own set of initializers for this class if any exist on the\n    // superclass and copy them down. Note, for a small perf boost, avoid\n    // creating initializers unless needed.\n    if (superCtor._initializers !== undefined) {\n      this._initializers = [...superCtor._initializers];\n    }\n    // Initialize elementProperties from the superclass\n    this.elementProperties = new Map(superCtor.elementProperties);\n  }\n\n  /**\n   * Finishes setting up the class so that it's ready to be registered\n   * as a custom element and instantiated.\n   *\n   * This method is called by the ReactiveElement.observedAttributes getter.\n   * If you override the observedAttributes getter, you must either call\n   * super.observedAttributes to trigger finalization, or call finalize()\n   * yourself.\n   *\n   * @nocollapse\n   */\n  protected static finalize() {\n    oneTimeWork();\n    if (this.hasOwnProperty(objectProperty('finalized', this))) {\n      return;\n    }\n    this.finalized = true;\n    this.__prepare();\n\n    // Create properties from the static properties block:\n    if (this.hasOwnProperty(objectProperty('properties', this))) {\n      const props = this.properties;\n      const propKeys = [\n        ...getOwnPropertyNames(props),\n        ...getOwnPropertySymbols(props),\n      ] as Array<keyof typeof props>;\n      for (const p of propKeys) {\n        this.createProperty(p, props[p]);\n      }\n    }\n\n    // Create properties from standard decorator metadata:\n    const metadata = this[symbolMetadata];\n    if (metadata !== null) {\n      const properties = litPropertyMetadata.get(metadata);\n      if (properties !== undefined) {\n        for (const [p, options] of properties) {\n          this.elementProperties.set(p, options);\n        }\n      }\n    }\n\n    // Create the attribute-to-property map\n    this.__attributeToPropertyMap = new Map();\n    for (const [p, options] of this.elementProperties) {\n      const attr = this.__attributeNameForProperty(p, options);\n      if (attr !== undefined) {\n        this.__attributeToPropertyMap.set(attr, p);\n      }\n    }\n\n    this.elementStyles = this.finalizeStyles(this.styles);\n\n    if (DEV_MODE) {\n      if (this.hasOwnProperty('createProperty')) {\n        issueWarning(\n          'no-override-create-property',\n          'Overriding ReactiveElement.createProperty() is deprecated. ' +\n            'The override will not be called with standard decorators'\n        );\n      }\n      if (this.hasOwnProperty('getPropertyDescriptor')) {\n        issueWarning(\n          'no-override-get-property-descriptor',\n          'Overriding ReactiveElement.getPropertyDescriptor() is deprecated. ' +\n            'The override will not be called with standard decorators'\n        );\n      }\n    }\n  }\n\n  /**\n   * Options used when calling `attachShadow`. Set this property to customize\n   * the options for the shadowRoot; for example, to create a closed\n   * shadowRoot: `{mode: 'closed'}`.\n   *\n   * Note, these options are used in `createRenderRoot`. If this method\n   * is customized, options should be respected if possible.\n   * @nocollapse\n   * @category rendering\n   */\n  static shadowRootOptions: ShadowRootInit = {mode: 'open'};\n\n  /**\n   * Takes the styles the user supplied via the `static styles` property and\n   * returns the array of styles to apply to the element.\n   * Override this method to integrate into a style management system.\n   *\n   * Styles are deduplicated preserving the _last_ instance in the list. This\n   * is a performance optimization to avoid duplicated styles that can occur\n   * especially when composing via subclassing. The last item is kept to try\n   * to preserve the cascade order with the assumption that it's most important\n   * that last added styles override previous styles.\n   *\n   * @nocollapse\n   * @category styles\n   */\n  protected static finalizeStyles(\n    styles?: CSSResultGroup\n  ): Array<CSSResultOrNative> {\n    const elementStyles = [];\n    if (Array.isArray(styles)) {\n      // Dedupe the flattened array in reverse order to preserve the last items.\n      // Casting to Array<unknown> works around TS error that\n      // appears to come from trying to flatten a type CSSResultArray.\n      const set = new Set((styles as Array<unknown>).flat(Infinity).reverse());\n      // Then preserve original order by adding the set items in reverse order.\n      for (const s of set) {\n        elementStyles.unshift(getCompatibleStyle(s as CSSResultOrNative));\n      }\n    } else if (styles !== undefined) {\n      elementStyles.push(getCompatibleStyle(styles));\n    }\n    return elementStyles;\n  }\n\n  /**\n   * Node or ShadowRoot into which element DOM should be rendered. Defaults\n   * to an open shadowRoot.\n   * @category rendering\n   */\n  readonly renderRoot!: HTMLElement | DocumentFragment;\n\n  /**\n   * Returns the property name for the given attribute `name`.\n   * @nocollapse\n   */\n  private static __attributeNameForProperty(\n    name: PropertyKey,\n    options: PropertyDeclaration\n  ) {\n    const attribute = options.attribute;\n    return attribute === false\n      ? undefined\n      : typeof attribute === 'string'\n        ? attribute\n        : typeof name === 'string'\n          ? name.toLowerCase()\n          : undefined;\n  }\n\n  // Initialize to an unresolved Promise so we can make sure the element has\n  // connected before first update.\n  private __updatePromise!: Promise<boolean>;\n\n  /**\n   * True if there is a pending update as a result of calling `requestUpdate()`.\n   * Should only be read.\n   * @category updates\n   */\n  isUpdatePending = false;\n\n  /**\n   * Is set to `true` after the first update. The element code cannot assume\n   * that `renderRoot` exists before the element `hasUpdated`.\n   * @category updates\n   */\n  hasUpdated = false;\n\n  /**\n   * Map with keys for any properties that have changed since the last\n   * update cycle with previous values.\n   *\n   * @internal\n   */\n  _$changedProperties!: PropertyValues;\n\n  /**\n   * Records property default values when the\n   * `useDefault` option is used.\n   */\n  private __defaultValues?: Map<PropertyKey, unknown>;\n\n  /**\n   * Properties that should be reflected when updated.\n   */\n  private __reflectingProperties?: Set<PropertyKey>;\n\n  /**\n   * Name of currently reflecting property\n   */\n  private __reflectingProperty: PropertyKey | null = null;\n\n  /**\n   * Set of controllers.\n   */\n  private __controllers?: Set<ReactiveController>;\n\n  protected squelchUpdateErrorsDuringLit2Migration?: boolean;\n\n  constructor() {\n    super();\n    this.__initialize();\n  }\n\n  /**\n   * Internal only override point for customizing work done when elements\n   * are constructed.\n   */\n  private __initialize() {\n    this.__updatePromise = new Promise<boolean>(\n      (res) => (this.enableUpdating = res)\n    );\n    this._$changedProperties = new Map();\n    // This enqueues a microtask that must run before the first update, so it\n    // must be called before requestUpdate()\n    this.__saveInstanceProperties();\n    // ensures first update will be caught by an early access of\n    // `updateComplete`\n    this.requestUpdate();\n    (this.constructor as typeof ReactiveElement)._initializers?.forEach((i) =>\n      i(this)\n    );\n  }\n\n  /**\n   * Registers a `ReactiveController` to participate in the element's reactive\n   * update cycle. The element automatically calls into any registered\n   * controllers during its lifecycle callbacks.\n   *\n   * If the element is connected when `addController()` is called, the\n   * controller's `hostConnected()` callback will be immediately called.\n   * @category controllers\n   */\n  addController(controller: ReactiveController) {\n    (this.__controllers ??= new Set()).add(controller);\n    // If a controller is added after the element has been connected,\n    // call hostConnected. Note, re-using existence of `renderRoot` here\n    // (which is set in connectedCallback) to avoid the need to track a\n    // first connected state.\n    if (this.renderRoot !== undefined && this.isConnected) {\n      controller.hostConnected?.();\n    }\n  }\n\n  /**\n   * Removes a `ReactiveController` from the element.\n   * @category controllers\n   */\n  removeController(controller: ReactiveController) {\n    this.__controllers?.delete(controller);\n  }\n\n  /**\n   * Fixes any properties set on the instance before upgrade time.\n   * Otherwise these would shadow the accessor and break these properties.\n   * The properties are stored in a Map which is played back after the\n   * constructor runs.\n   */\n  private __saveInstanceProperties() {\n    const instanceProperties = new Map<PropertyKey, unknown>();\n    const elementProperties = (this.constructor as typeof ReactiveElement)\n      .elementProperties;\n    for (const p of elementProperties.keys() as IterableIterator<keyof this>) {\n      if (this.hasOwnProperty(p)) {\n        instanceProperties.set(p, this[p]);\n        delete this[p];\n      }\n    }\n    if (instanceProperties.size > 0) {\n      this.__instanceProperties = instanceProperties;\n    }\n  }\n\n  /**\n   * Returns the node into which the element should render and by default\n   * creates and returns an open shadowRoot. Implement to customize where the\n   * element's DOM is rendered. For example, to render into the element's\n   * childNodes, return `this`.\n   *\n   * @return Returns a node into which to render.\n   * @category rendering\n   */\n  protected createRenderRoot(): HTMLElement | DocumentFragment {\n    const renderRoot =\n      this.shadowRoot ??\n      this.attachShadow(\n        (this.constructor as typeof ReactiveElement).shadowRootOptions\n      );\n    adoptStyles(\n      renderRoot,\n      (this.constructor as typeof ReactiveElement).elementStyles\n    );\n    return renderRoot;\n  }\n\n  /**\n   * On first connection, creates the element's renderRoot, sets up\n   * element styling, and enables updating.\n   * @category lifecycle\n   */\n  connectedCallback() {\n    // Create renderRoot before controllers `hostConnected`\n    (this as Mutable<typeof this, 'renderRoot'>).renderRoot ??=\n      this.createRenderRoot();\n    this.enableUpdating(true);\n    this.__controllers?.forEach((c) => c.hostConnected?.());\n  }\n\n  /**\n   * Note, this method should be considered final and not overridden. It is\n   * overridden on the element instance with a function that triggers the first\n   * update.\n   * @category updates\n   */\n  protected enableUpdating(_requestedUpdate: boolean) {}\n\n  /**\n   * Allows for `super.disconnectedCallback()` in extensions while\n   * reserving the possibility of making non-breaking feature additions\n   * when disconnecting at some point in the future.\n   * @category lifecycle\n   */\n  disconnectedCallback() {\n    this.__controllers?.forEach((c) => c.hostDisconnected?.());\n  }\n\n  /**\n   * Synchronizes property values when attributes change.\n   *\n   * Specifically, when an attribute is set, the corresponding property is set.\n   * You should rarely need to implement this callback. If this method is\n   * overridden, `super.attributeChangedCallback(name, _old, value)` must be\n   * called.\n   *\n   * See [responding to attribute changes](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements#responding_to_attribute_changes)\n   * on MDN for more information about the `attributeChangedCallback`.\n   * @category attributes\n   */\n  attributeChangedCallback(\n    name: string,\n    _old: string | null,\n    value: string | null\n  ) {\n    this._$attributeToProperty(name, value);\n  }\n\n  private __propertyToAttribute(name: PropertyKey, value: unknown) {\n    const elemProperties: PropertyDeclarationMap = (\n      this.constructor as typeof ReactiveElement\n    ).elementProperties;\n    const options = elemProperties.get(name)!;\n    const attr = (\n      this.constructor as typeof ReactiveElement\n    ).__attributeNameForProperty(name, options);\n    if (attr !== undefined && options.reflect === true) {\n      const converter =\n        (options.converter as ComplexAttributeConverter)?.toAttribute !==\n        undefined\n          ? (options.converter as ComplexAttributeConverter)\n          : defaultConverter;\n      const attrValue = converter.toAttribute!(value, options.type);\n      if (\n        DEV_MODE &&\n        (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n          'migration'\n        ) &&\n        attrValue === undefined\n      ) {\n        issueWarning(\n          'undefined-attribute-value',\n          `The attribute value for the ${name as string} property is ` +\n            `undefined on element ${this.localName}. The attribute will be ` +\n            `removed, but in the previous version of \\`ReactiveElement\\`, ` +\n            `the attribute would not have changed.`\n        );\n      }\n      // Track if the property is being reflected to avoid\n      // setting the property again via `attributeChangedCallback`. Note:\n      // 1. this takes advantage of the fact that the callback is synchronous.\n      // 2. will behave incorrectly if multiple attributes are in the reaction\n      // stack at time of calling. However, since we process attributes\n      // in `update` this should not be possible (or an extreme corner case\n      // that we'd like to discover).\n      // mark state reflecting\n      this.__reflectingProperty = name;\n      if (attrValue == null) {\n        this.removeAttribute(attr);\n      } else {\n        this.setAttribute(attr, attrValue as string);\n      }\n      // mark state not reflecting\n      this.__reflectingProperty = null;\n    }\n  }\n\n  /** @internal */\n  _$attributeToProperty(name: string, value: string | null) {\n    const ctor = this.constructor as typeof ReactiveElement;\n    // Note, hint this as an `AttributeMap` so closure clearly understands\n    // the type; it has issues with tracking types through statics\n    const propName = (ctor.__attributeToPropertyMap as AttributeMap).get(name);\n    // Use tracking info to avoid reflecting a property value to an attribute\n    // if it was just set because the attribute changed.\n    if (propName !== undefined && this.__reflectingProperty !== propName) {\n      const options = ctor.getPropertyOptions(propName);\n      const converter =\n        typeof options.converter === 'function'\n          ? {fromAttribute: options.converter}\n          : options.converter?.fromAttribute !== undefined\n            ? options.converter\n            : defaultConverter;\n      // mark state reflecting\n      this.__reflectingProperty = propName;\n      const converterResult = converter.fromAttribute!(value, options.type);\n      this[propName as keyof this] =\n        converterResult ??\n        this.__defaultValues?.get(propName) ??\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        converterResult as any;\n      // mark state not reflecting\n      this.__reflectingProperty = null;\n    }\n  }\n\n  /**\n   * Requests an update which is processed asynchronously. This should be called\n   * when an element should update based on some state not triggered by setting\n   * a reactive property. In this case, pass no arguments. It should also be\n   * called when manually implementing a property setter. In this case, pass the\n   * property `name` and `oldValue` to ensure that any configured property\n   * options are honored.\n   *\n   * @param name name of requesting property\n   * @param oldValue old value of requesting property\n   * @param options property options to use instead of the previously\n   *     configured options\n   * @category updates\n   */\n  requestUpdate(\n    name?: PropertyKey,\n    oldValue?: unknown,\n    options?: PropertyDeclaration\n  ): void {\n    // If we have a property key, perform property update steps.\n    if (name !== undefined) {\n      if (DEV_MODE && (name as unknown) instanceof Event) {\n        issueWarning(\n          ``,\n          `The requestUpdate() method was called with an Event as the property name. This is probably a mistake caused by binding this.requestUpdate as an event listener. Instead bind a function that will call it with no arguments: () => this.requestUpdate()`\n        );\n      }\n      const ctor = this.constructor as typeof ReactiveElement;\n      const newValue = this[name as keyof this];\n      options ??= ctor.getPropertyOptions(name);\n      const changed =\n        (options.hasChanged ?? notEqual)(newValue, oldValue) ||\n        // When there is no change, check a corner case that can occur when\n        // 1. there's a initial value which was not reflected\n        // 2. the property is subsequently set to this value.\n        // For example, `prop: {useDefault: true, reflect: true}`\n        // and el.prop = 'foo'. This should be considered a change if the\n        // attribute is not set because we will now reflect the property to the attribute.\n        (options.useDefault &&\n          options.reflect &&\n          newValue === this.__defaultValues?.get(name) &&\n          !this.hasAttribute(ctor.__attributeNameForProperty(name, options)!));\n      if (changed) {\n        this._$changeProperty(name, oldValue, options);\n      } else {\n        // Abort the request if the property should not be considered changed.\n        return;\n      }\n    }\n    if (this.isUpdatePending === false) {\n      this.__updatePromise = this.__enqueueUpdate();\n    }\n  }\n\n  /**\n   * @internal\n   */\n  _$changeProperty(\n    name: PropertyKey,\n    oldValue: unknown,\n    {useDefault, reflect, wrapped}: PropertyDeclaration,\n    initializeValue?: unknown\n  ) {\n    // Record default value when useDefault is used. This allows us to\n    // restore this value when the attribute is removed.\n    if (useDefault && !(this.__defaultValues ??= new Map()).has(name)) {\n      this.__defaultValues.set(\n        name,\n        initializeValue ?? oldValue ?? this[name as keyof this]\n      );\n      // if this is not wrapping an accessor, it must be an initial setting\n      // and in this case we do not want to record the change or reflect.\n      if (wrapped !== true || initializeValue !== undefined) {\n        return;\n      }\n    }\n    // TODO (justinfagnani): Create a benchmark of Map.has() + Map.set(\n    // vs just Map.set()\n    if (!this._$changedProperties.has(name)) {\n      // On the initial change, the old value should be `undefined`, except\n      // with `useDefault`\n      if (!this.hasUpdated && !useDefault) {\n        oldValue = undefined;\n      }\n      this._$changedProperties.set(name, oldValue);\n    }\n    // Add to reflecting properties set.\n    // Note, it's important that every change has a chance to add the\n    // property to `__reflectingProperties`. This ensures setting\n    // attribute + property reflects correctly.\n    if (reflect === true && this.__reflectingProperty !== name) {\n      (this.__reflectingProperties ??= new Set<PropertyKey>()).add(name);\n    }\n  }\n\n  /**\n   * Sets up the element to asynchronously update.\n   */\n  private async __enqueueUpdate() {\n    this.isUpdatePending = true;\n    try {\n      // Ensure any previous update has resolved before updating.\n      // This `await` also ensures that property changes are batched.\n      await this.__updatePromise;\n    } catch (e) {\n      // Refire any previous errors async so they do not disrupt the update\n      // cycle. Errors are refired so developers have a chance to observe\n      // them, and this can be done by implementing\n      // `window.onunhandledrejection`.\n      if (!this.squelchUpdateErrorsDuringLit2Migration) {\n        noAwait(Promise.reject(e));\n      }\n    }\n    const result = this.scheduleUpdate();\n    // If `scheduleUpdate` returns a Promise, we await it. This is done to\n    // enable coordinating updates with a scheduler. Note, the result is\n    // checked to avoid delaying an additional microtask unless we need to.\n    if (result != null) {\n      await result;\n    }\n    return !this.isUpdatePending;\n  }\n\n  /**\n   * Schedules an element update. You can override this method to change the\n   * timing of updates by returning a Promise. The update will await the\n   * returned Promise, and you should resolve the Promise to allow the update\n   * to proceed. If this method is overridden, `super.scheduleUpdate()`\n   * must be called.\n   *\n   * For instance, to schedule updates to occur just before the next frame:\n   *\n   * ```ts\n   * override protected async scheduleUpdate(): Promise<unknown> {\n   *   await new Promise((resolve) => requestAnimationFrame(() => resolve()));\n   *   super.scheduleUpdate();\n   * }\n   * ```\n   * @category updates\n   */\n  protected scheduleUpdate(): void | Promise<unknown> {\n    const result = this.performUpdate();\n    if (\n      DEV_MODE &&\n      (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n        'async-perform-update'\n      ) &&\n      typeof (result as unknown as Promise<unknown> | undefined)?.then ===\n        'function'\n    ) {\n      issueWarning(\n        'async-perform-update',\n        `Element ${this.localName} returned a Promise from performUpdate(). ` +\n          `This behavior is deprecated and will be removed in a future ` +\n          `version of ReactiveElement.`\n      );\n    }\n    return result;\n  }\n\n  /**\n   * Performs an element update. Note, if an exception is thrown during the\n   * update, `firstUpdated` and `updated` will not be called.\n   *\n   * Call `performUpdate()` to immediately process a pending update. This should\n   * generally not be needed, but it can be done in rare cases when you need to\n   * update synchronously.\n   *\n   * @category updates\n   */\n  protected performUpdate(): void {\n    // Abort any update if one is not pending when this is called.\n    // This can happen if `performUpdate` is called early to \"flush\"\n    // the update.\n    if (!this.isUpdatePending) {\n      return;\n    }\n    debugLogEvent != null && debugLogEvent?.({kind: 'update'});\n    if (!this.hasUpdated) {\n      // Create renderRoot before first update. This occurs in `connectedCallback`\n      // but is done here to support out of tree calls to `enableUpdating`/`performUpdate`.\n      (this as Mutable<typeof this, 'renderRoot'>).renderRoot ??=\n        this.createRenderRoot();\n      if (DEV_MODE) {\n        // Produce warning if any reactive properties on the prototype are\n        // shadowed by class fields. Instance fields set before upgrade are\n        // deleted by this point, so any own property is caused by class field\n        // initialization in the constructor.\n        const ctor = this.constructor as typeof ReactiveElement;\n        const shadowedProperties = [...ctor.elementProperties.keys()].filter(\n          (p) => this.hasOwnProperty(p) && p in getPrototypeOf(this)\n        );\n        if (shadowedProperties.length &&\n            !(this as any).__allowInstanceProperties) {\n          throw new Error(\n            `The following properties on element ${this.localName} will not ` +\n              `trigger updates as expected because they are set using class ` +\n              `fields: ${shadowedProperties.join(', ')}. ` +\n              `Native class fields and some compiled output will overwrite ` +\n              `accessors used for detecting changes. See ` +\n              `https://lit.dev/msg/class-field-shadowing ` +\n              `for more information.`\n          );\n        }\n      }\n      // Mixin instance properties once, if they exist.\n      if (this.__instanceProperties) {\n        // TODO (justinfagnani): should we use the stored value? Could a new value\n        // have been set since we stored the own property value?\n        for (const [p, value] of this.__instanceProperties) {\n          this[p as keyof this] = value as this[keyof this];\n        }\n        this.__instanceProperties = undefined;\n      }\n      // Trigger initial value reflection and populate the initial\n      // `changedProperties` map, but only for the case of properties created\n      // via `createProperty` on accessors, which will not have already\n      // populated the `changedProperties` map since they are not set.\n      // We can't know if these accessors had initializers, so we just set\n      // them anyway - a difference from experimental decorators on fields and\n      // standard decorators on auto-accessors.\n      // For context see:\n      // https://github.com/lit/lit/pull/4183#issuecomment-1711959635\n      const elementProperties = (this.constructor as typeof ReactiveElement)\n        .elementProperties;\n      if (elementProperties.size > 0) {\n        for (const [p, options] of elementProperties) {\n          const {wrapped} = options;\n          const value = this[p as keyof this];\n          if (\n            wrapped === true &&\n            !this._$changedProperties.has(p) &&\n            value !== undefined\n          ) {\n            this._$changeProperty(p, undefined, options, value);\n          }\n        }\n      }\n    }\n    let shouldUpdate = false;\n    const changedProperties = this._$changedProperties;\n    try {\n      shouldUpdate = this.shouldUpdate(changedProperties);\n      if (shouldUpdate) {\n        this.willUpdate(changedProperties);\n        this.__controllers?.forEach((c) => c.hostUpdate?.());\n        this.update(changedProperties);\n      } else {\n        this.__markUpdated();\n      }\n    } catch (e) {\n      // Prevent `firstUpdated` and `updated` from running when there's an\n      // update exception.\n      shouldUpdate = false;\n      // Ensure element can accept additional updates after an exception.\n      this.__markUpdated();\n      throw e;\n    }\n    // The update is no longer considered pending and further updates are now allowed.\n    if (shouldUpdate) {\n      this._$didUpdate(changedProperties);\n    }\n  }\n\n  /**\n   * Invoked before `update()` to compute values needed during the update.\n   *\n   * Implement `willUpdate` to compute property values that depend on other\n   * properties and are used in the rest of the update process.\n   *\n   * ```ts\n   * willUpdate(changedProperties) {\n   *   // only need to check changed properties for an expensive computation.\n   *   if (changedProperties.has('firstName') || changedProperties.has('lastName')) {\n   *     this.sha = computeSHA(`${this.firstName} ${this.lastName}`);\n   *   }\n   * }\n   *\n   * render() {\n   *   return html`SHA: ${this.sha}`;\n   * }\n   * ```\n   *\n   * @category updates\n   */\n  protected willUpdate(_changedProperties: PropertyValues): void {}\n\n  // Note, this is an override point for polyfill-support.\n  // @internal\n  _$didUpdate(changedProperties: PropertyValues) {\n    this.__controllers?.forEach((c) => c.hostUpdated?.());\n    if (!this.hasUpdated) {\n      this.hasUpdated = true;\n      this.firstUpdated(changedProperties);\n    }\n    this.updated(changedProperties);\n    if (\n      DEV_MODE &&\n      this.isUpdatePending &&\n      (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n        'change-in-update'\n      )\n    ) {\n      issueWarning(\n        'change-in-update',\n        `Element ${this.localName} scheduled an update ` +\n          `(generally because a property was set) ` +\n          `after an update completed, causing a new update to be scheduled. ` +\n          `This is inefficient and should be avoided unless the next update ` +\n          `can only be scheduled as a side effect of the previous update.`\n      );\n    }\n  }\n\n  private __markUpdated() {\n    this._$changedProperties = new Map();\n    this.isUpdatePending = false;\n  }\n\n  /**\n   * Returns a Promise that resolves when the element has completed updating.\n   * The Promise value is a boolean that is `true` if the element completed the\n   * update without triggering another update. The Promise result is `false` if\n   * a property was set inside `updated()`. If the Promise is rejected, an\n   * exception was thrown during the update.\n   *\n   * To await additional asynchronous work, override the `getUpdateComplete`\n   * method. For example, it is sometimes useful to await a rendered element\n   * before fulfilling this Promise. To do this, first await\n   * `super.getUpdateComplete()`, then any subsequent state.\n   *\n   * @return A promise of a boolean that resolves to true if the update completed\n   *     without triggering another update.\n   * @category updates\n   */\n  get updateComplete(): Promise<boolean> {\n    return this.getUpdateComplete();\n  }\n\n  /**\n   * Override point for the `updateComplete` promise.\n   *\n   * It is not safe to override the `updateComplete` getter directly due to a\n   * limitation in TypeScript which means it is not possible to call a\n   * superclass getter (e.g. `super.updateComplete.then(...)`) when the target\n   * language is ES5 (https://github.com/microsoft/TypeScript/issues/338).\n   * This method should be overridden instead. For example:\n   *\n   * ```ts\n   * class MyElement extends LitElement {\n   *   override async getUpdateComplete() {\n   *     const result = await super.getUpdateComplete();\n   *     await this._myChild.updateComplete;\n   *     return result;\n   *   }\n   * }\n   * ```\n   *\n   * @return A promise of a boolean that resolves to true if the update completed\n   *     without triggering another update.\n   * @category updates\n   */\n  protected getUpdateComplete(): Promise<boolean> {\n    return this.__updatePromise;\n  }\n\n  /**\n   * Controls whether or not `update()` should be called when the element requests\n   * an update. By default, this method always returns `true`, but this can be\n   * customized to control when to update.\n   *\n   * @param _changedProperties Map of changed properties with old values\n   * @category updates\n   */\n  protected shouldUpdate(_changedProperties: PropertyValues): boolean {\n    return true;\n  }\n\n  /**\n   * Updates the element. This method reflects property values to attributes.\n   * It can be overridden to render and keep updated element DOM.\n   * Setting properties inside this method will *not* trigger\n   * another update.\n   *\n   * @param _changedProperties Map of changed properties with old values\n   * @category updates\n   */\n  protected update(_changedProperties: PropertyValues) {\n    // The forEach() expression will only run when __reflectingProperties is\n    // defined, and it returns undefined, setting __reflectingProperties to\n    // undefined\n    this.__reflectingProperties &&= this.__reflectingProperties.forEach((p) =>\n      this.__propertyToAttribute(p, this[p as keyof this])\n    ) as undefined;\n    this.__markUpdated();\n  }\n\n  /**\n   * Invoked whenever the element is updated. Implement to perform\n   * post-updating tasks via DOM APIs, for example, focusing an element.\n   *\n   * Setting properties inside this method will trigger the element to update\n   * again after this update cycle completes.\n   *\n   * @param _changedProperties Map of changed properties with old values\n   * @category updates\n   */\n  protected updated(_changedProperties: PropertyValues) {}\n\n  /**\n   * Invoked when the element is first updated. Implement to perform one time\n   * work on the element after update.\n   *\n   * ```ts\n   * firstUpdated() {\n   *   this.renderRoot.getElementById('my-text-area').focus();\n   * }\n   * ```\n   *\n   * Setting properties inside this method will trigger the element to update\n   * again after this update cycle completes.\n   *\n   * @param _changedProperties Map of changed properties with old values\n   * @category updates\n   */\n  protected firstUpdated(_changedProperties: PropertyValues) {}\n}\n// Assigned here to work around a jscompiler bug with static fields\n// when compiling to ES5.\n// https://github.com/google/closure-compiler/issues/3177\n(ReactiveElement as unknown as Record<string, unknown>)[\n  objectProperty('elementProperties', ReactiveElement)\n] = new Map();\n(ReactiveElement as unknown as Record<string, unknown>)[\n  objectProperty('finalized', ReactiveElement)\n] = new Map();\n\n// Apply polyfills if available\nif (goog.FEATURESET_YEAR < 2020) {\n  polyfillSupport?.({ReactiveElement});\n}\n\n// Dev mode warnings...\nif (DEV_MODE) {\n  // Default warning set.\n  ReactiveElement.enabledWarnings = [\n    'change-in-update',\n    'async-perform-update',\n  ];\n  const ensureOwnWarnings = function (ctor: typeof ReactiveElement) {\n    if (\n      !ctor.hasOwnProperty(objectProperty('enabledWarnings', ctor))\n    ) {\n      ctor.enabledWarnings = ctor.enabledWarnings!.slice();\n    }\n  };\n  ReactiveElement.enableWarning = function (\n    this: typeof ReactiveElement,\n    warning: WarningKind\n  ) {\n    ensureOwnWarnings(this);\n    if (!this.enabledWarnings!.includes(warning)) {\n      this.enabledWarnings!.push(warning);\n    }\n  };\n  ReactiveElement.disableWarning = function (\n    this: typeof ReactiveElement,\n    warning: WarningKind\n  ) {\n    ensureOwnWarnings(this);\n    const i = this.enabledWarnings!.indexOf(warning);\n    if (i >= 0) {\n      this.enabledWarnings!.splice(i, 1);\n    }\n  };\n}\n\nlet oneTimeWork = () => {\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for ReactiveElement usage.\n(global.reactiveElementVersions ??= []).push('2.0.4');\nif (DEV_MODE && global.reactiveElementVersions.length > 1) {\n  Promise.resolve().then(() => {\n    issueWarning!(\n      'multiple-versions',\n      `Multiple versions of Lit loaded. Loading multiple versions ` +\n        `is not recommended.`\n    );\n  });\n}\noneTimeWork = () => {};\n};\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/*\n * IMPORTANT: For compatibility with tsickle and the Closure JS compiler, all\n * property decorators (but not class decorators) in this file that have\n * an @ExportDecoratedItems annotation must be defined as a regular function,\n * not an arrow function.\n */\n\nimport {\n  type PropertyDeclaration,\n  type ReactiveElement,\n  defaultConverter,\n  litPropertyMetadata,\n  notEqual,\n} from '../reactive-element.js';\nimport type {Interface} from './base.js';\n\nimport {DEV_MODE} from '@lit/reactive-element/dev-mode'; // COPYBARA: const\n\nlet issueWarning: (code: string, warning: string) => void;\n\nif (DEV_MODE) {\n  // Ensure warnings are issued only 1x, even if multiple versions of Lit\n  // are loaded.\n  globalThis.litIssuedWarnings ??= new Set();\n\n  /**\n   * Issue a warning if we haven't already, based either on `code` or `warning`.\n   * Warnings are disabled automatically only by `warning`; disabling via `code`\n   * can be done by users.\n   */\n  issueWarning = (code: string, warning: string) => {\n    warning += ` See https://lit.dev/msg/${code} for more information.`;\n    if (\n      !globalThis.litIssuedWarnings!.has(warning) &&\n      !globalThis.litIssuedWarnings!.has(code)\n    ) {\n      // Work around a jsconformance rule that fails when we might be\n      // logging outside of DEV_MODE, but this log is kosher because it is\n      // only in DEV_MODE.\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      const cons = (globalThis as any)['cons' + 'ole'] as {\n        warn(...args: unknown[]): void;\n      };\n      cons.warn(warning);\n      globalThis.litIssuedWarnings!.add(warning);\n    }\n  };\n}\n\n// Overloads for property decorator so that TypeScript can infer the correct\n// return type when a decorator is used as an accessor decorator or a setter\n// decorator.\nexport type PropertyDecorator = {\n  // accessor decorator signature\n  <C extends Interface<ReactiveElement>, V>(\n    target: ClassAccessorDecoratorTarget<C, V>,\n    context: ClassAccessorDecoratorContext<C, V>\n  ): ClassAccessorDecoratorResult<C, V>;\n\n  // setter decorator signature\n  <C extends Interface<ReactiveElement>, V>(\n    target: (value: V) => void,\n    context: ClassSetterDecoratorContext<C, V>\n  ): (this: C, value: V) => void;\n\n  // legacy decorator signature\n  (\n    protoOrDescriptor: Object,\n    name: PropertyKey,\n    descriptor?: PropertyDescriptor\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  ): any;\n};\n\nconst legacyProperty = (\n  options: PropertyDeclaration | undefined,\n  proto: Object,\n  name: PropertyKey\n) => {\n  const hasOwnProperty = proto.hasOwnProperty(name);\n  (proto.constructor as typeof ReactiveElement).createProperty(name, options);\n  // For accessors (which have a descriptor on the prototype) we need to\n  // return a descriptor, otherwise TypeScript overwrites the descriptor we\n  // define in createProperty() with the original descriptor. We don't do this\n  // for fields, which don't have a descriptor, because this could overwrite\n  // descriptor defined by other decorators.\n  return hasOwnProperty\n    ? Object.getOwnPropertyDescriptor(proto, name)\n    : undefined;\n};\n\n// This is duplicated from a similar variable in reactive-element.ts, but\n// actually makes sense to have this default defined with the decorator, so\n// that different decorators could have different defaults.\nconst defaultPropertyDeclaration: PropertyDeclaration = {\n  attribute: true,\n  type: String,\n  converter: defaultConverter,\n  reflect: false,\n  hasChanged: notEqual,\n};\n\n// Temporary type, until google3 is on TypeScript 5.2\ntype StandardPropertyContext<C, V> = (\n  | ClassAccessorDecoratorContext<C, V>\n  | ClassSetterDecoratorContext<C, V>\n) & {metadata: object};\n\n/**\n * Wraps a class accessor or setter so that `requestUpdate()` is called with the\n * property name and old value when the accessor is set.\n */\nexport const standardProperty = <C extends Interface<ReactiveElement>, V>(\n  options: PropertyDeclaration = defaultPropertyDeclaration,\n  target: ClassAccessorDecoratorTarget<C, V> | ((value: V) => void),\n  context: StandardPropertyContext<C, V>\n): ClassAccessorDecoratorResult<C, V> | ((this: C, value: V) => void) => {\n  const {kind, metadata} = context;\n\n  if (DEV_MODE && metadata == null) {\n    issueWarning(\n      'missing-class-metadata',\n      `The class ${target} is missing decorator metadata. This ` +\n        `could mean that you're using a compiler that supports decorators ` +\n        `but doesn't support decorator metadata, such as TypeScript 5.1. ` +\n        `Please update your compiler.`\n    );\n  }\n\n  // Store the property options\n  let properties = litPropertyMetadata.get(metadata);\n  if (properties === undefined) {\n    litPropertyMetadata.set(metadata, (properties = new Map()));\n  }\n  if (kind === 'setter') {\n    options = Object.create(options);\n    options.wrapped = true;\n  }\n  properties.set(context.name, options);\n\n  if (kind === 'accessor') {\n    // Standard decorators cannot dynamically modify the class, so we can't\n    // replace a field with accessors. The user must use the new `accessor`\n    // keyword instead.\n    const {name} = context;\n    return {\n      set(this: ReactiveElement, v: V) {\n        const oldValue = (\n          target as ClassAccessorDecoratorTarget<C, V>\n        ).get.call(this as unknown as C);\n        (target as ClassAccessorDecoratorTarget<C, V>).set.call(\n          this as unknown as C,\n          v\n        );\n        this.requestUpdate(name, oldValue, options);\n      },\n      init(this: ReactiveElement, v: V): V {\n        if (v !== undefined) {\n          this._$changeProperty(name, undefined, options, v);\n        }\n        return v;\n      },\n    } as unknown as ClassAccessorDecoratorResult<C, V>;\n  } else if (kind === 'setter') {\n    const {name} = context;\n    return function (this: ReactiveElement, value: V) {\n      const oldValue = this[name as keyof ReactiveElement];\n      (target as (value: V) => void).call(this, value);\n      this.requestUpdate(name, oldValue, options);\n    } as unknown as (this: C, value: V) => void;\n  }\n  throw new Error(`Unsupported decorator location: ${kind}`);\n};\n\n/**\n * A class field or accessor decorator which creates a reactive property that\n * reflects a corresponding attribute value. When a decorated property is set\n * the element will update and render. A {@linkcode PropertyDeclaration} may\n * optionally be supplied to configure property features.\n *\n * This decorator should only be used for public fields. As public fields,\n * properties should be considered as primarily settable by element users,\n * either via attribute or the property itself.\n *\n * Generally, properties that are changed by the element should be private or\n * protected fields and should use the {@linkcode state} decorator.\n *\n * However, sometimes element code does need to set a public property. This\n * should typically only be done in response to user interaction, and an event\n * should be fired informing the user; for example, a checkbox sets its\n * `checked` property when clicked and fires a `changed` event. Mutating public\n * properties should typically not be done for non-primitive (object or array)\n * properties. In other cases when an element needs to manage state, a private\n * property decorated via the {@linkcode state} decorator should be used. When\n * needed, state properties can be initialized via public properties to\n * facilitate complex interactions.\n *\n * ```ts\n * class MyElement {\n *   @property({ type: Boolean })\n *   clicked = false;\n * }\n * ```\n * @category Decorator\n * @ExportDecoratedItems\n */\nexport function property(options?: PropertyDeclaration): PropertyDecorator {\n  return <C extends Interface<ReactiveElement>, V>(\n    protoOrTarget:\n      | object\n      | ClassAccessorDecoratorTarget<C, V>\n      | ((value: V) => void),\n    nameOrContext:\n      | PropertyKey\n      | ClassAccessorDecoratorContext<C, V>\n      | ClassSetterDecoratorContext<C, V>\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  ): any => {\n    return (\n      typeof nameOrContext === 'object'\n        ? standardProperty<C, V>(\n            options,\n            protoOrTarget as\n              | ClassAccessorDecoratorTarget<C, V>\n              | ((value: V) => void),\n            nameOrContext as StandardPropertyContext<C, V>\n          )\n        : legacyProperty(\n            options,\n            protoOrTarget as Object,\n            nameOrContext as PropertyKey\n          )\n    ) as PropertyDecorator;\n  };\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * lit-html patch to support browsers without native web components.\n *\n * This module should be used in addition to loading the web components\n * polyfills via @webcomponents/webcomponentjs. When using those polyfills\n * support for polyfilled Shadow DOM is automatic via the ShadyDOM polyfill.\n * Scoping classes are added to DOM nodes to facilitate CSS scoping that\n * simulates the style scoping Shadow DOM provides. ShadyDOM does this scoping\n * to all elements added to the DOM. This module provides an important\n * optimization for this process by pre-scoping lit-html template\n * DOM. This means ShadyDOM does not have to scope each instance of the\n * template DOM. Instead, each template is scoped only once.\n *\n * Creating scoped CSS is not covered by this module. It is, however, integrated\n * into the lit-element and @lit/reactive-element packages. See the ShadyCSS docs\n * for how to apply scoping to CSS:\n * https://github.com/webcomponents/polyfills/tree/master/packages/shadycss#usage.\n *\n * (COPYBARA: packageDocumentation)\n */\n\nexport {};\n\ninterface RenderOptions {\n  readonly renderBefore?: ChildNode | null;\n  scope?: string;\n  readonly renderContainer?: Element;\n}\n\ninterface ShadyTemplateResult {\n  strings: TemplateStringsArray;\n  // This property needs to remain unminified.\n  ['_$litType$']?: string;\n}\n\n// Note, this is a dummy type as the full type here is big.\ninterface Directive {\n  __directive?: Directive;\n}\n\ninterface DirectiveParent {\n  _$parent?: DirectiveParent;\n  __directive?: Directive;\n  __directives?: Array<Directive | undefined>;\n}\n\ninterface PatchableChildPartConstructor {\n  // tslint:disable-next-line:no-any, @typescript-eslint/no-misused-new\n  new (...args: any[]): PatchableChildPart;\n}\n\ninterface PatchableChildPart {\n  __directive?: Directive;\n  _$committedValue: unknown;\n  _$startNode: ChildNode;\n  _$endNode: ChildNode | null;\n  options: RenderOptions;\n  _$setValue(value: unknown, directiveParent: DirectiveParent): void;\n  _$getTemplate(result: ShadyTemplateResult): HTMLTemplateElement;\n}\n\ninterface PatchableTemplate {\n  el: HTMLTemplateElement;\n}\n\ninterface PatchableTemplateConstructor {\n  // tslint:disable-next-line:no-any, @typescript-eslint/no-misused-new\n  new (...args: any[]): PatchableTemplate;\n  createElement(html: string, options?: RenderOptions): HTMLTemplateElement;\n}\n\ninterface PatchableTemplateInstance {\n  _$template: PatchableTemplate;\n}\n\n// Scopes that have had styling prepared. Note, must only be done once per\n// scope.\nconst styledScopes = new Set<string>();\n// Map of css per scope. This is collected during first scope render, used when\n// styling is prepared, and then discarded.\nconst scopeCssStore = new Map<string, string[]>();\n\nconst ENABLE_SHADYDOM_NOPATCH = true;\n\n// Note, explicitly use `var` here so that this can be re-defined when\n// bundled.\n// eslint-disable-next-line no-var\nimport {DEV_MODE} from '@lit/reactive-element/dev-mode'; // COPYBARA: var\n\n/**\n * lit-html patches. These properties cannot be renamed.\n * * ChildPart.prototype._$getTemplate\n * * ChildPart.prototype._$setValue\n */\nconst polyfillSupport: NonNullable<typeof litHtmlPolyfillSupport> = (\n  Template: PatchableTemplateConstructor,\n  ChildPart: PatchableChildPartConstructor,\n) => {\n  // polyfill-support is only needed if ShadyCSS or the ApplyShim is in use\n  // We test at the point of patching, which makes it safe to load\n  // webcomponentsjs and polyfill-support in either order\n  if (\n    globalThis.ShadyCSS === undefined ||\n    (globalThis.ShadyCSS.nativeShadow && !globalThis.ShadyCSS.ApplyShim)\n  ) {\n    return;\n  }\n\n  // console.log(\n  //   '%c Making lit-html compatible with ShadyDOM/CSS.',\n  //   'color: lightgreen; font-style: italic'\n  // );\n\n  const wrap =\n    ENABLE_SHADYDOM_NOPATCH &&\n    globalThis.ShadyDOM?.inUse &&\n    globalThis.ShadyDOM?.noPatch === true\n      ? globalThis.ShadyDOM!.wrap\n      : (node: Node) => node;\n\n  const needsPrepareStyles = (name: string | undefined) =>\n    name !== undefined && !styledScopes.has(name);\n\n  const cssForScope = (name: string) => {\n    let scopeCss = scopeCssStore.get(name);\n    if (scopeCss === undefined) {\n      scopeCssStore.set(name, (scopeCss = []));\n    }\n    return scopeCss;\n  };\n\n  const prepareStyles = (name: string, template: HTMLTemplateElement) => {\n    // Get styles\n    const scopeCss = cssForScope(name);\n    const hasScopeCss = scopeCss.length !== 0;\n    if (hasScopeCss) {\n      const style = document.createElement('style');\n      style.textContent = scopeCss.join('\\n');\n      // Note, it's important to add the style to the *end* of the template so\n      // it doesn't mess up part indices.\n      template.content.appendChild(style);\n    }\n    // Mark this scope as styled.\n    styledScopes.add(name);\n    // Remove stored data since it's no longer needed.\n    scopeCssStore.delete(name);\n    // ShadyCSS removes scopes and removes the style under ShadyDOM and leaves\n    // it under native Shadow DOM\n    globalThis.ShadyCSS!.prepareTemplateStyles(template, name);\n    // Note, under native Shadow DOM, the style is added to the beginning of the\n    // template. It must be moved to the *end* of the template so it doesn't\n    // mess up part indices.\n    if (hasScopeCss && globalThis.ShadyCSS!.nativeShadow) {\n      // If there were styles but the CSS text was empty, ShadyCSS will\n      // eliminate the style altogether, so the style here could be null\n      const style = template.content.querySelector('style');\n      if (style !== null) {\n        template.content.appendChild(style);\n      }\n    }\n  };\n\n  const scopedTemplateCache = new Map<\n    string | undefined,\n    Map<TemplateStringsArray, PatchableTemplate>\n  >();\n\n  /**\n   * Override to extract style elements from the template\n   * and store all style.textContent in the shady scope data.\n   * Note, it's ok to patch Template since it's only used via ChildPart.\n   */\n  const originalCreateElement = Template.createElement;\n  Template.createElement = function (html: string, options?: RenderOptions) {\n    const element = originalCreateElement.call(Template, html, options);\n    const scope = options?.scope;\n    if (scope !== undefined) {\n      if (!globalThis.ShadyCSS!.nativeShadow) {\n        globalThis.ShadyCSS!.prepareTemplateDom(element, scope);\n      }\n      // Process styles only if this scope is being prepared. Otherwise,\n      // leave styles as is for back compat with Lit1.\n      if (needsPrepareStyles(scope)) {\n        const scopeCss = cssForScope(scope);\n        // Remove styles and store textContent.\n        const styles = element.content.querySelectorAll(\n          'style',\n        ) as NodeListOf<HTMLStyleElement>;\n        // Store the css in this template in the scope css and remove the <style>\n        // from the template _before_ the node-walk captures part indices\n        scopeCss.push(\n          ...Array.from(styles).map((style) => {\n            style.parentNode?.removeChild(style);\n            return style.textContent!;\n          }),\n        );\n      }\n    }\n    return element;\n  };\n\n  const renderContainer = document.createDocumentFragment();\n  const renderContainerMarker = document.createComment('');\n\n  const childPartProto = ChildPart.prototype;\n  /**\n   * Patch to apply gathered css via ShadyCSS. This is done only once per scope.\n   */\n  const setValue = childPartProto._$setValue;\n  childPartProto._$setValue = function (\n    this: PatchableChildPart,\n    value: unknown,\n    directiveParent: DirectiveParent = this,\n  ) {\n    const container = wrap(this._$startNode).parentNode!;\n    const scope = this.options?.scope;\n    if (\n      (container instanceof ShadowRoot ||\n        // TODO(sorvell): Remove when Lit2 migration is complete in favor of\n        // cl/386884682.\n        container === this.options?.renderContainer) &&\n      needsPrepareStyles(scope)\n    ) {\n      // Note, @apply requires outer => inner scope rendering on initial\n      // scope renders to apply property values correctly. Style preparation\n      // is tied to rendering into `shadowRoot`'s and this is typically done by\n      // custom elements. If this is done in `connectedCallback`, as is typical,\n      // the code below ensures the right order since content is rendered\n      // into a fragment first so the hosting element can prepare styles first.\n      // If rendering is done in the constructor, this won't work, but that's\n      // not supported in ShadyDOM anyway.\n      const startNode = this._$startNode;\n      const endNode = this._$endNode;\n\n      // Temporarily move this part into the renderContainer.\n      renderContainer.appendChild(renderContainerMarker);\n      this._$startNode = renderContainerMarker;\n      this._$endNode = null;\n\n      // Note, any nested template results render here and their styles will\n      // be extracted and collected.\n      setValue.call(this, value, directiveParent);\n\n      // Get the template for this result or create a dummy one if a result\n      // is not being rendered.\n      // This property needs to remain unminified.\n      const template = (value as ShadyTemplateResult)?.['_$litType$']\n        ? (this._$committedValue as PatchableTemplateInstance)._$template.el\n        : document.createElement('template');\n      prepareStyles(scope!, template);\n\n      // Note, this is the temporary startNode.\n      renderContainer.removeChild(renderContainerMarker);\n      // When using native Shadow DOM, include prepared style in shadowRoot.\n      if (globalThis.ShadyCSS?.nativeShadow) {\n        const style = template.content.querySelector('style');\n        if (style !== null) {\n          renderContainer.appendChild(style.cloneNode(true));\n        }\n      }\n      container.insertBefore(renderContainer, endNode);\n      // Move part back to original container.\n      this._$startNode = startNode;\n      this._$endNode = endNode;\n    } else {\n      setValue.call(this, value, directiveParent);\n    }\n  };\n\n  /**\n   * Patch ChildPart._$getTemplate to look up templates in a cache bucketed\n   * by element name.\n   */\n  childPartProto._$getTemplate = function (\n    this: PatchableChildPart,\n    result: ShadyTemplateResult,\n  ) {\n    const scope = this.options?.scope;\n    let templateCache = scopedTemplateCache.get(scope);\n    if (templateCache === undefined) {\n      scopedTemplateCache.set(scope, (templateCache = new Map()));\n    }\n    let template = templateCache.get(result.strings);\n    if (template === undefined) {\n      templateCache.set(\n        result.strings,\n        (template = new Template(result, this.options)),\n      );\n    }\n    return template;\n  };\n};\n\nif (ENABLE_SHADYDOM_NOPATCH) {\n  polyfillSupport.noPatchSupported = ENABLE_SHADYDOM_NOPATCH;\n}\n\nif (DEV_MODE) {\n  /* COPYBARA: globalThis */ globalThis.litHtmlPolyfillSupportDevMode ??=\n    polyfillSupport;\n} else if (goog.FEATURESET_YEAR < 2020) {\n  /* COPYBARA: globalThis */ globalThis.litHtmlPolyfillSupport ??= polyfillSupport;\n}\n\nlet symbolKey = '';\nif (goog.FEATURESET_YEAR < 2019 && (globalThis.Symbol as unknown)) {\n  const s = Symbol();\n  if (typeof s !== 'symbol') {\n    // This key can sometimes be renamed so we just look at the first key and\n    // assume there's just one.\n    symbolKey = Object.keys(s)[0];\n  }\n}\n\nconst needsSymbolSupport = symbolKey !== '';\n\n/**\n * Checks if a value is specifically a closure polyfilled symbol. We expose\n * this directly since it's not possible to polyfill `typeof v === 'symbol'`.\n */\nexport const isPolyfilledSymbol = (() => {\n  if (needsSymbolSupport) {\n    return (value: unknown) =>\n      value != null &&\n      // tslint:disable-next-line:no-any\n      (value as any)[symbolKey] !== undefined;\n  } else {\n    return (value: unknown) => false;\n  }\n})();\n\n// tslint:disable-next-line:no-any\nif (needsSymbolSupport) {\n  // TODO(sorvell): Remove when/if b/187749613 is addressed.\n  if (!globalThis.Symbol.for) {\n    const map = new Map<string, symbol>();\n    globalThis.Symbol.for = (key) => {\n      if (!map.has(key)) {\n        map.set(key, Symbol(key));\n      }\n      return map.get(key)!;\n    };\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * LitElement patch to support browsers without native web components.\n *\n * This module should be used in addition to loading the web components\n * polyfills via @webcomponents/webcomponentjs. When using those polyfills\n * support for polyfilled Shadow DOM is automatic via the ShadyDOM polyfill, but\n * support for Shadow DOM like css scoping is opt-in. This module uses ShadyCSS\n * to scope styles defined via the `static styles` property and styles included\n * in the render method. There are some limitations to be aware of:\n * * only styles that are included in the first render of a component are scoped.\n * * In addition, support for the deprecated `@apply` feature of ShadyCSS is\n * only provided for styles included in the template and not styles provided\n * via the static styles property.\n * * Lit parts cannot be used in styles included in the template.\n *\n * (COPYBARA: packageDocumentation)\n */\n\nimport '@lit/reactive-element/polyfill-support.js';\nimport 'lit-html/polyfill-support.js';\n\ninterface RenderOptions {\n  readonly renderBefore?: ChildNode | null;\n  scope?: string;\n}\n\ninterface PatchableLitElementConstructor {\n  _$handlesPrepareStyles?: boolean;\n}\n\ninterface PatchableLitElement extends HTMLElement {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-misused-new\n  new (...args: any[]): PatchableLitElement;\n  constructor: PatchableLitElementConstructor;\n  createRenderRoot(): Element | ShadowRoot;\n  renderOptions: RenderOptions;\n}\n\n// Note, explicitly use `var` here so that this can be re-defined when\n// bundled.\n// eslint-disable-next-line no-var\nimport {DEV_MODE} from '@lit/reactive-element/dev-mode'; // COPYBARA: var\n\nconst polyfillSupport = ({LitElement}: {LitElement: PatchableLitElement}) => {\n  // polyfill-support is only needed if ShadyCSS or the ApplyShim is in use\n  // We test at the point of patching, which makes it safe to load\n  // webcomponentsjs and polyfill-support in either order\n  if (\n    globalThis.ShadyCSS === undefined ||\n    (globalThis.ShadyCSS.nativeShadow && !globalThis.ShadyCSS.ApplyShim)\n  ) {\n    return;\n  }\n\n  // console.log(\n  //   '%c Making LitElement compatible with ShadyDOM/CSS.',\n  //   'color: lightgreen; font-style: italic'\n  // );\n\n  (\n    LitElement as unknown as PatchableLitElementConstructor\n  )._$handlesPrepareStyles = true;\n\n  /**\n   * Patch to apply adoptedStyleSheets via ShadyCSS\n   */\n  const litElementProto = LitElement.prototype;\n  const createRenderRoot = litElementProto.createRenderRoot;\n  litElementProto.createRenderRoot = function (this: PatchableLitElement) {\n    // Pass the scope to render options so that it gets to lit-html for proper\n    // scoping via ShadyCSS. This is needed under Shady and also Shadow DOM,\n    // due to @apply.\n    this.renderOptions.scope = this.localName;\n    return createRenderRoot.call(this);\n  };\n};\n\nif (DEV_MODE) {\n  globalThis.litElementPolyfillSupportDevMode ??= polyfillSupport;\n} else if (goog.FEATURESET_YEAR < 2020) {\n  globalThis.litElementPolyfillSupport ??= polyfillSupport;\n}\n","/**\n * @license\n * Copyright Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Utilities for interacting with Trusted Types, create and/or\n * retrieve the policy for the library.\n */\n\nimport {DEV_MODE} from '../environment/dev';\nimport {\n  GlobalWithTrustedTypes,\n  TrustedTypePolicy,\n  TrustedTypePolicyFactory,\n} from './trusted_types_typings';\n\n\ntype ExposeTrustedTypes = true;  // LINE-INTERNAL\n// LINE-EXTERNAL type ExposeTrustedTypes = false;\n\n/**\n * Controls whether to expose Trusted Types to the user through unwrapper\n * functions.\n */\nexport type UnwrapType<T> = ExposeTrustedTypes extends true ? T : {toString(): string};\n\n// BEGIN-INTERNAL\n/**\n * The name of the Trusted Types policy used by the library, or empty\n * to disable Trusted Types.\n *\n * TODO(b/365132434): Migrate everyone to stop relying on goog.TRUSTED_TYPES_POLICY_NAME\n *\n * @define\n */\nconst configuredPolicyName = goog.define(\n  'goog.html.trustedtypes.POLICY_NAME',\n  goog.TRUSTED_TYPES_POLICY_NAME\n    ? goog.TRUSTED_TYPES_POLICY_NAME + '#html'\n    : '',\n);\n// END-INTERNAL\n// BEGIN-EXTERNAL\n// /**\n//  * The name of the Trusted Types policy used by the library, or empty\n//  * to disable Trusted Types.\n//  */\n// const configuredPolicyName = 'google#safe';\n// END-EXTERNAL\n\n/** Mutable version of the policy name so it is testable. */\nlet policyName = configuredPolicyName;\n\n/** Re-exports the global trustedTypes object for convenience. */\nexport const trustedTypes: TrustedTypePolicyFactory | undefined = (\n  globalThis as GlobalWithTrustedTypes\n).trustedTypes;\n\n/**\n * Mutable version of trustedTypes object so it is testable\n *\n * Note: we need to mark this as not inlineable to prevent the compiler from\n * inlining it and causing soy conformance tests to fail.\n * @noinline\n */\nlet trustedTypesInternal = trustedTypes;\n\n/**\n * Cached Trusted Types policy:\n *  - `null` if Trusted Types are not enabled/supported\n *  - `undefined` if the policy has not been created yet.\n */\nlet policy: TrustedTypePolicy | null | undefined;\n\nfunction createPolicy(): TrustedTypePolicy | null {\n  let policy: TrustedTypePolicy | null = null;\n  if (policyName === '') {\n    // Binary is not configured to use Trusted Types.\n    return policy;\n  }\n\n  if (!trustedTypesInternal) {\n    return policy;\n  }\n  // trustedTypes.createPolicy throws in some older versions of chrome if\n  // called with a name that is already registered, even in report-only mode.\n  // Until the API changes, catch the error not to break the applications\n  // functionally. In such case, the code will fall back to using strings.\n  // TODO(engels): Check if this code can be simplified now.  // LINE-INTERNAL\n  try {\n    const identity = (x: string) => x;\n    policy = trustedTypesInternal.createPolicy(policyName, {\n      createHTML: identity,\n      createScript: identity,\n      createScriptURL: identity,\n    });\n  } catch (e) {\n    if (DEV_MODE) {\n      throw e as Error;\n    }\n  }\n  return policy;\n}\n\n/**\n * Returns the Trusted Types policy used by safevalues, or null if Trusted\n * Types are not enabled/supported.\n *\n * The first call to this function will create the policy, and all subsequent\n * calls will return the same policy.\n */\nexport function getPolicy(): TrustedTypePolicy | null {\n  if (policy === undefined) {\n    policy = createPolicy();\n  }\n  return policy;\n}\n\n/** Helpers for tests. */\nexport const TEST_ONLY = {\n  setPolicyName(name: string): void {\n    policyName = name;\n  },\n  setTrustedTypes(\n    mockTrustedTypes: TrustedTypePolicyFactory | undefined,\n  ): void {\n    trustedTypesInternal = mockTrustedTypes;\n  },\n  resetDefaults(): void {\n    policy = undefined;\n    policyName = configuredPolicyName;\n    trustedTypesInternal = trustedTypes;\n  },\n};\n","/**\n * @license\n * Copyright Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/** @fileoverview Internal implementations of SafeHtml. */\n\nimport {getPolicy, trustedTypes, UnwrapType} from './trusted_types';\nimport {TrustedHTML} from './trusted_types_typings';\n\nimport {DEV_MODE} from '../environment/dev';\n\nimport {pure} from './pure';\nimport {ensureTokenIsValid, secretToken} from './secrets';\n\n/**\n * String that is safe to use in HTML contexts in DOM APIs and HTML documents.\n *\n * @final\n */\nexport class SafeHtml {\n  private readonly privateDoNotAccessOrElseWrappedHtml: TrustedHTML | string;\n\n  private constructor(token: object, value: TrustedHTML | string) {\n    if (DEV_MODE) {\n      ensureTokenIsValid(token);\n    }\n\n    this.privateDoNotAccessOrElseWrappedHtml = value;\n  }\n\n  toString(): string {\n    // String coercion minimizes code size.\n    // tslint:disable-next-line:restrict-plus-operands\n    return this.privateDoNotAccessOrElseWrappedHtml + '';\n  }\n}\n\n/**\n * Internal interface for `SafeHtml`.\n *\n * `SafeHtml` should remain an opaque type to users & they should never be able\n * to instantiate it directly, but we still need to create values.\n *\n * There are multiple ways to do this, but the following is the one that\n * minimizes code size.\n */\ninterface HtmlImpl {\n  privateDoNotAccessOrElseWrappedHtml: TrustedHTML | string;\n}\nconst HtmlImpl = SafeHtml as {\n  new (token: object, value: TrustedHTML | string): SafeHtml;\n};\n\nfunction constructHtml(value: TrustedHTML | string): SafeHtml {\n  return new HtmlImpl(secretToken, value);\n}\n\n/**\n * Builds a new `SafeHtml` from the given string, without enforcing\n * safety guarantees. It may cause side effects by creating a Trusted Types\n * policy. This shouldn't be exposed to application developers, and must only be\n * used as a step towards safe builders or safe constants.\n */\nexport function createHtmlInternal(value: string): SafeHtml {\n  // Inlining this variable can cause large codesize increases when it is a\n  // large constant string. See sizetests/examples/constants for an example.\n  /** @noinline */\n  const noinlineValue = value;\n  const policy = getPolicy();\n  return constructHtml(\n    policy ? policy.createHTML(noinlineValue) : noinlineValue,\n  );\n}\n\n/**\n * An empty `SafeHtml` constant.\n * Unlike the functions above, using this will not create a policy.\n */\nexport const EMPTY_HTML: SafeHtml = pure(() =>\n  constructHtml(trustedTypes ? trustedTypes.emptyHTML : ''),\n);\n\n/** Checks if the given value is a `SafeHtml` instance */\nexport function isHtml(value: unknown): value is SafeHtml {\n  return value instanceof SafeHtml;\n}\n\n/**\n * Returns the value of the passed `SafeHtml` object while ensuring it\n * has the correct type.\n * Using this function directly is not common. Safe types are not meant to be\n * unwrapped, but rather passed to other APIs that consume them, like the DOM\n * wrappers in safevalues/dom.\n *\n * Returns a native `TrustedHTML` or a string if Trusted Types are disabled.  // LINE-INTERNAL\n// LINE-EXTERNAL * Returns a native `TrustedHTML` instance typed as {toString(): string} or a string if Trusted Types are disabled.\n */\nexport function unwrapHtml(value: SafeHtml): UnwrapType<TrustedHTML> | string {\n  if (isHtml(value)) {\n    return (value as unknown as HtmlImpl).privateDoNotAccessOrElseWrappedHtml;\n  } else {\n    let message = '';\n    if (DEV_MODE) {\n      message = 'Unexpected type when unwrapping SafeHtml';\n    }\n    throw new Error(message);\n  }\n}\n","/**\n * @license\n * Copyright Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/** Mark an expression as being free of side effects. */\nexport function pure<T>(valueOf: () => T): T {\n  // This odd looking expression is a workaround specific to the Closure\n  // compiler to mark an expression as pure.\n  // BEGIN-INTERNAL\n  // Note: @nosideeffects can get dropped if calls to this function get inlined,\n  // whereas this expression is better preserved across inlining, resulting in\n  // smaller sizes in most cases. See\n  // https://groups.google.com/a/google.com/g/ise-web/c/vh4Ky_0KunY for context.\n  // END-INTERNAL\n  return {valueOf}.valueOf();\n}\n","/**\n * @license\n * Copyright Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/** @fileoverview Internal implementations of TrustedResourceUrl. */\n\nimport {getPolicy, UnwrapType} from './trusted_types';\nimport {TrustedScriptURL} from './trusted_types_typings';\n\nimport {DEV_MODE} from '../environment/dev';\n\nimport {ensureTokenIsValid, secretToken} from './secrets';\n\n/**\n * String that is safe to use in all URL contexts in DOM APIs and HTML\n * documents; even as a reference to resources that may load in the current\n * origin (e.g. scripts and stylesheets).\n *\n * @final\n */\nexport class TrustedResourceUrl {\n  private readonly privateDoNotAccessOrElseWrappedResourceUrl:\n    | TrustedScriptURL\n    | string;\n\n  private constructor(token: object, value: TrustedScriptURL | string) {\n    if (DEV_MODE) {\n      ensureTokenIsValid(token);\n    }\n\n    this.privateDoNotAccessOrElseWrappedResourceUrl = value;\n  }\n\n  toString(): string {\n    // String coercion minimizes code size.\n    // tslint:disable-next-line:restrict-plus-operands\n    return this.privateDoNotAccessOrElseWrappedResourceUrl + '';\n  }\n}\n\n/**\n * Internal interface for `TrustedResourceUrl`.\n *\n * `TrustedResourceUrl` should remain an opaque type to users & they should never be able\n * to instantiate it directly, but we still need to create values.\n *\n * There are multiple ways to do this, but the following is the one that\n * minimizes code size.\n */\ninterface ResourceUrlImpl {\n  privateDoNotAccessOrElseWrappedResourceUrl: TrustedScriptURL | string;\n}\nconst ResourceUrlImpl = TrustedResourceUrl as {\n  new (token: object, value: TrustedScriptURL | string): TrustedResourceUrl;\n};\n\nfunction constructResourceUrl(\n  value: TrustedScriptURL | string,\n): TrustedResourceUrl {\n  return new ResourceUrlImpl(secretToken, value);\n}\n\n/**\n * Builds a new `TrustedResourceUrl` from the given string, without enforcing\n * safety guarantees. It may cause side effects by creating a Trusted Types\n * policy. This shouldn't be exposed to application developers, and must only be\n * used as a step towards safe builders or safe constants.\n */\nexport function createResourceUrlInternal(value: string): TrustedResourceUrl {\n  // Inlining this variable can cause large codesize increases when it is a\n  // large constant string. See sizetests/examples/constants for an example.\n  /** @noinline */\n  const noinlineValue = value;\n  const policy = getPolicy();\n  return constructResourceUrl(\n    policy ? policy.createScriptURL(noinlineValue) : noinlineValue,\n  );\n}\n\n/** Checks if the given value is a `TrustedResourceUrl` instance */\nexport function isResourceUrl(value: unknown): value is TrustedResourceUrl {\n  return value instanceof TrustedResourceUrl;\n}\n\n/**\n * Returns the value of the passed `TrustedResourceUrl` object while ensuring it\n * has the correct type.\n * Using this function directly is not common. Safe types are not meant to be\n * unwrapped, but rather passed to other APIs that consume them, like the DOM\n * wrappers in safevalues/dom.\n *\n * Returns a native `TrustedScriptURL` or a string if Trusted Types are disabled.  // LINE-INTERNAL\n// LINE-EXTERNAL * Returns a native `TrustedScriptURL` instance typed as {toString(): string} or a string if Trusted Types are disabled.\n */\nexport function unwrapResourceUrl(\n  value: TrustedResourceUrl,\n): UnwrapType<TrustedScriptURL> | string {\n  if (isResourceUrl(value)) {\n    return (value as unknown as ResourceUrlImpl)\n      .privateDoNotAccessOrElseWrappedResourceUrl;\n  } else {\n    let message = '';\n    if (DEV_MODE) {\n      message = 'Unexpected type when unwrapping TrustedResourceUrl';\n    }\n    throw new Error(message);\n  }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * This is internal-only because enabling sanitization by default would be a\n * breaking change, and we don't want to have a mandatory dep on safevalues.\n *\n * However we'd like to open source this as an optional way of using lit-html.\n */\n\nimport {EMPTY_HTML, isHtml, isResourceUrl, trustedResourceUrl, unwrapHtml, unwrapResourceUrl} from 'safevalues';\n\n/**\n * A system for validating the security properties of Lit attribute and property\n * bindings.\n *\n * Part of our trusted type support, while also providing many of the benefits\n * of enabling trusted types to Lit attribute and property bindings even in\n * browsers without trusted type support.\n */\nexport const sanitizerFactory =\n    goog.DEBUG ? debugSanitizerFactory : realSanitizerFactory;\n\nfunction realSanitizerFactory(\n    node: Node, rawName: string, type: 'property'|'attribute'): ValueSanitizer {\n  // We're only concerned with setting attributes or properties on elements.\n  if (node.nodeType !== 1 /* NodeType.ELEMENT */) {\n    return allowAnything;\n  }\n  const name = rawName.toLowerCase() as Lowercase<string>;\n  if (name === 'innerhtml' || name === 'innertext' || name === 'textcontent' ||\n      name === 'outerhtml') {\n    if (goog.DEBUG) {\n      if (name === 'innerhtml' || name === 'outerhtml') {\n        debugLog(\n            `When Lit is running in high security mode, it can't be used to set ${\n                rawName}. Use the SafeHTML directive instead.`);\n      } else {\n        debugLog(`When Lit is running in high security mode, it can't be used to set ${\n            rawName}. Instead you can bind a string directly as a child of the element.`);\n      }\n    }\n    return (unused: unknown) => unwrapHtml(EMPTY_HTML);\n  }\n  const contract =\n      securityContracts.get(`${(node as Element).tagName as TagName} ${name}`);\n  if (contract !== undefined) {\n    return contract;\n  }\n  /**\n   * We want to forbid built in onevent attributes, as the browser will\n   * eval the attribute value. Since every custom element extends HTMLElement,\n   * we only need to worry about those events that are on its prototype.\n   *\n   * Properties are fine, because they must be set to a function object, which\n   * we assume an attacker can't construct, as to do that they already\n   * have code execution ability in the page and so are inside the perimeter.\n   *\n   * Custom elements might also declare properties with the same names as\n   * these onevent attributes, like an onInput property. That's fine, as long\n   * as it's never set as an attribute.\n   */\n  if (/^on/.test(name) && type === 'attribute') {\n    const baseToCheck = !(node as Element).tagName.includes('-') ?\n        /**\n         * By default we look to see if there's a property on the node since\n         * that's consistently there for the dangerous onevent attributes.\n         *\n         * We want to look on the node because a small number of elements have\n         * non-bubbling events, so their onevent handlers are only on their\n         * specific class. See:\n         * https://lit.dev/playground/#gist=a53869560f84fd0f310681438ef1ad87 for\n         * a current list of these cases. If this wasn't the case we could just\n         * look on HTMLElement.prototype for all cases.\n         */\n        node :\n         /**\n          * However, for custom elements, we do want to check\n          * HTMLElement.prototype, because every custom element extends\n          * HTMLElement, but an individual custom element might have its own\n          * fields that start with \"on\" that are unrelated to the dangerous\n          * native onevent attributes.\n          *\n          * We can do a simple check for a hyphen in the tag name because none\n          * of the built in elements with nonbubbling events have a hyphen.\n          */\n         HTMLElement.prototype;\n    if (name in baseToCheck) {\n      return (value: unknown) => {\n        let message = 'invalid binding';\n        if (goog.DEBUG) {\n          message =\n              `The ${\n                  name} attribute looks like a string based event listener. ` +\n              `These are insecure, and not supported in Lit's high security ` +\n              `mode. Use an event binding instead, like this:\n@${name.slice(2)}=\\${(event) => {${value}}}`;\n        }\n        throw new Error(message);\n      };\n    }\n  }\n  // This binding has no known security constraints.\n  return allowAnything;\n}\n\n/**\n * A function which can sanitize values that will be written to a specific kind\n * of DOM sink.\n */\ntype ValueSanitizer = (value: unknown) => unknown;\n\n/**\n * A pattern that blocks javascript: URLs. Matches\n * (a) Urls with no explicit scheme; or\n * (b) Urls with an explicit scheme that is not javascript and that only has\n *     alphanumeric or [.-+] characters.\n * This pattern is taken from the Soy URL sanitizer and is reviewed by the\n *   go/safehtml-team.\n */\nconst BLOCK_JAVASCRIPT_URL_PATTERN =\n    /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\\/?#]*(?:[\\/?#]|$))/i;\n\n/**\n * A safe and meaningless URL that we use instead of unsafe values.\n */\nconst fallbackTrustedUrl = {\n  valueOf() {\n    return unwrapResourceUrl(trustedResourceUrl`about:invalid#zClosurez`);\n  }\n}.valueOf();\n\n// Value sanitizers\n// One of these functions runs for every value that's bound into an attribute or\n// property in a lit-html template.\nconst allowAnything = (value: unknown) => value;\nconst onlyForbidJavascriptUrls = (url: unknown) => {\n  if (!BLOCK_JAVASCRIPT_URL_PATTERN.test(String(url))) {\n    if (goog.DEBUG) {\n      debugModeThrowValueSanitizerError({\n        message: `Blocked javascript: url. ` +\n            `These are not supported in Lit high security mode.`,\n        fallbackValue: fallbackTrustedUrl,\n        badValue: url,\n      });\n    }\n    return fallbackTrustedUrl;\n  }\n  return url;\n};\nconst forbidEverythingBecauseFieldIsUnsupported = (value: unknown) => {\n  if (goog.DEBUG) {\n    debugModeThrowValueSanitizerError({\n      message: `Unsupported field in Lit high security mode.`,\n      fallbackValue: fallbackTrustedUrl,\n      badValue: value\n    });\n  }\n  return fallbackTrustedUrl;\n};\nconst requireSafeHtml = (maybeSafeHtml: unknown) => {\n  if (!isHtml(maybeSafeHtml)) {\n    if (goog.DEBUG) {\n      debugModeThrowValueSanitizerError({\n        message: `This field requires SafeHtml.`,\n        fallbackValue: unwrapHtml(EMPTY_HTML),\n        badValue: maybeSafeHtml\n      });\n    }\n    return unwrapHtml(EMPTY_HTML);\n  }\n  return unwrapHtml(maybeSafeHtml);\n};\nconst requireTrustedResourceUrl = (maybeResourceUrl: unknown) => {\n  if (!isResourceUrl(maybeResourceUrl)) {\n    if (goog.DEBUG) {\n      debugModeThrowValueSanitizerError({\n        message: `This field requires TrustedResourceUrl.`,\n        fallbackValue: fallbackTrustedUrl,\n        badValue: maybeResourceUrl\n      });\n    }\n    return fallbackTrustedUrl;\n  }\n  return unwrapResourceUrl(maybeResourceUrl);\n};\n\ntype UpperLetter = 'A'|'B'|'C'|'D'|'E'|'F'|'G'|'H'|'I'|'J'|'K'|'L'|'M'|'N'|'O'|\n    'P'|'Q'|'R'|'S'|'T'|'U'|'V'|'W'|'X'|'Y'|'Z';\n// At least one letter, all upper case.\ntype TagName = `${UpperLetter}${Uppercase < string >}`;\n\n// We key security contracts by the uppercased tag name, followed by the type\n// of the binding, followed by the binding's name. The tag name and the type\n// can't include spaces, so we don't need to do any escaping.\ntype SecurityContractName = `${TagName} ${Lowercase < string >}`;\n\n// Up to date with go/controlled-web-apis as of August 3rd 2023.\nconst securityContracts = new Map<SecurityContractName, ValueSanitizer>([\n  // go/keep-sorted start\n  ['A href', onlyForbidJavascriptUrls],  //\n  ['AREA href', onlyForbidJavascriptUrls],\n  ['BASE href', forbidEverythingBecauseFieldIsUnsupported],\n  ['BUTTON formaction', onlyForbidJavascriptUrls],\n  ['EMBED src', forbidEverythingBecauseFieldIsUnsupported],\n  ['FORM action', onlyForbidJavascriptUrls],\n  ['FRAME src', forbidEverythingBecauseFieldIsUnsupported],\n  ['IFRAME src', requireTrustedResourceUrl],  //\n  ['IFRAME srcdoc', requireSafeHtml],\n  ['INPUT formaction', onlyForbidJavascriptUrls],\n  ['LINK href', requireTrustedResourceUrl],\n  ['OBJECT codebase', forbidEverythingBecauseFieldIsUnsupported],\n  ['OBJECT data', forbidEverythingBecauseFieldIsUnsupported],\n  // We don't know of an attack vector whereby the browser will execute a\n  // <script> element created with Lit, but since it's such a well known attack\n  // surface for arbitrary code execution, it seems better to err on the side\n  // of caution.\n  ['SCRIPT href', requireTrustedResourceUrl],  // for SVG scripts\n  ['SCRIPT src', requireTrustedResourceUrl],\n  ['SCRIPT text', forbidEverythingBecauseFieldIsUnsupported],\n  ['USE href', requireTrustedResourceUrl],\n  // go/keep-sorted end\n]);\n\n/**\n * This behaves the same as realSanitizerFactory, but when run in debug mode\n * it will debugLog with more information when a value is unsanitary.\n */\nfunction debugSanitizerFactory(\n    node: Node, name: string, type: 'property'|'attribute'): ValueSanitizer {\n  const result = realSanitizerFactory(node, name, type);\n  if (result === allowAnything) {\n    return result;\n  }\n  return (value: unknown) => {\n    try {\n      return result(value);\n    } catch (error: unknown) {\n      if (!isValueSanitizerErrorInfo(error)) {\n        throw error;\n      }\n      debugLog(\n          `Security error: \"${error.message}\" encountered when setting ${\n              type} named ${JSON.stringify(name)} on `,\n          node, ` to value: `, error.badValue);\n      return error.fallbackValue;\n    }\n  };\n}\n\n// Thrown by debugModeThrowValueSanitizerError so that debugSanitizerFactory\n// can log more info about an invalid value.\ninterface ValueSanitizerErrorInfo extends Error {\n  [brand]: true;\n  fallbackValue: unknown;\n  badValue: unknown;\n}\nconst brand = Symbol();\nfunction isValueSanitizerErrorInfo(error: unknown):\n    error is ValueSanitizerErrorInfo {\n  return (error as null | Partial<ValueSanitizerErrorInfo>)?.[brand] === true;\n}\n\nfunction debugModeThrowValueSanitizerError(\n    opts: {message: string, fallbackValue: unknown, badValue: unknown}) {\n  const error = new Error(opts.message) as ValueSanitizerErrorInfo;\n  error[brand] = true;\n  error.fallbackValue = opts.fallbackValue;\n  error.badValue = opts.badValue;\n  throw error;\n}\n\n/**\n * Like console.error, only it does nothing in prod, and it gets around\n * a GWS conformance check that's concerned about logging in prod:\n * go/gws-js-conformance#goog-console\n *\n * Using googLog.error is insufficient, as we want the ability to log a Node\n * and not just a string. This is useful in the browser debugger because you\n * can right click on it and see it in the elements panel, getting more context\n * on where the offending node is in your app.\n */\nfunction debugLog(...values: unknown[]) {\n  if (!goog.DEBUG) {\n    return;\n  }\n  const key = 'console';\n  const c = window[key];\n  c.error.apply(c, values);\n}\n","/**\n * @license\n * Copyright Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {DEV_MODE} from '../environment/dev';\nimport {\n  createResourceUrlInternal,\n  TrustedResourceUrl,\n  unwrapResourceUrl,\n} from '../internals/resource_url_impl';\nimport {SafeScript, unwrapScript} from '../internals/script_impl';\nimport {assertIsTemplateObject} from '../internals/string_literal';\n\n/** Type that we know how to interpolate */\ntype Primitive = string | number | boolean;\n\n/**\n * Check whether the base url contains a valid origin,\n *\n * A string for an origin must contain only alphanumeric or any of the\n * following: `-.:`, and must not be an IP address. Remember that, as per the\n * documentation for TrustedResourceUrl, the origin must be trustworthy.\n *\n * @param base The base url that contains an origin.\n */\nfunction hasValidOrigin(base: string): boolean {\n  if (!(/^https:\\/\\//.test(base) || /^\\/\\//.test(base))) {\n    return false;\n  }\n\n  const originStart = base.indexOf('//') + 2;\n  const originEnd = base.indexOf('/', originStart);\n  // If the base url only contains the prefix (e.g. //), or the slash\n  // for the origin is right after the prefix (e.g. ///), the origin is\n  // missing.\n  if (originEnd <= originStart) {\n    throw new Error(\n      `Can't interpolate data in a url's origin, ` +\n        `Please make sure to fully specify the origin, terminated with '/'.`,\n    );\n  }\n\n  const origin = base.substring(originStart, originEnd);\n  if (!/^[0-9a-z.:-]+$/i.test(origin)) {\n    throw new Error('The origin contains unsupported characters.');\n  }\n  if (!/^[^:]*(:[0-9]+)?$/i.test(origin)) {\n    throw new Error('Invalid port number.');\n  }\n  if (!/(^|\\.)[a-z][^.]*$/i.test(origin)) {\n    throw new Error('The top-level domain must start with a letter.');\n  }\n  return true;\n}\n\n/**\n * Check whether the base url contains a valid about url at its beginning.\n *\n * An about url is either exactly 'about:blank' or 'about:blank#<str>' where\n * <str> can be an arbitrary string.\n *\n * @param base The base url.\n */\nfunction isValidAboutUrl(base: string): boolean {\n  if (!/^about:blank/.test(base)) {\n    return false;\n  }\n  if (base !== 'about:blank' && !/^about:blank#/.test(base)) {\n    throw new Error('The about url is invalid.');\n  }\n  return true;\n}\n\n/**\n * Check whether the base url contains a valid path start at its beginning.\n *\n * A valid path start is either a '/' or a '/' followed by at least one\n * character that is not '/' or '\\'.\n *\n * @param base The base url.\n */\nfunction isValidPathStart(base: string): boolean {\n  if (!/^\\//.test(base)) {\n    return false;\n  }\n  if (\n    base === '/' ||\n    (base.length > 1 && base[1] !== '/' && base[1] !== '\\\\')\n  ) {\n    return true;\n  }\n  throw new Error('The path start in the url is invalid.');\n}\n\n/**\n * Check whether the base url contains a valid relative path start at its\n * beginning.\n *\n * A valid relative path start is a non empty string that has no ':', '/' nor\n * '\\', and that is followed by a '/'.\n *\n * @param base The base url.\n */\nfunction isValidRelativePathStart(base: string): boolean {\n  // Using the RegExp syntax as the native JS RegExp syntax is not well handled\n  // by some downstream bundlers with this regex.\n  return new RegExp('^[^:\\\\s\\\\\\\\/]+/').test(base);\n}\n\ninterface UrlSegments {\n  readonly urlPath: string;\n  readonly params: string;\n  readonly fragment: string;\n}\n\n/**\n * Splits an url into segments using '?' and '#' delimiters.\n *\n * The URL can later be put back together by concatenating the returned segments\n * like: path + params + hash. Note that the delimiters '?' and '#' will\n * already be included in 'params' and 'hash' values respectively when these are\n * not empty.\n *\n * @param url The url to split.\n */\nfunction getUrlSegments(url: string): UrlSegments {\n  const parts = url.split(/[?#]/);\n  const params = /[?]/.test(url) ? '?' + parts[1] : '';\n  const fragment = /[#]/.test(url) ? '#' + (params ? parts[2] : parts[1]) : '';\n  return {urlPath: parts[0], params, fragment};\n}\n\n/**\n * Builds TrustedResourceUrl from a template literal.\n *\n * This factory is a template literal tag function. It should be called with\n * a template literal, with or without embedded expressions. For example,\n *               trustedResourceUrl`//example.com/${bar}`;\n * or\n *               trustedResourceUrl`//example.com`;\n *\n * When this function is called with a template literal without any embedded\n * expressions, the template string may contain anything as the whole URL is\n * a compile-time string constant.\n *\n * When this function is called with a template literal that contains embedded\n * expressions, the template must start with one of the following:\n * - `https://<origin>/`\n * - `//<origin>/`\n * - `/<pathStart>`\n * - `<relativePathStart>/`\n * - `about:blank`\n * - `data:`\n *\n * `<origin>` must contain only alphanumeric or any of the following: `-.:`.\n * Remember that, as per the documentation for TrustedResourceUrl, the origin\n * must be trustworthy. An origin of \"example.com\" could be set with this\n * method, but would tie the security of your site to the security of\n * example.com. Similarly, formats that potentially cover redirects hosted\n * on a trusted origin are problematic, since that could lead to untrusted\n * origins.\n *\n * `<pathStart>` is either an empty string, or a non empty string that does not\n * start with '/' or '\\'.\n * In other words, `/<pathStart>` is either a '/' or a\n * '/' followed by at least one character that is not '/' or '\\'.\n *\n * `<relativePathStart> is a non empty string that has no ':', '/' nor '\\'.\n *\n * `data:` (data URL) does not allow embedded expressions in the template\n * literal input.\n *\n * All embedded expressions are URL encoded when they are interpolated. Do not\n * embed expressions that are already URL encoded as they will be double encoded\n * by the builder.\n *\n * @param templateObj This contains the literal part of the template literal.\n * @param rest This represents the template's embedded expressions.\n */\nexport function trustedResourceUrl(\n  templateObj: TemplateStringsArray,\n  ...rest: Primitive[]\n): TrustedResourceUrl {\n  // Check if templateObj is actually from a template literal.\n  if (DEV_MODE) {\n    assertIsTemplateObject(templateObj, rest.length);\n  }\n\n  if (rest.length === 0) {\n    return createResourceUrlInternal(templateObj[0]);\n  }\n\n  const base = templateObj[0].toLowerCase();\n\n  if (DEV_MODE) {\n    if (/^data:/.test(base)) {\n      throw new Error(\n        'Data URLs cannot have expressions in the template literal input.',\n      );\n    }\n\n    if (\n      !hasValidOrigin(base) &&\n      !isValidPathStart(base) &&\n      !isValidRelativePathStart(base) &&\n      !isValidAboutUrl(base)\n    ) {\n      throw new Error(\n        'Trying to interpolate expressions in an unsupported url format.',\n      );\n    }\n  }\n\n  let url = templateObj[0];\n  for (let i = 0; i < rest.length; i++) {\n    url += encodeURIComponent(rest[i]) + templateObj[i + 1];\n  }\n  return createResourceUrlInternal(url);\n}\n\n/**\n * Similar to iterable, but using the concrete types so we don't rely on the\n * iterable protocol, which needs a poyfill in ES5\n */\ntype IterableEntries<U> =\n  | ReadonlyMap<string, U>\n  | ReadonlyArray<[string, U]>\n  | Readonly<Record<string, U>>;\ntype SearchParams =\n  | IterableEntries<\n      Primitive | null | undefined | ReadonlyArray<Primitive | null | undefined>\n    >\n  // BEGIN-INTERNAL\n  | IterableEntries<string>\n  // Explicit type union for compatibility with the Closure compiler since it\n  // doesn't support covariance.\n  // END-INTERNAL\n  | URLSearchParams;\n\n/**\n * Creates a new TrustedResourceUrl with params to replace the URL's existing\n * search parameters.\n *\n * @param params What to add to the URL. Parameters with value `null` or\n * `undefined` are skipped. Both keys and values will be encoded. Do not pass\n * pre-encoded values as this will result them being double encoded. If the\n * value is an array then the same parameter is added for every element in the\n * array.\n */\nexport function replaceParams(\n  trustedUrl: TrustedResourceUrl,\n  params: SearchParams,\n): TrustedResourceUrl {\n  const urlSegments = getUrlSegments(unwrapResourceUrl(trustedUrl).toString());\n  return appendParamsInternal(\n    urlSegments.urlPath,\n    '',\n    urlSegments.fragment,\n    params,\n  );\n}\n\n/**\n * Creates a new TrustedResourceUrl with params added to the URL's search\n * parameters.\n *\n * @param params What to add to the URL. Parameters with value `null` or\n * `undefined` are skipped. Both keys and values will be encoded. Do not pass\n * pre-encoded values as this will result them being double encoded. If the\n * value is an array then the same parameter is added for every element in the\n * array.\n */\nexport function appendParams(\n  trustedUrl: TrustedResourceUrl,\n  params: SearchParams,\n): TrustedResourceUrl {\n  const urlSegments = getUrlSegments(unwrapResourceUrl(trustedUrl).toString());\n  return appendParamsInternal(\n    urlSegments.urlPath,\n    urlSegments.params,\n    urlSegments.fragment,\n    params,\n  );\n}\n\nfunction appendParamsInternal(\n  path: string,\n  params: string,\n  hash: string,\n  newParams: SearchParams,\n): TrustedResourceUrl {\n  let separator = params.length ? '&' : '?';\n\n  function addParam(\n    value:\n      | Primitive\n      | null\n      | undefined\n      | ReadonlyArray<Primitive | null | undefined>,\n    key: string,\n  ): void {\n    if (value == null) {\n      return;\n    }\n\n    if (isArray(value)) {\n      // tslint:disable-next-line:g3-no-void-expression\n      value.forEach((v) => addParam(v, key));\n    } else {\n      params +=\n        separator + encodeURIComponent(key) + '=' + encodeURIComponent(value);\n      separator = '&';\n    }\n  }\n\n  if (isPlainObject(newParams)) {\n    newParams = Object.entries(newParams);\n  }\n\n  // Avoids for-of and/or Array.from which has a big polyfill in ES5.\n  if (isArray(newParams)) {\n    // tslint:disable-next-line:g3-no-void-expression\n    newParams.forEach((pair) => addParam(pair[1], pair[0]));\n  } else {\n    // tslint:disable-next-line:g3-no-void-expression\n    newParams.forEach(addParam);\n  }\n\n  return createResourceUrlInternal(path + params + hash);\n}\n\nfunction isArray<T>(x: unknown | readonly T[]): x is readonly T[] {\n  return Array.isArray(x);\n}\n\nfunction isPlainObject<T>(\n  x: object | Record<string, T>,\n): x is Record<string, T> {\n  return x.constructor === Object;\n}\n\nconst BEFORE_FRAGMENT_REGEXP = /[^#]*/;\n\n/**\n * Creates a new TrustedResourceUrl based on an existing one but with the\n * addition of a fragment (the part after `#`). If the URL already has a\n * fragment, it is replaced with the new one.\n * @param fragment The fragment to add to the URL, verbatim, without the leading\n * `#`. No additional escaping is applied.\n */\nexport function replaceFragment(\n  trustedUrl: TrustedResourceUrl,\n  fragment: string,\n): TrustedResourceUrl {\n  const urlString = unwrapResourceUrl(trustedUrl).toString();\n  return createResourceUrlInternal(\n    BEFORE_FRAGMENT_REGEXP.exec(urlString)![0] +\n      (fragment.trim() ? '#' + fragment : ''),\n  );\n}\n\n/**\n * Creates a new TrustedResourceUrl based on an existing one with a single\n * subpath segment added to the end of the existing path and prior to any query\n * parameters and/or fragments that already exist in the URL.\n * @param pathSegment The singular sub path being added to the URL. Do not pass\n *     a pre-encoded value as this will result in it being double encoded.\n */\nexport function appendPathSegment(\n  trustedUrl: TrustedResourceUrl,\n  pathSegment: string,\n): TrustedResourceUrl {\n  const urlSegments = getUrlSegments(unwrapResourceUrl(trustedUrl).toString());\n\n  const separator = urlSegments.urlPath.slice(-1) === '/' ? '' : '/';\n  const newPath =\n    urlSegments.urlPath + separator + encodeURIComponent(pathSegment);\n\n  return createResourceUrlInternal(\n    newPath + urlSegments.params + urlSegments.fragment,\n  );\n}\n\n/**\n * Creates a `TrustedResourceUrl` by generating a `Blob` from a\n * `SafeScript` and then calling `URL.createObjectURL` with that `Blob`.\n *\n * Caller must call `URL.revokeObjectURL()` on the stringified url to\n * release the underlying `Blob`.\n */\nexport function objectUrlFromScript(\n  safeScript: SafeScript,\n): TrustedResourceUrl {\n  const scriptContent = unwrapScript(safeScript).toString();\n  const blob = new Blob([scriptContent], {type: 'text/javascript'});\n  return createResourceUrlInternal(URL.createObjectURL(blob));\n}\n\n/**\n * A function to safely retrieve the base URI from the Window object and set it\n * at the beginning of a given path-relative (starts with \"/\") resource url.\n *\n * @param pathRelativeUrl The resource to which the origin shall be prepended.\n */\nexport function toAbsoluteResourceUrl(\n  pathRelativeUrl: TrustedResourceUrl,\n): TrustedResourceUrl {\n  const originalUrl = unwrapResourceUrl(pathRelativeUrl).toString();\n  const qualifiedUrl = new URL(originalUrl, window.document.baseURI);\n  return createResourceUrlInternal(qualifiedUrl.toString());\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {isPolyfilledSymbol} from './polyfill-support';\n// IMPORTANT: these imports must be type-only\nimport type {Directive, DirectiveResult, PartInfo} from './directive.js';\ntype TrustedTypesWindow = Window;\n\nimport {sanitizerFactory as google3SanitizerFactory} from './internal-security.js';\nimport {disableSanitizationCapability} from './disable_sanitization_capability.js';\n\nimport {DEV_MODE} from '@lit/reactive-element/dev-mode'; // COPYBARA: const\nconst ENABLE_EXTRA_SECURITY_HOOKS = true;\nconst ENABLE_SHADYDOM_NOPATCH = true;\nimport {IS_SERVERSIDE as NODE_MODE} from 'google3/javascript/lit/is_serverside';\n\n// Allows minifiers to rename references to globalThis\nconst global = goog.global;\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace LitUnstable {\n  /**\n   * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n   * we will emit 'lit-debug' events to window, with live details about the update and render\n   * lifecycle. These can be useful for writing debug tooling and visualizations.\n   *\n   * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n   * making certain operations that are normally very cheap (like a no-op render) much slower,\n   * because we must copy data and dispatch events.\n   */\n  // eslint-disable-next-line @typescript-eslint/no-namespace\n  export namespace DebugLog {\n    export type Entry =\n      | TemplatePrep\n      | TemplateInstantiated\n      | TemplateInstantiatedAndUpdated\n      | TemplateUpdating\n      | BeginRender\n      | EndRender\n      | CommitPartEntry\n      | SetPartValue;\n    export interface TemplatePrep {\n      kind: 'template prep';\n      template: Template;\n      strings: TemplateStringsArray;\n      clonableTemplate: HTMLTemplateElement;\n      parts: TemplatePart[];\n    }\n    export interface BeginRender {\n      kind: 'begin render';\n      id: number;\n      value: unknown;\n      container: HTMLElement | DocumentFragment;\n      options: RenderOptions | undefined;\n      part: ChildPart | undefined;\n    }\n    export interface EndRender {\n      kind: 'end render';\n      id: number;\n      value: unknown;\n      container: HTMLElement | DocumentFragment;\n      options: RenderOptions | undefined;\n      part: ChildPart;\n    }\n    export interface TemplateInstantiated {\n      kind: 'template instantiated';\n      template: Template | CompiledTemplate;\n      instance: TemplateInstance;\n      options: RenderOptions | undefined;\n      fragment: Node;\n      parts: Array<Part | undefined>;\n      values: unknown[];\n    }\n    export interface TemplateInstantiatedAndUpdated {\n      kind: 'template instantiated and updated';\n      template: Template | CompiledTemplate;\n      instance: TemplateInstance;\n      options: RenderOptions | undefined;\n      fragment: Node;\n      parts: Array<Part | undefined>;\n      values: unknown[];\n    }\n    export interface TemplateUpdating {\n      kind: 'template updating';\n      template: Template | CompiledTemplate;\n      instance: TemplateInstance;\n      options: RenderOptions | undefined;\n      parts: Array<Part | undefined>;\n      values: unknown[];\n    }\n    export interface SetPartValue {\n      kind: 'set part';\n      part: Part;\n      value: unknown;\n      valueIndex: number;\n      values: unknown[];\n      templateInstance: TemplateInstance;\n    }\n\n    export type CommitPartEntry =\n      | CommitNothingToChildEntry\n      | CommitText\n      | CommitNode\n      | CommitAttribute\n      | CommitProperty\n      | CommitBooleanAttribute\n      | CommitEventListener\n      | CommitToElementBinding;\n\n    export interface CommitNothingToChildEntry {\n      kind: 'commit nothing to child';\n      start: ChildNode;\n      end: ChildNode | null;\n      parent: Disconnectable | undefined;\n      options: RenderOptions | undefined;\n    }\n\n    export interface CommitText {\n      kind: 'commit text';\n      node: Text;\n      value: unknown;\n      options: RenderOptions | undefined;\n    }\n\n    export interface CommitNode {\n      kind: 'commit node';\n      start: Node;\n      parent: Disconnectable | undefined;\n      value: Node;\n      options: RenderOptions | undefined;\n    }\n\n    export interface CommitAttribute {\n      kind: 'commit attribute';\n      element: Element;\n      name: string;\n      value: unknown;\n      options: RenderOptions | undefined;\n    }\n\n    export interface CommitProperty {\n      kind: 'commit property';\n      element: Element;\n      name: string;\n      value: unknown;\n      options: RenderOptions | undefined;\n    }\n\n    export interface CommitBooleanAttribute {\n      kind: 'commit boolean attribute';\n      element: Element;\n      name: string;\n      value: boolean;\n      options: RenderOptions | undefined;\n    }\n\n    export interface CommitEventListener {\n      kind: 'commit event listener';\n      element: Element;\n      name: string;\n      value: unknown;\n      oldListener: unknown;\n      options: RenderOptions | undefined;\n      // True if we're removing the old event listener (e.g. because settings changed, or value is nothing)\n      removeListener: boolean;\n      // True if we're adding a new event listener (e.g. because first render, or settings changed)\n      addListener: boolean;\n    }\n\n    export interface CommitToElementBinding {\n      kind: 'commit to element binding';\n      element: Element;\n      value: unknown;\n      options: RenderOptions | undefined;\n    }\n  }\n}\n\ninterface DebugLoggingWindow {\n  // Even in dev mode, we generally don't want to emit these events, as that's\n  // another level of cost, so only emit them when DEV_MODE is true _and_ when\n  // window.emitLitDebugEvents is true.\n  emitLitDebugLogEvents?: boolean;\n}\n\n/**\n * Useful for visualizing and logging insights into what the Lit template system is doing.\n *\n * Compiled out of prod mode builds.\n */\nconst debugLogEvent = DEV_MODE\n  ? (event: LitUnstable.DebugLog.Entry) => {\n      const shouldEmit = (global as unknown as DebugLoggingWindow)\n        .emitLitDebugLogEvents;\n      if (!shouldEmit) {\n        return;\n      }\n      global.dispatchEvent(\n        new CustomEvent<LitUnstable.DebugLog.Entry>('lit-debug', {\n          detail: event,\n        })\n      );\n    }\n  : undefined;\n// Used for connecting beginRender and endRender events when there are nested\n// renders when errors are thrown preventing an endRender event from being\n// called.\nlet debugLogRenderId = 0;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nif (DEV_MODE) {\n  global.litIssuedWarnings ??= new Set();\n\n  /**\n   * Issue a warning if we haven't already, based either on `code` or `warning`.\n   * Warnings are disabled automatically only by `warning`; disabling via `code`\n   * can be done by users.\n   */\n  issueWarning = (code: string, warning: string) => {\n    warning += code\n      ? ` See https://lit.dev/msg/${code} for more information.`\n      : '';\n    if (\n      !global.litIssuedWarnings!.has(warning) &&\n      !global.litIssuedWarnings!.has(code)\n    ) {\n      console.warn(warning);\n      global.litIssuedWarnings!.add(warning);\n    }\n  };\n}\n\nconst wrap =\n  ENABLE_SHADYDOM_NOPATCH &&\n  global.ShadyDOM?.inUse &&\n  (global.ShadyDOM?.noPatch === true ||\n                        global.ShadyDOM?.noPatch === 'on-demand')\n    ? (global.ShadyDOM!.wrap as <T extends Node>(node: T) => T)\n    : <T extends Node>(node: T) => node;\n\nconst trustedTypes = (global as unknown as TrustedTypesWindow).trustedTypes;\n\n/**\n * Our TrustedTypePolicy for HTML which is declared using the html template\n * tag function.\n *\n * That HTML is a developer-authored constant, and is parsed with innerHTML\n * before any untrusted expressions have been mixed in. Therefor it is\n * considered safe by construction.\n */\nconst policy = {valueOf: () => trustedTypes\n  ? trustedTypes.createPolicy('lit-html', {\n      createHTML: (s) => s,\n    })\n  : undefined}.valueOf();\n\n/**\n * Used to sanitize any value before it is written into the DOM. This can be\n * used to implement a security policy of allowed and disallowed values in\n * order to prevent XSS attacks.\n *\n * One way of using this callback would be to check attributes and properties\n * against a list of high risk fields, and require that values written to such\n * fields be instances of a class which is safe by construction. Closure's Safe\n * HTML Types is one implementation of this technique (\n * https://github.com/google/safe-html-types/blob/master/doc/safehtml-types.md).\n * The TrustedTypes polyfill in API-only mode could also be used as a basis\n * for this technique (https://github.com/WICG/trusted-types).\n *\n * @param node The HTML node (usually either a #text node or an Element) that\n *     is being written to. Note that this is just an exemplar node, the write\n *     may take place against another instance of the same class of node.\n * @param name The name of an attribute or property (for example, 'href').\n * @param type Indicates whether the write that's about to be performed will\n *     be to a property or a node.\n * @return A function that will sanitize this class of writes.\n */\nexport type SanitizerFactory = (\n  node: Node,\n  name: string,\n  type: 'property' | 'attribute'\n) => ValueSanitizer;\n\n/**\n * A function which can sanitize values that will be written to a specific kind\n * of DOM sink.\n *\n * See SanitizerFactory.\n *\n * @param value The value to sanitize. Will be the actual value passed into\n *     the lit-html template literal, so this could be of any type.\n * @return The value to write to the DOM. Usually the same as the input value,\n *     unless sanitization is needed.\n */\nexport type ValueSanitizer = (value: unknown) => unknown;\n\nconst identityFunction: ValueSanitizer = (value: unknown) => value;\nconst noopSanitizer: SanitizerFactory = (\n  _node: Node,\n  _name: string,\n  _type: 'property' | 'attribute'\n) => identityFunction;\n\n/** Sets the global sanitizer factory. */\nconst setSanitizer = (newSanitizer: SanitizerFactory) => {\n  if (!ENABLE_EXTRA_SECURITY_HOOKS) {\n    return;\n  }\n  if (sanitizerFactoryInternal !== noopSanitizer) {\n    throw new Error(\n      `Attempted to overwrite existing lit-html security policy.` +\n        ` setSanitizeDOMValueFactory should be called at most once.`\n    );\n  }\n  sanitizerFactoryInternal = newSanitizer;\n};\n\n/**\n * Only used in internal tests, not a part of the public API.\n */\nconst _testOnlyClearSanitizerFactoryDoNotCallOrElse = () => {\n  sanitizerFactoryInternal = noopSanitizer;\n};\n\nconst templateStringContentsToTemplates = new Map<string, Template>();\n\nconst createSanitizer: SanitizerFactory = (node, name, type) => {\n  return sanitizerFactoryInternal(node, name, type);\n};\n\n// Added to an attribute name to mark the attribute as bound so we can find\n// it easily.\nconst boundAttributeSuffix = '$lit$';\n\n// This marker is used in many syntactic positions in HTML, so it must be\n// a valid element name and attribute name. We don't support dynamic names (yet)\n// but this at least ensures that the parse tree is closer to the template\n// intention.\nconst marker = `lit$${Math.random().toFixed(9).slice(2)}$`;\n\n// String used to tell if a comment is a marker comment\nconst markerMatch = '?' + marker;\n\n// Text used to insert a comment marker node. We use processing instruction\n// syntax because it's slightly smaller, but parses as a comment node.\nconst nodeMarker = `<${markerMatch}>`;\n\nconst d =\n  NODE_MODE && global.document === undefined\n    ? ({\n        createTreeWalker() {\n          return {};\n        },\n      } as unknown as Document)\n    : document;\n\n// Creates a dynamic marker. We never have to search for these in the DOM.\nconst createMarker = () => d.createComment('');\n\n// https://tc39.github.io/ecma262/#sec-typeof-operator\ntype Primitive = null | undefined | boolean | number | string | symbol | bigint;\nconst isPrimitive = (value: unknown): value is Primitive => value === null ||\n    (typeof value != 'object' && typeof value != 'function') ||\n    isPolyfilledSymbol(value);\nconst isArray = Array.isArray;\nconst isIterable = (value: unknown): value is Iterable<unknown> =>\n  isArray(value) ||\n  // tslint:disable-next-line:no-any\n  typeof (value as any)?.[Symbol.iterator] === 'function';\n\nconst SPACE_CHAR = `[ \\t\\n\\f\\r]`;\nconst ATTR_VALUE_CHAR = `[^ \\t\\n\\f\\r\"'\\`<>=]`;\nconst NAME_CHAR = `[^\\\\s\"'>=/]`;\n\n// These regexes represent the five parsing states that we care about in the\n// Template's HTML scanner. They match the *end* of the state they're named\n// after.\n// Depending on the match, we transition to a new state. If there's no match,\n// we stay in the same state.\n// Note that the regexes are stateful. We utilize lastIndex and sync it\n// across the multiple regexes used. In addition to the five regexes below\n// we also dynamically create a regex to find the matching end tags for raw\n// text elements.\n\n/**\n * End of text is: `<` followed by:\n *   (comment start) or (tag) or (dynamic tag binding)\n */\nconst textEndRegex = /<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g;\nconst COMMENT_START = 1;\nconst TAG_NAME = 2;\nconst DYNAMIC_TAG_NAME = 3;\n\nconst commentEndRegex = /--\u003e/g;\n/**\n * Comments not started with \u003c!--, like </{, can be ended by a single `>`\n */\nconst comment2EndRegex = />/g;\n\n/**\n * The tagEnd regex matches the end of the \"inside an opening\" tag syntax\n * position. It either matches a `>`, an attribute-like sequence, or the end\n * of the string after a space (attribute-name position ending).\n *\n * See attributes in the HTML spec:\n * https://www.w3.org/TR/html5/syntax.html#elements-attributes\n *\n * \" \\t\\n\\f\\r\" are HTML space characters:\n * https://infra.spec.whatwg.org/#ascii-whitespace\n *\n * So an attribute is:\n *  * The name: any character except a whitespace character, (\"), ('), \">\",\n *    \"=\", or \"/\". Note: this is different from the HTML spec which also excludes control characters.\n *  * Followed by zero or more space characters\n *  * Followed by \"=\"\n *  * Followed by zero or more space characters\n *  * Followed by:\n *    * Any character except space, ('), (\"), \"<\", \">\", \"=\", (`), or\n *    * (\") then any non-(\"), or\n *    * (') then any non-(')\n */\nconst tagEndRegex = new RegExp(\n  `>|${SPACE_CHAR}(?:(${NAME_CHAR}+)(${SPACE_CHAR}*=${SPACE_CHAR}*(?:${ATTR_VALUE_CHAR}|(\"|')|))|$)`,\n  'g'\n);\nconst ENTIRE_MATCH = 0;\nconst ATTRIBUTE_NAME = 1;\nconst SPACES_AND_EQUALS = 2;\nconst QUOTE_CHAR = 3;\n\nconst singleQuoteAttrEndRegex = /'/g;\nconst doubleQuoteAttrEndRegex = /\"/g;\n/**\n * Matches the raw text elements.\n *\n * Comments are not parsed within raw text elements, so we need to search their\n * text content for marker strings.\n */\nconst rawTextElement = /^(?:script|style|textarea|title)$/i;\n\n/** TemplateResult types */\nconst HTML_RESULT = 1;\nconst SVG_RESULT = 2;\nconst MATHML_RESULT = 3;\n\ntype ResultType = typeof HTML_RESULT | typeof SVG_RESULT | typeof MATHML_RESULT;\n\n// TemplatePart types\n// IMPORTANT: these must match the values in PartType\nconst ATTRIBUTE_PART = 1;\nconst CHILD_PART = 2;\nconst PROPERTY_PART = 3;\nconst BOOLEAN_ATTRIBUTE_PART = 4;\nconst EVENT_PART = 5;\nconst ELEMENT_PART = 6;\nconst COMMENT_PART = 7;\n\n/**\n * The return type of the template tag functions, {@linkcode html} and\n * {@linkcode svg} when it hasn't been compiled by @lit-labs/compiler.\n *\n * A `TemplateResult` object holds all the information about a template\n * expression required to render it: the template strings, expression values,\n * and type of template (html or svg).\n *\n * `TemplateResult` objects do not create any DOM on their own. To create or\n * update DOM you need to render the `TemplateResult`. See\n * [Rendering](https://lit.dev/docs/components/rendering) for more information.\n *\n */\nexport type UncompiledTemplateResult<T extends ResultType = ResultType> = {\n  // This property needs to remain unminified.\n  ['_$litType$']: T;\n  strings: TemplateStringsArray;\n  values: unknown[];\n};\n\n/**\n * This is a template result that may be either uncompiled or compiled.\n *\n * In the future, TemplateResult will be this type. If you want to explicitly\n * note that a template result is potentially compiled, you can reference this\n * type and it will continue to behave the same through the next major version\n * of Lit. This can be useful for code that wants to prepare for the next\n * major version of Lit.\n */\nexport type MaybeCompiledTemplateResult<T extends ResultType = ResultType> =\n  | UncompiledTemplateResult<T>\n  | CompiledTemplateResult;\n\n/**\n * The return type of the template tag functions, {@linkcode html} and\n * {@linkcode svg}.\n *\n * A `TemplateResult` object holds all the information about a template\n * expression required to render it: the template strings, expression values,\n * and type of template (html or svg).\n *\n * `TemplateResult` objects do not create any DOM on their own. To create or\n * update DOM you need to render the `TemplateResult`. See\n * [Rendering](https://lit.dev/docs/components/rendering) for more information.\n *\n * In Lit 4, this type will be an alias of\n * MaybeCompiledTemplateResult, so that code will get type errors if it assumes\n * that Lit templates are not compiled. When deliberately working with only\n * one, use either {@linkcode CompiledTemplateResult} or\n * {@linkcode UncompiledTemplateResult} explicitly.\n */\nexport type TemplateResult<T extends ResultType = ResultType> =\n  MaybeCompiledTemplateResult<T>;\n\nexport type HTMLTemplateResult = TemplateResult<typeof HTML_RESULT>;\n\nexport type SVGTemplateResult = TemplateResult<typeof SVG_RESULT>;\n\nexport type MathMLTemplateResult = TemplateResult<typeof MATHML_RESULT>;\n\n/**\n * A TemplateResult that has been compiled by @lit-labs/compiler, skipping the\n * prepare step.\n */\nexport interface CompiledTemplateResult {\n  // This is a factory in order to make template initialization lazy\n  // and allow ShadyRenderOptions scope to be passed in.\n  // This property needs to remain unminified.\n  ['_$litType$']: CompiledTemplate;\n  values: unknown[];\n}\n\nexport interface CompiledTemplate extends Omit<Template, 'el'> {\n  // el is overridden to be optional. We initialize it on first render\n  el?: HTMLTemplateElement;\n\n  // The prepared HTML string to create a template element from.\n  // The type is a TemplateStringsArray to guarantee that the value came from\n  // source code, preventing a JSON injection attack.\n  h: TemplateStringsArray;\n}\n\n/**\n * Generates a template literal tag function that returns a TemplateResult with\n * the given result type.\n */\nconst tag =\n  <T extends ResultType>(type: T) =>\n  (strings: TemplateStringsArray, ...values: unknown[]): TemplateResult<T> => {\n    // Warn against templates octal escape sequences\n    // We do this here rather than in render so that the warning is closer to the\n    // template definition.\n    if (DEV_MODE && strings.some((s) => s === undefined)) {\n      console.warn(\n        'Some template strings are undefined.\\n' +\n          'This is probably caused by illegal octal escape sequences.'\n      );\n    }\n    if (DEV_MODE) {\n      // Import static-html.js results in a circular dependency which g3 doesn't\n      // handle. Instead we know that static values must have the field\n      // `_$litStatic$`.\n      if (\n        values.some((val) => (val as {_$litStatic$: unknown})?.['_$litStatic$'])\n      ) {\n        issueWarning(\n          '',\n          `Static values 'literal' or 'unsafeStatic' cannot be used as values to non-static templates.\\n` +\n            `Please use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions`\n        );\n      }\n    }\n    return {\n      // This property needs to remain unminified.\n      ['_$litType$']: type,\n      strings,\n      values,\n    };\n  };\n\n/**\n * Interprets a template literal as an HTML template that can efficiently\n * render to and update a container.\n *\n * ```ts\n * const header = (title: string) => html`<h1>${title}</h1>`;\n * ```\n *\n * The `html` tag returns a description of the DOM to render as a value. It is\n * lazy, meaning no work is done until the template is rendered. When rendering,\n * if a template comes from the same expression as a previously rendered result,\n * it's efficiently updated instead of replaced.\n */\nexport const html = (strings: TemplateStringsArray, ...values: unknown[]):\n    TemplateResult<typeof HTML_RESULT> => {\n      return {\n        // This property needs to remain unminified.\n        ['_$litType$']: HTML_RESULT,\n        strings,\n        values,\n      };\n    };\n\n/**\n * Interprets a template literal as an SVG fragment that can efficiently render\n * to and update a container.\n *\n * ```ts\n * const rect = svg`<rect width=\"10\" height=\"10\"></rect>`;\n *\n * const myImage = html`\n *   <svg viewBox=\"0 0 10 10\" xmlns=\"http://www.w3.org/2000/svg\">\n *     ${rect}\n *   </svg>`;\n * ```\n *\n * The `svg` *tag function* should only be used for SVG fragments, or elements\n * that would be contained **inside** an `<svg>` HTML element. A common error is\n * placing an `<svg>` *element* in a template tagged with the `svg` tag\n * function. The `<svg>` element is an HTML element and should be used within a\n * template tagged with the {@linkcode html} tag function.\n *\n * In LitElement usage, it's invalid to return an SVG fragment from the\n * `render()` method, as the SVG fragment will be contained within the element's\n * shadow root and thus not be properly contained within an `<svg>` HTML\n * element.\n */\nexport const svg = (strings: TemplateStringsArray, ...values: unknown[]):\n    TemplateResult<typeof SVG_RESULT> => {\n      return {\n        // This property needs to remain unminified.\n        ['_$litType$']: SVG_RESULT,\n        strings,\n        values,\n      };\n    };\n\n/**\n * Interprets a template literal as MathML fragment that can efficiently render\n * to and update a container.\n *\n * ```ts\n * const num = mathml`<mn>1</mn>`;\n *\n * const eq = html`\n *   <math>\n *     ${num}\n *   </math>`;\n * ```\n *\n * The `mathml` *tag function* should only be used for MathML fragments, or\n * elements that would be contained **inside** a `<math>` HTML element. A common\n * error is placing a `<math>` *element* in a template tagged with the `mathml`\n * tag function. The `<math>` element is an HTML element and should be used\n * within a template tagged with the {@linkcode html} tag function.\n *\n * In LitElement usage, it's invalid to return an MathML fragment from the\n * `render()` method, as the MathML fragment will be contained within the\n * element's shadow root and thus not be properly contained within a `<math>`\n * HTML element.\n */\nexport const mathml = tag(MATHML_RESULT);\n\n/**\n * A sentinel value that signals that a value was handled by a directive and\n * should not be written to the DOM.\n */\nexport const noChange: unique symbol = {valueOf: () => Symbol.for ? Symbol.for('lit-noChange') : Symbol('lit-noChange')}.valueOf() as any;\n\n/**\n * A sentinel value that signals a ChildPart to fully clear its content.\n *\n * ```ts\n * const button = html`${\n *  user.isAdmin\n *    ? html`<button>DELETE</button>`\n *    : nothing\n * }`;\n * ```\n *\n * Prefer using `nothing` over other falsy values as it provides a consistent\n * behavior between various expression binding contexts.\n *\n * In child expressions, `undefined`, `null`, `''`, and `nothing` all behave the\n * same and render no nodes. In attribute expressions, `nothing` _removes_ the\n * attribute, while `undefined` and `null` will render an empty string. In\n * property expressions `nothing` becomes `undefined`.\n */\nexport const nothing: unique symbol = {valueOf: () => Symbol.for ? Symbol.for('lit-nothing') : Symbol('lit-nothing')}.valueOf() as any;\n\n/**\n * The cache of prepared templates, keyed by the tagged TemplateStringsArray\n * and _not_ accounting for the specific template tag used. This means that\n * template tags cannot be dynamic - they must statically be one of html, svg,\n * or attr. This restriction simplifies the cache lookup, which is on the hot\n * path for rendering.\n */\nconst templateCache = new WeakMap<TemplateStringsArray, Template>();\n\n/**\n * Object specifying options for controlling lit-html rendering. Note that\n * while `render` may be called multiple times on the same `container` (and\n * `renderBefore` reference node) to efficiently update the rendered content,\n * only the options passed in during the first render are respected during\n * the lifetime of renders to that unique `container` + `renderBefore`\n * combination.\n */\nexport interface RenderOptions {\n  /**\n   * An object to use as the `this` value for event listeners. It's often\n   * useful to set this to the host component rendering a template.\n   */\n  host?: object;\n  /**\n   * A DOM node before which to render content in the container.\n   */\n  renderBefore?: ChildNode | null;\n  /**\n   * Node used for cloning the template (`importNode` will be called on this\n   * node). This controls the `ownerDocument` of the rendered DOM, along with\n   * any inherited context. Defaults to the global `document`.\n   */\n  creationScope?: {importNode(node: Node, deep?: boolean): Node};\n  /**\n   * The initial connected state for the top-level part being rendered. If no\n   * `isConnected` option is set, `AsyncDirective`s will be connected by\n   * default. Set to `false` if the initial render occurs in a disconnected tree\n   * and `AsyncDirective`s should see `isConnected === false` for their initial\n   * render. The `part.setConnected()` method must be used subsequent to initial\n   * render to change the connected state of the part.\n   */\n  isConnected?: boolean;\n}\n\nconst walker = {valueOf: () =>d.createTreeWalker(\n  d,\n  129 /* NodeFilter.SHOW_{ELEMENT|COMMENT} */\n)}.valueOf();\n\nlet sanitizerFactoryInternal: SanitizerFactory = google3SanitizerFactory;\n\n/**\n * Disables resin.\n *\n * This will be removed soon, see the docs on\n * //third_party/javascript/lit_html:disable_sanitization_capability\n */\nexport const deprecatedUnsafeDisableSecurity = (capability: object) => {\n  // Use the disableSanitizationCapability to visibility-restrict the\n  // ability to disable sanitization, so that we can eventually remove\n  // that capability entirely.\n  if (capability !== disableSanitizationCapability) {\n    throw new Error(\n        `To disable sanitization of lit-html expressions you must pass ` +\n        `in the disableSanitizationCapability object.`);\n  }\n  sanitizerFactoryInternal = noopSanitizer;\n};\n\n\n//\n// Classes only below here, const variable declarations only above here...\n//\n// Keeping variable declarations and classes together improves minification.\n// Interfaces and type aliases can be interleaved freely.\n//\n\n// Type for classes that have a `_directive` or `_directives[]` field, used by\n// `resolveDirective`\nexport interface DirectiveParent {\n  _$parent?: DirectiveParent;\n  _$isConnected: boolean;\n  __directive?: Directive;\n  __directives?: Array<Directive | undefined>;\n}\n\nfunction trustFromTemplateString(\n  tsa: TemplateStringsArray,\n  stringFromTSA: string\n): TrustedHTML {\n  // A security check to prevent spoofing of Lit template results.\n  // In the future, we may be able to replace this with Array.isTemplateObject,\n  // though we might need to make that check inside of the html and svg\n  // functions, because precompiled templates don't come in as\n  // TemplateStringArray objects.\n  if (!isArray(tsa) || !tsa.hasOwnProperty('raw')) {\n    let message = 'invalid template strings array';\n    if (DEV_MODE) {\n      message = `\n          Internal Error: expected template strings to be an array\n          with a 'raw' field. Faking a template strings array by\n          calling html or svg like an ordinary function is effectively\n          the same as calling unsafeHtml and can lead to major security\n          issues, e.g. opening your code up to XSS attacks.\n          If you're using the html or svg tagged template functions normally\n          and still seeing this error, please file a bug at\n          https://github.com/lit/lit/issues/new?template=bug_report.md\n          and include information about your build tooling, if any.\n        `\n        .trim()\n        .replace(/\\n */g, '\\n');\n    }\n    throw new Error(message);\n  }\n  return policy !== undefined\n    ? policy.createHTML(stringFromTSA)\n    : (stringFromTSA as unknown as TrustedHTML);\n}\n\n/**\n * Returns an HTML string for the given TemplateStringsArray and result type\n * (HTML or SVG), along with the case-sensitive bound attribute names in\n * template order. The HTML contains comment markers denoting the `ChildPart`s\n * and suffixes on bound attributes denoting the `AttributeParts`.\n *\n * @param strings template strings array\n * @param type HTML or SVG\n * @return Array containing `[html, attrNames]` (array returned for terseness,\n *     to avoid object fields since this code is shared with non-minified SSR\n *     code)\n */\nconst getTemplateHtml = (\n  strings: TemplateStringsArray,\n  type: ResultType\n): [TrustedHTML, Array<string>] => {\n  // Insert makers into the template HTML to represent the position of\n  // bindings. The following code scans the template strings to determine the\n  // syntactic position of the bindings. They can be in text position, where\n  // we insert an HTML comment, attribute value position, where we insert a\n  // sentinel string and re-write the attribute name, or inside a tag where\n  // we insert the sentinel string.\n  const l = strings.length - 1;\n  // Stores the case-sensitive bound attribute names in the order of their\n  // parts. ElementParts are also reflected in this array as undefined\n  // rather than a string, to disambiguate from attribute bindings.\n  const attrNames: Array<string> = [];\n  let html =\n    type === SVG_RESULT ? '<svg>' : type === MATHML_RESULT ? '<math>' : '';\n\n  // When we're inside a raw text tag (not it's text content), the regex\n  // will still be tagRegex so we can find attributes, but will switch to\n  // this regex when the tag ends.\n  let rawTextEndRegex: RegExp | undefined;\n\n  // The current parsing state, represented as a reference to one of the\n  // regexes\n  let regex = textEndRegex;\n\n  for (let i = 0; i < l; i++) {\n    const s = strings[i];\n    // The index of the end of the last attribute name. When this is\n    // positive at end of a string, it means we're in an attribute value\n    // position and need to rewrite the attribute name.\n    // We also use a special value of -2 to indicate that we encountered\n    // the end of a string in attribute name position.\n    let attrNameEndIndex = -1;\n    let attrName: string | undefined;\n    let lastIndex = 0;\n    let match!: RegExpExecArray | null;\n\n    // The conditions in this loop handle the current parse state, and the\n    // assignments to the `regex` variable are the state transitions.\n    while (lastIndex < s.length) {\n      // Make sure we start searching from where we previously left off\n      regex.lastIndex = lastIndex;\n      match = regex.exec(s);\n      if (match === null) {\n        break;\n      }\n      lastIndex = regex.lastIndex;\n      if (regex === textEndRegex) {\n        if (match[COMMENT_START] === '!--') {\n          regex = commentEndRegex;\n        } else if (match[COMMENT_START] !== undefined) {\n          // We started a weird comment, like </{\n          regex = comment2EndRegex;\n        } else if (match[TAG_NAME] !== undefined) {\n          if (rawTextElement.test(match[TAG_NAME])) {\n            // Record if we encounter a raw-text element. We'll switch to\n            // this regex at the end of the tag.\n            rawTextEndRegex = new RegExp(`</${match[TAG_NAME]}`, 'g');\n          }\n          regex = tagEndRegex;\n        } else if (match[DYNAMIC_TAG_NAME] !== undefined) {\n          if (DEV_MODE) {\n            throw new Error(\n              'Bindings in tag names are not supported. Please use static templates instead. ' +\n                'See https://lit.dev/docs/templates/expressions/#static-expressions'\n            );\n          }\n          regex = tagEndRegex;\n        }\n      } else if (regex === tagEndRegex) {\n        if (match[ENTIRE_MATCH] === '>') {\n          // End of a tag. If we had started a raw-text element, use that\n          // regex\n          regex = rawTextEndRegex ?? textEndRegex;\n          // We may be ending an unquoted attribute value, so make sure we\n          // clear any pending attrNameEndIndex\n          attrNameEndIndex = -1;\n        } else if (match[ATTRIBUTE_NAME] === undefined) {\n          // Attribute name position\n          attrNameEndIndex = -2;\n        } else {\n          attrNameEndIndex = regex.lastIndex - match[SPACES_AND_EQUALS].length;\n          attrName = match[ATTRIBUTE_NAME];\n          regex =\n            match[QUOTE_CHAR] === undefined\n              ? tagEndRegex\n              : match[QUOTE_CHAR] === '\"'\n                ? doubleQuoteAttrEndRegex\n                : singleQuoteAttrEndRegex;\n        }\n      } else if (\n        regex === doubleQuoteAttrEndRegex ||\n        regex === singleQuoteAttrEndRegex\n      ) {\n        regex = tagEndRegex;\n      } else if (regex === commentEndRegex || regex === comment2EndRegex) {\n        regex = textEndRegex;\n      } else {\n        // Not one of the five state regexes, so it must be the dynamically\n        // created raw text regex and we're at the close of that element.\n        regex = tagEndRegex;\n        rawTextEndRegex = undefined;\n      }\n    }\n\n    if (DEV_MODE) {\n      // If we have a attrNameEndIndex, which indicates that we should\n      // rewrite the attribute name, assert that we're in a valid attribute\n      // position - either in a tag, or a quoted attribute value.\n      console.assert(\n        attrNameEndIndex === -1 ||\n          regex === tagEndRegex ||\n          regex === singleQuoteAttrEndRegex ||\n          regex === doubleQuoteAttrEndRegex,\n        'unexpected parse state B'\n      );\n    }\n\n    // We have four cases:\n    //  1. We're in text position, and not in a raw text element\n    //     (regex === textEndRegex): insert a comment marker.\n    //  2. We have a non-negative attrNameEndIndex which means we need to\n    //     rewrite the attribute name to add a bound attribute suffix.\n    //  3. We're at the non-first binding in a multi-binding attribute, use a\n    //     plain marker.\n    //  4. We're somewhere else inside the tag. If we're in attribute name\n    //     position (attrNameEndIndex === -2), add a sequential suffix to\n    //     generate a unique attribute name.\n\n    // Detect a binding next to self-closing tag end and insert a space to\n    // separate the marker from the tag end:\n    const end =\n      regex === tagEndRegex && strings[i + 1].startsWith('/>') ? ' ' : '';\n    html +=\n      regex === textEndRegex\n        ? s + nodeMarker\n        : attrNameEndIndex >= 0\n          ? (attrNames.push(attrName!),\n            s.slice(0, attrNameEndIndex) +\n              boundAttributeSuffix +\n              s.slice(attrNameEndIndex)) +\n            marker +\n            end\n          : s + marker + (attrNameEndIndex === -2 ? i : end);\n  }\n\n  const htmlResult: string | TrustedHTML =\n    html +\n    (strings[l] || '<?>') +\n    (type === SVG_RESULT ? '</svg>' : type === MATHML_RESULT ? '</math>' : '');\n\n  // Returned as an array for terseness\n  return [trustFromTemplateString(strings, htmlResult), attrNames];\n};\n\n/** @internal */\nexport /* COPYBARA: type */ {Template};\nclass Template {\n  /** @internal */\n  el!: HTMLTemplateElement;\n\n  parts: Array<TemplatePart> = [];\n\n  constructor(\n    // This property needs to remain unminified.\n    {strings, ['_$litType$']: type}: UncompiledTemplateResult,\n    options?: RenderOptions\n  ) {\n    let node: Node | null;\n    let nodeIndex = 0;\n    let attrNameIndex = 0;\n    const partCount = strings.length - 1;\n    const parts = this.parts;\n\n    // Create template element\n    const [html, attrNames] = getTemplateHtml(strings, type);\n    this.el = Template.createElement(html, options);\n    walker.currentNode = this.el.content;\n\n    // Re-parent SVG or MathML nodes into template root\n    if (type === SVG_RESULT || type === MATHML_RESULT) {\n      const wrapper = this.el.content.firstChild!;\n      wrapper.replaceWith(...wrapper.childNodes);\n    }\n\n    // Walk the template to find binding markers and create TemplateParts\n    while ((node = walker.nextNode()) !== null && parts.length < partCount) {\n      if (node.nodeType === 1) {\n        if (DEV_MODE) {\n          const tag = (node as Element).localName;\n          // Warn if `textarea` includes an expression and throw if `template`\n          // does since these are not supported. We do this by checking\n          // innerHTML for anything that looks like a marker. This catches\n          // cases like bindings in textarea there markers turn into text nodes.\n          if (\n            /^(?:textarea|template)$/i!.test(tag) &&\n            (node as Element).innerHTML.includes(marker)\n          ) {\n            const m =\n              `Expressions are not supported inside \\`${tag}\\` ` +\n              `elements. See https://lit.dev/msg/expression-in-${tag} for more ` +\n              `information.`;\n            if (tag === 'template') {\n              throw new Error(m);\n            } else issueWarning('', m);\n          }\n        }\n        // TODO (justinfagnani): for attempted dynamic tag names, we don't\n        // increment the bindingIndex, and it'll be off by 1 in the element\n        // and off by two after it.\n        if ((node as Element).hasAttributes()) {\n          for (const name of (node as Element).getAttributeNames()) {\n            if (name.endsWith(boundAttributeSuffix)) {\n              const realName = attrNames[attrNameIndex++];\n              const value = (node as Element).getAttribute(name)!;\n              const statics = value.split(marker);\n              const m = /([.?@])?(.*)/.exec(realName)!;\n              parts.push({\n                type: ATTRIBUTE_PART,\n                index: nodeIndex,\n                name: m[2],\n                strings: statics,\n                ctor:\n                  m[1] === '.'\n                    ? PropertyPart\n                    : m[1] === '?'\n                      ? BooleanAttributePart\n                      : m[1] === '@'\n                        ? EventPart\n                        : AttributePart,\n              });\n              (node as Element).removeAttribute(name);\n            } else if (name.startsWith(marker)) {\n              parts.push({\n                type: ELEMENT_PART,\n                index: nodeIndex,\n              });\n              (node as Element).removeAttribute(name);\n            }\n          }\n        }\n        // TODO (justinfagnani): benchmark the regex against testing for each\n        // of the 3 raw text element names.\n        if (rawTextElement.test((node as Element).tagName)) {\n          // For raw text elements we need to split the text content on\n          // markers, create a Text node for each segment, and create\n          // a TemplatePart for each marker.\n          const strings = (node as Element).textContent!.split(marker);\n          const lastIndex = strings.length - 1;\n          if (lastIndex > 0) {\n            (node as Element).textContent = trustedTypes\n              ? (trustedTypes.emptyScript as unknown as '')\n              : '';\n            // Generate a new text node for each literal section\n            // These nodes are also used as the markers for child parts\n            for (let i = 0; i < lastIndex; i++) {\n              (node as Element).append(strings[i], createMarker());\n              // Walk past the marker node we just added\n              walker.nextNode();\n              parts.push({type: CHILD_PART, index: ++nodeIndex});\n            }\n            // Note because this marker is added after the walker's current\n            // node, it will be walked to in the outer loop (and ignored), so\n            // we don't need to adjust nodeIndex here\n            (node as Element).append(strings[lastIndex], createMarker());\n          }\n        }\n      } else if (node.nodeType === 8) {\n        const data = (node as Comment).data;\n        if (data === markerMatch) {\n          parts.push({type: CHILD_PART, index: nodeIndex});\n        } else {\n          let i = -1;\n          while ((i = (node as Comment).data.indexOf(marker, i + 1)) !== -1) {\n            // Comment node has a binding marker inside, make an inactive part\n            // The binding won't work, but subsequent bindings will\n            parts.push({type: COMMENT_PART, index: nodeIndex});\n            // Move to the end of the match\n            i += marker.length - 1;\n          }\n        }\n      }\n      nodeIndex++;\n    }\n\n    if (DEV_MODE) {\n      // If there was a duplicate attribute on a tag, then when the tag is\n      // parsed into an element the attribute gets de-duplicated. We can detect\n      // this mismatch if we haven't precisely consumed every attribute name\n      // when preparing the template. This works because `attrNames` is built\n      // from the template string and `attrNameIndex` comes from processing the\n      // resulting DOM.\n      if (attrNames.length !== attrNameIndex) {\n        throw new Error(\n          `Detected duplicate attribute bindings. This occurs if your template ` +\n            `has duplicate attributes on an element tag. For example ` +\n            `\"<input ?disabled=\\${true} ?disabled=\\${false}>\" contains a ` +\n            `duplicate \"disabled\" attribute. The error was detected in ` +\n            `the following template: \\n` +\n            '`' +\n            strings.join('${...}') +\n            '`'\n        );\n      }\n    }\n\n    // We could set walker.currentNode to another node here to prevent a memory\n    // leak, but every time we prepare a template, we immediately render it\n    // and re-use the walker in new TemplateInstance._clone().\n    debugLogEvent &&\n      debugLogEvent({\n        kind: 'template prep',\n        template: this,\n        clonableTemplate: this.el,\n        parts: this.parts,\n        strings,\n      });\n  }\n\n  // Overridden via `litHtmlPolyfillSupport` to provide platform support.\n  /** @nocollapse */\n  static createElement(html: TrustedHTML, _options?: RenderOptions) {\n    const el = d.createElement('template');\n    el.innerHTML = html as unknown as string;\n    return el;\n  }\n}\n\nexport interface Disconnectable {\n  _$parent?: Disconnectable;\n  _$disconnectableChildren?: Set<Disconnectable>;\n  // Rather than hold connection state on instances, Disconnectables recursively\n  // fetch the connection state from the RootPart they are connected in via\n  // getters up the Disconnectable tree via _$parent references. This pushes the\n  // cost of tracking the isConnected state to `AsyncDirectives`, and avoids\n  // needing to pass all Disconnectables (parts, template instances, and\n  // directives) their connection state each time it changes, which would be\n  // costly for trees that have no AsyncDirectives.\n  _$isConnected: boolean;\n}\n\nfunction resolveDirective(\n  part: ChildPart | AttributePart | ElementPart,\n  value: unknown,\n  parent: DirectiveParent = part,\n  attributeIndex?: number\n): unknown {\n  // Bail early if the value is explicitly noChange. Note, this means any\n  // nested directive is still attached and is not run.\n  if (value === noChange) {\n    return value;\n  }\n  let currentDirective =\n    attributeIndex !== undefined\n      ? (parent as AttributePart).__directives?.[attributeIndex]\n      : (parent as ChildPart | ElementPart | Directive).__directive;\n  const nextDirectiveConstructor = isPrimitive(value)\n    ? undefined\n    : // This property needs to remain unminified.\n      (value as DirectiveResult)['_$litDirective$'];\n  if (currentDirective?.constructor !== nextDirectiveConstructor) {\n    // This property needs to remain unminified.\n    currentDirective?.['_$notifyDirectiveConnectionChanged']?.(false);\n    if (nextDirectiveConstructor === undefined) {\n      currentDirective = undefined;\n    } else {\n      currentDirective = new nextDirectiveConstructor(part as PartInfo);\n      currentDirective._$initialize(part, parent, attributeIndex);\n    }\n    if (attributeIndex !== undefined) {\n      ((parent as AttributePart).__directives ??= [])[attributeIndex] =\n        currentDirective;\n    } else {\n      (parent as ChildPart | Directive).__directive = currentDirective;\n    }\n  }\n  if (currentDirective !== undefined) {\n    value = resolveDirective(\n      part,\n      currentDirective._$resolve(part, (value as DirectiveResult).values),\n      currentDirective,\n      attributeIndex\n    );\n  }\n  return value;\n}\n\nexport /* COPYBARA: type */ {TemplateInstance};\n/**\n * An updateable instance of a Template. Holds references to the Parts used to\n * update the template instance.\n */\nclass TemplateInstance implements Disconnectable {\n  _$template: Template;\n  _$parts: Array<Part | undefined> = [];\n\n  /** @internal */\n  _$parent: ChildPart;\n  /** @internal */\n  _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n  constructor(template: Template, parent: ChildPart) {\n    this._$template = template;\n    this._$parent = parent;\n  }\n\n  // Called by ChildPart parentNode getter\n  get parentNode() {\n    return this._$parent.parentNode;\n  }\n\n  // See comment in Disconnectable interface for why this is a getter\n  get _$isConnected() {\n    return this._$parent._$isConnected;\n  }\n\n  // This method is separate from the constructor because we need to return a\n  // DocumentFragment and we don't want to hold onto it with an instance field.\n  _clone(options: RenderOptions | undefined) {\n    const {\n      el: {content},\n      parts: parts,\n    } = this._$template;\n    const fragment = (options?.creationScope ?? d).importNode(content, true);\n    walker.currentNode = fragment;\n\n    let node = walker.nextNode()!;\n    let nodeIndex = 0;\n    let partIndex = 0;\n    let templatePart = parts[0];\n\n    while (templatePart !== undefined) {\n      if (nodeIndex === templatePart.index) {\n        let part: Part | undefined;\n        if (templatePart.type === CHILD_PART) {\n          part = new ChildPart(\n            node as HTMLElement,\n            node.nextSibling,\n            this,\n            options\n          );\n        } else if (templatePart.type === ATTRIBUTE_PART) {\n          part = new templatePart.ctor(\n            node as HTMLElement,\n            templatePart.name,\n            templatePart.strings,\n            this,\n            options\n          );\n        } else if (templatePart.type === ELEMENT_PART) {\n          part = new ElementPart(node as HTMLElement, this, options);\n        }\n        this._$parts.push(part);\n        templatePart = parts[++partIndex];\n      }\n      if (nodeIndex !== templatePart?.index) {\n        node = walker.nextNode()!;\n        nodeIndex++;\n      }\n    }\n    // We need to set the currentNode away from the cloned tree so that we\n    // don't hold onto the tree even if the tree is detached and should be\n    // freed.\n    walker.currentNode = d;\n    return fragment;\n  }\n\n  _update(values: Array<unknown>) {\n    let i = 0;\n    for (const part of this._$parts) {\n      if (part !== undefined) {\n        debugLogEvent &&\n          debugLogEvent({\n            kind: 'set part',\n            part,\n            value: values[i],\n            valueIndex: i,\n            values,\n            templateInstance: this,\n          });\n        if ((part as AttributePart).strings !== undefined) {\n          (part as AttributePart)._$setValue(values, part as AttributePart, i);\n          // The number of values the part consumes is part.strings.length - 1\n          // since values are in between template spans. We increment i by 1\n          // later in the loop, so increment it by part.strings.length - 2 here\n          i += (part as AttributePart).strings!.length - 2;\n        } else {\n          part._$setValue(values[i]);\n        }\n      }\n      i++;\n    }\n  }\n}\n\n/*\n * Parts\n */\ntype AttributeTemplatePart = {\n  readonly type: typeof ATTRIBUTE_PART;\n  readonly index: number;\n  readonly name: string;\n  readonly ctor: typeof AttributePart;\n  readonly strings: ReadonlyArray<string>;\n};\ntype ChildTemplatePart = {\n  readonly type: typeof CHILD_PART;\n  readonly index: number;\n};\ntype ElementTemplatePart = {\n  readonly type: typeof ELEMENT_PART;\n  readonly index: number;\n};\ntype CommentTemplatePart = {\n  readonly type: typeof COMMENT_PART;\n  readonly index: number;\n};\n\n/**\n * A TemplatePart represents a dynamic part in a template, before the template\n * is instantiated. When a template is instantiated Parts are created from\n * TemplateParts.\n */\ntype TemplatePart =\n  | ChildTemplatePart\n  | AttributeTemplatePart\n  | ElementTemplatePart\n  | CommentTemplatePart;\n\nexport type Part =\n  | ChildPart\n  | AttributePart\n  | PropertyPart\n  | BooleanAttributePart\n  | ElementPart\n  | EventPart;\n\nexport /* COPYBARA: type */ {ChildPart};\nclass ChildPart implements Disconnectable {\n  readonly type = CHILD_PART;\n  readonly options: RenderOptions | undefined;\n  _$committedValue: unknown = nothing;\n  /** @internal */\n  __directive?: Directive;\n  /** @internal */\n  _$startNode: ChildNode;\n  /** @internal */\n  _$endNode: ChildNode | null;\n  private _textSanitizer: ValueSanitizer | undefined;\n  /** @internal */\n  _$parent: Disconnectable | undefined;\n  /**\n   * Connection state for RootParts only (i.e. ChildPart without _$parent\n   * returned from top-level `render`). This field is unused otherwise. The\n   * intention would be clearer if we made `RootPart` a subclass of `ChildPart`\n   * with this field (and a different _$isConnected getter), but the subclass\n   * caused a perf regression, possibly due to making call sites polymorphic.\n   * @internal\n   */\n  __isConnected: boolean;\n\n  // See comment in Disconnectable interface for why this is a getter\n  get _$isConnected() {\n    // ChildParts that are not at the root should always be created with a\n    // parent; only RootChildNode's won't, so they return the local isConnected\n    // state\n    return this._$parent?._$isConnected ?? this.__isConnected;\n  }\n\n  // The following fields will be patched onto ChildParts when required by\n  // AsyncDirective\n  /** @internal */\n  _$disconnectableChildren?: Set<Disconnectable> = undefined;\n  /** @internal */\n  _$notifyConnectionChanged?(\n    isConnected: boolean,\n    removeFromParent?: boolean,\n    from?: number\n  ): void;\n  /** @internal */\n  _$reparentDisconnectables?(parent: Disconnectable): void;\n\n  constructor(\n    startNode: ChildNode,\n    endNode: ChildNode | null,\n    parent: TemplateInstance | ChildPart | undefined,\n    options: RenderOptions | undefined\n  ) {\n    this._$startNode = startNode;\n    this._$endNode = endNode;\n    this._$parent = parent;\n    this.options = options;\n    // Note __isConnected is only ever accessed on RootParts (i.e. when there is\n    // no _$parent); the value on a non-root-part is \"don't care\", but checking\n    // for parent would be more code\n    this.__isConnected = options?.isConnected ?? true;\n    if (ENABLE_EXTRA_SECURITY_HOOKS) {\n      // Explicitly initialize for consistent class shape.\n      this._textSanitizer = undefined;\n    }\n  }\n\n  /**\n   * The parent node into which the part renders its content.\n   *\n   * A ChildPart's content consists of a range of adjacent child nodes of\n   * `.parentNode`, possibly bordered by 'marker nodes' (`.startNode` and\n   * `.endNode`).\n   *\n   * - If both `.startNode` and `.endNode` are non-null, then the part's content\n   * consists of all siblings between `.startNode` and `.endNode`, exclusively.\n   *\n   * - If `.startNode` is non-null but `.endNode` is null, then the part's\n   * content consists of all siblings following `.startNode`, up to and\n   * including the last child of `.parentNode`. If `.endNode` is non-null, then\n   * `.startNode` will always be non-null.\n   *\n   * - If both `.endNode` and `.startNode` are null, then the part's content\n   * consists of all child nodes of `.parentNode`.\n   */\n  get parentNode(): Node {\n    let parentNode: Node = wrap(this._$startNode).parentNode!;\n    const parent = this._$parent;\n    if (\n      parent !== undefined &&\n      parentNode?.nodeType === 11 /* Node.DOCUMENT_FRAGMENT */\n    ) {\n      // If the parentNode is a DocumentFragment, it may be because the DOM is\n      // still in the cloned fragment during initial render; if so, get the real\n      // parentNode the part will be committed into by asking the parent.\n      parentNode = (parent as ChildPart | TemplateInstance).parentNode;\n    }\n    return parentNode;\n  }\n\n  /**\n   * The part's leading marker node, if any. See `.parentNode` for more\n   * information.\n   */\n  get startNode(): Node | null {\n    return this._$startNode;\n  }\n\n  /**\n   * The part's trailing marker node, if any. See `.parentNode` for more\n   * information.\n   */\n  get endNode(): Node | null {\n    return this._$endNode;\n  }\n\n  _$setValue(value: unknown, directiveParent: DirectiveParent = this): void {\n    if (DEV_MODE && this.parentNode === null) {\n      throw new Error(\n        `This \\`ChildPart\\` has no \\`parentNode\\` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's \\`innerHTML\\` or \\`textContent\\` can do this.`\n      );\n    }\n    value = resolveDirective(this, value, directiveParent);\n    if (isPrimitive(value)) {\n      // Non-rendering child values. It's important that these do not render\n      // empty text nodes to avoid issues with preventing default <slot>\n      // fallback content.\n      if (value === nothing || value == null || value === '') {\n        if (this._$committedValue !== nothing) {\n          debugLogEvent &&\n            debugLogEvent({\n              kind: 'commit nothing to child',\n              start: this._$startNode,\n              end: this._$endNode,\n              parent: this._$parent,\n              options: this.options,\n            });\n          this._$clear();\n        }\n        this._$committedValue = nothing;\n      } else if (value !== this._$committedValue && value !== noChange) {\n        this._commitText(value);\n      }\n      // This property needs to remain unminified.\n    } else if ((value as TemplateResult)['_$litType$'] !== undefined) {\n      this._commitTemplateResult(value as TemplateResult);\n    } else if ((value as Node).nodeType !== undefined) {\n      if (DEV_MODE && this.options?.host === value) {\n        this._commitText(\n          `[probable mistake: rendered a template's host in itself ` +\n            `(commonly caused by writing \\${this} in a template]`\n        );\n        console.warn(\n          `Attempted to render the template host`,\n          value,\n          `inside itself. This is almost always a mistake, and in dev mode `,\n          `we render some warning text. In production however, we'll `,\n          `render it, which will usually result in an error, and sometimes `,\n          `in the element disappearing from the DOM.`\n        );\n        return;\n      }\n      this._commitNode(value as Node);\n    } else if (isIterable(value)) {\n      this._commitIterable(value);\n    } else {\n      // Fallback, will render the string representation\n      this._commitText(value);\n    }\n  }\n\n  private _insert<T extends Node>(node: T) {\n    return wrap(wrap(this._$startNode).parentNode!).insertBefore(\n      node,\n      this._$endNode\n    );\n  }\n\n  private _commitNode(value: Node): void {\n    if (this._$committedValue !== value) {\n      this._$clear();\n      if (\n        ENABLE_EXTRA_SECURITY_HOOKS &&\n        sanitizerFactoryInternal !== noopSanitizer\n      ) {\n        const parentNodeName = this._$startNode.parentNode?.nodeName;\n        if (parentNodeName === 'STYLE' || parentNodeName === 'SCRIPT') {\n          let message = 'Forbidden';\n          if (DEV_MODE) {\n            if (parentNodeName === 'STYLE') {\n              message =\n                `Lit does not support binding inside style nodes. ` +\n                `This is a security risk, as style injection attacks can ` +\n                `exfiltrate data and spoof UIs. ` +\n                `Consider instead using css\\`...\\` literals ` +\n                `to compose styles, and do dynamic styling with ` +\n                `css custom properties, ::parts, <slot>s, ` +\n                `and by mutating the DOM rather than stylesheets.`;\n            } else {\n              message =\n                `Lit does not support binding inside script nodes. ` +\n                `This is a security risk, as it could allow arbitrary ` +\n                `code execution.`;\n            }\n          }\n          throw new Error(message);\n        }\n      }\n      debugLogEvent &&\n        debugLogEvent({\n          kind: 'commit node',\n          start: this._$startNode,\n          parent: this._$parent,\n          value: value,\n          options: this.options,\n        });\n      this._$committedValue = this._insert(value);\n    }\n  }\n\n  private _commitText(value: unknown): void {\n    // If the committed value is a primitive it means we called _commitText on\n    // the previous render, and we know that this._$startNode.nextSibling is a\n    // Text node. We can now just replace the text content (.data) of the node.\n    if (\n      this._$committedValue !== nothing &&\n      isPrimitive(this._$committedValue)\n    ) {\n      const node = wrap(this._$startNode).nextSibling as Text;\n      if (ENABLE_EXTRA_SECURITY_HOOKS) {\n        if (this._textSanitizer === undefined) {\n          this._textSanitizer = createSanitizer(node, 'data', 'property');\n        }\n        value = this._textSanitizer(value);\n      }\n      debugLogEvent &&\n        debugLogEvent({\n          kind: 'commit text',\n          node,\n          value,\n          options: this.options,\n        });\n      (node as Text).data = value as string;\n    } else {\n      if (ENABLE_EXTRA_SECURITY_HOOKS) {\n        const textNode = d.createTextNode('');\n        this._commitNode(textNode);\n        // When setting text content, for security purposes it matters a lot\n        // what the parent is. For example, <style> and <script> need to be\n        // handled with care, while <span> does not. So first we need to put a\n        // text node into the document, then we can sanitize its content.\n        if (this._textSanitizer === undefined) {\n          this._textSanitizer = createSanitizer(textNode, 'data', 'property');\n        }\n        value = this._textSanitizer(value);\n        debugLogEvent &&\n          debugLogEvent({\n            kind: 'commit text',\n            node: textNode,\n            value,\n            options: this.options,\n          });\n        textNode.data = value as string;\n      } else {\n        this._commitNode(d.createTextNode(value as string));\n        debugLogEvent &&\n          debugLogEvent({\n            kind: 'commit text',\n            node: wrap(this._$startNode).nextSibling as Text,\n            value,\n            options: this.options,\n          });\n      }\n    }\n    this._$committedValue = value;\n  }\n\n  private _commitTemplateResult(\n    result: TemplateResult | CompiledTemplateResult\n  ): void {\n    // This property needs to remain unminified.\n    const {values, ['_$litType$']: type} = result;\n    // If $litType$ is a number, result is a plain TemplateResult and we get\n    // the template from the template cache. If not, result is a\n    // CompiledTemplateResult and _$litType$ is a CompiledTemplate and we need\n    // to create the <template> element the first time we see it.\n    const template: Template | CompiledTemplate =\n      typeof type === 'number'\n        ? this._$getTemplate(result as UncompiledTemplateResult)\n        : (type.el === undefined &&\n            (type.el = Template.createElement(\n              trustFromTemplateString(type.h, type.h[0]),\n              this.options\n            )),\n          type);\n\n    if ((this._$committedValue as TemplateInstance)?._$template === template) {\n      debugLogEvent &&\n        debugLogEvent({\n          kind: 'template updating',\n          template,\n          instance: this._$committedValue as TemplateInstance,\n          parts: (this._$committedValue as TemplateInstance)._$parts,\n          options: this.options,\n          values,\n        });\n      (this._$committedValue as TemplateInstance)._update(values);\n    } else {\n      const instance = new TemplateInstance(template as Template, this);\n      const fragment = instance._clone(this.options);\n      debugLogEvent &&\n        debugLogEvent({\n          kind: 'template instantiated',\n          template,\n          instance,\n          parts: instance._$parts,\n          options: this.options,\n          fragment,\n          values,\n        });\n      instance._update(values);\n      debugLogEvent &&\n        debugLogEvent({\n          kind: 'template instantiated and updated',\n          template,\n          instance,\n          parts: instance._$parts,\n          options: this.options,\n          fragment,\n          values,\n        });\n      this._commitNode(fragment);\n      this._$committedValue = instance;\n    }\n  }\n\n  // Overridden via `litHtmlPolyfillSupport` to provide platform support.\n  /** @internal */\n  _$getTemplate(result: UncompiledTemplateResult) {\n    const strings = result.strings;\n    let template = templateCache.get(strings);\n    if (template === undefined) {\n      if (goog.DEBUG) {\n        const key = strings.join('\\0');\n        template = templateStringContentsToTemplates.get(key);\n        if (template === undefined) {\n          template = new Template(result);\n          templateStringContentsToTemplates.set(key, template);\n        }\n        templateCache.set(strings, template);\n      } else {\n        templateCache.set(result.strings, (template = new Template(result)));\n      }\n    }\n\n    return template;\n  }\n\n  private _commitIterable(value: Iterable<unknown>): void {\n    // For an Iterable, we create a new InstancePart per item, then set its\n    // value to the item. This is a little bit of overhead for every item in\n    // an Iterable, but it lets us recurse easily and efficiently update Arrays\n    // of TemplateResults that will be commonly returned from expressions like:\n    // array.map((i) => html`${i}`), by reusing existing TemplateInstances.\n\n    // If value is an array, then the previous render was of an\n    // iterable and value will contain the ChildParts from the previous\n    // render. If value is not an array, clear this part and make a new\n    // array for ChildParts.\n    if (!isArray(this._$committedValue)) {\n      this._$committedValue = [];\n      this._$clear();\n    }\n\n    // Lets us keep track of how many items we stamped so we can clear leftover\n    // items from a previous render\n    const itemParts = this._$committedValue as ChildPart[];\n    let partIndex = 0;\n    let itemPart: ChildPart | undefined;\n\n    for (const item of value) {\n      if (partIndex === itemParts.length) {\n        // If no existing part, create a new one\n        // TODO (justinfagnani): test perf impact of always creating two parts\n        // instead of sharing parts between nodes\n        // https://github.com/lit/lit/issues/1266\n        itemParts.push(\n          (itemPart = new ChildPart(\n            this._insert(createMarker()),\n            this._insert(createMarker()),\n            this,\n            this.options\n          ))\n        );\n      } else {\n        // Reuse an existing part\n        itemPart = itemParts[partIndex];\n      }\n      itemPart._$setValue(item);\n      partIndex++;\n    }\n\n    if (partIndex < itemParts.length) {\n      // itemParts always have end nodes\n      this._$clear(\n        itemPart && wrap(itemPart._$endNode!).nextSibling,\n        partIndex\n      );\n      // Truncate the parts array so _value reflects the current state\n      itemParts.length = partIndex;\n    }\n  }\n\n  /**\n   * Removes the nodes contained within this Part from the DOM.\n   *\n   * @param start Start node to clear from, for clearing a subset of the part's\n   *     DOM (used when truncating iterables)\n   * @param from  When `start` is specified, the index within the iterable from\n   *     which ChildParts are being removed, used for disconnecting directives in\n   *     those Parts.\n   *\n   * @internal\n   */\n  _$clear(\n    start: ChildNode | null = wrap(this._$startNode).nextSibling,\n    from?: number\n  ) {\n    this._$notifyConnectionChanged?.(false, true, from);\n    while (start && start !== this._$endNode) {\n      const n = wrap(start!).nextSibling;\n      (wrap(start!) as Element).remove();\n      start = n;\n    }\n  }\n  /**\n   * Implementation of RootPart's `isConnected`. Note that this method\n   * should only be called on `RootPart`s (the `ChildPart` returned from a\n   * top-level `render()` call). It has no effect on non-root ChildParts.\n   * @param isConnected Whether to set\n   * @internal\n   */\n  setConnected(isConnected: boolean) {\n    if (this._$parent === undefined) {\n      this.__isConnected = isConnected;\n      this._$notifyConnectionChanged?.(isConnected);\n    } else if (DEV_MODE) {\n      throw new Error(\n        'part.setConnected() may only be called on a ' +\n          'RootPart returned from render().'\n      );\n    }\n  }\n}\n\n/**\n * A top-level `ChildPart` returned from `render` that manages the connected\n * state of `AsyncDirective`s created throughout the tree below it.\n */\nexport interface RootPart extends ChildPart {\n  /**\n   * Sets the connection state for `AsyncDirective`s contained within this root\n   * ChildPart.\n   *\n   * lit-html does not automatically monitor the connectedness of DOM rendered;\n   * as such, it is the responsibility of the caller to `render` to ensure that\n   * `part.setConnected(false)` is called before the part object is potentially\n   * discarded, to ensure that `AsyncDirective`s have a chance to dispose of\n   * any resources being held. If a `RootPart` that was previously\n   * disconnected is subsequently re-connected (and its `AsyncDirective`s should\n   * re-connect), `setConnected(true)` should be called.\n   *\n   * @param isConnected Whether directives within this tree should be connected\n   * or not\n   */\n  setConnected(isConnected: boolean): void;\n}\n\nexport /* COPYBARA: type */ {AttributePart};\nclass AttributePart implements Disconnectable {\n  readonly type:\n    | typeof ATTRIBUTE_PART\n    | typeof PROPERTY_PART\n    | typeof BOOLEAN_ATTRIBUTE_PART\n    | typeof EVENT_PART = ATTRIBUTE_PART;\n  readonly element: HTMLElement;\n  readonly name: string;\n  readonly options: RenderOptions | undefined;\n\n  /**\n   * If this attribute part represents an interpolation, this contains the\n   * static strings of the interpolation. For single-value, complete bindings,\n   * this is undefined.\n   */\n  readonly strings?: ReadonlyArray<string>;\n  /** @internal */\n  _$committedValue: unknown | Array<unknown> = nothing;\n  /** @internal */\n  __directives?: Array<Directive | undefined>;\n  /** @internal */\n  _$parent: Disconnectable;\n  /** @internal */\n  _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n  protected _sanitizer: ValueSanitizer | undefined;\n\n  get tagName() {\n    return this.element.tagName;\n  }\n\n  // See comment in Disconnectable interface for why this is a getter\n  get _$isConnected() {\n    return this._$parent._$isConnected;\n  }\n\n  constructor(\n    element: HTMLElement,\n    name: string,\n    strings: ReadonlyArray<string>,\n    parent: Disconnectable,\n    options: RenderOptions | undefined\n  ) {\n    this.element = element;\n    this.name = name;\n    this._$parent = parent;\n    this.options = options;\n    if (strings.length > 2 || strings[0] !== '' || strings[1] !== '') {\n      this._$committedValue = new Array(strings.length - 1).fill(new String());\n      this.strings = strings;\n    } else {\n      this._$committedValue = nothing;\n    }\n    if (ENABLE_EXTRA_SECURITY_HOOKS) {\n      this._sanitizer = undefined;\n    }\n  }\n\n  /**\n   * Sets the value of this part by resolving the value from possibly multiple\n   * values and static strings and committing it to the DOM.\n   * If this part is single-valued, `this._strings` will be undefined, and the\n   * method will be called with a single value argument. If this part is\n   * multi-value, `this._strings` will be defined, and the method is called\n   * with the value array of the part's owning TemplateInstance, and an offset\n   * into the value array from which the values should be read.\n   * This method is overloaded this way to eliminate short-lived array slices\n   * of the template instance values, and allow a fast-path for single-valued\n   * parts.\n   *\n   * @param value The part value, or an array of values for multi-valued parts\n   * @param valueIndex the index to start reading values from. `undefined` for\n   *   single-valued parts\n   * @param noCommit causes the part to not commit its value to the DOM. Used\n   *   in hydration to prime attribute parts with their first-rendered value,\n   *   but not set the attribute, and in SSR to no-op the DOM operation and\n   *   capture the value for serialization.\n   *\n   * @internal\n   */\n  _$setValue(\n    value: unknown | Array<unknown>,\n    directiveParent: DirectiveParent = this,\n    valueIndex?: number,\n    noCommit?: boolean\n  ) {\n    const strings = this.strings;\n\n    // Whether any of the values has changed, for dirty-checking\n    let change = false;\n\n    if (strings === undefined) {\n      // Single-value binding case\n      value = resolveDirective(this, value, directiveParent, 0);\n      change =\n        !isPrimitive(value) ||\n        (value !== this._$committedValue && value !== noChange);\n      if (change) {\n        this._$committedValue = value;\n      }\n    } else {\n      // Interpolation case\n      const values = value as Array<unknown>;\n      value = strings[0];\n\n      let i, v;\n      for (i = 0; i < strings.length - 1; i++) {\n        v = resolveDirective(this, values[valueIndex! + i], directiveParent, i);\n\n        if (v === noChange) {\n          // If the user-provided value is `noChange`, use the previous value\n          v = (this._$committedValue as Array<unknown>)[i];\n        }\n        change ||=\n          !isPrimitive(v) || v !== (this._$committedValue as Array<unknown>)[i];\n        if (v === nothing) {\n          value = nothing;\n        } else if (value !== nothing) {\n          value += (v ?? '') + strings[i + 1];\n        }\n        // We always record each value, even if one is `nothing`, for future\n        // change detection.\n        (this._$committedValue as Array<unknown>)[i] = v;\n      }\n    }\n    if (change && !noCommit) {\n      this._commitValue(value);\n    }\n  }\n\n  /** @internal */\n  _commitValue(value: unknown) {\n    if (value === nothing) {\n      (wrap(this.element) as Element).removeAttribute(this.name);\n    } else {\n      if (ENABLE_EXTRA_SECURITY_HOOKS) {\n        if (this._sanitizer === undefined) {\n          this._sanitizer = sanitizerFactoryInternal(\n            this.element,\n            this.name,\n            'attribute'\n          );\n        }\n        value = this._sanitizer(value ?? '');\n      }\n      debugLogEvent &&\n        debugLogEvent({\n          kind: 'commit attribute',\n          element: this.element,\n          name: this.name,\n          value,\n          options: this.options,\n        });\n      (wrap(this.element) as Element).setAttribute(\n        this.name,\n        (value ?? '') as string\n      );\n    }\n  }\n}\n\nexport /* COPYBARA: type */ {PropertyPart};\nclass PropertyPart extends AttributePart {\n  override readonly type = PROPERTY_PART;\n\n  /** @internal */\n  override _commitValue(value: unknown) {\n    if (ENABLE_EXTRA_SECURITY_HOOKS) {\n      if (this._sanitizer === undefined) {\n        this._sanitizer = sanitizerFactoryInternal(\n          this.element,\n          this.name,\n          'property'\n        );\n      }\n      value = this._sanitizer(value);\n    }\n    debugLogEvent &&\n      debugLogEvent({\n        kind: 'commit property',\n        element: this.element,\n        name: this.name,\n        value,\n        options: this.options,\n      });\n    // tslint:disable-next-line:no-any\n    (this.element as any)[this.name] = value === nothing ? undefined : value;\n  }\n}\n\nexport /* COPYBARA: type */ {BooleanAttributePart};\nclass BooleanAttributePart extends AttributePart {\n  override readonly type = BOOLEAN_ATTRIBUTE_PART;\n\n  /** @internal */\n  override _commitValue(value: unknown) {\n    debugLogEvent &&\n      debugLogEvent({\n        kind: 'commit boolean attribute',\n        element: this.element,\n        name: this.name,\n        value: !!(value && value !== nothing),\n        options: this.options,\n      });\n    (wrap(this.element) as Element).toggleAttribute(\n      this.name,\n      !!value && value !== nothing\n    );\n  }\n}\n\ntype EventListenerWithOptions = EventListenerOrEventListenerObject &\n  Partial<AddEventListenerOptions>;\n\n/**\n * An AttributePart that manages an event listener via add/removeEventListener.\n *\n * This part works by adding itself as the event listener on an element, then\n * delegating to the value passed to it. This reduces the number of calls to\n * add/removeEventListener if the listener changes frequently, such as when an\n * inline function is used as a listener.\n *\n * Because event options are passed when adding listeners, we must take case\n * to add and remove the part as a listener when the event options change.\n */\nexport /* COPYBARA: type */ {EventPart};\nclass EventPart extends AttributePart {\n  override readonly type = EVENT_PART;\n\n  constructor(\n    element: HTMLElement,\n    name: string,\n    strings: ReadonlyArray<string>,\n    parent: Disconnectable,\n    options: RenderOptions | undefined\n  ) {\n    super(element, name, strings, parent, options);\n\n    if (DEV_MODE && this.strings !== undefined) {\n      throw new Error(\n        `A \\`<${element.localName}>\\` has a \\`@${name}=...\\` listener with ` +\n          'invalid content. Event listeners in templates must have exactly ' +\n          'one expression and no surrounding text.'\n      );\n    }\n  }\n\n  // EventPart does not use the base _$setValue/_resolveValue implementation\n  // since the dirty checking is more complex\n  /** @internal */\n  override _$setValue(\n    newListener: unknown,\n    directiveParent: DirectiveParent = this\n  ) {\n    newListener =\n      resolveDirective(this, newListener, directiveParent, 0) ?? nothing;\n    if (newListener === noChange) {\n      return;\n    }\n    const oldListener = this._$committedValue;\n\n    // If the new value is nothing or any options change we have to remove the\n    // part as a listener.\n    const shouldRemoveListener =\n      (newListener === nothing && oldListener !== nothing) ||\n      (newListener as EventListenerWithOptions).capture !==\n        (oldListener as EventListenerWithOptions).capture ||\n      (newListener as EventListenerWithOptions).once !==\n        (oldListener as EventListenerWithOptions).once ||\n      (newListener as EventListenerWithOptions).passive !==\n        (oldListener as EventListenerWithOptions).passive;\n\n    // If the new value is not nothing and we removed the listener, we have\n    // to add the part as a listener.\n    const shouldAddListener =\n      newListener !== nothing &&\n      (oldListener === nothing || shouldRemoveListener);\n\n    debugLogEvent &&\n      debugLogEvent({\n        kind: 'commit event listener',\n        element: this.element,\n        name: this.name,\n        value: newListener,\n        options: this.options,\n        removeListener: shouldRemoveListener,\n        addListener: shouldAddListener,\n        oldListener,\n      });\n    if (shouldRemoveListener) {\n      this.element.removeEventListener(\n        this.name,\n        this,\n        oldListener as EventListenerWithOptions\n      );\n    }\n    if (shouldAddListener) {\n      this.element.addEventListener(\n        this.name,\n        this,\n        newListener as EventListenerWithOptions\n      );\n    }\n    this._$committedValue = newListener;\n  }\n\n  handleEvent(event: Event) {\n    if (typeof this._$committedValue === 'function') {\n      this._$committedValue.call(this.options?.host ?? this.element, event);\n    } else {\n      (this._$committedValue as EventListenerObject).handleEvent(event);\n    }\n  }\n}\n\nexport /* COPYBARA: type */ {ElementPart};\nclass ElementPart implements Disconnectable {\n  readonly type = ELEMENT_PART;\n\n  /** @internal */\n  __directive?: Directive;\n\n  // This is to ensure that every Part has a _$committedValue\n  _$committedValue: undefined;\n\n  /** @internal */\n  _$parent!: Disconnectable;\n\n  /** @internal */\n  _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n  options: RenderOptions | undefined;\n\n  constructor(\n    public element: Element,\n    parent: Disconnectable,\n    options: RenderOptions | undefined\n  ) {\n    this._$parent = parent;\n    this.options = options;\n  }\n\n  // See comment in Disconnectable interface for why this is a getter\n  get _$isConnected() {\n    return this._$parent._$isConnected;\n  }\n\n  _$setValue(value: unknown): void {\n    debugLogEvent &&\n      debugLogEvent({\n        kind: 'commit to element binding',\n        element: this.element,\n        value,\n        options: this.options,\n      });\n    resolveDirective(this, value);\n  }\n}\n\n/**\n * END USERS SHOULD NOT RELY ON THIS OBJECT.\n *\n * Private exports for use by other Lit packages, not intended for use by\n * external users.\n *\n * We currently do not make a mangled rollup build of the lit-ssr code. In order\n * to keep a number of (otherwise private) top-level exports mangled in the\n * client side code, we export a _$LH object containing those members (or\n * helper methods for accessing private fields of those members), and then\n * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the\n * client-side code is being used in `dev` mode or `prod` mode.\n *\n * This has a unique name, to disambiguate it from private exports in\n * lit-element, which re-exports all of lit-html.\n *\n * @private\n */\nexport const _$LH = {\n  // Used in lit-ssr\n  _boundAttributeSuffix: boundAttributeSuffix,\n  _marker: marker,\n  _markerMatch: markerMatch,\n  _HTML_RESULT: HTML_RESULT,\n  _getTemplateHtml: getTemplateHtml,\n  // Used in tests and private-ssr-support\n  _TemplateInstance: TemplateInstance,\n  _isIterable: isIterable,\n  _resolveDirective: resolveDirective,\n  _ChildPart: ChildPart,\n  _AttributePart: AttributePart,\n  _BooleanAttributePart: BooleanAttributePart,\n  _EventPart: EventPart,\n  _PropertyPart: PropertyPart,\n  _ElementPart: ElementPart,\n};\n\nif (goog.FEATURESET_YEAR < 2020) {\n  // Apply polyfills if available\n  const polyfillSupport = DEV_MODE ? globalThis.litHtmlPolyfillSupportDevMode :\n                                     globalThis.litHtmlPolyfillSupport;\n  polyfillSupport?.(Template, ChildPart);\n}\n\nconst markVersions = () => {\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for lit-html usage.\n(global.litHtmlVersions ??= []).push('3.2.1');\nif (DEV_MODE && global.litHtmlVersions.length > 1) {\n  Promise.resolve().then(() => {\n    issueWarning!(\n      'multiple-versions',\n      `Multiple versions of Lit loaded. Loading multiple versions ` +\n        `is not recommended.`\n    );\n  });\n}\n};\n\n/**\n * Renders a value, usually a lit-html TemplateResult, to the container.\n *\n * This example renders the text \"Hello, Zoe!\" inside a paragraph tag, appending\n * it to the container `document.body`.\n *\n * ```js\n * import {html, render} from 'lit';\n *\n * const name = \"Zoe\";\n * render(html`<p>Hello, ${name}!</p>`, document.body);\n * ```\n *\n * @param value Any [renderable\n *   value](https://lit.dev/docs/templates/expressions/#child-expressions),\n *   typically a {@linkcode TemplateResult} created by evaluating a template tag\n *   like {@linkcode html} or {@linkcode svg}.\n * @param container A DOM container to render to. The first render will append\n *   the rendered value to the container: container as HTMLElement|DocumentFragment, and subsequent renders will\n *   efficiently update the rendered value if the same result type was\n *   previously rendered there.\n * @param options See {@linkcode RenderOptions} for options documentation.\n * @see\n * {@link https://lit.dev/docs/libraries/standalone-templates/#rendering-lit-html-templates| Rendering Lit HTML Templates}\n */\nexport const render = {valueOf() {\nmarkVersions();\nconst render = (\n  value: unknown,\n  container: Element | DocumentFragment,\n  options?: RenderOptions\n): RootPart => {\n  if (DEV_MODE && container == null) {\n    // Give a clearer error message than\n    //     Uncaught TypeError: Cannot read properties of null (reading\n    //     '_$litPart$')\n    // which reads like an internal Lit error.\n    throw new TypeError(`The container to render into may not be ${container}`);\n  }\n  const renderId = DEV_MODE ? debugLogRenderId++ : 0;\n  const partOwnerNode = options?.renderBefore ?? container;\n  // This property needs to remain unminified.\n  // tslint:disable-next-line:no-any\n  let part: ChildPart = (partOwnerNode as any)['_$litPart$'];\n  debugLogEvent &&\n    debugLogEvent({\n      kind: 'begin render',\n      id: renderId,\n      value,\n      container: container as HTMLElement|DocumentFragment,\n      options,\n      part,\n    });\n  if (part === undefined) {\n    const endNode = options?.renderBefore ?? null;\n    // This property needs to remain unminified.\n    // tslint:disable-next-line:no-any\n    (partOwnerNode as any)['_$litPart$'] = part = new ChildPart(\n      container.insertBefore(createMarker(), endNode),\n      endNode,\n      undefined,\n      options ?? {}\n    );\n  }\n  part._$setValue(value);\n  debugLogEvent &&\n    debugLogEvent({\n      kind: 'end render',\n      id: renderId,\n      value,\n      container: container as HTMLElement|DocumentFragment,\n      options,\n      part,\n    });\n  return part as RootPart;\n};\n\nif (ENABLE_EXTRA_SECURITY_HOOKS) {\n  render.setSanitizer = setSanitizer;\n  render.createSanitizer = createSanitizer;\n  if (DEV_MODE) {\n    render._testOnlyClearSanitizerFactoryDoNotCallOrElse =\n      _testOnlyClearSanitizerFactoryDoNotCallOrElse;\n  }\n}\nreturn render;\n}}.valueOf();\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * The main LitElement module, which defines the {@linkcode LitElement} base\n * class and related APIs.\n *\n * LitElement components can define a template and a set of observed\n * properties. Changing an observed property triggers a re-render of the\n * element.\n *\n * Import {@linkcode LitElement} and {@linkcode html} from this module to\n * create a component:\n *\n *  ```js\n * import {LitElement, html} from 'lit-element';\n *\n * class MyElement extends LitElement {\n *\n *   // Declare observed properties\n *   static get properties() {\n *     return {\n *       adjective: {}\n *     }\n *   }\n *\n *   constructor() {\n *     this.adjective = 'awesome';\n *   }\n *\n *   // Define the element's template\n *   render() {\n *     return html`<p>your ${adjective} template here</p>`;\n *   }\n * }\n *\n * customElements.define('my-element', MyElement);\n * ```\n *\n * `LitElement` extends {@linkcode ReactiveElement} and adds lit-html\n * templating. The `ReactiveElement` class is provided for users that want to\n * build their own custom element base classes that don't use lit-html.\n *\n * (COPYBARA: packageDocumentation)\n */\n\nimport './polyfill-support';\nimport {objectProperty} from 'google3/third_party/javascript/closure/reflect/reflect';\nimport {adoptStyles, supportsAdoptingStyleSheets} from '@lit/reactive-element/css-tag.js';\nimport {shadowPiercingWalk} from 'google3/javascript/polymer/testing/shadow_piercer';\nimport {PropertyValues, ReactiveElement} from '@lit/reactive-element';\nimport {render, RenderOptions, noChange, RootPart} from 'lit-html';\nexport * from '@lit/reactive-element';\nexport * from 'lit-html';\n\nimport {LitUnstable} from 'lit-html';\nimport {ReactiveUnstable} from '@lit/reactive-element';\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace Unstable {\n  /**\n   * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n   * we will emit 'lit-debug' events to window, with live details about the update and render\n   * lifecycle. These can be useful for writing debug tooling and visualizations.\n   *\n   * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n   * making certain operations that are normally very cheap (like a no-op render) much slower,\n   * because we must copy data and dispatch events.\n   */\n  // eslint-disable-next-line @typescript-eslint/no-namespace\n  export namespace DebugLog {\n    export type Entry =\n      | LitUnstable.DebugLog.Entry\n      | ReactiveUnstable.DebugLog.Entry;\n  }\n}\n// COPYBARA: JSCompiler_renameProperty\n\nimport {DEV_MODE} from '@lit/reactive-element/dev-mode'; // COPYBARA: const\n// Allows minifiers to rename references to globalThis\nconst global = goog.global;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nif (DEV_MODE) {\n  // Ensure warnings are issued only 1x, even if multiple versions of Lit\n  // are loaded.\n  global.litIssuedWarnings ??= new Set();\n\n  /**\n   * Issue a warning if we haven't already, based either on `code` or `warning`.\n   * Warnings are disabled automatically only by `warning`; disabling via `code`\n   * can be done by users.\n   */\n  issueWarning = (code: string, warning: string) => {\n    warning += ` See https://lit.dev/msg/${code} for more information.`;\n    if (\n      !global.litIssuedWarnings!.has(warning) &&\n      !global.litIssuedWarnings!.has(code)\n    ) {\n      console.warn(warning);\n      global.litIssuedWarnings!.add(warning);\n    }\n  };\n}\n\n/**\n * Base element class that manages element properties and attributes, and\n * renders a lit-html template.\n *\n * To define a component, subclass `LitElement` and implement a\n * `render` method to provide the component's template. Define properties\n * using the {@linkcode LitElement.properties properties} property or the\n * {@linkcode property} decorator.\n */\nexport class LitElement extends ReactiveElement {\n  // This property needs to remain unminified.\n  static ['_$litElement$'] = true;\n\n  /**\n   * @category rendering\n   */\n  readonly renderOptions: RenderOptions = {host: this};\n\n  private __childPart: RootPart | undefined = undefined;\n\n  /**\n   * @category rendering\n   */\n  protected override createRenderRoot() {\n    const renderRoot = super.createRenderRoot();\n    // When adoptedStyleSheets are shimmed, they are inserted into the\n    // shadowRoot by createRenderRoot. Adjust the renderBefore node so that\n    // any styles in Lit content render before adoptedStyleSheets. This is\n    // important so that adoptedStyleSheets have precedence over styles in\n    // the shadowRoot.\n    this.renderOptions.renderBefore ??= renderRoot!.firstChild as ChildNode;\n    return renderRoot;\n  }\n\n  /**\n   * Updates the element. This method reflects property values to attributes\n   * and calls `render` to render DOM via lit-html. Setting properties inside\n   * this method will *not* trigger another update.\n   * @param changedProperties Map of changed properties with old values\n   * @category updates\n   */\n  protected override update(changedProperties: PropertyValues) {\n    // Setting properties in `render` should not trigger an update. Since\n    // updates are allowed after super.update, it's important to call `render`\n    // before that.\n    const value = this.render();\n    if (!this.hasUpdated) {\n      this.renderOptions.isConnected = this.isConnected;\n    }\n    super.update(changedProperties);\n    this.__childPart = render(value, this.renderRoot, this.renderOptions);\n  }\n\n  /**\n   * Invoked when the component is added to the document's DOM.\n   *\n   * In `connectedCallback()` you should setup tasks that should only occur when\n   * the element is connected to the document. The most common of these is\n   * adding event listeners to nodes external to the element, like a keydown\n   * event handler added to the window.\n   *\n   * ```ts\n   * connectedCallback() {\n   *   super.connectedCallback();\n   *   addEventListener('keydown', this._handleKeydown);\n   * }\n   * ```\n   *\n   * Typically, anything done in `connectedCallback()` should be undone when the\n   * element is disconnected, in `disconnectedCallback()`.\n   *\n   * @category lifecycle\n   */\n  override connectedCallback() {\n    super.connectedCallback();\n    this.__childPart?.setConnected(true);\n  }\n\n  /**\n   * Invoked when the component is removed from the document's DOM.\n   *\n   * This callback is the main signal to the element that it may no longer be\n   * used. `disconnectedCallback()` should ensure that nothing is holding a\n   * reference to the element (such as event listeners added to nodes external\n   * to the element), so that it is free to be garbage collected.\n   *\n   * ```ts\n   * disconnectedCallback() {\n   *   super.disconnectedCallback();\n   *   window.removeEventListener('keydown', this._handleKeydown);\n   * }\n   * ```\n   *\n   * An element may be re-connected after being disconnected.\n   *\n   * @category lifecycle\n   */\n  override disconnectedCallback() {\n    super.disconnectedCallback();\n    this.__childPart?.setConnected(false);\n  }\n\n  /**\n   * Invoked on each update to perform rendering tasks. This method may return\n   * any value renderable by lit-html's `ChildPart` - typically a\n   * `TemplateResult`. Setting properties inside this method will *not* trigger\n   * the element to update.\n   * @category rendering\n   */\n  protected render(): unknown {\n    return noChange;\n  }\n\n  /** @nocollapse */\n  static notifyOnHotReplace(tagname: string, classObj: typeof LitElement) {\n    if (goog.DEBUG) {\n      // There's lots of things that this doesn't handle, but probably the\n      // biggest is updates to the constructor. That means that changes to event\n      // handlers won't go through when they're defined as arrow function\n      // property initializers. We could potentially hack that together, via\n      // some really wild tricks, but I'm inclined not to. Periodically\n      // reloading the page while developing with HMR is a good habit for people\n      // to get into.\n      //\n      // One thing I'd like to support is live updating of CSS defined in a\n      // css file with lit_css_module.\n      const existingProps = new Set(Object.getOwnPropertyNames(this.prototype));\n      const newProps = new Set(Object.getOwnPropertyNames(classObj.prototype));\n      for (const prop of Object.getOwnPropertyNames(classObj.prototype)) {\n        Object.defineProperty(\n            this.prototype, prop,\n            Object.getOwnPropertyDescriptor(classObj.prototype, prop)!);\n      }\n      const nonconfigurablePropsToDelete = new Set<string>();\n      for (const existingProp of existingProps) {\n        if (!newProps.has(existingProp)) {\n          if (Object.getOwnPropertyDescriptor(this.prototype, existingProp)\n                  ?.configurable === false) {\n            nonconfigurablePropsToDelete.add(existingProp);\n            // No way to delete a non-configurable property off the prototype.\n            continue;\n          }\n          // tslint:disable-next-line:no-any Yep, this is hacky.\n          delete (this.prototype as any)[existingProp];\n        }\n      }\n\n      // This new class object has never been finalized before. Need to finalize\n      // so that instances can get any updated styles.\n      classObj.finalize();\n\n      for (const node of shadowPiercingWalk(document)) {\n        if (node instanceof HTMLElement &&\n            node.tagName.toLowerCase() === tagname.toLowerCase()) {\n          const myNode = node as LitElement;\n\n          for (const prop of nonconfigurablePropsToDelete) {\n            // So, prop is a non-configurable property on the prototype that\n            // we want to delete. We can't remove it on the prototype, but\n            // we can probably shadow it on the instance.\n            const directDescriptor =\n                Object.getOwnPropertyDescriptor(myNode, prop);\n            if (directDescriptor !== undefined) {\n              // The prototype field has been overwritten by a field on the\n              // instance, leave it alone.\n              continue;\n            }\n            // Patch myNode to behave as though it has no `prop` by defining an\n            // instance field named `prop` that is initially undefined, writable\n            // but not enumerable.\n            let val: unknown = undefined;\n            Object.defineProperty(myNode, prop, {\n              get() {\n                return val;\n              },\n              set(updated: unknown) {\n                val = updated;\n              },\n              enumerable: false,\n              configurable: true,\n            });\n          }\n          // Get updated styling. Need to test that this works in all the\n          // different browser configs, only tested on recent Chrome so far,\n          // where overriding adopted stylesheets seems to just work.\n          const styles = (myNode.constructor as typeof LitElement).elementStyles;\n          const renderRoot = myNode.renderRoot;\n          if (styles && renderRoot instanceof ShadowRoot) {\n            if (supportsAdoptingStyleSheets) {\n              adoptStyles(renderRoot, styles);\n            } else {\n              // Remove all existing shimmed styles from the node.\n              const nodes = Array.from(renderRoot.children);\n              for (const node of nodes) {\n                if (node.tagName.toLowerCase() === 'style') {\n                  renderRoot.removeChild(node);\n                }\n              }\n              // `myNode.renderOptions.renderBefore` needs to be updated\n              // because it refers to the first shimmed adopted style, which was\n              // just removed. So, keep track of the last child in `renderRoot`\n              // because the first new shimmed adopted style to be added by\n              // `adoptStyles` will be its next sibling once `adoptStyles` is\n              // finished.\n              const lastChild = renderRoot.lastChild;\n              adoptStyles(renderRoot, styles);\n              if (lastChild) {\n                myNode.renderOptions.renderBefore = lastChild.nextSibling;\n              } else {\n                delete myNode.renderOptions.renderBefore;\n              }\n            }\n            // Ask for a re-render.\n            myNode.requestUpdate();\n          }\n        }\n      }\n    }\n  }\n\n  /** @nocollapse */\n  static override finalize() {\n    oneTimeWork();\n    return super.finalize.call(this);\n  }\n}\n\n/**\n * Ensure this class is marked as `finalized` as an optimization ensuring\n * it will not needlessly try to `finalize`.\n *\n * Note this property name is a string to prevent breaking Closure JS Compiler\n * optimizations. See @lit/reactive-element for more information.\n */\n(LitElement as unknown as Record<string, unknown>)[\n  objectProperty('finalized', LitElement)\n] = true;\n\n// Install hydration if available\n// commented out by copybara\n// global.litElementHydrateSupport?.({LitElement});\n\n// Apply polyfills if available\nif (goog.FEATURESET_YEAR < 2020) {\n  const polyfillSupport = DEV_MODE ?\n      global.litElementPolyfillSupportDevMode :\n      global.litElementPolyfillSupport;\n  polyfillSupport?.({LitElement});\n}\n\n/**\n * END USERS SHOULD NOT RELY ON THIS OBJECT.\n *\n * Private exports for use by other Lit packages, not intended for use by\n * external users.\n *\n * We currently do not make a mangled rollup build of the lit-ssr code. In order\n * to keep a number of (otherwise private) top-level exports  mangled in the\n * client side code, we export a _$LE object containing those members (or\n * helper methods for accessing private fields of those members), and then\n * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the\n * client-side code is being used in `dev` mode or `prod` mode.\n *\n * This has a unique name, to disambiguate it from private exports in\n * lit-html, since this module re-exports all of lit-html.\n *\n * @private\n */\nexport const _$LE = {\n  _$attributeToProperty: (\n    el: LitElement,\n    name: string,\n    value: string | null\n  ) => {\n    // eslint-disable-next-line\n    (el as any)._$attributeToProperty(name, value);\n  },\n  // eslint-disable-next-line\n  _$changedProperties: (el: LitElement) => (el as any)._$changedProperties,\n};\n\nlet oneTimeWork = () => {\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for LitElement usage.\n(global.litElementVersions ??= []).push('4.1.1');\nif (DEV_MODE && global.litElementVersions.length > 1) {\n  Promise.resolve().then(() => {\n    issueWarning!(\n      'multiple-versions',\n      `Multiple versions of Lit loaded. Loading multiple versions ` +\n        `is not recommended.`\n    );\n  });\n}\noneTimeWork = () => {};\n};\n","import {LitElement, css, html} from 'lit';\nimport {customElement, property} from 'lit/decorators';\nimport {HELP_URL} from './constants';\n\n/**\n * The <c2c-help-icon> component shows an AI specific help icon with a tooltip.\n * Spark icons cannot be open sourced, so they have to live in the plugin.\n */\n@customElement('c2c-help-icon')\nexport class C2CHelpIcon extends LitElement {\n  @property({type: Boolean}) editing = false;\n\n  static override get styles() {\n    return [\n      css`\n        /* div.rightActions is display:flex, so this must be display:block */\n        :host {\n          display: block;\n        }\n        /* display:inline is generally annoying, if we are not rendering text.\n           display:block is easier to reason about when it comes to sizing and\n           positioning. */\n        gr-tooltip-content,\n        a,\n        svg {\n          display: block;\n        }\n        gr-tooltip-content {\n          margin-left: var(--spacing-l);\n        }\n        a {\n          color: var(--deemphasized-text-color);\n        }\n      `,\n    ];\n  }\n\n  override render() {\n    if (!this.editing) return;\n    return html`\n      <gr-tooltip-content has-tooltip title=\"About AI powered features\">\n        <a href=\"${HELP_URL}\" target=\"_blank\"> ${this.renderSvg()} </a>\n      </gr-tooltip-content>\n    `;\n  }\n\n  // Copied from:\n  // google3/googledata/html/external_content/scs_corp/devtools/codereview/ai_help.svg\n  private renderSvg() {\n    // The viewBox, width and height attributes are set to scale from the\n    // original 18x18 to 20x20.\n    return html`\n      <svg\n        xmlns=\"http://www.w3.org/2000/svg\"\n        width=\"20\"\n        height=\"20\"\n        viewBox=\"-1 -1 20 20\"\n        fill=\"currentColor\">\n        <path\n          fill=\"currentColor\"\n          fill-rule=\"evenodd\"\n          d=\"M8.963 13.5a.89.89 0 0 0 .656-.262.92.92 0 0 0 .281-.675.86.86 0 0 0-.281-.657.86.86 0 0 0-.656-.281.92.92 0 0 0-.675.281.89.89 0 0 0-.263.656c0 .263.088.488.262.676a.954.954 0 0 0 .675.262Zm-.675-2.887h1.387c0-.413.044-.738.131-.976.1-.237.369-.562.807-.975a5.86 5.86 0 0 0 .768-.918c.188-.3.281-.656.281-1.069 0-.7-.256-1.237-.768-1.612-.513-.375-1.119-.563-1.819-.563-.712 0-1.294.188-1.744.563a3.005 3.005 0 0 0-.919 1.35L7.65 6.9c.063-.225.2-.469.412-.731.226-.263.563-.394 1.013-.394.4 0 .7.112.9.337.2.213.3.45.3.713 0 .25-.075.487-.225.712a3.15 3.15 0 0 1-.563.6c-.55.488-.887.857-1.012 1.107s-.188.706-.188 1.369ZM9 16.5a7.405 7.405 0 0 1-2.925-.581 7.706 7.706 0 0 1-2.381-1.613 7.706 7.706 0 0 1-1.613-2.381A7.405 7.405 0 0 1 1.5 9c0-1.037.194-2.013.581-2.925.4-.913.938-1.706 1.613-2.381A7.445 7.445 0 0 1 6.075 2.1c.912-.4 1.888-.6 2.925-.6s2.012.2 2.925.6a7.444 7.444 0 0 1 2.381 1.594A7.445 7.445 0 0 1 15.9 6.075c.4.912.6 1.888.6 2.925 0 .539-.054 1.06-.162 1.566a4.109 4.109 0 0 0-1.396-.677C14.981 9.601 15 9.305 15 9c0-1.675-.581-3.094-1.744-4.256C12.094 3.58 10.675 3 9 3c-1.675 0-3.094.581-4.256 1.744C3.58 5.906 3 7.325 3 9c0 1.675.581 3.094 1.744 4.256C5.906 14.42 7.325 15 9 15c.305 0 .601-.02.89-.058.136.513.37.987.68 1.4A7.712 7.712 0 0 1 9 16.5Zm4.875 1.5c0-1.15-.4-2.125-1.2-2.925-.8-.8-1.775-1.2-2.925-1.2 1.15 0 2.125-.4 2.925-1.2.8-.8 1.2-1.775 1.2-2.925 0 1.15.4 2.125 1.2 2.925.8.8 1.775 1.2 2.925 1.2-1.15 0-2.125.4-2.925 1.2-.8.8-1.2 1.775-1.2 2.925Z\"\n          clip-rule=\"evenodd\" />\n      </svg>\n    `;\n  }\n}\n\ndeclare global {\n  interface HTMLElementTagNameMap {\n    'c2c-help-icon': C2CHelpIcon;\n    // Known to exist from main Gerrit app\n    'gr-tooltip-content': HTMLElement;\n  }\n}\n","/** URL to the help page. */\nexport const HELP_URL = 'http://go/gob/users/ai-features';\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/*\n * IMPORTANT: For compatibility with tsickle and the Closure JS compiler, all\n * property decorators (but not class decorators) in this file that have\n * an @ExportDecoratedItems annotation must be defined as a regular function,\n * not an arrow function.\n */\n\nimport type {Constructor} from './base.js';\n\n/**\n * Allow for custom element classes with private constructors\n */\ntype CustomElementClass = Omit<typeof HTMLElement, 'new'>;\n\nexport type CustomElementDecorator = {\n  // legacy\n  (cls: CustomElementClass): void;\n\n  // standard\n  (\n    target: CustomElementClass,\n    context: ClassDecoratorContext<Constructor<HTMLElement>>\n  ): void;\n};\n\n/**\n * Class decorator factory that defines the decorated class as a custom element.\n *\n * ```js\n * @customElement('my-element')\n * class MyElement extends LitElement {\n *   render() {\n *     return html``;\n *   }\n * }\n * ```\n * @category Decorator\n * @param tagName The tag name of the custom element to define.\n */\nexport const customElement =\n  (tagName: string): CustomElementDecorator =>\n  (\n    classOrTarget: CustomElementClass | Constructor<HTMLElement>,\n    context?: ClassDecoratorContext<Constructor<HTMLElement>>\n  ) => {\n    if (context !== undefined) {\n      context.addInitializer(() => {\n        customElements.define(\n          tagName,\n          classOrTarget as CustomElementConstructor\n        );\n      });\n    } else {\n      customElements.define(tagName, classOrTarget as CustomElementConstructor);\n    }\n  };\n","import {CommentRange} from 'google3/third_party/javascript/polygerrit/api/rest-api';\nimport {\n  SuggestCodeRequest,\n  Suggestion,\n} from 'google3/third_party/javascript/polygerrit/api/suggestions';\n\nimport {C2CCommentRange, C2CReplacement, C2CSuggestion} from './types';\n\n/**\n * Check if replacement is inside of suggested Code request range\n */\nexport function isReplacementInRange(\n  replacement: C2CReplacement,\n  requestRange: CommentRange,\n) {\n  if (!replacement.range) return false;\n  const replacementRange = textRangeToCommentRange(replacement.range);\n  // TODO(milutin): Track number of suggestions excluded because of conditions\n  return (\n    // requestRange.end_line + 1, replacement can be just addition after\n    // request range.\n    replacementRange.start_line <= requestRange.end_line + 1 &&\n    replacementRange.start_line >= requestRange.start_line &&\n    replacementRange.end_line <= requestRange.end_line\n  );\n}\n\n/**\n * convert {@link TextRangeProto.TextRange} into {@link Comment.Range}\n * used for suggest-code implementation\n */\nfunction textRangeToCommentRange(range: C2CCommentRange): CommentRange {\n  return {\n    start_line: range.start_line,\n    start_character: range.start_char - 1,\n    end_line: range.end_line - 1,\n    end_character: range.end_char,\n  };\n}\n\n/**\n * extract full lines in range or on a line from full file content\n * similar to google3/third_party/javascript/polygerrit/utils/comment-util.ts\n **/\nfunction getContentInCommentRange(\n  fileContent: string,\n  fromLine: number,\n  numLines: number,\n) {\n  const lines = fileContent.split('\\n');\n  return lines.slice(fromLine - 1, fromLine - 1 + numLines).join('\\n');\n}\n\n/**\n * Transform C2C Suggestion to User Suggested Edit format\n * It expects full lines replacement defined by range or line\n **/\nexport function transformC2CSuggestionsToProviderSuggestions(\n  suggestion: C2CSuggestion,\n  suggestCodeRequest: SuggestCodeRequest,\n  newRange?: CommentRange,\n): Suggestion[] {\n  const requestRange = newRange ?? getNormalizedRange(suggestCodeRequest);\n  let numAddedLinesBeforeRequestRange = 0;\n  for (const replacement of suggestion.replacements) {\n    const numLinesAddedByReplacement =\n      getNumLinesAddedByReplacement(replacement);\n    // if new lines are added and replacement is before requestedRange,\n    // add number of new lines to total num of added lines before requested\n    // range\n    if (\n      numLinesAddedByReplacement > 0 &&\n      replacement.range.end_line <= requestRange.start_line\n    ) {\n      numAddedLinesBeforeRequestRange += numLinesAddedByReplacement;\n    }\n\n    if (!isReplacementInRange(replacement, requestRange)) continue;\n    // TODO(milutin): accept replacement out of range, once we are able to\n    // change comment range\n    let addedLinesBeforeRange = 0;\n    if (isAdditionBeforeRequestedRange(replacement, requestRange)) {\n      addedLinesBeforeRange = getNumOfLinesInReplacement(replacement);\n    }\n    const content = getContentInCommentRange(\n      suggestion.new_content,\n      requestRange.start_line +\n        numAddedLinesBeforeRequestRange -\n        addedLinesBeforeRange,\n      getNumLinesOfSuggestion(replacement, requestRange),\n    );\n    if (newRange) {\n      return [{replacement: content, newRange}];\n    } else {\n      return [{replacement: content}];\n    }\n  }\n  return [];\n}\n\n/**\n * Get new range from c2cSuggestion\n * This function provides a good range based of comments2code suggestion. It\n * returns undefined if there is no good candidate for new range.\n * For now, we use simple strategy - find the largest replacement and\n * use its range. Replacement needs to have 3 lines or more.\n **/\nexport function getNewRange(\n  c2cSuggestion: C2CSuggestion,\n): CommentRange | undefined {\n  let newRange: CommentRange | undefined = undefined;\n  let largestReplacement = 0; // Replacement needs to have 1 line or more\n  for (const replacement of c2cSuggestion.replacements) {\n    const numOfLinesInReplacement = getNumOfLinesInReplacement(replacement);\n    if (largestReplacement < numOfLinesInReplacement) {\n      largestReplacement = numOfLinesInReplacement;\n      newRange = textRangeToCommentRange(replacement.range);\n    }\n  }\n  return newRange;\n}\n\n/**\n * Get normalized range from suggestCodeRequest\n **/\nexport function getNormalizedRange(\n  suggestCodeRequest: SuggestCodeRequest,\n): CommentRange {\n  return (\n    suggestCodeRequest.range ?? {\n      start_line: suggestCodeRequest.lineNumber!,\n      end_line: suggestCodeRequest.lineNumber!,\n      start_character: 0,\n      end_character: 0,\n    }\n  );\n}\n\nfunction getNumLinesAddedByReplacement(replacement: C2CReplacement) {\n  const replacementRange = textRangeToCommentRange(replacement.range);\n  return (\n    getNumOfLinesInReplacement(replacement) -\n    Math.max(0, numOfLinesInRange(replacementRange))\n  );\n}\n\nfunction getNumOfLinesInReplacement(replacement: C2CReplacement) {\n  // Comments2code replacement always ends with \\n that we skip by -1\n  return replacement.new_content.split('\\n').length - 1;\n}\n\nfunction numOfLinesInRange(range: CommentRange) {\n  return range.end_line - range.start_line + 1;\n}\n\nfunction getNumLinesOfSuggestion(\n  replacement: C2CReplacement,\n  requestRange: CommentRange,\n) {\n  const isOnlyAddingLines =\n    replacement.range.start_line === requestRange.end_line + 1 ||\n    isAdditionBeforeRequestedRange(replacement, requestRange);\n  if (isOnlyAddingLines) {\n    return (\n      getNumOfLinesInReplacement(replacement) + numOfLinesInRange(requestRange)\n    );\n  } else {\n    return Math.max(\n      getNumOfLinesInReplacement(replacement),\n      numOfLinesInRange(requestRange),\n    );\n  }\n}\n\nfunction isAdditionBeforeRequestedRange(\n  replacement: C2CReplacement,\n  requestRange: CommentRange,\n) {\n  return replacement.range.end_line === requestRange.start_line;\n}\n","import {PluginApi} from 'google3/third_party/javascript/polygerrit/api/plugin';\nimport {RestPluginApi} from 'google3/third_party/javascript/polygerrit/api/rest';\nimport {\n  FixId,\n  FixSuggestionInfo,\n  PatchSetNum,\n} from 'google3/third_party/javascript/polygerrit/api/rest-api';\nimport {\n  AutocompleteCommentRequest,\n  AutocompleteCommentResponse,\n  Feedback,\n  ResponseCode,\n  SuggestCodeRequest,\n  SuggestedFixResponse,\n  SuggestionFeedbackEntry,\n  SuggestionsProvider,\n} from 'google3/third_party/javascript/polygerrit/api/suggestions';\n\nimport {uuid} from 'google3/third_party/javascript/polygerrit/utils/common-util';\nimport {outcomeToResponseCode} from './autocomplete-comment-util';\nimport {HELP_URL} from './constants';\nimport {\n  getNewRange,\n  getNormalizedRange,\n  isReplacementInRange,\n  transformC2CSuggestionsToProviderSuggestions,\n} from './suggest-code-util';\nimport {textRangeToCommentRange} from './suggest-fix-util';\nimport {\n  C2CSuggestion,\n  ChatPostRequestBody,\n  ChatPostResponse,\n  CommentAutocompletionPostRequestBody,\n  CommentAutocompletionPostResponse,\n  MachineSuggestedCodePostRequestBody,\n} from './types';\n\nconst ML_SUGGESTION_DESCRIPTION = 'prompt_to_edit API';\n\nconst MAGIC_FILES_TO_SKIP = ['/COMMIT_MSG', '/MERGE_LIST', '/PATCHSET_LEVEL'];\n\n// LINT.IfChange\n/**\n * The name of the smart choice study.\n */\nexport enum FeedbackStudy {\n  PREDICT_COMMENT = 'PREDICT_COMMENT',\n  PREDICT_EDIT = 'PREDICT_EDIT',\n}\n// LINT.ThenChange(\n//   //depot/google3/java/com/google/devtools/gerritcodereview/plugins/comments2code/SendSmartChoiceFeedback.java\n// )\n\n/**\n * Body for the POST request to the suggestion_feedback endpoint.\n * Corresponds to SendSmartChoiceFeedback.Input in the Java backend.\n */\ninterface FeedbackPostBody {\n  /**\n   * Represents a 128-bit unique identifier for a suggestion, used for tracking feedback.\n   * The ID is split into two 64-bit BigInt components.\n   */\n  // tslint:disable:enforce-name-casing\n  feedback_id1: bigint;\n  feedback_id2: bigint;\n  feedback_study: FeedbackStudy;\n  // tslint:enable:enforce-name-casing\n  accepted: boolean;\n}\n\n/**\n * Implements SuggestionsProvider with using comments2code (go/comments2code)\n * and comment autocompletion (go/gerrit-ai-comment-autocompletion).\n **/\nexport class SuggestionsPredictor implements SuggestionsProvider {\n  private readonly restApi: RestPluginApi;\n\n  constructor(plugin: PluginApi) {\n    this.restApi = plugin.restApi();\n  }\n\n  async autocompleteComment(\n    request: AutocompleteCommentRequest,\n  ): Promise<AutocompleteCommentResponse> {\n    if (!request.commentText || request.changeInfo.is_private) {\n      return {completion: '', responseCode: ResponseCode.OK};\n    }\n    if (MAGIC_FILES_TO_SKIP.includes(request.filePath)) {\n      return {completion: '', responseCode: ResponseCode.OK};\n    }\n\n    let response: CommentAutocompletionPostResponse | undefined;\n    try {\n      response = await this.commentAutocompletionRestApi(\n        request.changeInfo._number,\n        request.patchsetNumber,\n        {\n          content: request.commentText,\n          path: request.filePath,\n          range: request.range,\n          line: request.lineNumber,\n          id: request.id,\n          // The backend will decide which model to use based on Mendel flags.\n          // But setting something >0 here allows us to force using a different\n          // model for testing and experimentation.\n          model: 0, // see cs/symbol:AutocompleteModelConfig\n        },\n      );\n    } catch (e: unknown) {\n      console.error('Failed to request comment autocompletion', e);\n      return {responseCode: ResponseCode.ERROR};\n    }\n    const modelVersion = response?.model_name;\n    const completion = response?.comment_completion;\n    const outcome = response?.outcome;\n    let feedback: Feedback | undefined;\n    if (\n      response?.feedback_id1 !== undefined &&\n      response?.feedback_id2 !== undefined\n    ) {\n      feedback = {id1: response.feedback_id1, id2: response.feedback_id2};\n    }\n\n    return {\n      completion,\n      modelVersion,\n      outcome,\n      feedback,\n      responseCode: outcomeToResponseCode(outcome),\n    };\n  }\n\n  async suggestCode(commentData: SuggestCodeRequest) {\n    if (!commentData.prompt) {\n      return {\n        suggestions: [],\n        responseCode: ResponseCode.ERROR,\n      };\n    }\n\n    if (commentData.changeInfo.is_private) {\n      return {\n        suggestions: [],\n        responseCode: ResponseCode.OK,\n      };\n    }\n\n    const {prompt, filePath, range, lineNumber} = commentData;\n    let c2cSuggestions: C2CSuggestion[] | undefined;\n    try {\n      c2cSuggestions = await this.machineSuggestedCodeRestApi(\n        commentData.changeInfo._number,\n        commentData.patchsetNumber,\n        {\n          prompt,\n          filepath: filePath,\n          range,\n          line_nbr: lineNumber,\n        },\n      );\n    } catch (e: unknown) {\n      console.error('Failed to request suggested code', e);\n      return {\n        suggestions: [],\n        responseCode: ResponseCode.ERROR,\n      };\n    }\n    // In current prototype we are only interested in one suggestion\n    const c2cSuggestion = c2cSuggestions?.[0];\n    if (!c2cSuggestion) {\n      return {suggestions: [], responseCode: ResponseCode.NO_SUGGESTION};\n    }\n\n    const isSomeReplacementsInRange = c2cSuggestion.replacements.some((r) =>\n      isReplacementInRange(r, getNormalizedRange(commentData)),\n    );\n    let newRange = undefined;\n    if (!isSomeReplacementsInRange) {\n      newRange = getNewRange(c2cSuggestion);\n      if (!newRange) {\n        return {\n          suggestions: [],\n          responseCode: ResponseCode.OUT_OF_RANGE,\n        };\n      }\n    }\n\n    const suggestions = transformC2CSuggestionsToProviderSuggestions(\n      c2cSuggestion,\n      commentData,\n      newRange,\n    );\n    return {\n      suggestions,\n      responseCode: ResponseCode.OK,\n    };\n  }\n\n  async suggestFix(\n    commentData: SuggestCodeRequest,\n  ): Promise<SuggestedFixResponse> {\n    if (!commentData.prompt) {\n      return {\n        fix_suggestions: [],\n        responseCode: ResponseCode.ERROR,\n      };\n    }\n\n    if (commentData.changeInfo.is_private) {\n      return {\n        fix_suggestions: [],\n        responseCode: ResponseCode.OK,\n      };\n    }\n\n    const {prompt, filePath, range, lineNumber} = commentData;\n    let c2cSuggestions: C2CSuggestion[] | undefined;\n    try {\n      c2cSuggestions = await this.machineSuggestedCodeRestApi(\n        commentData.changeInfo._number,\n        commentData.patchsetNumber,\n        {\n          prompt,\n          filepath: filePath,\n          range,\n          line_nbr: lineNumber,\n        },\n      );\n    } catch (e: unknown) {\n      console.error('Failed to request suggested code', e);\n      return {\n        fix_suggestions: [],\n        responseCode: ResponseCode.ERROR,\n      };\n    }\n    // tslint:disable-next-line:enforce-name-casing\n    const fix_suggestions: FixSuggestionInfo[] = (c2cSuggestions ?? []).map(\n      (suggestion) => ({\n        fix_id: `ml-${uuid()}` as FixId,\n        description: ML_SUGGESTION_DESCRIPTION,\n        log_probability: suggestion.log_probability,\n        replacements: (suggestion.replacements ?? []).map((replacement) => ({\n          // The AI model is currently setting replacement.path to only the file\n          // extension (e.g., \".ts\"), but a full path is required.\n          // As a workaround, we're using the filepath from the request, since\n          // we're restricting suggestions to the requested file\n          path: filePath,\n          range: textRangeToCommentRange(replacement.range),\n          replacement: replacement.new_content,\n        })),\n      }),\n    );\n    return {\n      fix_suggestions,\n      responseCode: ResponseCode.OK,\n    };\n  }\n\n  /**\n   * Sends feedback for suggestions.\n   */\n  async sendFeedback(\n    feedbackEntries: SuggestionFeedbackEntry[],\n    feedbackStudy: FeedbackStudy,\n    changeNum?: number,\n    revisionId?: PatchSetNum,\n  ): Promise<void> {\n    if (!changeNum || !revisionId) {\n      console.warn(\n        'changeNum and revisionId are required for Send AI feedback.',\n      );\n      return;\n    }\n    for (const entry of feedbackEntries) {\n      if (!entry.feedbackId) {\n        console.warn(\n          'Skipping Sending AI feedback, feedbackId is missing:',\n          entry,\n        );\n        continue;\n      }\n      const body: FeedbackPostBody = {\n        feedback_id1: entry.feedbackId.id1,\n        feedback_id2: entry.feedbackId.id2,\n        feedback_study: feedbackStudy, // From SendSmartChoiceFeedback.SmartChoiceStudy\n        accepted: entry.accepted,\n      };\n      const endpoint = `/changes/${changeNum}/revisions/${revisionId}/suggestion_feedback`;\n      try {\n        await this.restApi.post(endpoint, body);\n      } catch (e: unknown) {\n        console.error(\n          `Failed to send suggestion feedback for change ${changeNum}, revision ${revisionId} with body ${JSON.stringify(body)}`,\n          e,\n        );\n      }\n    }\n  }\n\n  getFixSuggestionTitle(fixSuggestions?: FixSuggestionInfo[]): string {\n    if (!fixSuggestions || this.isFixSuggestionFromML(fixSuggestions)) {\n      return 'AI-suggested fix';\n    }\n    return '';\n  }\n\n  getDocumentationLink(fixSuggestions?: FixSuggestionInfo[]): string {\n    if (!fixSuggestions || this.isFixSuggestionFromML(fixSuggestions)) {\n      return `${HELP_URL}#ai-suggested-fixes-v2`;\n    }\n    return '';\n  }\n\n  private isFixSuggestionFromML(fixSuggestions: FixSuggestionInfo[]): boolean {\n    const description = fixSuggestions?.[0]?.description;\n    return description === ML_SUGGESTION_DESCRIPTION;\n  }\n\n  async machineSuggestedCodeRestApi(\n    changeNum?: number,\n    revisionId?: PatchSetNum,\n    body?: MachineSuggestedCodePostRequestBody,\n  ): Promise<C2CSuggestion[] | undefined> {\n    if (\n      changeNum === undefined ||\n      revisionId === undefined ||\n      body === undefined\n    ) {\n      return;\n    }\n    const errFn = () => {\n      throw new Error(`request for ${changeNum} failed`);\n    };\n    return await this.restApi.post(\n      `/changes/${changeNum}/revisions/${revisionId}/prompt_to_edit`,\n      body,\n      errFn,\n    );\n  }\n\n  async commentAutocompletionRestApi(\n    changeNum?: number,\n    revisionId?: PatchSetNum,\n    body?: CommentAutocompletionPostRequestBody,\n  ): Promise<CommentAutocompletionPostResponse | undefined> {\n    if (\n      changeNum === undefined ||\n      revisionId === undefined ||\n      body === undefined\n    ) {\n      return;\n    }\n    const errFn = () => {\n      throw new Error(`comment_autocompletion request for ${changeNum} failed`);\n    };\n    const response = await this.restApi.post(\n      `/changes/${changeNum}/revisions/${revisionId}/comment_autocompletion`,\n      body,\n      errFn,\n    );\n    return response as CommentAutocompletionPostResponse | undefined;\n  }\n\n  async chatRestApi(\n    changeNum?: number,\n    revisionId?: PatchSetNum,\n    body?: ChatPostRequestBody,\n  ): Promise<ChatPostResponse | undefined> {\n    if (\n      changeNum === undefined ||\n      revisionId === undefined ||\n      body === undefined\n    ) {\n      return;\n    }\n    const errFn = () => {\n      throw new Error(`chat request for ${changeNum} failed`);\n    };\n    // TODO: Remove trace param post launch.\n    const response = await this.restApi.post(\n      `/changes/${changeNum}/revisions/${revisionId}/chat?trace=issue/437944720`,\n      body,\n      errFn,\n    );\n    return response as ChatPostResponse | undefined;\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {fireAlert} from './event-util';\n\n/**\n * @fileoverview Functions in this file contains some widely used\n * code patterns. If you noticed a repeated code and none of the existing util\n * files are appropriate for it - you can wrap the code in a function and put it\n * here. If you notice that several functions can be group together - create\n * a separate util file for them.\n */\n\n/**\n * Wrapper for the Object.prototype.hasOwnProperty method\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function hasOwnProperty(obj: any, prop: PropertyKey) {\n  // Typescript rules don't allow to use obj.hasOwnProperty directly\n  return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\n// TODO(TS): move to common types once we have type utils\n//  Required for constructor signature.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type Constructor<T> = new (...args: any[]) => T;\n\n/**\n * Use the function for compile-time checking that all possible input\n * values are processed\n */\nexport function assertNever(obj: never, msg: string): never {\n  console.error(msg, obj);\n  throw new Error(msg);\n}\n\n/**\n * Throws an error with the provided error message if the condition is false.\n */\nexport function assert(\n  condition: boolean,\n  errorMessage: string\n): asserts condition {\n  if (!condition) throw new Error(errorMessage);\n}\n\n/**\n * Throws an error if the property is not defined.\n */\nexport function assertIsDefined<T>(\n  val: T,\n  variableName = 'variable'\n): asserts val is NonNullable<T> {\n  if (val === undefined || val === null) {\n    throw new Error(`${variableName} is not defined`);\n  }\n}\n\nexport function queryAll<E extends Element = Element>(\n  el: Element,\n  selector: string\n): NodeListOf<E> {\n  if (!el) throw new Error('element not defined');\n  if (el.shadowRoot) {\n    const r = el.shadowRoot.querySelectorAll<E>(selector);\n    if (r.length > 0) return r;\n  }\n  return el.querySelectorAll<E>(selector);\n}\n\nexport function query<E extends Element = Element>(\n  el: Element | null | undefined,\n  selector: string\n): E | undefined {\n  if (!el) return undefined;\n  if (el.shadowRoot) {\n    const r = el.shadowRoot.querySelector<E>(selector);\n    if (r) return r;\n  }\n  return el.querySelector<E>(selector) ?? undefined;\n}\n\nexport function queryAndAssert<E extends Element = Element>(\n  el: Element | null | undefined,\n  selector: string\n): E {\n  const found = query<E>(el, selector);\n  if (!found) throw new Error(`selector '${selector}' did not match anything'`);\n  return found;\n}\n\n/**\n * Returns true, if both sets contain the same members.\n */\nexport function areSetsEqual<T>(a: Set<T>, b: Set<T>): boolean {\n  if (a.size !== b.size) {\n    return false;\n  }\n  return containsAll(a, b);\n}\n\n/**\n * Returns true, if 'set' contains 'subset'.\n */\nexport function containsAll<T>(set: Set<T>, subSet: Set<T>): boolean {\n  for (const value of subSet) {\n    if (!set.has(value)) {\n      return false;\n    }\n  }\n  return true;\n}\n\n/**\n * Add value, if the set does not contain it. Otherwise remove it.\n */\nexport function toggleSet<T>(set: Set<T>, value: T): void {\n  if (set.has(value)) {\n    set.delete(value);\n  } else {\n    set.add(value);\n  }\n}\n\nexport function toggle<T>(array: T[], item: T): T[] {\n  if (array.includes(item)) {\n    return array.filter(r => r !== item);\n  } else {\n    return array.concat([item]);\n  }\n}\n\nexport function unique<T>(item: T, index: number, array: T[]) {\n  return array.indexOf(item) === index;\n}\n\n/**\n * Returns the elements that are present in every sub-array. If a compareBy\n * predicate is passed in, it will be used instead of strict equality. A new\n * array is always returned even if there is already just a single array.\n */\nexport function intersection<T>(\n  arrays: T[][],\n  compareBy: (t: T, u: T) => boolean = (t, u) => t === u\n): T[] {\n  // Array.prototype.reduce needs either an initialValue or a non-empty array.\n  // Since there is no good initialValue for intersecting (\u2205 \u2229 X = \u2205), the\n  // empty array must be checked separately.\n  if (arrays.length === 0) {\n    return [];\n  }\n  if (arrays.length === 1) {\n    return [...arrays[0]];\n  }\n  return arrays.reduce((result, array) =>\n    result.filter(t => array.find(u => compareBy(t, u)))\n  );\n}\n\n/**\n * Returns the elements that are present in A but not present in B.\n */\nexport function difference<T>(\n  a: T[],\n  b: T[],\n  compareBy: (t: T, u: T) => boolean = (t, u) => t === u\n): T[] {\n  return a.filter(aVal => !b.some(bVal => compareBy(aVal, bVal)));\n}\n\nexport async function copyToClipboard(text: string, copyTargetName?: string) {\n  await navigator.clipboard.writeText(text);\n  fireAlert(document, `${copyTargetName ?? text} was copied to clipboard`);\n}\n\n/**\n * Produces strings such as `y364b4tm28n`.\n */\nexport function uuid() {\n  return Math.random().toString(36).substring(2);\n}\n\n/**\n * Produces strings such as `36b8f84d-df4e-4d49-b662-bcde71a8764f`.\n */\nexport function cryptoUuid() {\n  return crypto.randomUUID();\n}\n","import {CommentRange} from 'google3/third_party/javascript/polygerrit/api/rest-api';\nimport {C2CCommentRange} from './types';\n\n/**\n * convert {@link TextRangeProto.TextRange} into {@link Comment.Range}\n * where {@link TextRangeProto.TextRange} was created in comments2code/RangeUtil.java\n * start_character and end_character are >= 0\n */\nexport function textRangeToCommentRange(range: C2CCommentRange): CommentRange {\n  return {\n    start_line: range.start_line,\n    start_character: Math.max(range.start_char, 0),\n    end_line: range.end_line,\n    end_character: Math.max(range.end_char, 0),\n  };\n}\n","import 'google3/third_party/javascript/polygerrit/api/gerrit';\n\nimport {PatchSetNum} from 'google3/third_party/javascript/polygerrit/api/rest-api';\nimport {SuggestionFeedbackEntry} from 'google3/third_party/javascript/polygerrit/api/suggestions';\nimport {AiCodeReview} from './ai-code-review';\nimport './c2c-help-icon';\nimport {FeedbackStudy, SuggestionsPredictor} from './predictor';\n\nwindow.Gerrit.install(async (plugin) => {\n  if ((await plugin.restApi().getAccount())?.tags?.includes('GOOGLER')) {\n    const suggestionsApi = plugin.suggestions();\n    const predictor = new SuggestionsPredictor(plugin);\n    plugin.registerCustomComponent('comment', 'c2c-help-icon', {\n      slot: 'draft-actions-end',\n    });\n    plugin.registerCustomComponent(\n      'fix-suggestion-title-help',\n      'c2c-help-icon',\n    );\n    const aiCodeReview = new AiCodeReview(plugin);\n    plugin.aiCodeReview().register(aiCodeReview);\n\n    suggestionsApi.register({\n      autocompleteComment: (data) => predictor.autocompleteComment(data),\n      suggestCode: (data) => predictor.suggestCode(data),\n      suggestFix: (data) => predictor.suggestFix(data),\n      getFixSuggestionTitle: (fix) => predictor.getFixSuggestionTitle(fix),\n      getDocumentationLink: (fix) => predictor.getDocumentationLink(fix),\n      sendAutocompleteFeedback: (\n        feedbackEntries: SuggestionFeedbackEntry[],\n        changeNum?: number,\n        revisionId?: PatchSetNum,\n      ) => {\n        predictor.sendFeedback(\n          feedbackEntries,\n          /* feedback_study= */ FeedbackStudy.PREDICT_COMMENT,\n          changeNum,\n          revisionId,\n        );\n      },\n      sendSuggestFixFeedback: (\n        feedbackEntries: SuggestionFeedbackEntry[],\n        changeNum?: number,\n        revisionId?: PatchSetNum,\n      ) => {\n        predictor.sendFeedback(\n          feedbackEntries,\n          /* feedback_study= */ FeedbackStudy.PREDICT_EDIT,\n          changeNum,\n          revisionId,\n        );\n      },\n      // support all file extensions\n      supportedFileExtensions: undefined,\n    });\n  }\n});\n"],
"names":["$jscomp.defineProperty","$jscomp.global","$jscomp.getGlobal","$jscomp.polyfill","goog.global","self","exports.__decorate","decorators","target","key","desc","c","arguments","length","r","Object","getOwnPropertyDescriptor","d","Reflect","i","defineProperty","referenceToGerritReference","reference","symbolLookup","type","displayText","symbolName","secondaryText","externalUrl","buganizer","id","String","issueId","errorMsg","error","critique","clNumber","clUrl","codesearch","url","g3doc","parsedUrl","URL","pathParts","pathname","split","hash","e","TypeError","tooltip","document","yaqs","gerrit","gerritUrl","Buganizer","constructor","name","icon","placeholder","regex","parse","link","buganizerMatch","match","identifier","undefined","type_id","title","Codesearch","csMatch","Critique","clMatch","G3Doc","g3docMatch","filePath","anchor","fileParts","fileName","GDoc","gdocMatch","module$exports$google3$java$com$google$devtools$gerritcodereview$plugins$comments2code$web$ai$2dcode$2dreview.AiCodeReview","plugin","chat","req","listener","change","current_revision","_number","payload","action","user_question","prompt","conversation_id","turn_index","regeneration_index","client_data","model_name","files","getFiles","restApi","post","then","res","references","rest","response","map","filter","x","emitResponse","done","catch","emitError","listChatConversations","get","conversations","getChatConversation","turns","getModels","documentation_url","citation_url","privacy_url","getActions","Promise","resolve","actions","display_text","initial_user_prompt","enable_splash_page_card","enable_send_without_input","default_action_id","getContextItemTypes","filesIn","commit","parents","revisions","base_commit","revision","filesOut","fileIn","status","ADDED","DELETED","push","path","operation","base_file","outcomeToResponseCode","outcome","ERROR","OK","NO_SUGGESTION","FILE_TOO_LARGE","INVALID_RANGE","UNSUPPORTED_FILE_TYPE","USER_QUOTA_EXCEEDED","OK_LOW_CONFIDENCE","shimNotNeeded","module$exports$google3$javascript$polymer$detect_transpilation$detect_transpilation.wasTranspiledToEs5","test","servingRawClasses","toString","HTMLElement","goog.globalReflect","goog.globalcustomElements","customElements","patchedHTMLElement","module$exports$webcomponentsjs$custom_elements$es5_shim_implementation.getHTMLElement","exports.getHTMLElement","reflect","construct","BuiltInHTMLElement","shim","prototype","es5Shimmed","setPrototypeOf","applied","module$exports$google3$third_party$javascript$lit$packages$reactive$2delement$src$css$2dtag.supportsAdoptingStyleSheets","goog.globalShadowRoot","ShadowRoot","goog.globalShadyCSS","ShadyCSS","goog.globalShadyCSSnativeShadow","nativeShadow","Document","CSSStyleSheet","constructionToken","Symbol","cssTagCache","WeakMap","module$exports$google3$third_party$javascript$lit$packages$reactive$2delement$src$css$2dtag.CSSResult","cssText","strings","Error","_strings","styleSheet","_styleSheet","cacheable","replaceSync","set","module$exports$google3$third_party$javascript$lit$packages$reactive$2delement$src$css$2dtag.css","values","exports.css","valueOf","reduce","acc","v","idx","module$exports$google3$third_party$javascript$lit$packages$reactive$2delement$src$css$2dtag.adoptStyles","renderRoot","styles","exports.adoptStyles","adoptedStyleSheets","s","style","createElement","nonce","setAttribute","textContent","appendChild","module$exports$google3$third_party$javascript$lit$packages$reactive$2delement$src$css$2dtag.getCompatibleStyle","rule","sheet","cssRules","polyfillSupport","ReactiveElement","globalThis","ApplyShim","elementProto","ShadyDOM","inUse","noPatch","patchElementProto","createRenderRoot","elementProto.createRenderRoot","localName","call","hasOwnProperty","SCOPED","css","elementStyles","Array","from","a","ScopingShim","prepareAdoptedCssText","_$handlesPrepareStyles","prepareTemplateStyles","shadowRoot","attachShadow","shadowRootOptions","connectedCallback","elementProto.connectedCallback","hasUpdated","styleElement","didUpdate","_$didUpdate","elementProto._$didUpdate","changedProperties","reactiveElementPolyfillSupport","is","getOwnPropertyNames","getOwnPropertySymbols","getPrototypeOf","trustedTypes","goog.globaltrustedTypes","emptyStringForBooleanAttribute","emptyScript","goog.globalreactiveElementPolyfillSupport","module$exports$google3$third_party$javascript$lit$packages$reactive$2delement$src$reactive$2delement.defaultConverter","toAttribute","value","Boolean","JSON","stringify","fromAttribute","fromValue","Number","module$exports$google3$third_party$javascript$lit$packages$reactive$2delement$src$reactive$2delement.notEqual","old","exports.notEqual","defaultPropertyDeclaration","attribute","converter","useDefault","hasChanged","metadata","module$exports$google3$third_party$javascript$lit$packages$reactive$2delement$src$reactive$2delement.litPropertyMetadata","getPropertyDescriptor","options","oldValue","requestUpdate","configurable","enumerable","createProperty","state","__prepare","create","wrapped","elementProperties","noAccessor","descriptor","ctor","newValue","getPropertyOptions","__defaultValues","hasAttribute","__attributeNameForProperty","_$changeProperty","isUpdatePending","__updatePromise","__enqueueUpdate","performUpdate","__instanceProperties","p__tsickle_destructured_5","value__tsickle_destructured_6","size","p__tsickle_destructured_7","options__tsickle_destructured_8","p","_$changedProperties","has","shouldUpdate","__controllers","forEach","hostUpdate","update","__markUpdated","module$exports$google3$third_party$javascript$lit$packages$reactive$2delement$src$reactive$2delement.ReactiveElement","addInitializer","initializer","_initializers","finalize","__attributeToPropertyMap","keys","superCtor","Map","oneTimeWork","finalized","props","properties","propKeys","symbolMetadata","module$exports$google3$third_party$javascript$lit$packages$reactive$2delement$src$reactive$2delement.litPropertyMetadataget","p__tsickle_destructured_1","options__tsickle_destructured_2","p__tsickle_destructured_3","options__tsickle_destructured_4","attr","isArray","Set","flat","Infinity","reverse","unshift","toLowerCase","__reflectingProperty","__initialize","enableUpdating","__saveInstanceProperties","instanceProperties","hostConnected","disconnectedCallback","hostDisconnected","attributeChangedCallback","_old","_$attributeToProperty","__propertyToAttribute","attrValue","removeAttribute","propName","converterResult","initializeValue","__reflectingProperties","add","squelchUpdateErrorsDuringLit2Migration","reject","result","scheduleUpdate","hostUpdated","updated","module$exports$google3$third_party$javascript$lit$packages$reactive$2delement$src$reactive$2delement.ReactiveElementelementStyles","module$exports$google3$third_party$javascript$lit$packages$reactive$2delement$src$reactive$2delement.ReactiveElementshadowRootOptions","mode","reactiveElementVersions","goog.globalreactiveElementVersions","module$exports$google3$third_party$javascript$lit$packages$reactive$2delement$src$decorators$property.standardProperty","context","exports.standardProperty","kind","module$exports$google3$third_party$javascript$lit$packages$reactive$2delement$src$reactive$2delement.litPropertyMetadataset","init","styledScopes","scopeCssStore","Template","ChildPart","wrap","node","needsPrepareStyles","cssForScope","scopeCss","prepareStyles","template","hasScopeCss","join","content","delete","querySelector","scopedTemplateCache","originalCreateElement","Template.createElement","html","element","scope","prepareTemplateDom","querySelectorAll","parentNode","removeChild","renderContainer","createDocumentFragment","renderContainerMarker","createComment","childPartProto","setValue","_$setValue","childPartProto._$setValue","directiveParent","container","_$startNode","startNode","endNode","_$endNode","_$committedValue","_$template","el","cloneNode","insertBefore","_$getTemplate","childPartProto._$getTemplate","templateCache","litHtmlPolyfillSupport","symbolKey","needsSymbolSupport","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$polyfill$2dsupport.isPolyfilledSymbol","for","globalThis.Symbol.for","LitElement","litElementProto","litElementProto.createRenderRoot","renderOptions","litElementPolyfillSupport","module$exports$google3$third_party$javascript$safevalues$internals$trusted_types.trustedTypes","trustedTypesInternal","policy","createPolicy","identity","configuredPolicyName","createHTML","createScript","createScriptURL","module$exports$google3$third_party$javascript$safevalues$internals$html_impl.SafeHtml","privateDoNotAccessOrElseWrappedHtml","module$exports$google3$third_party$javascript$safevalues$internals$trusted_types.trustedTypesemptyHTML","emptyHTML","unwrapHtml","message","module$exports$google3$third_party$javascript$safevalues$internals$resource_url_impl.TrustedResourceUrl","privateDoNotAccessOrElseWrappedResourceUrl","createResourceUrlInternal","noinlineValue","unwrapResourceUrl","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$internal$2dsecurity.sanitizerFactory","realSanitizerFactory","rawName","nodeType","allowAnything","module$exports$google3$third_party$javascript$safevalues$internals$html_impl.EMPTY_HTML","contract","securityContracts","tagName","baseToCheck","includes","BLOCK_JAVASCRIPT_URL_PATTERN","fallbackTrustedUrl","trustedResourceUrl","templateObj","encodeURIComponent","onlyForbidJavascriptUrls","forbidEverythingBecauseFieldIsUnsupported","requireTrustedResourceUrl","maybeResourceUrl","maybeSafeHtml","requireSafeHtml","goog.globalShadyDOM","goog.globalShadyDOMwrap","identityFunction","noopSanitizer","marker","Math","random","toFixed","slice","markerMatch","nodeMarker","isPrimitive","textEndRegex","commentEndRegex","comment2EndRegex","tagEndRegex","RegExp","singleQuoteAttrEndRegex","doubleQuoteAttrEndRegex","rawTextElement","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$lit$2dhtml.html","exports.html","HTML_RESULT","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$lit$2dhtml.noChange","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$lit$2dhtml.nothing","walker","createTreeWalker","trustFromTemplateString","tsa","stringFromTSA","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$lit$2dhtml.Template","parts","nodeIndex","attrNameIndex","partCount","l","attrNames","SVG_RESULT","MATHML_RESULT","rawTextEndRegex","attrNameEndIndex","attrName","lastIndex","exec","COMMENT_START","TAG_NAME","DYNAMIC_TAG_NAME","ENTIRE_MATCH","ATTRIBUTE_NAME","SPACES_AND_EQUALS","QUOTE_CHAR","end","startsWith","boundAttributeSuffix","html__tsickle_destructured_1","attrNames__tsickle_destructured_2","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$lit$2dhtml.TemplatecreateElement","currentNode","wrapper","firstChild","replaceWith","childNodes","nextNode","hasAttributes","getAttributeNames","endsWith","realName","statics","getAttribute","m","ATTRIBUTE_PART","index","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$lit$2dhtml.PropertyPart","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$lit$2dhtml.BooleanAttributePart","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$lit$2dhtml.EventPart","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$lit$2dhtml.AttributePart","ELEMENT_PART","append","CHILD_PART","data","indexOf","COMMENT_PART","innerHTML","resolveDirective","part","parent","attributeIndex","__directives","currentDirective","__directive","nextDirectiveConstructor","_$initialize","_$resolve","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$lit$2dhtml.TemplateInstance","_$parts","_$disconnectableChildren","_$parent","_$isConnected","_clone","creationScope","fragment","importNode","partIndex","templatePart","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$lit$2dhtml.ChildPart","nextSibling","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$lit$2dhtml.ElementPart","_update","setConnected","isConnected","__isConnected","_$notifyConnectionChanged","_textSanitizer","_$clear","_commitText","_commitTemplateResult","_commitNode","iterator","_commitIterable","_insert","parentNodeName","nodeName","textNode","createTextNode","h","instance","itemParts","itemPart","item","start","n","remove","fill","_sanitizer","valueIndex","noCommit","_commitValue","PROPERTY_PART","BOOLEAN_ATTRIBUTE_PART","toggleAttribute","EVENT_PART","newListener","oldListener","shouldRemoveListener","capture","once","passive","shouldAddListener","removeEventListener","addEventListener","handleEvent","event","host","litHtmlVersions","goog.globallitHtmlVersions","render","renderBefore","partOwnerNode","module$exports$google3$third_party$javascript$lit$packages$lit$2delement$src$lit$2delement.LitElement","__childPart","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$lit$2dhtml.render","goog.globallitElementPolyfillSupport","litElementVersions","goog.globallitElementVersions","module$exports$google3$java$com$google$devtools$gerritcodereview$plugins$comments2code$web$c2c$2dhelp$2dicon.C2CHelpIcon","editing","module$exports$google3$java$com$google$devtools$gerritcodereview$plugins$comments2code$web$constants.HELP_URL","property","protoOrTarget","nameOrContext","proto","metadataKey","module$exports$google3$third_party$javascript$tslib$tslib.__decorate","exports.customElement","classOrTarget","define","isReplacementInRange","replacement","requestRange","range","replacementRange","textRangeToCommentRange","start_line","end_line","start_character","start_char","end_character","end_char","transformC2CSuggestionsToProviderSuggestions","suggestion","suggestCodeRequest","newRange","getNormalizedRange","numAddedLinesBeforeRequestRange","replacements","numLinesAddedByReplacement","getNumOfLinesInReplacement","max","addedLinesBeforeRange","new_content","lines","fromLine","numLines","getNewRange","c2cSuggestion","largestReplacement","numOfLinesInReplacement","lineNumber","MAGIC_FILES_TO_SKIP","commentAutocompletionRestApi","changeNum","revisionId","body","errFn","machineSuggestedCodeRestApi","sendFeedback","feedbackEntries","feedbackStudy","entry","feedbackId","console","warn","feedback_id1","id1","feedback_id2","id2","feedback_study","accepted","endpoint","isFixSuggestionFromML","fixSuggestions","description","ML_SUGGESTION_DESCRIPTION","module$exports$google3$java$com$google$devtools$gerritcodereview$plugins$comments2code$web$predictor.SuggestionsPredictor","autocompleteComment","request","commentText","changeInfo","is_private","completion","responseCode","patchsetNumber","line","model","modelVersion","comment_completion","feedback","suggestCode","commentData","suggestions","c2cSuggestions","filepath","line_nbr","some","isSomeReplacementsInRange","OUT_OF_RANGE","suggestFix","fix_suggestions","fix_id","substring","log_probability","getFixSuggestionTitle","getDocumentationLink","window","Gerrit","install","tags","getAccount","suggestionsApi","predictor","registerCustomComponent","slot","aiCodeReview","register","fix","sendAutocompleteFeedback","PREDICT_COMMENT","sendSuggestFixFeedback","PREDICT_EDIT","supportedFileExtensions"]
}
