apollo-elements/apollo-elements

View on GitHub
docs/_assets/_static/apollo-elements-lit-apollo.js.map

Summary

Maintainability
Test Coverage
{
  "version": 3,
  "sources": ["../../../node_modules/ts-invariant/node_modules/tslib/tslib.js", "../../../node_modules/@lit/reactive-element/src/css-tag.ts", "../../../node_modules/@lit/reactive-element/src/reactive-element.ts", "../../../node_modules/lit/node_modules/lit-html/src/lit-html.ts", "../../../node_modules/lit/node_modules/lit-element/src/lit-element.ts", "../../../packages/core/decorators.ts", "../../../packages/core/events.ts", "../../../node_modules/@lit/reactive-element/src/decorators/property.ts", "../../../node_modules/@lit/reactive-element/src/decorators/state.ts", "../../../node_modules/@lit/reactive-element/src/decorators/query-assigned-nodes.ts", "../../../packages/lit-apollo/apollo-element.ts", "../../../node_modules/ts-invariant/node_modules/tslib/modules/index.js", "../../../node_modules/ts-invariant/src/invariant.ts", "../../../node_modules/@apollo/src/core/networkStatus.ts", "../../../node_modules/@apollo/src/core/index.ts", "../../../packages/core/lib/is-valid-gql.ts", "../../../packages/core/apollo-controller.ts", "../../../packages/core/lib/bound.ts", "../../../packages/core/apollo-query-controller.ts", "../../../packages/lit-apollo/apollo-query.ts", "../../../packages/core/apollo-mutation-controller.ts", "../../../packages/lit-apollo/apollo-mutation.ts", "../../../packages/core/apollo-subscription-controller.ts", "../../../packages/lit-apollo/apollo-subscription.ts"],
  "sourcesContent": ["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global global, define, System, Reflect, Promise */\r\nvar __extends;\r\nvar __assign;\r\nvar __rest;\r\nvar __decorate;\r\nvar __param;\r\nvar __metadata;\r\nvar __awaiter;\r\nvar __generator;\r\nvar __exportStar;\r\nvar __values;\r\nvar __read;\r\nvar __spread;\r\nvar __spreadArrays;\r\nvar __spreadArray;\r\nvar __await;\r\nvar __asyncGenerator;\r\nvar __asyncDelegator;\r\nvar __asyncValues;\r\nvar __makeTemplateObject;\r\nvar __importStar;\r\nvar __importDefault;\r\nvar __classPrivateFieldGet;\r\nvar __classPrivateFieldSet;\r\nvar __createBinding;\r\n(function (factory) {\r\n    var root = typeof global === \"object\" ? global : typeof self === \"object\" ? self : typeof this === \"object\" ? this : {};\r\n    if (typeof define === \"function\" && define.amd) {\r\n        define(\"tslib\", [\"exports\"], function (exports) { factory(createExporter(root, createExporter(exports))); });\r\n    }\r\n    else if (typeof module === \"object\" && typeof module.exports === \"object\") {\r\n        factory(createExporter(root, createExporter(module.exports)));\r\n    }\r\n    else {\r\n        factory(createExporter(root));\r\n    }\r\n    function createExporter(exports, previous) {\r\n        if (exports !== root) {\r\n            if (typeof Object.create === \"function\") {\r\n                Object.defineProperty(exports, \"__esModule\", { value: true });\r\n            }\r\n            else {\r\n                exports.__esModule = true;\r\n            }\r\n        }\r\n        return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };\r\n    }\r\n})\r\n(function (exporter) {\r\n    var extendStatics = Object.setPrototypeOf ||\r\n        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n        function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n\r\n    __extends = function (d, b) {\r\n        if (typeof b !== \"function\" && b !== null)\r\n            throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n        extendStatics(d, b);\r\n        function __() { this.constructor = d; }\r\n        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n    };\r\n\r\n    __assign = Object.assign || function (t) {\r\n        for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n            s = arguments[i];\r\n            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n        }\r\n        return t;\r\n    };\r\n\r\n    __rest = function (s, e) {\r\n        var t = {};\r\n        for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n            t[p] = s[p];\r\n        if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n            for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n                if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n                    t[p[i]] = s[p[i]];\r\n            }\r\n        return t;\r\n    };\r\n\r\n    __decorate = function (decorators, target, key, desc) {\r\n        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n        if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n        return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n    };\r\n\r\n    __param = function (paramIndex, decorator) {\r\n        return function (target, key) { decorator(target, key, paramIndex); }\r\n    };\r\n\r\n    __metadata = function (metadataKey, metadataValue) {\r\n        if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n    };\r\n\r\n    __awaiter = function (thisArg, _arguments, P, generator) {\r\n        function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n        return new (P || (P = Promise))(function (resolve, reject) {\r\n            function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n            function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n            function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n            step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n        });\r\n    };\r\n\r\n    __generator = function (thisArg, body) {\r\n        var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n        return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n        function verb(n) { return function (v) { return step([n, v]); }; }\r\n        function step(op) {\r\n            if (f) throw new TypeError(\"Generator is already executing.\");\r\n            while (_) try {\r\n                if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n                if (y = 0, t) op = [op[0] & 2, t.value];\r\n                switch (op[0]) {\r\n                    case 0: case 1: t = op; break;\r\n                    case 4: _.label++; return { value: op[1], done: false };\r\n                    case 5: _.label++; y = op[1]; op = [0]; continue;\r\n                    case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n                    default:\r\n                        if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n                        if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n                        if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n                        if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n                        if (t[2]) _.ops.pop();\r\n                        _.trys.pop(); continue;\r\n                }\r\n                op = body.call(thisArg, _);\r\n            } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n            if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n        }\r\n    };\r\n\r\n    __exportStar = function(m, o) {\r\n        for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n    };\r\n\r\n    __createBinding = Object.create ? (function(o, m, k, k2) {\r\n        if (k2 === undefined) k2 = k;\r\n        Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n    }) : (function(o, m, k, k2) {\r\n        if (k2 === undefined) k2 = k;\r\n        o[k2] = m[k];\r\n    });\r\n\r\n    __values = function (o) {\r\n        var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n        if (m) return m.call(o);\r\n        if (o && typeof o.length === \"number\") return {\r\n            next: function () {\r\n                if (o && i >= o.length) o = void 0;\r\n                return { value: o && o[i++], done: !o };\r\n            }\r\n        };\r\n        throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n    };\r\n\r\n    __read = function (o, n) {\r\n        var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n        if (!m) return o;\r\n        var i = m.call(o), r, ar = [], e;\r\n        try {\r\n            while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n        }\r\n        catch (error) { e = { error: error }; }\r\n        finally {\r\n            try {\r\n                if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n            }\r\n            finally { if (e) throw e.error; }\r\n        }\r\n        return ar;\r\n    };\r\n\r\n    /** @deprecated */\r\n    __spread = function () {\r\n        for (var ar = [], i = 0; i < arguments.length; i++)\r\n            ar = ar.concat(__read(arguments[i]));\r\n        return ar;\r\n    };\r\n\r\n    /** @deprecated */\r\n    __spreadArrays = function () {\r\n        for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n        for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n            for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n                r[k] = a[j];\r\n        return r;\r\n    };\r\n\r\n    __spreadArray = function (to, from) {\r\n        for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\r\n            to[j] = from[i];\r\n        return to;\r\n    };\r\n\r\n    __await = function (v) {\r\n        return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n    };\r\n\r\n    __asyncGenerator = function (thisArg, _arguments, generator) {\r\n        if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n        var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n        return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n        function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n        function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n        function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);  }\r\n        function fulfill(value) { resume(\"next\", value); }\r\n        function reject(value) { resume(\"throw\", value); }\r\n        function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n    };\r\n\r\n    __asyncDelegator = function (o) {\r\n        var i, p;\r\n        return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n        function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n    };\r\n\r\n    __asyncValues = function (o) {\r\n        if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n        var m = o[Symbol.asyncIterator], i;\r\n        return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n        function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n        function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n    };\r\n\r\n    __makeTemplateObject = function (cooked, raw) {\r\n        if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n        return cooked;\r\n    };\r\n\r\n    var __setModuleDefault = Object.create ? (function(o, v) {\r\n        Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n    }) : function(o, v) {\r\n        o[\"default\"] = v;\r\n    };\r\n\r\n    __importStar = function (mod) {\r\n        if (mod && mod.__esModule) return mod;\r\n        var result = {};\r\n        if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n        __setModuleDefault(result, mod);\r\n        return result;\r\n    };\r\n\r\n    __importDefault = function (mod) {\r\n        return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n    };\r\n\r\n    __classPrivateFieldGet = function (receiver, state, kind, f) {\r\n        if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n        if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n        return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n    };\r\n\r\n    __classPrivateFieldSet = function (receiver, state, value, kind, f) {\r\n        if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n        if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n        if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n        return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n    };\r\n\r\n    exporter(\"__extends\", __extends);\r\n    exporter(\"__assign\", __assign);\r\n    exporter(\"__rest\", __rest);\r\n    exporter(\"__decorate\", __decorate);\r\n    exporter(\"__param\", __param);\r\n    exporter(\"__metadata\", __metadata);\r\n    exporter(\"__awaiter\", __awaiter);\r\n    exporter(\"__generator\", __generator);\r\n    exporter(\"__exportStar\", __exportStar);\r\n    exporter(\"__createBinding\", __createBinding);\r\n    exporter(\"__values\", __values);\r\n    exporter(\"__read\", __read);\r\n    exporter(\"__spread\", __spread);\r\n    exporter(\"__spreadArrays\", __spreadArrays);\r\n    exporter(\"__spreadArray\", __spreadArray);\r\n    exporter(\"__await\", __await);\r\n    exporter(\"__asyncGenerator\", __asyncGenerator);\r\n    exporter(\"__asyncDelegator\", __asyncDelegator);\r\n    exporter(\"__asyncValues\", __asyncValues);\r\n    exporter(\"__makeTemplateObject\", __makeTemplateObject);\r\n    exporter(\"__importStar\", __importStar);\r\n    exporter(\"__importDefault\", __importDefault);\r\n    exporter(\"__classPrivateFieldGet\", __classPrivateFieldGet);\r\n    exporter(\"__classPrivateFieldSet\", __classPrivateFieldSet);\r\n});\r\n", "/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Whether the current browser supports `adoptedStyleSheets`.\n */\nexport const supportsAdoptingStyleSheets =\n  window.ShadowRoot &&\n  (window.ShadyCSS === undefined || window.ShadyCSS.nativeShadow) &&\n  'adoptedStyleSheets' in Document.prototype &&\n  'replace' in CSSStyleSheet.prototype;\n\nexport type CSSResultOrNative = CSSResult | CSSStyleSheet;\n\nexport type CSSResultFlatArray = CSSResultOrNative[];\n\nexport type CSSResultArray = Array<CSSResultOrNative | CSSResultArray>;\n\nexport type CSSResultGroup = CSSResultOrNative | CSSResultArray;\n\nconst constructionToken = Symbol();\n\nexport class CSSResult {\n  readonly cssText: string;\n  private _styleSheet?: CSSStyleSheet;\n\n  constructor(cssText: string, safeToken: symbol) {\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  }\n\n  // Note, this is a getter so that it's lazy. In practice, this means\n  // stylesheets are not created until the first element instance is made.\n  get styleSheet(): CSSStyleSheet | undefined {\n    // Note, if `supportsAdoptingStyleSheets` is true then we assume\n    // CSSStyleSheet is constructable.\n    if (supportsAdoptingStyleSheets && this._styleSheet === undefined) {\n      this._styleSheet = new CSSStyleSheet();\n      this._styleSheet.replaceSync(this.cssText);\n    }\n    return this._styleSheet;\n  }\n\n  toString(): string {\n    return this.cssText;\n  }\n}\n\nconst cssResultCache = new Map<string, CSSResult>();\n\nconst getCSSResult = (cssText: string): CSSResult => {\n  let result = cssResultCache.get(cssText);\n  if (result === undefined) {\n    cssResultCache.set(\n      cssText,\n      (result = new CSSResult(cssText, constructionToken))\n    );\n  }\n  return result;\n};\n\nconst textFromCSSResult = (value: CSSResultGroup | number) => {\n  if (value instanceof CSSResult) {\n    return value.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 [[`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 */\nexport const unsafeCSS = (value: unknown) => {\n  return getCSSResult(typeof value === 'string' ? value : String(value));\n};\n\n/**\n * Template tag which which can be used with LitElement's [[LitElement.styles |\n * `styles`]] property to set element styles. For security reasons, only literal\n * string values may be used. To incorporate non-literal values [[`unsafeCSS`]]\n * may be used inside a template string part.\n */\nexport const css = (\n  strings: TemplateStringsArray,\n  ...values: (CSSResultGroup | number)[]\n): CSSResultGroup => {\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 getCSSResult(cssText);\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 spec behavior](https://wicg.github.io/construct-stylesheets/#using-constructed-stylesheets).\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: CSSResultFlatArray\n) => {\n  if (supportsAdoptingStyleSheets) {\n    (renderRoot as ShadowRoot).adoptedStyleSheets = styles.map((s) =>\n      s instanceof CSSStyleSheet ? s : s.styleSheet!\n    );\n  } else {\n    styles.forEach((s) => {\n      const style = document.createElement('style');\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 = supportsAdoptingStyleSheets\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 * Use this module if you want to create your own base class extending\n * [[ReactiveElement]].\n * @packageDocumentation\n */\n\nimport {\n  getCompatibleStyle,\n  adoptStyles,\n  CSSResultGroup,\n  CSSResultOrNative,\n  CSSResultFlatArray,\n} from './css-tag.js';\nimport type {\n  ReactiveController,\n  ReactiveControllerHost,\n} from './reactive-controller.js';\n\nexport * from './css-tag.js';\nexport type {\n  ReactiveController,\n  ReactiveControllerHost,\n} from './reactive-controller.js';\n\nconst DEV_MODE = true;\n\nlet requestUpdateThenable: {\n  then: (\n    onfulfilled?: (value: boolean) => void,\n    _onrejected?: () => void\n  ) => void;\n};\n\nif (DEV_MODE) {\n  // TODO(sorvell): Add a link to the docs about using dev v. production mode.\n  console.warn(`Running in dev mode. Do not use in production!`);\n\n  // Issue platform support warning.\n  if (\n    window.ShadyDOM?.inUse &&\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    (globalThis as any)['reactiveElementPlatformSupport'] === undefined\n  ) {\n    console.warn(\n      `Shadow DOM is being polyfilled via ShadyDOM but ` +\n        `the \\`polyfill-support\\` module has not been loaded.`\n    );\n  }\n\n  requestUpdateThenable = {\n    then: (\n      onfulfilled?: (value: boolean) => void,\n      _onrejected?: () => void\n    ) => {\n      console.warn(\n        `\\`requestUpdate\\` no longer returns a Promise.` +\n          `Use \\`updateComplete\\` instead.`\n      );\n      if (onfulfilled !== undefined) {\n        onfulfilled(false);\n      }\n    },\n  };\n}\n\n/*\n * When using Closure Compiler, JSCompiler_renameProperty(property, object) is\n * replaced at compile time by the munged name for object[property]. We cannot\n * alias this function, so we have to use a small shim that has the same\n * behavior when not compiling.\n */\n/*@__INLINE__*/\nconst JSCompiler_renameProperty = <P extends PropertyKey>(\n  prop: P,\n  _obj: unknown\n): P => prop;\n\n/**\n * Converts property values to and from attribute values.\n */\nexport interface ComplexAttributeConverter<Type = unknown, TypeHint = unknown> {\n  /**\n   * Function called to convert an attribute value to a property\n   * value.\n   */\n  fromAttribute?(value: string | null, type?: TypeHint): Type;\n\n  /**\n   * Function 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/**\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 * Map of changed properties with old values. Takes an optional generic\n * interface corresponding to the declared element properties.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type PropertyValues<T = any> = keyof T extends PropertyKey\n  ? Map<keyof T, unknown>\n  : never;\n\nexport const defaultConverter: ComplexAttributeConverter = {\n  toAttribute(value: unknown, type?: unknown): unknown {\n    switch (type) {\n      case Boolean:\n        value = value ? '' : 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  // This ensures (old==NaN, value==NaN) always returns false\n  return old !== value && (old === old || value === value);\n};\n\nconst defaultPropertyDeclaration: PropertyDeclaration = {\n  attribute: true,\n  type: String,\n  converter: defaultConverter,\n  reflect: false,\n  hasChanged: notEqual,\n};\n\n/**\n * The Closure JS Compiler doesn't currently have good support for static\n * property semantics where \"this\" is dynamic (e.g.\n * https://github.com/google/closure-compiler/issues/3177 and others) so we use\n * this hack to bypass any rewriting by the compiler.\n */\nconst finalized = 'finalized';\n\n/**\n * A string representing one of the supported dev mode warnings classes.\n */\nexport type WarningKind = 'change-in-update' | 'migration';\n\nexport type Initializer = (element: ReactiveElement) => void;\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 subclassers to render updates as desired.\n * @noInheritDoc\n */\nexport abstract class ReactiveElement\n  extends HTMLElement\n  implements ReactiveControllerHost {\n  // Note: these are patched in only in DEV_MODE.\n  /**\n   * Read or set all the enabled warning kinds 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 kind 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 classes\n   * ReactiveElement.enableWarning.?('migration');\n   *\n   * // Enable for all MyElement only\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 kind 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 classes\n   * ReactiveElement.disableWarning.?('migration');\n   *\n   * // Disable for all MyElement only\n   * MyElement.disableWarning.?('migration');\n   * ```\n   *\n   * @nocollapse\n   * @category dev-mode\n   */\n  static disableWarning?: (warningKind: WarningKind) => void;\n\n  /**\n   * @nocollapse\n   */\n  static addInitializer(initializer: Initializer) {\n    this._initializers ??= [];\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 finished creating properties.\n   */\n  protected static [finalized] = true;\n\n  /**\n   * Memoized list of all element properties, including any superclass properties.\n   * Created lazily on user subclasses when finalizing the class.\n   * @nocollapse\n   * @category properties\n   */\n  static elementProperties: PropertyDeclarationMap = new Map();\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: CSSResultFlatArray = [];\n\n  /**\n   * Array of styles to apply to the element. The styles should be defined\n   * using the [[`css`]] tag function or via constructible stylesheets.\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    // note: piggy backing on this to ensure we're finalized.\n    this.finalize();\n    const attributes: string[] = [];\n    // Use forEach so this works even if for/of loops are compiled to for loops\n    // expecting arrays\n    this.elementProperties.forEach((v, p) => {\n      const attr = this.__attributeNameForProperty(p, v);\n      if (attr !== undefined) {\n        this.__attributeToPropertyMap.set(attr, p);\n        attributes.push(attr);\n      }\n    });\n    return attributes;\n  }\n\n  /**\n   * Creates a property accessor on the element prototype if one does not exist\n   * and stores a PropertyDeclaration for the property with the given options.\n   * The property setter calls the property's `hasChanged` property option\n   * or uses a strict identity check to determine whether or not to request\n   * 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   * static createProperty(name, options) {\n   *   options = Object.assign(options, {myOption: true});\n   *   super.createProperty(name, options);\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      // Cast as any since this is readonly.\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      (options as any).attribute = false;\n    }\n    // Note, since this can be called by the `@property` decorator which\n    // is called before `finalize`, we ensure finalization has been kicked off.\n    this.finalize();\n    this.elementProperties.set(name, options);\n    // Do not generate an accessor if the prototype already has one, since\n    // it would be lost otherwise and that would never be the user's intention;\n    // Instead, we expect users to call `requestUpdate` themselves from\n    // user-defined accessors. Note that if the super has an accessor we will\n    // still overwrite it\n    if (!options.noAccessor && !this.prototype.hasOwnProperty(name)) {\n      const key = typeof name === 'symbol' ? Symbol() : `__${name}`;\n      const descriptor = this.getPropertyDescriptor(name, key, options);\n      if (descriptor !== undefined) {\n        Object.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   *   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   * @nocollapse\n   * @category properties\n   */\n  protected static getPropertyDescriptor(\n    name: PropertyKey,\n    key: string | symbol,\n    options: PropertyDeclaration\n  ) {\n    return {\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      get(): any {\n        return (this as {[key: string]: unknown})[key as string];\n      },\n      set(this: ReactiveElement, value: unknown) {\n        const oldValue = ((this as {}) as {[key: string]: unknown})[\n          name as string\n        ];\n        ((this as {}) as {[key: string]: unknown})[key as string] = value;\n        ((this as unknown) as ReactiveElement).requestUpdate(\n          name,\n          oldValue,\n          options\n        );\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 `createProperty`.\n   *\n   * @nocollapse\n   * @final\n   * @category properties\n   */\n  protected static getPropertyOptions(name: PropertyKey) {\n    return this.elementProperties.get(name) || defaultPropertyDeclaration;\n  }\n\n  /**\n   * Creates property accessors for registered properties, sets up element\n   * styling, and ensures any superclasses are also finalized. Returns true if\n   * the element was finalized.\n   * @nocollapse\n   */\n  protected static finalize() {\n    if (this.hasOwnProperty(finalized)) {\n      return false;\n    }\n    this[finalized] = true;\n    // finalize any superclasses\n    const superCtor = Object.getPrototypeOf(this) as typeof ReactiveElement;\n    superCtor.finalize();\n    this.elementProperties = new Map(superCtor.elementProperties);\n    // initialize Map populated in observedAttributes\n    this.__attributeToPropertyMap = new Map();\n    // make any properties\n    // Note, only process \"own\" properties since this element will inherit\n    // any properties defined on the superClass, and finalization ensures\n    // the entire prototype chain is finalized.\n    if (this.hasOwnProperty(JSCompiler_renameProperty('properties', this))) {\n      const props = this.properties;\n      // support symbols in properties (IE11 does not support this)\n      const propKeys = [\n        ...Object.getOwnPropertyNames(props),\n        ...Object.getOwnPropertySymbols(props),\n      ];\n      // This for/of is ok because propKeys is an array\n      for (const p of propKeys) {\n        // note, use of `any` is due to TypeScript lack of support for symbol in\n        // index types\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        this.createProperty(p, (props as any)[p]);\n      }\n    }\n    this.elementStyles = this.finalizeStyles(this.styles);\n    // DEV mode warnings\n    if (DEV_MODE) {\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      const warnRemoved = (obj: any, name: string) => {\n        if (obj[name] !== undefined) {\n          console.warn(\n            `\\`${name}\\` is implemented. It ` +\n              `has been removed from this version of ReactiveElement.` +\n              ` See the changelog at https://github.com/lit/lit/blob/main/packages/reactive-element/CHANGELOG.md`\n          );\n        }\n      };\n      [`initialize`, `requestUpdateInternal`, `_getUpdateComplete`].forEach(\n        (name: string) =>\n          // eslint-disable-next-line @typescript-eslint/no-explicit-any\n          warnRemoved(this.prototype as any, name)\n      );\n    }\n    return true;\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(styles?: CSSResultGroup): CSSResultFlatArray {\n    const elementStyles = [];\n    if (Array.isArray(styles)) {\n      // Dedupe the flattened array in reverse order to preserve the last items.\n      // TODO(sorvell): 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 | ShadowRoot;\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  private __instanceProperties?: PropertyValues = new Map();\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  private __pendingConnectionPromise: Promise<void> | undefined = undefined;\n  private __enableConnection: (() => void) | undefined = undefined;\n\n  /**\n   * @category updates\n   */\n  isUpdatePending = false;\n\n  /**\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   * Map with keys of properties that should be reflected when updated.\n   */\n  private __reflectingProperties?: Map<PropertyKey, PropertyDeclaration>;\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?: ReactiveController[];\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   * @internal\n   */\n  _initialize() {\n    this.__updatePromise = new Promise<boolean>(\n      (res) => (this.enableUpdating = res)\n    );\n    this._$changedProperties = new Map();\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   * @category controllers\n   */\n  addController(controller: ReactiveController) {\n    (this.__controllers ??= []).push(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   * @category controllers\n   */\n  removeController(controller: ReactiveController) {\n    // Note, if the indexOf is -1, the >>> will flip the sign which makes the\n    // splice do nothing.\n    this.__controllers?.splice(this.__controllers.indexOf(controller) >>> 0, 1);\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. Note, on very old versions of Safari (<=9) or Chrome\n   * (<=41), properties created for native platform properties like (`id` or\n   * `name`) may not have default values set in the element constructor. On\n   * these browsers native properties appear on instances and therefore their\n   * default value will overwrite any element default (e.g. if the element sets\n   * this.id = 'id' in the constructor, the 'id' will become '' since this is\n   * the native platform default).\n   */\n  private __saveInstanceProperties() {\n    // Use forEach so this works even if for/of loops are compiled to for loops\n    // expecting arrays\n    (this.constructor as typeof ReactiveElement).elementProperties.forEach(\n      (_v, p) => {\n        if (this.hasOwnProperty(p)) {\n          this.__instanceProperties!.set(p, this[p as keyof this]);\n          delete this[p as keyof this];\n        }\n      }\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(): Element | ShadowRoot {\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 first update.\n    if (this.renderRoot === undefined) {\n      (this as {\n        renderRoot: Element | DocumentFragment;\n      }).renderRoot = this.createRenderRoot();\n    }\n    this.enableUpdating(true);\n    this.__controllers?.forEach((c) => c.hostConnected?.());\n    // If we were disconnected, re-enable updating by resolving the pending\n    // connection promise\n    if (this.__enableConnection) {\n      this.__enableConnection();\n      this.__pendingConnectionPromise = this.__enableConnection = undefined;\n    }\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    this.__pendingConnectionPromise = new Promise(\n      (r) => (this.__enableConnection = r)\n    );\n  }\n\n  /**\n   * Synchronizes property values when attributes change.\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(\n    name: PropertyKey,\n    value: unknown,\n    options: PropertyDeclaration = defaultPropertyDeclaration\n  ) {\n    const attr = (this\n      .constructor as typeof ReactiveElement).__attributeNameForProperty(\n      name,\n      options\n    );\n    if (attr !== undefined && options.reflect === true) {\n      const toAttribute =\n        (options.converter as ComplexAttributeConverter)?.toAttribute ??\n        defaultConverter.toAttribute;\n      const attrValue = toAttribute!(value, options.type);\n      if (\n        DEV_MODE &&\n        (this.constructor as typeof ReactiveElement).enabledWarnings!.indexOf(\n          'migration'\n        ) >= 0 &&\n        attrValue === undefined\n      ) {\n        console.warn(\n          `The attribute value for the ` +\n            `${name as string} property is undefined. The attribute will be ` +\n            `removed, but in the previous version of ReactiveElement, the ` +\n            `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 = options.converter;\n      const fromAttribute =\n        (converter as ComplexAttributeConverter)?.fromAttribute ??\n        (typeof converter === 'function'\n          ? (converter as (value: string | null, type?: unknown) => unknown)\n          : null) ??\n        defaultConverter.fromAttribute;\n      // mark state reflecting\n      this.__reflectingProperty = propName;\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      this[propName as keyof this] = fromAttribute!(value, options.type) 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    let shouldRequestUpdate = true;\n    // If we have a property key, perform property update steps.\n    if (name !== undefined) {\n      options =\n        options ||\n        (this.constructor as typeof ReactiveElement).getPropertyOptions(name);\n      const hasChanged = options.hasChanged || notEqual;\n      if (hasChanged(this[name as keyof this], oldValue)) {\n        if (!this._$changedProperties.has(name)) {\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 (options.reflect === true && this.__reflectingProperty !== name) {\n          if (this.__reflectingProperties === undefined) {\n            this.__reflectingProperties = new Map();\n          }\n          this.__reflectingProperties.set(name, options);\n        }\n      } else {\n        // Abort the request if the property should not be considered changed.\n        shouldRequestUpdate = false;\n      }\n    }\n    if (!this.isUpdatePending && shouldRequestUpdate) {\n      this.__updatePromise = this.__enqueueUpdate();\n    }\n    // Note, since this no longer returns a promise, in dev mode we return a\n    // thenable which warns if it's called.\n    return DEV_MODE ? ((requestUpdateThenable as unknown) as void) : undefined;\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      // If we were disconnected, wait until re-connected to flush an update\n      while (this.__pendingConnectionPromise) {\n        await this.__pendingConnectionPromise;\n      }\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      Promise.reject(e);\n    }\n    const result = this.performUpdate();\n    // If `performUpdate` 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   * Performs an element update. Note, if an exception is thrown during the\n   * update, `firstUpdated` and `updated` will not be called.\n   *\n   * You can override this method to change the timing of updates. If this\n   * method is overridden, `super.performUpdate()` must be called.\n   *\n   * For instance, to schedule updates to occur just before the next frame:\n   *\n   * ```\n   * protected async performUpdate(): Promise<unknown> {\n   *   await new Promise((resolve) => requestAnimationFrame(() => resolve()));\n   *   super.performUpdate();\n   * }\n   * ```\n   * @category updates\n   */\n  protected performUpdate(): void | Promise<unknown> {\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    // create renderRoot before first update.\n    if (!this.hasUpdated) {\n      // Produce warning if any class properties are shadowed by class fields\n      if (DEV_MODE) {\n        const shadowedProperties: string[] = [];\n        (this.constructor as typeof ReactiveElement).elementProperties.forEach(\n          (_v, p) => {\n            if (this.hasOwnProperty(p) && !this.__instanceProperties?.has(p)) {\n              shadowedProperties.push(p as string);\n            }\n          }\n        );\n        if (shadowedProperties.length) {\n          // TODO(sorvell): Link to docs explanation of this issue.\n          console.warn(\n            `The following properties will not trigger updates as expected ` +\n              `because they are set using class fields: ` +\n              `${shadowedProperties.join(', ')}. ` +\n              `Native class fields and some compiled output will overwrite ` +\n              `accessors used for detecting changes. To fix this issue, ` +\n              `either initialize properties in the constructor or adjust ` +\n              `your compiler settings; for example, for TypeScript set ` +\n              `\\`useDefineForClassFields: false\\` in your \\`tsconfig.json\\`.`\n          );\n        }\n      }\n    }\n    // Mixin instance properties once, if they exist.\n    if (this.__instanceProperties) {\n      // Use forEach so this works even if for/of loops are compiled to for loops\n      // expecting arrays\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      this.__instanceProperties!.forEach((v, p) => ((this as any)[p] = v));\n      this.__instanceProperties = undefined;\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   * @category updates\n   */\n  willUpdate(_changedProperties: PropertyValues) {}\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!.indexOf(\n        'change-in-update'\n      ) >= 0\n    ) {\n      console.warn(\n        `An update was requested (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 indicates if the update resolved\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   *   class MyElement extends LitElement {\n   *     async getUpdateComplete() {\n   *       await super.getUpdateComplete();\n   *       await this._myChild.updateComplete;\n   *     }\n   *   }\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    if (this.__reflectingProperties !== undefined) {\n      // Use forEach so this works even if for/of loops are compiled to for\n      // loops expecting arrays\n      this.__reflectingProperties.forEach((v, k) =>\n        this.__propertyToAttribute(k, this[k as keyof this], v)\n      );\n      this.__reflectingProperties = undefined;\n    }\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   * 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\n// Apply polyfills if available\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n(globalThis as any)['reactiveElementPlatformSupport']?.({ReactiveElement});\n\n// Dev mode warnings...\nif (DEV_MODE) {\n  // Default warning set.\n  ReactiveElement.enabledWarnings = ['change-in-update'];\n  const ensureOwnWarnings = function (ctor: typeof ReactiveElement) {\n    if (\n      !ctor.hasOwnProperty(JSCompiler_renameProperty('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!.indexOf(warning) < 0) {\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\ndeclare global {\n  interface Window {\n    reactiveElementVersions: string[];\n  }\n}\n\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// TODO(justinfagnani): inject version number at build time\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n((globalThis as any)['reactiveElementVersions'] ??= []).push('1.0.0-rc.2');\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n// IMPORTANT: these imports must be type-only\nimport type {Directive, DirectiveResult, PartInfo} from './directive.js';\n\nconst DEV_MODE = true;\nconst ENABLE_EXTRA_SECURITY_HOOKS = true;\nconst ENABLE_SHADYDOM_NOPATCH = true;\n\nif (DEV_MODE) {\n  console.warn('lit-html is in dev mode. Not recommended for production!');\n}\n\nconst wrap =\n  ENABLE_SHADYDOM_NOPATCH &&\n  window.ShadyDOM?.inUse &&\n  window.ShadyDOM?.noPatch === true\n    ? window.ShadyDOM!.wrap\n    : (node: Node) => node;\n\nconst trustedTypes = ((globalThis as unknown) as Partial<Window>).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 = trustedTypes\n  ? trustedTypes.createPolicy('lit-html', {\n      createHTML: (s) => s,\n    })\n  : undefined;\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 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$${String(Math.random()).slice(9)}$`;\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 = document;\n\n// Creates a dynamic marker. We never have to search for these in the DOM.\nconst createMarker = (v = '') => d.createComment(v);\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 =>\n  value === null || (typeof value != 'object' && typeof value != 'function');\nconst isArray = Array.isArray;\nconst isIterable = (value: unknown): value is Iterable<unknown> =>\n  isArray(value) ||\n  // eslint-disable-next-line @typescript-eslint/no-explicit-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 = /-->/g;\n/**\n * Comments not started with <!--, 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)$/i;\n\n/** TemplateResult types */\nconst HTML_RESULT = 1;\nconst SVG_RESULT = 2;\n\ntype ResultType = typeof HTML_RESULT | typeof SVG_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.\n */\nexport type TemplateResult<T extends ResultType = ResultType> = {\n  _$litType$: T;\n  // TODO (justinfagnani): consider shorter names, like `s` and `v`. This is a\n  // semi-public API though. We can't just let Terser rename them for us,\n  // because we need TemplateResults to work between compatible versions of\n  // lit-html.\n  strings: TemplateStringsArray;\n  values: unknown[];\n};\n\nexport type HTMLTemplateResult = TemplateResult<typeof HTML_RESULT>;\n\nexport type SVGTemplateResult = TemplateResult<typeof SVG_RESULT>;\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  _$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  h: TrustedHTML;\n}\n\n/**\n * Generates a template literal tag function that returns a TemplateResult with\n * the given result type.\n */\nconst tag = <T extends ResultType>(_$litType$: T) => (\n  strings: TemplateStringsArray,\n  ...values: unknown[]\n): TemplateResult<T> => ({\n  _$litType$,\n  strings,\n  values,\n});\n\n/**\n * Interprets a template literal as an HTML template that can efficiently\n * render to and update a container.\n */\nexport const html = tag(HTML_RESULT);\n\n/**\n * Interprets a template literal as an SVG template that can efficiently\n * render to and update a container.\n */\nexport const svg = tag(SVG_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 = Symbol.for('lit-noChange');\n\n/**\n * A sentinel value that signals a ChildPart to fully clear its content.\n */\nexport const nothing = Symbol.for('lit-nothing');\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 - the 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\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\n/**\n * Renders a value, usually a lit-html TemplateResult, to the container.\n * @param value\n * @param container\n * @param options\n */\nexport const render = (\n  value: unknown,\n  container: HTMLElement | DocumentFragment,\n  options?: RenderOptions\n): ChildPart => {\n  const partOwnerNode = options?.renderBefore ?? container;\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  let part: ChildPart = (partOwnerNode as any)._$litPart$;\n  if (part === undefined) {\n    const endNode = options?.renderBefore ?? null;\n    // eslint-disable-next-line @typescript-eslint/no-explicit-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  return part;\n};\n\nif (ENABLE_EXTRA_SECURITY_HOOKS) {\n  render.setSanitizer = setSanitizer;\n  render.createSanitizer = createSanitizer;\n  if (DEV_MODE) {\n    render._testOnlyClearSanitizerFactoryDoNotCallOrElse = _testOnlyClearSanitizerFactoryDoNotCallOrElse;\n  }\n}\n\nconst walker = d.createTreeWalker(\n  d,\n  129 /* NodeFilter.SHOW_{ELEMENT|COMMENT} */,\n  null,\n  false\n);\n\nlet sanitizerFactoryInternal: SanitizerFactory = noopSanitizer;\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  __directive?: Directive;\n  __directives?: Array<Directive | undefined>;\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 comment markers denoting the\n * `ChildPart`s 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 | undefined>] => {\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 | undefined> = [];\n  let html = type === SVG_RESULT ? '<svg>' : '';\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          // dynamic tag name\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 +\n          marker +\n          (attrNameEndIndex === -2 ? (attrNames.push(undefined), i) : end);\n  }\n\n  const htmlResult: string | TrustedHTML =\n    html + (strings[l] || '<?>') + (type === SVG_RESULT ? '</svg>' : '');\n\n  // Returned as an array for terseness\n  return [\n    policy !== undefined\n      ? policy.createHTML(htmlResult)\n      : ((htmlResult as unknown) as TrustedHTML),\n    attrNames,\n  ];\n};\n\n/** @internal */\nexport type {Template};\nclass Template {\n  /** @internal */\n  el!: HTMLTemplateElement;\n  /** @internal */\n  parts: Array<TemplatePart> = [];\n\n  constructor(\n    {strings, _$litType$: type}: TemplateResult,\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    // Reparent SVG nodes into template root\n    if (type === SVG_RESULT) {\n      const content = this.el.content;\n      const svgElement = content.firstChild!;\n      svgElement.remove();\n      content.append(...svgElement.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        // 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          // We defer removing bound attributes because on IE we might not be\n          // iterating attributes in their template order, and would sometimes\n          // remove an attribute that we still need to create a part for.\n          const attrsToRemove = [];\n          for (const name of (node as Element).getAttributeNames()) {\n            // `name` is the name of the attribute we're iterating over, but not\n            // _neccessarily_ the name of the attribute we will create a part\n            // for. They can be different in browsers that don't iterate on\n            // attributes in source order. In that case the attrNames array\n            // contains the attribute name we'll process next. We only need the\n            // attribute name here to know if we should process a bound attribute\n            // on this element.\n            if (\n              name.endsWith(boundAttributeSuffix) ||\n              name.startsWith(marker)\n            ) {\n              const realName = attrNames[attrNameIndex++];\n              attrsToRemove.push(name);\n              if (realName !== undefined) {\n                // Lowercase for case-sensitive SVG attributes like viewBox\n                const value = (node as Element).getAttribute(\n                  realName.toLowerCase() + boundAttributeSuffix\n                )!;\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              } else {\n                parts.push({\n                  type: ELEMENT_PART,\n                  index: nodeIndex,\n                });\n              }\n            }\n          }\n          for (const name of attrsToRemove) {\n            (node as Element).removeAttribute(name);\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 node parts\n            // We can't use empty text nodes as markers because they're\n            // normalized in some browsers (TODO: check)\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            // TODO (justinfagnani): consider whether it's even worth it to\n            // make bindings in comments work\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\n  // Overridden via `litHtmlPlatformSupport` to provide platform support.\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}\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    : (value as DirectiveResult)._$litDirective$;\n  if (currentDirective?.constructor !== nextDirectiveConstructor) {\n    currentDirective?._$setDirectiveConnected?.(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 ??= [])[\n        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\n/**\n * An updateable instance of a Template. Holds references to the Parts used to\n * update the template instance.\n */\nclass TemplateInstance {\n  /** @internal */\n  _$template: Template;\n  /** @internal */\n  _parts: Array<Part | undefined> = [];\n\n  /** @internal */\n  _$parent: Disconnectable;\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  // 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    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        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  /** @internal */\n  readonly ctor: typeof AttributePart;\n  /** @internal */\n  readonly strings: ReadonlyArray<string>;\n};\ntype NodeTemplatePart = {\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  | NodeTemplatePart\n  | AttributeTemplatePart\n  | ElementTemplatePart\n  | CommentTemplatePart;\n\nexport type Part =\n  | ChildPart\n  | AttributePart\n  | PropertyPart\n  | BooleanAttributePart\n  | ElementPart\n  | EventPart;\n\nexport type {ChildPart};\nclass ChildPart {\n  readonly type = CHILD_PART;\n  readonly options: RenderOptions | undefined;\n  _$committedValue: unknown;\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  // The following fields will be patched onto ChildParts when required by\n  // AsyncDirective\n  /** @internal */\n  _$disconnectableChildren?: Set<Disconnectable> = undefined;\n  /** @internal */\n  _$setChildPartConnected?(\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    if (ENABLE_EXTRA_SECURITY_HOOKS) {\n      // Explicitly initialize for consistent class shape.\n      this._textSanitizer = undefined;\n    }\n  }\n\n  /**\n   * Sets the connection state for any `AsyncDirectives` contained\n   * within this part and runs their `disconnected` or `reconnected`, according\n   * to the `isConnected` argument.\n   */\n  setConnected(isConnected: boolean) {\n    this._$setChildPartConnected?.(isConnected);\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    return wrap(this._$startNode).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    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          this._$clear();\n        }\n        this._$committedValue = nothing;\n      } else if (value !== this._$committedValue && value !== noChange) {\n        this._commitText(value);\n      }\n    } else if ((value as TemplateResult)._$litType$ !== undefined) {\n      this._commitTemplateResult(value as TemplateResult);\n    } else if ((value as Node).nodeType !== undefined) {\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, ref = this._$endNode) {\n    return wrap(wrap(this._$startNode).parentNode!).insertBefore(node, ref);\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          this._insert(\n            new Text(\n              '/* lit-html will not write ' +\n                'TemplateResults to scripts and styles */'\n            )\n          );\n          return;\n        }\n      }\n      this._$committedValue = this._insert(value);\n    }\n  }\n\n  private _commitText(value: unknown): void {\n    const node = wrap(this._$startNode).nextSibling;\n    // TODO(justinfagnani): Can we just check if this._$committedValue is primitive?\n    if (\n      node !== null &&\n      node.nodeType === 3 /* Node.TEXT_NODE */ &&\n      (this._$endNode === null\n        ? wrap(node).nextSibling === null\n        : node === wrap(this._$endNode).previousSibling)\n    ) {\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      // If we only have a single text node between the markers, we can just\n      // set its value, rather than replacing it.\n      (node as Text).data = value as string;\n    } else {\n      if (ENABLE_EXTRA_SECURITY_HOOKS) {\n        const textNode = document.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 contentx.\n        if (this._textSanitizer === undefined) {\n          this._textSanitizer = createSanitizer(textNode, 'data', 'property');\n        }\n        value = this._textSanitizer(value);\n        textNode.data = value as string;\n      } else {\n        this._commitNode(d.createTextNode(value as string));\n      }\n    }\n    this._$committedValue = value;\n  }\n\n  private _commitTemplateResult(\n    result: TemplateResult | CompiledTemplateResult\n  ): void {\n    const {values, _$litType$} = 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 _$litType$ === 'number'\n        ? this._$getTemplate(result as TemplateResult)\n        : (_$litType$.el === undefined &&\n            (_$litType$.el = Template.createElement(\n              _$litType$.h,\n              this.options\n            )),\n          _$litType$);\n\n    if ((this._$committedValue as TemplateInstance)?._$template === template) {\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      instance._update(values);\n      this._commitNode(fragment);\n      this._$committedValue = instance;\n    }\n  }\n\n  // Overridden via `litHtmlPlatformSupport` to provide platform support.\n  /** @internal */\n  _$getTemplate(result: TemplateResult) {\n    let template = templateCache.get(result.strings);\n    if (template === undefined) {\n      templateCache.set(result.strings, (template = new Template(result)));\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._$setChildPartConnected?.(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\nexport type {AttributePart};\nclass AttributePart {\n  readonly type = ATTRIBUTE_PART as\n    | typeof ATTRIBUTE_PART\n    | typeof PROPERTY_PART\n    | typeof BOOLEAN_ATTRIBUTE_PART\n    | typeof EVENT_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 | undefined;\n  /** @internal */\n  _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n  protected _sanitizer: ValueSanitizer | undefined;\n  /** @internal */\n  _setDirectiveConnected?: (\n    directive: Directive | undefined,\n    isConnected: boolean,\n    removeFromParent?: boolean\n  ) => void = undefined;\n\n  get tagName() {\n    return this.element.tagName;\n  }\n\n  constructor(\n    element: HTMLElement,\n    name: string,\n    strings: ReadonlyArray<string>,\n    parent: Disconnectable | undefined,\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(nothing);\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      (wrap(this.element) as Element).setAttribute(\n        this.name,\n        (value ?? '') as string\n      );\n    }\n  }\n}\n\nexport type {PropertyPart};\nclass PropertyPart extends AttributePart {\n  readonly type = PROPERTY_PART;\n\n  /** @internal */\n  _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    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    (this.element as any)[this.name] = value === nothing ? undefined : value;\n  }\n}\n\nexport type {BooleanAttributePart};\nclass BooleanAttributePart extends AttributePart {\n  readonly type = BOOLEAN_ATTRIBUTE_PART;\n\n  /** @internal */\n  _commitValue(value: unknown) {\n    if (value && value !== nothing) {\n      (wrap(this.element) as Element).setAttribute(this.name, '');\n    } else {\n      (wrap(this.element) as Element).removeAttribute(this.name);\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 type {EventPart};\nclass EventPart extends AttributePart {\n  readonly type = EVENT_PART;\n\n  // EventPart does not use the base _$setValue/_resolveValue implementation\n  // since the dirty checking is more complex\n  /** @internal */\n  _$setValue(newListener: unknown, directiveParent: DirectiveParent = this) {\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    if (shouldRemoveListener) {\n      this.element.removeEventListener(\n        this.name,\n        this,\n        oldListener as EventListenerWithOptions\n      );\n    }\n    if (shouldAddListener) {\n      // Beware: IE11 and Chrome 41 don't like using the listener as the\n      // options object. Figure out how to deal w/ this in IE11 - maybe\n      // patch addEventListener?\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      // TODO (justinfagnani): do we need to default to this.element?\n      // It'll always be the same as `e.currentTarget`.\n      this._$committedValue.call(this.options?.host ?? this.element, event);\n    } else {\n      (this._$committedValue as EventListenerObject).handleEvent(event);\n    }\n  }\n}\n\nexport type {ElementPart};\nclass ElementPart {\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 | undefined;\n\n  /** @internal */\n  _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n  /** @internal */\n  _setDirectiveConnected?: (\n    directive: Directive | undefined,\n    isConnected: boolean,\n    removeFromParent?: boolean\n  ) => void = 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  _$setValue(value: unknown): void {\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 _\u03A3 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 _\u03A3 = {\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 hydrate\n  _TemplateInstance: TemplateInstance,\n  _isIterable: isIterable,\n  _resolveDirective: resolveDirective,\n  // Used in tests and private-ssr-support\n  _ChildPart: ChildPart,\n  _AttributePart: AttributePart,\n  _BooleanAttributePart: BooleanAttributePart,\n  _EventPart: EventPart,\n  _PropertyPart: PropertyPart,\n  _ElementPart: ElementPart,\n};\n\n// Apply polyfills if available\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n(globalThis as any)['litHtmlPlatformSupport']?.(Template, ChildPart);\n\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// TODO(justinfagnani): inject version number at build time\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n((globalThis as any)['litHtmlVersions'] ??= []).push('2.0.0-rc.3');\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 [[`LitElement`]] base class and\n * 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 [[`LitElement`]] and [[`html`]] from this module to create a\n * 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 [[`ReactiveElement`]] and adds lit-html templating.\n * The `ReactiveElement` class is provided for users that want to build\n * their own custom element base classes that don't use lit-html.\n *\n * @packageDocumentation\n */\nimport {PropertyValues, ReactiveElement} from '@lit/reactive-element';\nimport {render, RenderOptions, noChange, ChildPart} from 'lit-html';\nexport * from '@lit/reactive-element';\nexport * from 'lit-html';\n\n// For backwards compatibility export ReactiveElement as UpdatingElement. Note,\n// IE transpilation requires exporting like this.\nexport const UpdatingElement = ReactiveElement;\n\nconst DEV_MODE = true;\n\ndeclare global {\n  interface Window {\n    litElementVersions: string[];\n  }\n}\n\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// TODO(justinfagnani): inject version number at build time\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n((globalThis as any)['litElementVersions'] ??= []).push('3.0.0-rc.2');\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 [[`properties`]] property or the [[`property`]] decorator.\n */\nexport class LitElement extends ReactiveElement {\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  protected static ['finalized'] = true;\n\n  static _$litElement$ = true;\n\n  /**\n   * @category rendering\n   */\n  readonly renderOptions: RenderOptions = {host: this};\n\n  private __childPart: ChildPart | undefined = undefined;\n\n  /**\n   * @category rendering\n   */\n  protected 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 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    super.update(changedProperties);\n    this.__childPart = render(value, this.renderRoot, this.renderOptions);\n  }\n\n  // TODO(kschaaf): Consider debouncing directive disconnection so element moves\n  // do not thrash directive callbacks\n  // https://github.com/lit/lit/issues/1457\n  /**\n   * @category lifecycle\n   */\n  connectedCallback() {\n    super.connectedCallback();\n    this.__childPart?.setConnected(true);\n  }\n\n  /**\n   * @category lifecycle\n   */\n  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\n// Install hydration if available\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n(globalThis as any)['litElementHydrateSupport']?.({LitElement});\n\n// Apply polyfills if available\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n(globalThis as any)['litElementPlatformSupport']?.({LitElement});\n\n// DEV mode warnings\nif (DEV_MODE) {\n  // Note, for compatibility with closure compilation, this access\n  // needs to be as a string property index.\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  (LitElement as any)['finalize'] = function (this: typeof LitElement) {\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    const finalized = (ReactiveElement as any).finalize.call(this);\n    if (!finalized) {\n      return false;\n    }\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    const warnRemoved = (obj: any, name: string) => {\n      if (obj[name] !== undefined) {\n        console.warn(\n          `\\`${name}\\` is implemented. It ` +\n            `has been removed from this version of LitElement. `\n          // TODO(sorvell): add link to changelog when location has stabilized.\n          // + See the changelog at https://github.com/lit/lit/blob/main/packages/lit-element/CHANGELOG.md`\n        );\n      }\n    };\n    [`render`, `getStyles`].forEach((name: string) =>\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      warnRemoved(this as any, name)\n    );\n    [`adoptStyles`].forEach((name: string) =>\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      warnRemoved(this.prototype as any, name)\n    );\n    return true;\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 _\u03A6 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 _\u03A6 = {\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", "import type { ReactiveElement, ReactiveControllerHost } from '@lit/reactive-element';\nimport type { ApolloController, ApolloControllerOptions } from './apollo-controller.js';\n\ntype O = ApolloControllerOptions<any, any>; // eslint-disable-line @typescript-eslint/no-explicit-any\ntype Key = string|number|symbol;\n\n/* eslint-disable @typescript-eslint/ban-types */\ntype AnyObj = object;\n/* eslint-enable @typescript-eslint/ban-types */\n\nconst initialProps = new WeakMap<AnyObj, Map<Key, unknown>>();\n\nexport function getInitialProps<T extends AnyObj>(\n  obj: T,\n): Map<keyof T, T[keyof T]> {\n  if (!initialProps.has(obj))\n    initialProps.set(obj, new Map());\n  return initialProps.get(obj) as Map<keyof T, T[keyof T]>;\n}\n\nexport function getInitialProp<T extends AnyObj>(obj: T, key: keyof T): T[keyof T] | undefined {\n  return getInitialProps(obj).get(key);\n}\n\nexport function setInitialProps<T extends AnyObj>(obj: T): void {\n  getInitialProps(obj).forEach((val, key) => obj[key] ??= val);\n}\n\nexport function setInitialProp<T extends AnyObj>(obj: T, key: keyof T, value: T[keyof T]): void {\n  getInitialProps(obj).set(key, value);\n}\n\nexport interface DefineOptions {\n  /** When set to 'options', the controlled property is a member of controller.options */\n  path?: 'options',\n  /** When true, setting the property has no effect */\n  readonly?: boolean,\n  /** Called after setting with the new value */\n  onSet?(x: unknown): void,\n}\n\nfunction defineOnReactiveElement<T extends ReactiveElement & {\n  controller: ApolloController;\n}>(\n  proto: T,\n  name: string & keyof T,\n  opts: DefineOptions\n): void {\n  // Run our property effects\n  defineOnHTMLElement(proto, name, {\n    ...opts,\n    // In addition to any user-defined side-effects,\n    // also notify the ReactiveElement lifecycle\n    onSet(this: T, x: unknown) {\n      const old = this[name];\n      opts?.onSet?.call?.(this, x);/* c8 ignore next */\n      this.requestUpdate(name, old);\n    },\n  });\n  // And also run ReactiveElement's property effects\n  const Class = proto.constructor as typeof ReactiveElement;\n  // @ts-expect-error: i know it's protected\n  Class.createProperty(name, Class.getPropertyOptions(name));\n}\n\nfunction defineOnHTMLElement<T extends HTMLElement & ReactiveControllerHost & {\n  controller: ApolloController;\n  requestUpdate(name?: string, old?: unknown): void;\n}>(\n  proto: T,\n  name: string & keyof T,\n  opts: DefineOptions\n): void {\n  Object.defineProperty(proto, name, {\n    configurable: true,\n    get(this: T) {\n      if (opts.path) { /* c8 ignore next */\n        return (\n            !this.controller ? getInitialProp(this, name)/* c8 ignore next */\n          : this.controller[opts.path][name as keyof O]\n        );\n      } else {\n        return (\n            !this.controller ? getInitialProp(this, name)/* c8 ignore next */\n          : this.controller[name as keyof ApolloController]\n        );\n      }\n    },\n\n    set(this: T, value: T[keyof T]) {\n      if (opts.readonly) return;/* c8 ignore next */\n      const old = this[name as keyof T];\n      if (!this.controller)\n        setInitialProp(this, name, value);/* c8 ignore next */\n      else {\n        if (opts.path)\n          this.controller[opts.path][name as keyof O] = value as O[keyof O];\n        else\n          this.controller[name as keyof ApolloController] = value as any; // eslint-disable-line @typescript-eslint/no-explicit-any\n        if (opts.onSet)\n          opts.onSet.call(this, value);/* c8 ignore next */\n      }\n      this.requestUpdate?.(name, old);\n    },\n  });\n}\n\nfunction isReactiveElement(\n  proto: HTMLElement\n): proto is ReactiveElement {\n  return typeof (proto.constructor as typeof ReactiveElement).createProperty === 'function';\n}\n\n/**\n * @summary Class field decorator for controlled properties\n *\n * Controlled properties are element class fields which defer to and reflect that property on the element's `controller` property, which is a `ReactiveController`.\n *\n * @param  options Options for the controlled field\n */\nexport function controlled(options: DefineOptions = {}) {\n  return function<T extends HTMLElement & ReactiveControllerHost & {\n  controller: ApolloController;\n}>(\n    proto: T,\n    name: string & keyof T\n  ): void {\n    if (isReactiveElement(proto))\n      defineOnReactiveElement(proto, name, options);/* c8 ignore next */\n    else\n      defineOnHTMLElement(proto, name, options);/* c8 ignore next */\n  };\n}\n", "import type { ApolloController } from './apollo-controller.js';\nimport type { Data } from '@apollo-elements/core/types';\nimport type {\n  ApolloClient,\n  ApolloError,\n  ApolloQueryResult,\n  FetchResult,\n  NormalizedCacheObject,\n} from '@apollo/client/core';\n\ntype ApolloEventType = `apollo-${'controller'|'element'}-${'connected'|'disconnected'}`;\ntype ApolloElementEventType = `apollo-element-${'disconnected'|'connected'}`;\ntype ApolloControllerEventType = `apollo-controller-${'disconnected'|'connected'}`;\n\ninterface ApolloControllerHost extends HTMLElement {\n  controller: ApolloController;\n}\n\nexport type ApolloQueryResultEvent<TData = unknown> =\n  CustomEvent<ApolloQueryResult<TData>>;\n\nexport type ApolloMutationResultEvent<TData = unknown> =\n  CustomEvent<FetchResult<TData>>;\n\nexport type ApolloSubscriptionResultEvent<D = unknown> = CustomEvent<{\n  client: ApolloClient<NormalizedCacheObject>;\n  subscriptionData: {\n    data: Data<D> | null;\n    loading: boolean;\n    error: null;\n  };\n}>;\n\nexport abstract class ApolloEvent<T = ApolloControllerHost> extends CustomEvent<T> {\n  public abstract type: ApolloEventType\n  public declare controller?: ApolloController;\n  constructor(type: ApolloEventType, options?: CustomEventInit) {\n    super(type, { ...options, bubbles: true, composed: true });\n  }\n}\n\n/**\n * @summary Fired when an ApolloElement connects to or disconnects from the DOM\n */\nexport class ApolloElementEvent<T = ApolloControllerHost> extends ApolloEvent<T> {\n  public declare static type: ApolloElementEventType;\n  public declare type: ApolloElementEventType;\n  constructor(type: ApolloElementEventType, detail: T) {\n    super(type, { detail });\n  }\n}\n\nexport abstract class ApolloControllerEvent extends ApolloEvent {\n  public abstract controller: ApolloController;\n  public abstract type: ApolloControllerEventType\n  constructor(type: ApolloControllerEventType) {\n    super(type);\n  }\n}\n\n/**\n * @summary Fired when a controlled element connects to the DOM\n */\nexport class ApolloControllerConnectedEvent extends ApolloControllerEvent {\n  public static type = 'apollo-controller-connected' as const;\n  public declare type: 'apollo-controller-connected';\n  constructor(public controller: ApolloController) {\n    super(ApolloControllerConnectedEvent.type);\n  }\n}\n\n/**\n * @summary Fired when a controlled element disconnects from the DOM\n */\nexport class ApolloControllerDisconnectedEvent extends ApolloControllerEvent {\n  public static type = 'apollo-controller-disconnected' as const;\n  public declare type: 'apollo-controller-disconnected';\n  constructor(public controller: ApolloController) {\n    super(ApolloControllerDisconnectedEvent.type);\n  }\n}\n\ndeclare global {\n  interface HTMLElementEventMap {\n    'apollo-controller-connected': ApolloControllerConnectedEvent;\n    'apollo-controller-disconnected': ApolloControllerDisconnectedEvent;\n    'apollo-element-connected': ApolloElementEvent;\n    'apollo-element-disconnected': ApolloElementEvent;\n    'apollo-error': CustomEvent<ApolloError>;\n    'apollo-mutation-result': ApolloMutationResultEvent;\n    'apollo-query-result': ApolloQueryResultEvent;\n    'apollo-subscription-result': ApolloSubscriptionResultEvent;\n  }\n\n  interface WindowEventMap {\n    'apollo-element-disconnected': ApolloElementEvent;\n    'apollo-controller-disconnected': ApolloControllerDisconnectedEvent;\n  }\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 */\nimport {PropertyDeclaration, ReactiveElement} from '../reactive-element.js';\nimport {ClassElement} from './base.js';\n\nconst standardProperty = (\n  options: PropertyDeclaration,\n  element: ClassElement\n) => {\n  // When decorating an accessor, pass it through and add property metadata.\n  // Note, the `hasOwnProperty` check in `createProperty` ensures we don't\n  // stomp over the user's accessor.\n  if (\n    element.kind === 'method' &&\n    element.descriptor &&\n    !('value' in element.descriptor)\n  ) {\n    return {\n      ...element,\n      finisher(clazz: typeof ReactiveElement) {\n        clazz.createProperty(element.key, options);\n      },\n    };\n  } else {\n    // createProperty() takes care of defining the property, but we still\n    // must return some kind of descriptor, so return a descriptor for an\n    // unused prototype field. The finisher calls createProperty().\n    return {\n      kind: 'field',\n      key: Symbol(),\n      placement: 'own',\n      descriptor: {},\n      // store the original key so subsequent decorators have access to it.\n      originalKey: element.key,\n      // When @babel/plugin-proposal-decorators implements initializers,\n      // do this instead of the initializer below. See:\n      // https://github.com/babel/babel/issues/9260 extras: [\n      //   {\n      //     kind: 'initializer',\n      //     placement: 'own',\n      //     initializer: descriptor.initializer,\n      //   }\n      // ],\n      initializer(this: {[key: string]: unknown}) {\n        if (typeof element.initializer === 'function') {\n          this[element.key as string] = element.initializer.call(this);\n        }\n      },\n      finisher(clazz: typeof ReactiveElement) {\n        clazz.createProperty(element.key, options);\n      },\n    };\n  }\n};\n\nconst legacyProperty = (\n  options: PropertyDeclaration,\n  proto: Object,\n  name: PropertyKey\n) => {\n  (proto.constructor as typeof ReactiveElement).createProperty(name, options);\n};\n\n/**\n * A property decorator which creates a reactive property that reflects a\n * corresponding attribute value. When a decorated property is set\n * the element will update and render. A [[`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 [[`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 [[`state`]] decorator should be used. When needed,\n * state properties can be initialized via public properties to facilitate\n * complex interactions.\n *\n * @example\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) {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  return (protoOrDescriptor: Object | ClassElement, name?: PropertyKey): any =>\n    name !== undefined\n      ? legacyProperty(options!, protoOrDescriptor as Object, name)\n      : standardProperty(options!, protoOrDescriptor as ClassElement);\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 {property} from './property.js';\n\nexport interface InternalPropertyDeclaration<Type = unknown> {\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/**\n * Declares a private or protected reactive property that still triggers\n * updates to the element when it changes. It does not reflect from the\n * corresponding attribute.\n *\n * Properties declared this way must not be used from HTML or HTML templating\n * systems, they're solely for properties internal to the element. These\n * properties may be renamed by optimization tools like closure compiler.\n * @category Decorator\n */\nexport function state(options?: InternalPropertyDeclaration) {\n  return property({\n    ...options,\n    state: true,\n    attribute: false,\n  });\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 {ReactiveElement} from '../reactive-element.js';\nimport {decorateProperty} from './base.js';\n\n// TODO(sorvell): Remove when https://github.com/webcomponents/polyfills/issues/397 is addressed.\n// x-browser support for matches\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst ElementProto = Element.prototype as any;\nconst legacyMatches =\n  ElementProto.msMatchesSelector || ElementProto.webkitMatchesSelector;\n\n/**\n * A property decorator that converts a class property into a getter that\n * returns the `assignedNodes` of the given named `slot`. Note, the type of\n * this property should be annotated as `NodeListOf<HTMLElement>`.\n *\n * @param slotName A string name of the slot.\n * @param flatten A boolean which when true flattens the assigned nodes,\n *     meaning any assigned nodes that are slot elements are replaced with their\n *     assigned nodes.\n * @param selector A string which filters the results to elements that match\n *     the given css selector.\n *\n * * @example\n * ```ts\n * class MyElement {\n *   @queryAssignedNodes('list', true, '.item')\n *   listItems;\n *\n *   render() {\n *     return html`\n *       <slot name=\"list\"></slot>\n *     `;\n *   }\n * }\n * ```\n * @category Decorator\n */\nexport function queryAssignedNodes(\n  slotName = '',\n  flatten = false,\n  selector = ''\n) {\n  return decorateProperty({\n    descriptor: (_name: PropertyKey) => ({\n      get(this: ReactiveElement) {\n        const slotSelector = `slot${\n          slotName ? `[name=${slotName}]` : ':not([name])'\n        }`;\n        const slot = this.renderRoot?.querySelector(slotSelector);\n        let nodes = (slot as HTMLSlotElement)?.assignedNodes({flatten});\n        if (nodes && selector) {\n          nodes = nodes.filter(\n            (node) =>\n              node.nodeType === Node.ELEMENT_NODE &&\n              // eslint-disable-next-line @typescript-eslint/no-explicit-any\n              ((node as any).matches\n                ? (node as Element).matches(selector)\n                : legacyMatches.call(node as Element, selector))\n          );\n        }\n        return nodes;\n      },\n      enumerable: true,\n      configurable: true,\n    }),\n  });\n}\n", "import type { ApolloClient, ApolloError, NormalizedCacheObject } from '@apollo/client/core';\n\nimport type { PropertyDeclaration } from 'lit';\n\nimport type { ApolloController } from '@apollo-elements/core';\n\nimport type {\n  ComponentDocument,\n  Data,\n  GraphQLError,\n  MaybeTDN,\n  MaybeVariables,\n  Variables,\n} from '@apollo-elements/core/types';\n\nimport { LitElement } from 'lit';\n\nimport { controlled } from '@apollo-elements/core/decorators';\nimport { ApolloElementEvent } from '@apollo-elements/core/events';\n\nimport { property, state } from 'lit/decorators.js';\n\nexport interface ControlledPropertyDeclaration extends PropertyDeclaration {\n  controlled?: boolean|string;\n  readonly?: boolean;\n}\n\n/**\n * `ApolloElement`\n *\n * \uD83D\uDE80 Custom element base class for apollo lit elements.\n *\n * See [`ApolloElementInterface`](https://apolloelements.dev/api/core/interfaces/element) for more information on events\n */\nexport class ApolloElement<\n  D extends MaybeTDN = MaybeTDN,\n  V = MaybeVariables<D>\n> extends LitElement {\n  declare controller: ApolloController<D, V>;\n\n  readyToReceiveDocument = false;\n\n  connectedCallback(): void {\n    this.readyToReceiveDocument = true;\n    super.connectedCallback();\n    this.dispatchEvent(new ApolloElementEvent('apollo-element-connected', this));\n  }\n\n  disconnectedCallback(): void {\n    this.readyToReceiveDocument = false;\n    this.dispatchEvent(new ApolloElementEvent('apollo-element-disconnected', this));\n    window.dispatchEvent(new ApolloElementEvent('apollo-element-disconnected', this));\n    super.disconnectedCallback?.(); /* c8 ignore start */ // manual testing showed that both cases were hit\n  }\n\n  /** @summary The Apollo Client instance. */\n  @controlled()\n  @state()\n  client: ApolloClient<NormalizedCacheObject> | null = window.__APOLLO_CLIENT__ ?? null;\n\n  /** @summary Context passed to the link execution chain. */\n  @controlled({ path: 'options' }) @state() context?: Record<string, unknown>;\n\n  /** @summary Whether a request is in flight. */\n  @controlled() @property({ reflect: true, type: Boolean }) loading = false;\n\n  /** @summary Latest Data. */\n  @controlled() @state() data: Data<D>|null = null;\n\n  /**\n   * @summary Operation document.\n   * GraphQL operation document i.e. query, subscription, or mutation.\n   * Must be a parsed GraphQL `DocumentNode`\n   */\n  @controlled() @state() document: ComponentDocument<D>|null = null;\n\n  /** @summary Latest error */\n  @controlled() @state() error: Error|ApolloError|null = null;\n\n  /** @summary Latest errors */\n  @controlled() @state() errors: readonly GraphQLError[] = [];\n\n  /** @summary Operation variables. */\n  @controlled() @state() variables: Variables<D, V>|null = null;\n}\n", "import tslib from '../tslib.js';\r\nconst {\r\n    __extends,\r\n    __assign,\r\n    __rest,\r\n    __decorate,\r\n    __param,\r\n    __metadata,\r\n    __awaiter,\r\n    __generator,\r\n    __exportStar,\r\n    __createBinding,\r\n    __values,\r\n    __read,\r\n    __spread,\r\n    __spreadArrays,\r\n    __spreadArray,\r\n    __await,\r\n    __asyncGenerator,\r\n    __asyncDelegator,\r\n    __asyncValues,\r\n    __makeTemplateObject,\r\n    __importStar,\r\n    __importDefault,\r\n    __classPrivateFieldGet,\r\n    __classPrivateFieldSet,\r\n} = tslib;\r\nexport {\r\n    __extends,\r\n    __assign,\r\n    __rest,\r\n    __decorate,\r\n    __param,\r\n    __metadata,\r\n    __awaiter,\r\n    __generator,\r\n    __exportStar,\r\n    __createBinding,\r\n    __values,\r\n    __read,\r\n    __spread,\r\n    __spreadArrays,\r\n    __spreadArray,\r\n    __await,\r\n    __asyncGenerator,\r\n    __asyncDelegator,\r\n    __asyncValues,\r\n    __makeTemplateObject,\r\n    __importStar,\r\n    __importDefault,\r\n    __classPrivateFieldGet,\r\n    __classPrivateFieldSet,\r\n};\r\n", "const genericMessage = \"Invariant Violation\";\nconst {\n  setPrototypeOf = function (obj: any, proto: any) {\n    obj.__proto__ = proto;\n    return obj;\n  },\n} = Object as any;\n\nexport class InvariantError extends Error {\n  framesToPop = 1;\n  name = genericMessage;\n  constructor(message: string | number = genericMessage) {\n    super(\n      typeof message === \"number\"\n        ? `${genericMessage}: ${message} (see https://github.com/apollographql/invariant-packages)`\n        : message\n    );\n    setPrototypeOf(this, InvariantError.prototype);\n  }\n}\n\nexport function invariant(\n  condition: any,\n  message?: string | number,\n): asserts condition {\n  if (!condition) {\n    throw new InvariantError(message);\n  }\n}\n\nconst verbosityLevels = [\"log\", \"warn\", \"error\", \"silent\"] as const;\ntype VerbosityLevel = (typeof verbosityLevels)[number];\ntype ConsoleMethodName = Exclude<VerbosityLevel, \"silent\">;\nlet verbosityLevel = verbosityLevels.indexOf(\"log\");\n\nfunction wrapConsoleMethod<M extends ConsoleMethodName>(method: M) {\n  return function () {\n    if (verbosityLevels.indexOf(method) >= verbosityLevel) {\n      return console[method].apply(console, arguments as any);\n    }\n  } as (typeof console)[M];\n}\n\nexport namespace invariant {\n  export const log = wrapConsoleMethod(\"log\");\n  export const warn = wrapConsoleMethod(\"warn\");\n  export const error = wrapConsoleMethod(\"error\");\n}\n\nexport function setVerbosity(level: VerbosityLevel): VerbosityLevel {\n  const old = verbosityLevels[verbosityLevel];\n  verbosityLevel = Math.max(0, verbosityLevels.indexOf(level));\n  return old;\n}\n\n// Code that uses ts-invariant with rollup-plugin-invariant may want to\n// import this process stub to avoid errors evaluating process.env.NODE_ENV.\n// However, because most ESM-to-CJS compilers will rewrite the process import\n// as tsInvariant.process, which prevents proper replacement by minifiers, we\n// also export processStub, so you can import { invariant, processStub } from\n// \"ts-invariant\" and assign processStub to a local variable named process.\nexport const processStub: {\n  env: Record<string, any>;\n  [key: string]: any;\n} = (\n  typeof process === \"object\" &&\n  typeof process.env === \"object\"\n) ? process : { env: {} };\n\nexport { processStub as process };\n\nexport default invariant;\n", "/**\n * The current status of a query\u2019s execution in our system.\n */\nexport enum NetworkStatus {\n  /**\n   * The query has never been run before and the query is now currently running. A query will still\n   * have this network status even if a partial data result was returned from the cache, but a\n   * query was dispatched anyway.\n   */\n  loading = 1,\n\n  /**\n   * If `setVariables` was called and a query was fired because of that then the network status\n   * will be `setVariables` until the result of that query comes back.\n   */\n  setVariables = 2,\n\n  /**\n   * Indicates that `fetchMore` was called on this query and that the query created is currently in\n   * flight.\n   */\n  fetchMore = 3,\n\n  /**\n   * Similar to the `setVariables` network status. It means that `refetch` was called on a query\n   * and the refetch request is currently in flight.\n   */\n  refetch = 4,\n\n  /**\n   * Indicates that a polling query is currently in flight. So for example if you are polling a\n   * query every 10 seconds then the network status will switch to `poll` every 10 seconds whenever\n   * a poll request has been sent but not resolved.\n   */\n  poll = 6,\n\n  /**\n   * No request is in flight for this query, and no errors happened. Everything is OK.\n   */\n  ready = 7,\n\n  /**\n   * No request is in flight for this query, but one or more errors were detected.\n   */\n  error = 8,\n}\n\n/**\n * Returns true if there is currently a network request in flight according to a given network\n * status.\n */\nexport function isNetworkRequestInFlight(\n  networkStatus?: NetworkStatus,\n): boolean {\n  return networkStatus ? networkStatus < 7 : false;\n}\n", "/* Core */\n\nexport {\n  ApolloClient,\n  ApolloClientOptions,\n  DefaultOptions,\n  mergeOptions,\n} from './ApolloClient';\nexport {\n  ObservableQuery,\n  FetchMoreOptions,\n  UpdateQueryOptions,\n} from './ObservableQuery';\nexport {\n  QueryOptions,\n  WatchQueryOptions,\n  MutationOptions,\n  SubscriptionOptions,\n  FetchPolicy,\n  WatchQueryFetchPolicy,\n  ErrorPolicy,\n  FetchMoreQueryOptions,\n  SubscribeToMoreOptions,\n  MutationUpdaterFn,\n} from './watchQueryOptions';\nexport { NetworkStatus } from './networkStatus';\nexport * from './types';\nexport {\n  Resolver,\n  FragmentMatcher,\n} from './LocalState';\nexport { isApolloError, ApolloError } from '../errors';\n\n/* Cache */\n\nexport {\n  // All the exports (types and values) from ../cache, minus cacheSlot,\n  // which we want to keep semi-private.\n  Cache,\n  ApolloCache,\n  Transaction,\n  DataProxy,\n  InMemoryCache,\n  InMemoryCacheConfig,\n  MissingFieldError,\n  defaultDataIdFromObject,\n  ReactiveVar,\n  makeVar,\n  TypePolicies,\n  TypePolicy,\n  FieldPolicy,\n  FieldReadFunction,\n  FieldMergeFunction,\n  FieldFunctionOptions,\n  PossibleTypesMap,\n} from '../cache';\n\nexport * from '../cache/inmemory/types';\n\n/* Link */\n\nexport * from '../link/core';\nexport * from '../link/http';\nexport {\n  fromError,\n  toPromise,\n  fromPromise,\n  ServerError,\n  throwServerError,\n} from '../link/utils';\n\n/* Utilities */\n\nexport {\n  Observable,\n  Observer,\n  ObservableSubscription,\n  Reference,\n  isReference,\n  makeReference,\n  StoreObject,\n} from '../utilities';\n\n/* Supporting */\n\n// The verbosity of invariant.{log,warn,error} can be controlled globally\n// (for anyone using the same ts-invariant package) by passing \"log\",\n// \"warn\", \"error\", or \"silent\" to setVerbosity (\"log\" is the default).\n// Note that all invariant.* logging is hidden in production.\nimport { setVerbosity } from \"ts-invariant\";\nexport { setVerbosity as setLogVerbosity }\nsetVerbosity(\"log\");\n\n// Note that importing `gql` by itself, then destructuring\n// additional properties separately before exporting, is intentional.\n// Due to the way the `graphql-tag` library is setup, certain bundlers\n// can't find the properties added to the exported `gql` function without\n// additional guidance (e.g. Rollup - see\n// https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module).\n// Instead of having people that are using bundlers with `@apollo/client` add\n// extra bundler config to help `graphql-tag` exports be found (which would be\n// awkward since they aren't importing `graphql-tag` themselves), this\n// workaround of pulling the extra properties off the `gql` function,\n// then re-exporting them separately, helps keeps bundlers happy without any\n// additional config changes.\nexport {\n  default as gql,\n  resetCaches,\n  disableFragmentWarnings,\n  enableExperimentalFragmentVariables,\n  disableExperimentalFragmentVariables,\n} from 'graphql-tag';\n", "import type { DocumentNode } from '@apollo/client/core';\n\n/**\n * Validates a graphql document node.\n *\n * ```haskell\n * isValidGql :: DocumentNode a => a -> Bool\n * ```\n * @param doc Maybe a DocumentNode\n * @return Whether the argument is a DocumentNode\n */\nexport function isValidGql(doc: unknown): doc is DocumentNode {\n  return !!(\n    doc &&\n    typeof doc === 'object' &&\n    'kind' in doc &&\n    'definitions' in doc\n  );\n}\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\nimport type {\n  ApolloClient,\n  ApolloError,\n  ErrorPolicy,\n  NormalizedCacheObject,\n} from '@apollo/client/core';\n\n\nimport type {\n  ComponentDocument,\n  Data,\n  GraphQLError,\n  MaybeTDN,\n  MaybeVariables,\n  Variables,\n} from '@apollo-elements/core/types';\n\nimport { isValidGql } from './lib/is-valid-gql.js';\n\nimport { ApolloControllerConnectedEvent, ApolloControllerDisconnectedEvent } from './events.js';\n\nexport interface ApolloControllerOptions<D, V> {\n  /** The `ApolloClient` instance for the controller. */\n  client?: ApolloClient<NormalizedCacheObject>;\n  /** Variables for the operation. */\n  variables?: Variables<D, V>;\n  /** Context passed to the link execution chain. */\n  context?: any; // eslint-disable-line @typescript-eslint/no-explicit-any\n  /**\n   * errorPolicy determines the level of events for errors in the execution result. The options are:\n   * - `none` (default): any errors from the request are treated like runtime errors and the observable is stopped (XXX this is default to lower breaking changes going from AC 1.0 => 2.0)\n   * - `ignore`: errors from the request do not stop the observable, but also don't call `next`\n   * - `all`: errors are treated like data and will notify observables\n   * @summary [Error Policy](https://www.apollographql.com/docs/react/api/core/ApolloClient/#ErrorPolicy) for the query.\n   */\n  errorPolicy?: ErrorPolicy;\n  /** When provided, the controller will fall back to this element to fire events */\n  hostElement?: HTMLElement;\n  /** Host update callback */\n  [update]?(properties?: Record<string, unknown>): void;\n}\n\nexport const update = Symbol('update');\n\ninterface ReflectingReactiveControllerHost extends ReactiveControllerHost {\n  [update](properties?: Record<string, unknown>): void;\n}\n\nfunction isReflectingHost(host: ReactiveControllerHost): host is ReflectingReactiveControllerHost {\n  return typeof (host as ReactiveControllerHost & { [update]: unknown })[update] === 'function';\n}\n\nexport abstract class ApolloController<\n  D extends MaybeTDN = MaybeTDN,\n  V = MaybeVariables<D>\n>\nimplements ReactiveController {\n  #options: ApolloControllerOptions<D, V> = {};\n\n  #client: ApolloClient<NormalizedCacheObject> | null = null;\n\n  #document: ComponentDocument<D> | null = null;\n\n  /** @summary The event emitter to use when firing events, usually the host element. */\n  protected emitter: EventTarget;\n\n  called = true;\n\n  /** @summary Latest data for the operation, or `null`. */\n  data: Data<D> | null = null;\n\n  /** @summary Latest error from the operation, or `null`. */\n  error: ApolloError | null = null;\n\n  /** @summary Latest errors from the operation, or `[]`. */\n  errors: readonly GraphQLError[] = [];\n\n  /** @summary Whether a request is in-flight. */\n  loading = false;\n\n  /** @summary Options for the operation and controller. */\n  get options(): ApolloControllerOptions<D, V> {\n    return this.#options;\n  }\n\n  set options(v: ApolloControllerOptions<D, V>) {\n    const u = this.#options[update];\n    this.#options = { [update]: u, ...v };\n  }\n\n  /** @summary The `ApolloClient` instance for this controller. */\n  get client(): ApolloClient<NormalizedCacheObject> | null {\n    return this.#client;\n  }\n\n  set client(v: ApolloClient<NormalizedCacheObject> | null) {\n    this.#client = v;\n    this.clientChanged?.(v); /* c8 ignore next */ // covered\n    this.notify('client');\n  }\n\n  /** @summary The GraphQL document for the operation. */\n  get document(): ComponentDocument<D> | null { return this.#document; }\n\n  set document(document: ComponentDocument<D> | null) {\n    if (document === this.#document)\n      return; /* c8 ignore next */ // covered\n    else if (!document)\n      this.#document = null; /* c8 ignore next */ // covered\n    else if (!isValidGql(document)) { /* c8 ignore next */ // covered\n      const name = (this.constructor.name).replace(/Apollo(\\w+)Controller/, '$1');\n      throw new TypeError(`${name} must be a parsed GraphQL document.`);\n    } else {\n      this.#document = document;\n      this[update]({ document });\n      this.documentChanged?.(document);/* c8 ignore next */\n    }\n  }\n\n  /** @summary Variables for the operation. */\n  get variables(): Variables<D, V> | null {\n    return this.options?.variables ?? null;\n  }\n\n  set variables(variables: Variables<D, V> | null) {\n    if (!variables)\n      delete this.options.variables;/* c8 ignore next */ // covered\n    else if (variables === this.options.variables)\n      return; /* c8 ignore next */ // covered\n    else\n      this.options.variables = variables;\n    this[update]({ variables });\n    this.variablesChanged?.(variables);/* c8 ignore next */\n  }\n\n  constructor(public host: ReactiveControllerHost, options?: ApolloControllerOptions<D, V>) {\n    /* c8 ignore start */ // these are all covered\n    if (host instanceof EventTarget)\n      this.emitter = host;\n    else if (options?.hostElement instanceof EventTarget)\n      this.emitter = options.hostElement;\n    else\n      this.emitter = new EventTarget();\n    this.options = options ?? {};\n    this.client = this.options.client ?? window.__APOLLO_CLIENT__ ?? null;\n    host.addController?.(this);\n    /* c8 ignore stop */\n  }\n\n  /** @summary requests an update on the host. */\n  private [update](properties?: Record<string, unknown>): void {\n    this.host.requestUpdate();\n    /* c8 ignore start */ // these are all covered\n    if (isReflectingHost(this.host))\n      this.host[update](properties);\n    else\n      this.options[update]?.(properties);\n    /* c8 ignore stop */\n  }\n\n  /** @summary callback for when the GraphQL document changes. */\n  protected documentChanged?(document?: ComponentDocument<D> | null): void;\n\n  /** @summary callback for when the GraphQL variables change. */\n  protected variablesChanged?(variables?: Variables<D, V> | null): void;\n\n  /** @summary callback for when the Apollo client changes. */\n  protected clientChanged?(client?: ApolloClient<NormalizedCacheObject> | null): void;\n\n  /** @summary Notifies about updated properties. */\n  protected notify(...keys: (keyof this)[]): void {\n    this[update](Object.fromEntries(keys.map(x => [x, this[x]])));\n  }\n\n  /** @summary Assigns the controller's variables and GraphQL document. */\n  protected init(document: ComponentDocument<D> | null): void {\n    this.variables ??= this.options.variables ?? null;\n    this.document = document;\n  }\n\n  /** @fires {ApolloControllerConnectedEvent} apollo-controller-connected when the controller's host connects to the document. */\n  hostConnected(): void {\n    this.emitter.dispatchEvent(new ApolloControllerConnectedEvent(this));\n  }\n\n  /** @fires {ApolloControllerDisconnectedEvent} apollo-controller-disconnected when the controller's host disconnects from the document. */\n  hostDisconnected(): void {\n    this.emitter.dispatchEvent(new ApolloControllerDisconnectedEvent(this));\n    window.dispatchEvent(new ApolloControllerDisconnectedEvent(this));\n  }\n}\n", "const configurable = true;\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\nexport function bound(_: any, key: string, descriptor: PropertyDescriptor): PropertyDescriptor {\n  if (typeof descriptor?.value !== 'function')\n    throw new TypeError(`Only methods can be decorated with @bound. <${key ?? _.name}> is not a method!`); /* c8 ignore next */\n  return {\n    configurable,\n    get() {\n      const value = descriptor.value.bind(this);\n      Object.defineProperty(this, key, { value, configurable, writable: true });\n      return value;\n    },\n  };\n}\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\nimport type {\n  ComponentDocument,\n  Data,\n  FetchMoreParams,\n  MaybeTDN,\n  MaybeVariables,\n  Variables,\n} from '@apollo-elements/core/types';\n\nimport type {\n  ApolloError,\n  ApolloQueryResult,\n  DocumentNode,\n  ObservableQuery,\n  QueryOptions,\n  SubscribeToMoreOptions,\n  SubscriptionOptions,\n  WatchQueryOptions,\n} from '@apollo/client/core';\n\nimport { NetworkStatus } from '@apollo/client/core';\n\nimport { ApolloController, ApolloControllerOptions } from './apollo-controller.js';\n\nimport { bound } from './lib/bound.js';\n\nexport interface ApolloQueryControllerOptions<D, V> extends\n    ApolloControllerOptions<D, V>,\n    Partial<WatchQueryOptions<Variables<D, V>, Data<D>>> {\n  variables?: Variables<D, V>;\n  noAutoSubscribe?: boolean;\n  shouldSubscribe?: (options?: Partial<SubscriptionOptions<Variables<D, V>, Data<D>>>) => boolean;\n  onData?: (data: Data<D>) => void;\n  onError?: (error: Error) => void;\n}\n\nexport class ApolloQueryController<D extends MaybeTDN = MaybeTDN, V = MaybeVariables<D>>\n  extends ApolloController<D, V>\n  implements ReactiveController {\n  private observableQuery?: ObservableQuery<Data<D>, Variables<D, V>>;\n\n  private pollingInterval?: number;\n\n  /** @summary Options to customize the query and to interface with the controller. */ // @ts-expect-error: https://github.com/microsoft/TypeScript/issues/40220\n  declare options: ApolloQueryControllerOptions<D, V>;\n\n  /**\n   * `networkStatus` is useful if you want to display a different loading indicator (or no indicator at all)\n   * depending on your network status as it provides a more detailed view into the state of a network request\n   * on your component than `loading` does. `networkStatus` is an enum with different number values between 1 and 8.\n   * These number values each represent a different network state.\n   *\n   * 1. `loading`: The query has never been run before and the request is now pending. A query will still have this network status even if a result was returned from the cache, but a query was dispatched anyway.\n   * 2. `setVariables`: If a query\u2019s variables change and a network request was fired then the network status will be setVariables until the result of that query comes back. React users will see this when options.variables changes on their queries.\n   * 3. `fetchMore`: Indicates that fetchMore was called on this query and that the network request created is currently in flight.\n   * 4. `refetch`: It means that refetch was called on a query and the refetch request is currently in flight.\n   * 5. Unused.\n   * 6. `poll`: Indicates that a polling query is currently in flight. So for example if you are polling a query every 10 seconds then the network status will switch to poll every 10 seconds whenever a poll request has been sent but not resolved.\n   * 7. `ready`: No request is in flight for this query, and no errors happened. Everything is OK.\n   * 8. `error`: No request is in flight for this query, but one or more errors were detected.\n   *\n   * If the network status is less then 7 then it is equivalent to `loading` being true. In fact you could\n   * replace all of your `loading` checks with `networkStatus < 7` and you would not see a difference.\n   * It is recommended that you use `loading`, however.\n   */\n  networkStatus = NetworkStatus.ready;\n\n  /**\n   * If data was read from the cache with missing fields,\n   * partial will be true. Otherwise, partial will be falsy.\n   *\n   * @summary True when the query returned partial data.\n   */\n  partial = false;\n\n  #hasDisconnected = false;\n\n  #lastQueryDocument?: DocumentNode;\n\n  /** @summary A GraphQL document containing a single query. */\n  get query(): ComponentDocument<D> | null { return this.document; }\n\n  set query(document: ComponentDocument<D> | null) { this.document = document; }\n\n  /** @summary Flags an element that's ready and able to auto-subscribe */\n  public get canAutoSubscribe(): boolean {\n    return (\n      !!this.client &&\n      !!this.document &&\n      !this.options.noAutoSubscribe &&\n      this.shouldSubscribe()\n    );\n  }\n\n  constructor(\n    host: ReactiveControllerHost,\n    query?: ComponentDocument<D> | null,\n    options?: ApolloQueryControllerOptions<D, V>\n  ) {\n    super(host, options);\n    this.init(query ?? null);/* c8 ignore next */\n  }\n\n  /** @summary initializes or reinitializes the query */\n  override hostConnected(): void {\n    super.hostConnected();\n    if (this.#hasDisconnected && this.observableQuery) { /* c8 ignore next */\n      this.observableQuery.reobserve();\n      this.#hasDisconnected = false;\n    } else\n      this.documentChanged(this.query);\n  }\n\n  override hostDisconnected(): void {\n    this.#hasDisconnected = true;\n    super.hostDisconnected();\n  }\n\n  private shouldSubscribe(opts?: Partial<SubscriptionOptions<Variables<D, V>, Data<D>>>): boolean {\n    return this.options.shouldSubscribe?.(opts) ?? true;/* c8 ignore next */\n  }\n\n  /**\n   * Determines whether the element is able to automatically subscribe\n   */\n  private canSubscribe(\n    options?: Partial<SubscriptionOptions<Variables<D, V> | null, Data<D>>>\n  ): boolean {\n    /* c8 ignore next 4 */\n    return (\n      !(this.options.noAutoSubscribe ?? false) &&\n      !!this.client &&\n      !!(options?.query ?? this.document)\n    );\n  }\n\n  /**\n   * Creates an instance of ObservableQuery with the options provided by the element.\n   * - `context` Context to be passed to link execution chain\n   * - `errorPolicy` Specifies the ErrorPolicy to be used for this query\n   * - `fetchPolicy` Specifies the FetchPolicy to be used for this query\n   * - `fetchResults` Whether or not to fetch results\n   * - `metadata` Arbitrary metadata stored in the store with this query. Designed for debugging, developer tools, etc.\n   * - `notifyOnNetworkStatusChange` Whether or not updates to the network status should trigger next on the observer of this query\n   * - `pollInterval` The time interval (in milliseconds) on which this query should be refetched from the server.\n   * - `query` A GraphQL document that consists of a single query to be sent down to the server.\n   * - `variables` A map going from variable name to variable value, where the variables are used within the GraphQL query.\n   */\n  @bound private watchQuery(\n    params?: Partial<WatchQueryOptions<Variables<D, V>, Data<D>>>\n  ): ObservableQuery<Data<D>, Variables<D, V>> {\n    if (!this.client)\n      throw new TypeError('No Apollo client. See https://apolloelements.dev/guides/getting-started/apollo-client/'); /* c8 ignore next */ // covered\n\n    return this.client.watchQuery({\n      // It's better to let Apollo client throw this error\n      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n      query: this.query!,\n      variables: this.variables ?? undefined,\n      context: this.options.context,\n      errorPolicy: this.options.errorPolicy,\n      fetchPolicy: this.options.fetchPolicy,\n      notifyOnNetworkStatusChange: this.options.notifyOnNetworkStatusChange,\n      partialRefetch: this.options.partialRefetch,\n      pollInterval: this.options.pollInterval,\n      returnPartialData: this.options.returnPartialData,\n      nextFetchPolicy: this.options.nextFetchPolicy,\n      ...params,\n    }) as ObservableQuery<Data<D>, Variables<D, V>>;\n  }\n\n  private nextData(result: ApolloQueryResult<Data<D>>): void {\n    this.emitter.dispatchEvent(new CustomEvent('apollo-query-result', { detail: result }));\n    this.data = result.data;\n    this.error = result.error ?? null;/* c8 ignore next */\n    this.errors = result.errors ?? [];\n    this.loading = result.loading ?? false;/* c8 ignore next */\n    this.networkStatus = result.networkStatus;\n    this.partial = result.partial ?? false;\n    this.options.onData?.(result.data);/* c8 ignore next */\n    this.notify('data', 'error', 'errors', 'loading', 'networkStatus', 'partial');\n  }\n\n  private nextError(error: ApolloError): void {\n    this.emitter.dispatchEvent(new CustomEvent('apollo-error', { detail: error }));\n    this.error = error;\n    this.loading = false;\n    this.options.onError?.(error);/* c8 ignore next */\n    this.notify('error', 'loading');\n  }\n\n  protected override clientChanged(): void {\n    if (this.canSubscribe() && this.shouldSubscribe())/* c8 ignore next */\n      this.subscribe();/* c8 ignore next */\n  }\n\n  protected override documentChanged(doc?: ComponentDocument<D> | null): void {\n    const query = doc ?? undefined;/* c8 ignore next */\n    if (doc === this.#lastQueryDocument)\n      return;/* c8 ignore next */\n    if (this.canSubscribe({ query }) && this.shouldSubscribe({ query }))/* c8 ignore next */\n      this.subscribe({ query }); /* c8 ignore next */ // covered\n  }\n\n  protected override variablesChanged(variables?: Variables<D, V>): void {\n    if (this.observableQuery)\n      this.refetch(variables);/* c8 ignore next */\n    else if (this.canSubscribe({ variables }) && this.shouldSubscribe({ variables }))/* c8 ignore next */\n      this.subscribe({ variables });/* c8 ignore next */\n  }\n\n  /**\n   * Exposes the [`ObservableQuery#refetch`](https://www.apollographql.com/docs/react/api/apollo-client.html#ObservableQuery.refetch) method.\n   *\n   * @param variables The new set of variables. If there are missing variables, the previous values of those variables will be used.\n   */\n  @bound public async refetch(variables?: Variables<D, V>): Promise<ApolloQueryResult<Data<D>>> {\n    if (!this.observableQuery)\n      throw new Error('Cannot refetch without an ObservableQuery'); /* c8 ignore next */ // covered\n    return this.observableQuery.refetch(variables as Variables<D, V>);\n  }\n\n  /**\n   * Resets the observableQuery and subscribes.\n   * @param params options for controlling how the subscription subscribes\n   */\n  @bound public subscribe(\n    params?: Partial<WatchQueryOptions<Variables<D, V>, Data<D>>>\n  ): ZenObservable.Subscription {\n    if (this.observableQuery)\n      this.observableQuery.stopPolling(); /* c8 ignore next */ // covered\n\n    this.observableQuery = this.watchQuery({\n      // It's better to let Apollo client throw this error\n      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n      query: this.query!,\n      variables: this.variables ?? undefined,\n      context: this.options.context,\n      errorPolicy: this.options.errorPolicy,\n      fetchPolicy: this.options.fetchPolicy,\n      pollInterval: this.options.pollInterval,\n      notifyOnNetworkStatusChange: this.options.notifyOnNetworkStatusChange,\n      returnPartialData: this.options.returnPartialData,\n      partialRefetch: this.options.partialRefetch,\n      ...params,\n    });\n\n    this.#lastQueryDocument = params?.query ?? this.query ?? undefined;/* c8 ignore next */\n\n    this.loading = true;\n    this.notify('loading');\n\n    return this.observableQuery?.subscribe({\n      next: this.nextData.bind(this),\n      error: this.nextError.bind(this),\n    });\n  }\n\n  /**\n   * Lets you pass a GraphQL subscription and updateQuery function\n   * to subscribe to more updates for your query.\n   *\n   * The `updateQuery` parameter is a function that takes the previous query data,\n   * then a `{ subscriptionData: TSubscriptionResult }` object,\n   * and returns an object with updated query data based on the new results.\n   */\n  @bound public subscribeToMore<TSubscriptionVariables, TSubscriptionData>(\n    options: SubscribeToMoreOptions<Data<D>, TSubscriptionVariables, TSubscriptionData>\n  ): (() => void) | void {\n    return this.observableQuery?.subscribeToMore(options);\n  }\n\n  /**\n   * @summary Executes a Query once and updates the with the result\n   */\n  @bound public async executeQuery(\n    params?: Partial<QueryOptions<Variables<D, V>, Data<D>>>\n  ): Promise<ApolloQueryResult<Data<D>>> {\n    try {\n      if (!this.client)\n        throw new TypeError('No Apollo client. See https://apolloelements.dev/guides/getting-started/apollo-client/'); /* c8 ignore next */ // covered\n\n      this.loading = true;\n      this.notify('loading');\n\n      const result = await this.client.query<Data<D>, Variables<D, V>>({\n        // It's better to let Apollo client throw this error, if needs be\n        // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n        query: this.query!, variables: this.variables!,\n        context: this.options.context,\n        errorPolicy: this.options.errorPolicy,\n        fetchPolicy:\n            this.options.fetchPolicy === 'cache-and-network' ? undefined/* c8 ignore next */\n          : this.options.fetchPolicy,\n        notifyOnNetworkStatusChange: this.options.notifyOnNetworkStatusChange,\n        partialRefetch: this.options.partialRefetch,\n        returnPartialData: this.options.returnPartialData,\n        ...params,\n      });\n      if (result) // NB: not sure why, but sometimes this returns undefined\n        this.nextData(result);\n      return result;/* c8 ignore next */\n    } catch (error) {\n      this.nextError(error);\n      throw error;\n    }\n  }\n\n  /**\n   * Exposes the `ObservableQuery#fetchMore` method.\n   * https://www.apollographql.com/docs/react/api/core/ObservableQuery/#ObservableQuery.fetchMore\n   *\n   * The optional `updateQuery` parameter is a function that takes the previous query data,\n   * then a `{ subscriptionData: TSubscriptionResult }` object,\n   * and returns an object with updated query data based on the new results.\n   *\n   * The optional `variables` parameter is an optional new variables object.\n   */\n  @bound public async fetchMore(\n    params?: Partial<FetchMoreParams<D, V>>\n  ): Promise<ApolloQueryResult<Data<D>>> {\n    this.loading = true;\n    this.notify('loading');\n\n    const options = {\n      // It's better to let Apollo client throw this error\n      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n      query: this.query!,\n      context: this.options.context,\n      variables: this.variables,\n      ...params,\n    };\n\n    return (\n      this.observableQuery ??= this.watchQuery(\n        options as WatchQueryOptions<Variables<D, V>, Data<D>>\n      )\n    ).fetchMore({\n      ...options,\n      variables: (options.variables as Variables<D, V>) ?? undefined, /* c8 ignore next */\n    }).then(x => {\n      this.loading = false;\n      this.notify('loading');\n      return x;\n    });\n  }\n\n  /**\n   * @summary Start polling this query\n   * @param ms milliseconds to wait between fetches\n   */\n  @bound public startPolling(ms: number): void {\n    this.pollingInterval = window.setInterval(() => {\n      this.refetch();\n    }, ms);\n  }\n\n  /**\n   * @summary Stop polling this query\n   */\n  @bound public stopPolling(): void {\n    clearInterval(this.pollingInterval);\n  }\n}\n", "import type * as C from '@apollo/client/core';\n\nimport type {\n  ComponentDocument,\n  Data,\n  FetchMoreParams,\n  MaybeTDN,\n  MaybeVariables,\n  Variables,\n} from '@apollo-elements/core/types';\n\nimport {\n  ApolloQueryController,\n  ApolloQueryControllerOptions,\n} from '@apollo-elements/core/apollo-query-controller';\n\nimport { controlled } from '@apollo-elements/core/decorators';\n\nimport { NetworkStatus } from '@apollo/client/core';\n\nimport { property, state } from 'lit/decorators.js';\n\nimport { ApolloElement } from './apollo-element.js';\n\n/**\n * `ApolloQuery`\n *\n * \uD83D\uDE80 Custom element base class that connects to your Apollo cache.\n *\n * See [`ApolloQueryInterface`](https://apolloelements.dev/api/core/interfaces/query) for more information on events\n *\n */\nexport class ApolloQuery<\n  D extends MaybeTDN = MaybeTDN,\n  V = MaybeVariables<D>\n> extends ApolloElement<D, V> {\n  /**\n   * Latest query data.\n   */\n  declare data: Data<D> | null;\n\n  /**\n   * An object that maps from the name of a variable as used in the query GraphQL document to that variable's value.\n   *\n   * @summary Query variables.\n   */\n  declare variables: Variables<D, V> | null;\n\n  controller: ApolloQueryController<D, V> = new ApolloQueryController<D, V>(this, null, {\n    shouldSubscribe: options => this.readyToReceiveDocument && this.shouldSubscribe(options),\n    onData: data => this.onData?.(data),\n    onError: error => this.onError?.(error), /* c8 ignore next */ // covered\n  });\n\n  /**\n   * Determines whether the element should attempt to subscribe i.e. begin querying\n   * Override to prevent subscribing unless your conditions are met\n   * @override\n   */\n  shouldSubscribe(\n    options?: Partial<C.SubscriptionOptions<Variables<D, V>, Data<D>>>\n  ): boolean {\n    return (void options, true);\n  }\n\n  /** @summary Flags an element that's ready and able to auto subscribe */\n  @controlled({ readonly: true }) @state() canAutoSubscribe = false;\n\n  get options(): ApolloQueryControllerOptions<D, V> {\n    return this.controller.options;\n  }\n\n  set options(v: ApolloQueryControllerOptions<D, V>) {\n    const { onData, onError, shouldSubscribe } = this.controller.options;\n    this.controller.options = {\n      onData, onError, shouldSubscribe, ...v,\n    };\n  }\n\n  /**\n   * `networkStatus` is useful if you want to display a different loading indicator (or no indicator at all)\n   * depending on your network status as it provides a more detailed view into the state of a network request\n   * on your component than `loading` does. `networkStatus` is an enum with different number values between 1 and 8.\n   * These number values each represent a different network state.\n   *\n   * 1. `loading`: The query has never been run before and the request is now pending. A query will still have this network status even if a result was returned from the cache, but a query was dispatched anyway.\n   * 2. `setVariables`: If a query\u2019s variables change and a network request was fired then the network status will be setVariables until the result of that query comes back. React users will see this when options.variables changes on their queries.\n   * 3. `fetchMore`: Indicates that fetchMore was called on this query and that the network request created is currently in flight.\n   * 4. `refetch`: It means that refetch was called on a query and the refetch request is currently in flight.\n   * 5. Unused.\n   * 6. `poll`: Indicates that a polling query is currently in flight. So for example if you are polling a query every 10 seconds then the network status will switch to poll every 10 seconds whenever a poll request has been sent but not resolved.\n   * 7. `ready`: No request is in flight for this query, and no errors happened. Everything is OK.\n   * 8. `error`: No request is in flight for this query, but one or more errors were detected.\n   *\n   * If the network status is less then 7 then it is equivalent to `loading` being true. In fact you could\n   * replace all of your `loading` checks with `networkStatus < 7` and you would not see a difference.\n   * It is recommended that you use `loading`, however.\n   */\n  @controlled() @state() networkStatus = NetworkStatus.ready;\n\n  /**\n   * @summary A GraphQL document containing a single query.\n   */\n  @controlled() @state() query: null | ComponentDocument<D> = null;\n\n  /** @summary Context passed to the link execution chain. */\n  @controlled({ path: 'options' }) @state() context?: Record<string, any>;\n\n  /**\n   * If data was read from the cache with missing fields,\n   * partial will be true. Otherwise, partial will be falsy.\n   *\n   * @summary True when the query returned partial data.\n   */\n  @controlled() @state() partial = false;\n\n  /**\n   * If true, perform a query refetch if the query result is marked as being partial,\n   * and the returned data is reset to an empty Object by the Apollo Client QueryManager\n   * (due to a cache miss).\n   *\n   * The default value is false for backwards-compatibility's sake,\n   * but should be changed to true for most use-cases.\n   *\n   * @summary Set to retry any partial query results.\n   */\n  @controlled({ path: 'options' })\n  @property({ type: Boolean, attribute: 'partial-refetch' })\n  partialRefetch?: boolean;\n\n  /**\n   * @summary The time interval (in milliseconds) on which this query should be refetched from the server.\n   */\n  @controlled({ path: 'options' })\n  @property({ type: Number, attribute: 'poll-interval' })\n  pollInterval?: number;\n\n  /**\n   * Opt into receiving partial results from the cache for queries\n   * that are not fully satisfied by the cache.\n   */\n  @controlled({ path: 'options' })\n  @property({ type: Boolean, attribute: 'return-partial-data' })\n  returnPartialData?: boolean;\n\n  /**\n   * When true, the component will not automatically subscribe to new data.\n   * Call the `subscribe()` method to do so.\n   * @attr no-auto-subscribe\n   */\n  @controlled({ path: 'options' })\n  @property({ type: Boolean, attribute: 'no-auto-subscribe', reflect: true })\n  noAutoSubscribe = false;\n\n  /**\n   * @summary Whether or not updates to the network status should trigger next on the observer of this query.\n   */\n  @controlled({ path: 'options' })\n  @property({ type: Boolean, attribute: 'notify-on-network-status-change' })\n  notifyOnNetworkStatusChange?: boolean;\n\n  /**\n   * errorPolicy determines the level of events for errors in the execution result. The options are:\n   * - `none` (default): any errors from the request are treated like runtime errors and the observable is stopped (XXX this is default to lower breaking changes going from AC 1.0 => 2.0)\n   * - `ignore`: errors from the request do not stop the observable, but also don't call `next`\n   * - `all`: errors are treated like data and will notify observables\n   * @summary [Error Policy](https://www.apollographql.com/docs/react/api/core/ApolloClient/#ErrorPolicy) for the query.\n   * @attr error-policy\n   */\n  @controlled({ path: 'options' })\n  @property({ attribute: 'error-policy' })\n  errorPolicy?: this['controller']['options']['errorPolicy'];\n\n  /**\n   * Determines where the client may return a result from. The options are:\n   *\n   * - `cache-first` (default): return result from cache, fetch from network if cached result is not available.\n   * - `cache-and-network`: return result from cache first (if it exists), then return network result once it's available.\n   * - `cache-only`: return result from cache if available, fail otherwise.\n   * - `no-cache`: return result from network, fail if network call doesn't succeed, don't save to cache\n   * - `network-only`: return result from network, fail if network call doesn't succeed, save to cache\n   * - `standby`: only for queries that aren't actively watched, but should be available for refetch and updateQueries.\n   *\n   * @summary The [fetchPolicy](https://www.apollographql.com/docs/react/api/core/ApolloClient/#FetchPolicy) for the query.\n   * @attr fetch-policy\n   */\n  @controlled({ path: 'options' })\n  @property({ attribute: 'fetch-policy' })\n  fetchPolicy?: this['controller']['options']['fetchPolicy'];\n\n  /**\n   * When someone chooses cache-and-network or network-only as their\n   * initial FetchPolicy, they often do not want future cache updates to\n   * trigger unconditional network requests, which is what repeatedly\n   * applying the cache-and-network or network-only policies would seem\n   * to imply. Instead, when the cache reports an update after the\n   * initial network request, it may be desirable for subsequent network\n   * requests to be triggered only if the cache result is incomplete.\n   * The nextFetchPolicy option provides a way to update\n   * options.fetchPolicy after the intial network request, without\n   * having to set options.\n   *\n   * @summary Set to prevent subsequent network requests when the fetch policy is `cache-and-network` or `network-only`.\n   * @attr next-fetch-policy\n   */\n  @controlled({ path: 'options' })\n  @property({ attribute: 'next-fetch-policy' })\n  nextFetchPolicy?: this['controller']['options']['nextFetchPolicy'];\n\n  /**\n   * Exposes the [`ObservableQuery#refetch`](https://www.apollographql.com/docs/react/api/apollo-client.html#ObservableQuery.refetch) method.\n   *\n   * @param variables The new set of variables. If there are missing variables, the previous values of those variables will be used..\n   */\n  public async refetch(\n    variables?: Variables<D, V>\n  ): Promise<C.ApolloQueryResult<Data<D>>> {\n    return this.controller.refetch(variables);\n  }\n\n  /**\n   * Resets the observableQuery and subscribes.\n   * @param params options for controlling how the subscription subscribes\n   */\n  public subscribe(\n    params?: Partial<C.WatchQueryOptions<Variables<D, V>, Data<D>>>\n  ): ZenObservable.Subscription {\n    return this.controller.subscribe(params);\n  }\n\n  /**\n   * Lets you pass a GraphQL subscription and updateQuery function\n   * to subscribe to more updates for your query.\n   *\n   * The `updateQuery` parameter is a function that takes the previous query data,\n   * then a `{ subscriptionData: TSubscriptionResult }` object,\n   * and returns an object with updated query data based on the new results.\n   */\n  public subscribeToMore<TSubscriptionVariables, TSubscriptionData>(\n    options: C.SubscribeToMoreOptions<Data<D>, TSubscriptionVariables, TSubscriptionData>\n  ): (() => void) | void {\n    return this.controller.subscribeToMore(options);\n  }\n\n  /**\n   * Executes a Query once and updates the with the result\n   */\n  public async executeQuery(\n    params?: Partial<C.QueryOptions<Variables<D, V>, Data<D>>>\n  ): Promise<C.ApolloQueryResult<Data<D>>> {\n    return this.controller.executeQuery(params);\n  }\n\n  /**\n   * Exposes the `ObservableQuery#fetchMore` method.\n   * https://www.apollographql.com/docs/react/api/core/ObservableQuery/#ObservableQuery.fetchMore\n   *\n   * The optional `updateQuery` parameter is a function that takes the previous query data,\n   * then a `{ subscriptionData: TSubscriptionResult }` object,\n   * and returns an object with updated query data based on the new results.\n   *\n   * The optional `variables` parameter is an optional new variables object.\n   */\n  public async fetchMore(\n    params?: Partial<FetchMoreParams<D, V>>\n  ): Promise<C.ApolloQueryResult<Data<D>>> {\n    return this.controller.fetchMore(params);\n  }\n\n  public startPolling(ms: number): void {\n    return this.controller.startPolling(ms);\n  }\n\n  public stopPolling(): void {\n    return this.controller.stopPolling();\n  }\n\n  /**\n   * Optional callback for when a query is completed.\n   */\n  onData?(data: Data<D>): void\n\n  /**\n   * Optional callback for when an error occurs.\n   */\n  onError?(error: Error): void\n}\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\nimport type {\n  ComponentDocument,\n  Data,\n  MaybeTDN,\n  MaybeVariables,\n  OptimisticResponseType,\n  RefetchQueriesType,\n  Variables,\n} from '@apollo-elements/core/types';\n\nimport type {\n  ApolloError,\n  ErrorPolicy,\n  FetchPolicy,\n  FetchResult,\n  MutationOptions,\n  MutationUpdaterFn,\n} from '@apollo/client/core';\n\nimport { ApolloController, ApolloControllerOptions } from './apollo-controller.js';\n\nimport { bound } from './lib/bound.js';\n\nexport interface ApolloMutationControllerOptions<D, V> extends ApolloControllerOptions<D, V> {\n  /**\n   * An object that maps from the name of a variable as used in the mutation GraphQL document to that variable's value.\n   *\n   * @summary Mutation variables.\n   */\n  variables?: Variables<D, V>,\n  refetchQueries?: RefetchQueriesType<D> | null,\n  context?: Record<string, unknown>,\n  optimisticResponse?: OptimisticResponseType<D, V>,\n  errorPolicy?: ErrorPolicy;\n  fetchPolicy?: Extract<FetchPolicy, 'no-cache'>,\n  awaitRefetchQueries?: boolean,\n  onCompleted?(data: Data<D>|null): void,\n  onError?(error: Error): void,\n  update?(\n    ...p: Parameters<MutationUpdaterFn<Data<D>>>\n  ): ReturnType<MutationUpdaterFn<Data<D>>>,\n  ignoreResults?: boolean,\n}\n\nexport class ApolloMutationController<D extends MaybeTDN = MaybeTDN, V = MaybeVariables<D>>\n  extends ApolloController<D, V> implements ReactiveController {\n  /**\n   * The ID number of the most recent mutation since the element was instantiated.\n   */\n  private mostRecentMutationId = 0;\n\n  // @ts-expect-error: https://github.com/microsoft/TypeScript/issues/40220\n  declare options: ApolloMutationControllerOptions<D, V>;\n\n  called = false;\n\n  get mutation(): ComponentDocument<D> | null { return this.document; }\n\n  set mutation(document: ComponentDocument<D> | null) { this.document = document; }\n\n  constructor(\n    host: ReactiveControllerHost,\n    mutation?: ComponentDocument<D> | null,\n    options?: ApolloMutationControllerOptions<D, V>\n  ) {\n    super(host, options);\n    this.init(mutation ?? null);/* c8 ignore next */\n  }\n\n  /**\n   * @summary Fires a mutation\n   * This resolves a single mutation according to the options specified and returns a Promise which is either resolved with the resulting data or rejected with an error.\n   */\n  @bound public async mutate(\n    params?: Partial<MutationOptions<Data<D>, Variables<D, V>>>\n  ): Promise<FetchResult<Data<D>>> {\n    if (!this.client)\n      throw new TypeError('No Apollo client. See https://apolloelements.dev/guides/getting-started/apollo-client/'); /* c8 ignore next */ // covered\n    const mutationId = this.generateMutationId();\n\n    this.loading = true;\n    this.called = true;\n    this.error = null;\n    this.errors = [];\n    this.data = null;\n    this.notify('called', 'data', 'error', 'errors', 'loading');\n\n    return this.client.mutate<Data<D>, Variables<D, V>>({\n      // It's better to let Apollo client throw this error\n      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n      mutation: this.mutation!,\n\n      awaitRefetchQueries: this.options.awaitRefetchQueries,\n      context: this.options.context,\n      errorPolicy: this.options.errorPolicy,\n      fetchPolicy: this.options.fetchPolicy,\n      optimisticResponse: this.options.optimisticResponse,\n      refetchQueries: this.options.refetchQueries ?? undefined,\n      update: this.options.update,\n      variables: this.variables ?? undefined,\n      ...params,\n    })\n      .then(this.onCompletedMutation.bind(this, mutationId))\n      .catch(this.onMutationError.bind(this, mutationId));\n  }\n\n  /**\n   * Increments and returns the most recent mutation id.\n   */\n  private generateMutationId(): number {\n    this.mostRecentMutationId += 1;\n    return this.mostRecentMutationId;\n  }\n\n  /**\n   * Returns true when an ID matches the most recent mutation id.\n   */\n  private isMostRecentMutation(mutationId: number): boolean {\n    return this.mostRecentMutationId === mutationId;\n  }\n\n  /**\n   * Callback for when a mutation is completed.\n   */\n  private onCompletedMutation(\n    mutationId: number,\n    response: FetchResult<Data<D>>\n  ): FetchResult<Data<D>> {\n    const { data } = response;\n    this.emitter.dispatchEvent(new CustomEvent('apollo-mutation-result', { detail: response }));\n    if (this.isMostRecentMutation(mutationId)) {\n      this.loading = false;\n      if (!this.options.ignoreResults) {\n        this.error = null;\n        this.data = data ?? null;/* c8 ignore next */\n        this.errors = response.errors ?? [];\n        this.options.onCompleted?.(this.data); /* c8 ignore next */\n      }\n      this.notify('data', 'error', 'errors', 'loading');\n    }\n    return response;\n  }\n\n  /**\n   * Callback for when a mutation fails.\n   */\n  private onMutationError(mutationId: number, error: ApolloError): never {\n    this.emitter.dispatchEvent(new CustomEvent('apollo-error', { detail: error }));\n    if (this.isMostRecentMutation(mutationId)) {\n      this.loading = false;\n      this.data = null;\n      this.error = error;\n    }\n    this.options.onError?.(error);\n    this.notify('data', 'error', 'loading');\n    throw error;\n  }\n}\n", "import type * as C from '@apollo/client/core';\n\nimport type {\n  Data,\n  Variables,\n  MaybeTDN,\n  MaybeVariables,\n  ComponentDocument,\n  OptimisticResponseType,\n  RefetchQueriesType,\n} from '@apollo-elements/core/types';\n\nimport { controlled } from '@apollo-elements/core/decorators';\n\nimport { property, state } from 'lit/decorators.js';\n\nimport { ApolloMutationController } from '@apollo-elements/core/apollo-mutation-controller';\n\nimport { ApolloElement } from './apollo-element.js';\n\ntype P<D extends MaybeTDN, V, K extends keyof ApolloMutationController<D, V>> =\n  ApolloMutationController<D, V>[K] extends (...args:any[]) => unknown\n  ? Parameters<ApolloMutationController<D, V>[K]>\n  : never\n\ntype R<D extends MaybeTDN, V, K extends keyof ApolloMutationController<D, V>> =\n  ApolloMutationController<D, V>[K] extends (...args:any[]) => unknown\n  ? ReturnType<ApolloMutationController<D, V>[K]>\n  : never\n\n/**\n * `ApolloMutation`\n *\n * \uD83D\uDC69\u200D\uD83D\uDE80 Custom element base class to issue mutations via your Apollo cache.\n *\n * See [`ApolloMutationInterface`](https://apolloelements.dev/api/core/interfaces/mutation) for more information on events\n *\n */\nexport class ApolloMutation<D extends MaybeTDN = MaybeTDN, V = MaybeVariables<D>>\n  extends ApolloElement<D, V> {\n  /**\n   * Latest mutation data.\n   */\n  declare data: Data<D> | null;\n\n  /**\n   * An object that maps from the name of a variable as used in the mutation GraphQL document to that variable's value.\n   *\n   * @summary Mutation variables.\n   */\n  declare variables: Variables<D, V> | null;\n\n  controller = new ApolloMutationController<D, V>(this, null, {\n    onCompleted: data => this.onCompleted?.(data),\n    onError: error => this.onError?.(error),\n  });\n\n  /**\n   * @summary Whether the mutation was called\n   */\n  @controlled() @property({ type: Boolean, reflect: true }) called = false;\n\n  /** @summary The mutation. */\n  @controlled() @state() mutation: ComponentDocument<D> | null = null;\n\n  /** @summary Context passed to the link execution chain. */\n  @controlled({ path: 'options' }) @state() context?: Record<string, unknown>;\n\n  /**\n   * An object that represents the result of this mutation that\n   * will be optimistically stored before the server has actually returned a\n   * result.\n   *\n   * This is most often used for optimistic UI, where we want to be able to see\n   * the result of a mutation immediately, and update the UI later if any errors\n   * appear.\n   */\n  @controlled({ path: 'options' }) @state() optimisticResponse?: OptimisticResponseType<D, V>;\n\n  /**\n   * @summary If true, the returned data property will not update with the mutation result.\n   */\n  @controlled({ path: 'options' })\n  @property({ attribute: 'ignore-results', type: Boolean })\n  ignoreResults = false;\n\n  /**\n   * Queries refetched as part of refetchQueries are handled asynchronously,\n   * and are not waited on before the mutation is completed (resolved).\n   * Setting this to true will make sure refetched queries are completed\n   * before the mutation is considered done. false by default.\n   * @attr await-refetch-queries\n   */\n  @controlled({ path: 'options' })\n  @property({ attribute: 'await-refetch-queries', type: Boolean })\n  awaitRefetchQueries?: boolean;\n\n  /**\n   * Specifies the ErrorPolicy to be used for this mutation.\n   * @attr error-policy\n   */\n  @controlled({ path: 'options' })\n  @property({ attribute: 'error-policy' })\n  errorPolicy?: this['controller']['options']['errorPolicy'];\n\n  /**\n   * Specifies the FetchPolicy to be used for this mutation.\n   * @attr fetch-policy\n   */\n  @controlled({ path: 'options' })\n  @property({ attribute: 'fetch-policy' })\n  fetchPolicy?: this['controller']['options']['fetchPolicy'];\n\n  /**\n   * A list of query names which will be refetched once this mutation has returned.\n   * This is often used if you have a set of queries which may be affected by a mutation and will have to update.\n   * Rather than writing a mutation query reducer (i.e. `updateQueries`) for this,\n   * you can refetch the queries that will be affected\n   * and achieve a consistent store once these queries return.\n   * @attr refetch-queries\n   */\n  @controlled({ path: 'options' })\n  @property({\n    attribute: 'refetch-queries',\n    converter: {\n      fromAttribute(newVal) {\n        return !newVal ? null : newVal\n          .split(',')\n          .map(x => x.trim());\n      },\n    },\n  }) refetchQueries: RefetchQueriesType<D> | null = null;\n\n  /**\n   * A function which updates the apollo cache when the query responds.\n   * This function will be called twice over the lifecycle of a mutation.\n   * Once at the very beginning if an optimisticResponse was provided.\n   * The writes created from the optimistic data will be rolled back before\n   * the second time this function is called which is when the mutation has\n   * succesfully resolved. At that point update will be called with the actual\n   * mutation result and those writes will not be rolled back.\n   *\n   * The reason a DataProxy is provided instead of the user calling the methods\n   * directly on ApolloClient is that all of the writes are batched together at\n   * the end of the update, and it allows for writes generated by optimistic\n   * data to be rolled back.\n   */\n  public updater?(\n    ...params: Parameters<C.MutationUpdaterFn<Data<D>>>\n  ): ReturnType<C.MutationUpdaterFn<Data<D>>>;\n\n  public mutate(params?: P<D, V, 'mutate'>[0]): R<D, V, 'mutate'> {\n    return this.controller.mutate({\n      ...params,\n      update: params?.update ?? this.updater,\n    });\n  }\n\n  /**\n   * Callback for when a mutation is completed.\n   */\n  onCompleted?(data: Data<D>|null): void\n\n  /**\n   * Callback for when an error occurs in mutation.\n   */\n  onError?(error: Error): void\n}\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\nimport type {\n  ComponentDocument,\n  Data,\n  MaybeTDN,\n  MaybeVariables,\n  SubscriptionDataOptions,\n  Variables,\n} from '@apollo-elements/core/types';\n\nimport type {\n  ApolloClient,\n  ApolloError,\n  DocumentNode,\n  FetchPolicy,\n  FetchResult,\n  NormalizedCacheObject,\n  Observable,\n  SubscriptionOptions,\n  WatchQueryOptions,\n} from '@apollo/client/core';\n\nimport { ApolloController, ApolloControllerOptions } from './apollo-controller.js';\n\nimport { bound } from './lib/bound.js';\n\nexport interface ApolloSubscriptionControllerOptions<D, V> extends ApolloControllerOptions<D, V>,\n          Partial<WatchQueryOptions<Variables<D, V>, Data<D>>> {\n  variables?: Variables<D, V>,\n  fetchPolicy?: FetchPolicy;\n  noAutoSubscribe?: boolean;\n  shouldSubscribe?: (options?: Partial<SubscriptionOptions<Variables<D, V>, Data<D>>>) => boolean;\n  shouldResubscribe?: boolean;\n  skip?: boolean;\n  onData?: (detail: {\n    client: ApolloClient<NormalizedCacheObject>;\n    subscriptionData: { data: Data<D> | null; loading: boolean; error: null; };\n  }) => void;\n  onComplete?: () => void;\n  onError?: (error: ApolloError) => void;\n}\n\nexport class ApolloSubscriptionController<D extends MaybeTDN = MaybeTDN, V = MaybeVariables<D>>\n  extends ApolloController<D, V>\n  implements ReactiveController {\n  private observable?: Observable<FetchResult<Data<D>>>;\n\n  private observableSubscription?: ZenObservable.Subscription;\n\n  // @ts-expect-error: https://github.com/microsoft/TypeScript/issues/40220\n  declare options: ApolloSubscriptionControllerOptions<D, V>;\n\n  #hasDisconnected = false;\n\n  #lastSubscriptionDocument?: DocumentNode;\n\n  get subscription(): ComponentDocument<D> | null { return this.document; }\n\n  set subscription(document: ComponentDocument<D> | null) { this.document = document; }\n\n  /** Flags an element that's ready and able to auto-subscribe */\n  public get canAutoSubscribe(): boolean {\n    return (\n      !!this.client &&\n      !this.options.noAutoSubscribe &&\n      this.shouldSubscribe()\n    );\n  }\n\n  constructor(\n    host: ReactiveControllerHost,\n    subscription?: ComponentDocument<D> | null,\n    options?: ApolloSubscriptionControllerOptions<D, V>\n  ) {\n    super(host, options);\n    this.init(subscription ?? null);/* c8 ignore next */\n  }\n\n  override hostConnected(): void {\n    super.hostConnected();\n    /* c8 ignore start */ // covered\n    if (this.#hasDisconnected && this.observableSubscription)\n      this.subscribe(); /* c8 ignore stop */\n    else\n      this.documentChanged(this.subscription);\n  }\n\n  override hostDisconnected(): void {\n    this.endSubscription();\n    this.#hasDisconnected = true;\n    super.hostDisconnected();\n  }\n\n  /**\n   * Determines whether the element is able to automatically subscribe\n   */\n  private canSubscribe(\n    options?: Partial<SubscriptionOptions<Variables<D, V> | null, Data<D>>>\n  ): boolean {\n    /* c8 ignore next 4 */\n    return (\n      !this.options.noAutoSubscribe &&\n      !!this.client &&\n      (!this.observable || !!this.options.shouldResubscribe) &&\n      !!(options?.query ?? this.subscription)\n    );\n  }\n\n  private initObservable(params?: Partial<SubscriptionDataOptions<D, V>>): void {\n    const {\n      shouldResubscribe = this.options.shouldResubscribe,\n      client = this.client,\n      skip = this.options.skip,\n      ...rest\n    } = params ?? {}; /* c8 ignore start */ // covered\n\n    if (!client) /* c8 ignore start */ // covered\n      throw new TypeError('No Apollo client. See https://apolloelements.dev/guides/getting-started/apollo-client/');\n\n\n    if ((this.observable && !shouldResubscribe) || skip)\n      return; /* c8 ignore stop */\n\n    const query = params?.subscription ?? this.subscription as DocumentNode; /* c8 ignore next */\n    this.#lastSubscriptionDocument = query;\n    this.observable = client.subscribe({\n      // It's better to let Apollo client throw this error\n      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n      variables: this.variables,\n      context: this.options.context,\n      errorPolicy: this.options.errorPolicy,\n      fetchPolicy: this.options.fetchPolicy,\n      ...rest,\n      query,\n    });\n  }\n\n  /**\n   * Sets `data`, `loading`, and `error` on the instance when new subscription results arrive.\n   */\n  private nextData(result: FetchResult<Data<D>>) {\n    const { data = null, errors } = result;\n    // If we got to this line without a client, it's because of user error\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n    const client = this.client!;\n    const loading = false;\n    const subscriptionData = { data, loading, error: null };\n    const detail = { client, subscriptionData };\n    this.emitter.dispatchEvent(new CustomEvent('apollo-subscription-result', { detail }));\n    this.data = data;\n    this.error = null;\n    this.errors = errors ?? [];\n    this.loading = loading;\n    this.options.onData?.(detail); /* c8 ignore next */ // covered\n    this.notify('data', 'error', 'errors', 'loading');\n  }\n\n  /**\n   * Sets `error` and `loading` on the instance when the subscription errors.\n   */\n  private nextError(error: ApolloError) {\n    this.emitter.dispatchEvent(new CustomEvent('apollo-error', { detail: error }));\n    this.error = error;\n    this.loading = false;\n    this.options.onError?.(error); /* c8 ignore next */ // covered\n    this.notify('error', 'loading');\n  }\n\n  /**\n   * Shuts down the subscription\n   */\n  private onComplete(): void {\n    this.options.onComplete?.(); /* c8 ignore next */ // covered\n    this.endSubscription();\n    this.notify();\n  }\n\n  private endSubscription() {\n    if (this.observableSubscription)\n      this.observableSubscription.unsubscribe();\n  }\n\n  private shouldSubscribe(opts?: Partial<SubscriptionOptions<Variables<D, V>, Data<D>>>): boolean {\n    return this.options.shouldSubscribe?.(opts) ?? true; /* c8 ignore next */\n  }\n\n  protected override clientChanged(): void {\n    if (this.canSubscribe() && this.shouldSubscribe())/* c8 ignore next */\n      this.subscribe();/* c8 ignore next */\n  }\n\n  protected override documentChanged(doc?: ComponentDocument<D> | null): void {\n    const query = doc ?? undefined;/* c8 ignore next */\n    if (doc === this.#lastSubscriptionDocument)\n      return;/* c8 ignore next */\n    this.cancel();\n    if (this.canSubscribe({ query }) && this.shouldSubscribe({ query })) /* c8 ignore next */\n      this.subscribe();/* c8 ignore next */\n  }\n\n  protected override variablesChanged(variables?: Variables<D, V>): void {\n    this.cancel();\n    if (this.canSubscribe({ variables }) && this.shouldSubscribe({ variables }))/* c8 ignore next */\n      this.subscribe();/* c8 ignore next */\n  }\n\n  /**\n   * @summary Starts the subscription\n   */\n  @bound public subscribe(params?: Partial<SubscriptionDataOptions<D, V>>): void {\n    this.initObservable(params);\n\n    /* c8 ignore start */ // covered\n    const shouldResubscribe = params?.shouldResubscribe ?? this.options.shouldResubscribe;\n    if (this.observableSubscription && !shouldResubscribe) return;\n    /* c8 ignore stop */\n\n    this.loading = true;\n    this.notify('loading');\n\n    this.observableSubscription =\n      this.observable?.subscribe({\n        next: this.nextData.bind(this),\n        error: this.nextError.bind(this),\n        complete: this.onComplete.bind(this),\n      });\n  }\n\n  /**\n   * @summary Ends the subscription\n   */\n  @bound public cancel(): void {\n    this.endSubscription();\n    this.observableSubscription = undefined;\n    this.observable = undefined;\n  }\n}\n", "import type {\n  ComponentDocument,\n  Data,\n  MaybeTDN,\n  MaybeVariables,\n  OnSubscriptionDataParams,\n  Variables,\n} from '@apollo-elements/core/types';\n\nimport type * as C from '@apollo/client/core';\n\nimport { ApolloElement } from './apollo-element.js';\n\nimport { ApolloSubscriptionController } from '@apollo-elements/core/apollo-subscription-controller';\n\nimport { controlled } from '@apollo-elements/core/decorators';\n\nimport { state, property } from '@lit/reactive-element/decorators.js';\n\n/**\n * `ApolloSubscription`\n *\n * \uD83D\uDE80 Custom element base class that updates with an Apollo GraphQL subscription.\n *\n * See [`ApolloSubscriptionInterface`](https://apolloelements.dev/api/core/interfaces/subscription) for more information on events\n *\n */\nexport class ApolloSubscription<\n  D extends MaybeTDN = MaybeTDN,\n  V = MaybeVariables<D>\n> extends ApolloElement<D, V> {\n  static readonly is = 'apollo-subscription';\n\n  controller = new ApolloSubscriptionController<D, V>(this, null, {\n    shouldSubscribe: x => this.readyToReceiveDocument && this.shouldSubscribe(x),\n    onData: data => this.onSubscriptionData?.(data),\n    onComplete: () => this.onSubscriptionComplete?.(),\n    onError: error => this.onError?.(error),\n  });\n\n  /** @summary Flags an element that's ready and able to auto subscribe */\n  get canAutoSubscribe(): boolean { return this.controller?.canAutoSubscribe ?? false; }\n\n  /**\n   * @summary A GraphQL document containing a single subscription.\n   */\n  @controlled() @state() subscription: ComponentDocument<D> | null = null;\n\n  /**\n   * @summary If true, the element will not begin querying data until you manually call `subscribe`\n   * @attr no-auto-subscribe\n   */\n  @controlled({ path: 'options' })\n  @property({ type: Boolean, attribute: 'no-auto-subscribe' })\n  noAutoSubscribe = false;\n\n  /**\n   * @summary Whether or not updates to the network status should trigger next on the observer of this subscription.\n   */\n  @controlled({ path: 'options' })\n  @property({ type: Boolean, attribute: 'notify-on-network-status-change' })\n  notifyOnNetworkStatusChange?: boolean;\n\n  /**\n   * @summary Determines if your subscription should be unsubscribed and subscribed again.\n   */\n  @controlled({ path: 'options' })\n  @property({ type: Boolean, attribute: 'should-resubscribe' })\n  shouldResubscribe = false;\n\n  /**\n   * @summary If true, the query will be skipped entirely\n   */\n  @controlled({ path: 'options' })\n  @property({ type: Boolean, attribute: 'skip' }) skip = false;\n\n  /**\n   * @summary Error policy for the subscription\n   */\n  @controlled({ path: 'options' })\n  @property({ attribute: 'error-policy' })\n  errorPolicy?: this['controller']['options']['errorPolicy'];\n\n  /**\n   * @summary Specifies the FetchPolicy to be used for this subscription.\n   * @attr fetch-policy\n   */\n  @controlled({ path: 'options' })\n  @property({ attribute: 'fetch-policy' })\n  fetchPolicy?: this['controller']['options']['fetchPolicy'];\n\n  /**\n   * @summary The time interval (in milliseconds) on which this subscription should be refetched from the server.\n   */\n  @controlled({ path: 'options' })\n  @property({ type: Number, attribute: 'poll-interval' })\n  pollInterval?: number;\n\n  /**\n   * @summary Resets the observable and subscribes.\n   */\n  subscribe(...args: Parameters<this['controller']['subscribe']>): void {\n    return this.controller.subscribe(...args);\n  }\n\n  /**\n   * @summary Cancels and clears the subscription\n   */\n  cancel(): void {\n    return this.controller.cancel();\n  }\n\n  /**\n   * Determines whether the element should attempt to subscribe automatically\n   * Override to prevent subscribing unless your conditions are met\n   * @override\n   */\n  shouldSubscribe(\n    options?: Partial<C.SubscriptionOptions<Variables<D, V>, Data<D>>>\n  ): boolean {\n    return (void options, true);\n  }\n\n  /**\n   * Callback for when data is updated\n   */\n  onSubscriptionData?(result: OnSubscriptionDataParams<Data<D>>): void;\n\n  /**\n   * Callback for when error is updated\n   */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