saby-customizer 0.0.0 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/material.js CHANGED
@@ -1,62 +1,66 @@
1
1
  var extendStatics = function(d, b) {
2
- extendStatics = Object.setPrototypeOf ||
3
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
4
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
5
- return extendStatics(d, b);
2
+ extendStatics = Object.setPrototypeOf ||
3
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
4
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
5
+ return extendStatics(d, b);
6
6
  };
7
7
  function __extends(d, b) {
8
- if (typeof b !== "function" && b !== null)
9
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
8
+ if (typeof b !== "function" && b !== null)
9
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
+ extendStatics(d, b);
11
+ function __() { this.constructor = d; }
12
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
13
  }
14
14
  var __assign = function() {
15
- __assign = Object.assign || function __assign(t) {
16
- for (var s, i = 1, n = arguments.length; i < n; i++) {
17
- s = arguments[i];
18
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
19
- }
20
- return t;
21
- };
22
- return __assign.apply(this, arguments);
15
+ __assign = Object.assign || function __assign(t) {
16
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
17
+ s = arguments[i];
18
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
19
+ }
20
+ return t;
21
+ };
22
+ return __assign.apply(this, arguments);
23
23
  };
24
24
  function __decorate(decorators, target, key, desc) {
25
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
26
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
27
- 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;
28
- return c > 3 && r && Object.defineProperty(target, key, r), r;
25
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
26
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
27
+ 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;
28
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
29
29
  }
30
30
  function __values(o) {
31
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
32
- if (m) return m.call(o);
33
- if (o && typeof o.length === "number") return {
34
- next: function () {
35
- if (o && i >= o.length) o = void 0;
36
- return { value: o && o[i++], done: !o };
37
- }
38
- };
39
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
31
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
32
+ if (m) return m.call(o);
33
+ if (o && typeof o.length === "number") return {
34
+ next: function () {
35
+ if (o && i >= o.length) o = void 0;
36
+ return { value: o && o[i++], done: !o };
37
+ }
38
+ };
39
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
40
40
  }
41
41
  function __read(o, n) {
42
- var m = typeof Symbol === "function" && o[Symbol.iterator];
43
- if (!m) return o;
44
- var i = m.call(o), r, ar = [], e;
45
- try {
46
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
47
- }
48
- catch (error) { e = { error: error }; }
49
- finally {
50
- try {
51
- if (r && !r.done && (m = i["return"])) m.call(i);
52
- }
53
- finally { if (e) throw e.error; }
54
- }
55
- return ar;
42
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
43
+ if (!m) return o;
44
+ var i = m.call(o), r, ar = [], e;
45
+ try {
46
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
47
+ }
48
+ catch (error) { e = { error: error }; }
49
+ finally {
50
+ try {
51
+ if (r && !r.done && (m = i["return"])) m.call(i);
52
+ }
53
+ finally { if (e) throw e.error; }
54
+ }
55
+ return ar;
56
56
  }
57
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
58
+ var e = new Error(message);
59
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
60
+ };
57
61
 
58
62
  const legacyCustomElement = (tagName, clazz) => {
59
- window.customElements.define(tagName, clazz);
63
+ customElements.define(tagName, clazz);
60
64
  return clazz;
61
65
  };
62
66
  const standardCustomElement = (tagName, descriptor) => {
@@ -65,7 +69,7 @@ const standardCustomElement = (tagName, descriptor) => {
65
69
  kind,
66
70
  elements,
67
71
  finisher(clazz) {
68
- window.customElements.define(tagName, clazz);
72
+ customElements.define(tagName, clazz);
69
73
  },
70
74
  };
71
75
  };
@@ -152,7 +156,8 @@ const decorateProperty = ({ finisher, descriptor, }) => (protoOrDescriptor, name
152
156
  function eventOptions(options) {
153
157
  return decorateProperty({
154
158
  finisher: (ctor, name) => {
155
- Object.assign(ctor.prototype[name], options);
159
+ Object.assign(
160
+ ctor.prototype[name], options);
156
161
  },
157
162
  });
158
163
  }
@@ -197,8 +202,9 @@ function queryAsync(selector) {
197
202
  });
198
203
  }
199
204
 
200
- var _a$6;
201
- const slotAssignedElements = ((_a$6 = window.HTMLSlotElement) === null || _a$6 === void 0 ? void 0 : _a$6.prototype.assignedElements) != null
205
+ var _a$5;
206
+ const global$3 = window;
207
+ const slotAssignedElements = ((_a$5 = global$3.HTMLSlotElement) === null || _a$5 === void 0 ? void 0 : _a$5.prototype.assignedElements) != null
202
208
  ? (slot, opts) => slot.assignedElements(opts)
203
209
  : (slot, opts) => slot
204
210
  .assignedNodes(opts)
@@ -929,9 +935,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
929
935
  style.textContent = '\n' + '[inert] {\n' + ' pointer-events: none;\n' + ' cursor: default;\n' + '}\n' + '\n' + '[inert], [inert] * {\n' + ' -webkit-user-select: none;\n' + ' -moz-user-select: none;\n' + ' -ms-user-select: none;\n' + ' user-select: none;\n' + '}\n';
930
936
  node.appendChild(style);
931
937
  }
932
- if (!Element.prototype.hasOwnProperty('inert')) {
938
+ if (!HTMLElement.prototype.hasOwnProperty('inert')) {
933
939
  var inertManager = new InertManager(document);
934
- Object.defineProperty(Element.prototype, 'inert', {
940
+ Object.defineProperty(HTMLElement.prototype, 'inert', {
935
941
  enumerable: true,
936
942
  get: function get() {
937
943
  return this.hasAttribute('inert');
@@ -1407,25 +1413,37 @@ function matches(element, selector) {
1407
1413
  return nativeMatches.call(element, selector);
1408
1414
  }
1409
1415
 
1410
- const supportsAdoptingStyleSheets = window.ShadowRoot &&
1411
- (window.ShadyCSS === undefined || window.ShadyCSS.nativeShadow) &&
1416
+ const NODE_MODE = false;
1417
+ const global$2 = window;
1418
+ const supportsAdoptingStyleSheets = global$2.ShadowRoot &&
1419
+ (global$2.ShadyCSS === undefined || global$2.ShadyCSS.nativeShadow) &&
1412
1420
  'adoptedStyleSheets' in Document.prototype &&
1413
1421
  'replace' in CSSStyleSheet.prototype;
1414
1422
  const constructionToken = Symbol();
1415
- const styleSheetCache = new Map();
1423
+ const cssTagCache = new WeakMap();
1416
1424
  class CSSResult {
1417
- constructor(cssText, safeToken) {
1425
+ constructor(cssText, strings, safeToken) {
1418
1426
  this['_$cssResult$'] = true;
1419
1427
  if (safeToken !== constructionToken) {
1420
1428
  throw new Error('CSSResult is not constructable. Use `unsafeCSS` or `css` instead.');
1421
1429
  }
1422
1430
  this.cssText = cssText;
1431
+ this._strings = strings;
1423
1432
  }
1424
1433
  get styleSheet() {
1425
- let styleSheet = styleSheetCache.get(this.cssText);
1434
+ let styleSheet = this._styleSheet;
1435
+ const strings = this._strings;
1426
1436
  if (supportsAdoptingStyleSheets && styleSheet === undefined) {
1427
- styleSheetCache.set(this.cssText, (styleSheet = new CSSStyleSheet()));
1428
- styleSheet.replaceSync(this.cssText);
1437
+ const cacheable = strings !== undefined && strings.length === 1;
1438
+ if (cacheable) {
1439
+ styleSheet = cssTagCache.get(strings);
1440
+ }
1441
+ if (styleSheet === undefined) {
1442
+ (this._styleSheet = styleSheet = new CSSStyleSheet()).replaceSync(this.cssText);
1443
+ if (cacheable) {
1444
+ cssTagCache.set(strings, styleSheet);
1445
+ }
1446
+ }
1429
1447
  }
1430
1448
  return styleSheet;
1431
1449
  }
@@ -1446,12 +1464,12 @@ const textFromCSSResult = (value) => {
1446
1464
  `to ensure page security.`);
1447
1465
  }
1448
1466
  };
1449
- const unsafeCSS = (value) => new CSSResult(typeof value === 'string' ? value : String(value), constructionToken);
1467
+ const unsafeCSS = (value) => new CSSResult(typeof value === 'string' ? value : String(value), undefined, constructionToken);
1450
1468
  const css = (strings, ...values) => {
1451
1469
  const cssText = strings.length === 1
1452
1470
  ? strings[0]
1453
1471
  : values.reduce((acc, v, idx) => acc + textFromCSSResult(v) + strings[idx + 1], strings[0]);
1454
- return new CSSResult(cssText, constructionToken);
1472
+ return new CSSResult(cssText, strings, constructionToken);
1455
1473
  };
1456
1474
  const adoptStyles = (renderRoot, styles) => {
1457
1475
  if (supportsAdoptingStyleSheets) {
@@ -1460,7 +1478,7 @@ const adoptStyles = (renderRoot, styles) => {
1460
1478
  else {
1461
1479
  styles.forEach((s) => {
1462
1480
  const style = document.createElement('style');
1463
- const nonce = window['litNonce'];
1481
+ const nonce = global$2['litNonce'];
1464
1482
  if (nonce !== undefined) {
1465
1483
  style.setAttribute('nonce', nonce);
1466
1484
  }
@@ -1476,23 +1494,25 @@ const cssResultFromStyleSheet = (sheet) => {
1476
1494
  }
1477
1495
  return unsafeCSS(cssText);
1478
1496
  };
1479
- const getCompatibleStyle = supportsAdoptingStyleSheets
1497
+ const getCompatibleStyle = supportsAdoptingStyleSheets ||
1498
+ (NODE_MODE )
1480
1499
  ? (s) => s
1481
1500
  : (s) => s instanceof CSSStyleSheet ? cssResultFromStyleSheet(s) : s;
1482
1501
 
1483
- var _a$5, _b$5, _c$2;
1484
- var _d$1;
1502
+ var _b$5, _c$2, _d$1;
1503
+ var _e;
1504
+ const global$1 = window;
1485
1505
  let requestUpdateThenable;
1486
1506
  let issueWarning$2;
1487
- const trustedTypes$1 = window
1507
+ const trustedTypes$1 = global$1
1488
1508
  .trustedTypes;
1489
1509
  const emptyStringForBooleanAttribute$1 = trustedTypes$1
1490
1510
  ? trustedTypes$1.emptyScript
1491
1511
  : '';
1492
- const polyfillSupport$2 = window.reactiveElementPolyfillSupportDevMode
1512
+ const polyfillSupport$2 = global$1.reactiveElementPolyfillSupportDevMode
1493
1513
  ;
1494
1514
  {
1495
- const issuedWarnings = ((_a$5 = globalThis.litIssuedWarnings) !== null && _a$5 !== void 0 ? _a$5 : (globalThis.litIssuedWarnings = new Set()));
1515
+ const issuedWarnings = ((_b$5 = global$1.litIssuedWarnings) !== null && _b$5 !== void 0 ? _b$5 : (global$1.litIssuedWarnings = new Set()));
1496
1516
  issueWarning$2 = (code, warning) => {
1497
1517
  warning += ` See https://lit.dev/msg/${code} for more information.`;
1498
1518
  if (!issuedWarnings.has(warning)) {
@@ -1501,7 +1521,7 @@ const polyfillSupport$2 = window.reactiveElementPolyfillSupportDevMode
1501
1521
  }
1502
1522
  };
1503
1523
  issueWarning$2('dev-mode', `Lit is in dev mode. Not recommended for production!`);
1504
- if (((_b$5 = window.ShadyDOM) === null || _b$5 === void 0 ? void 0 : _b$5.inUse) && polyfillSupport$2 === undefined) {
1524
+ if (((_c$2 = global$1.ShadyDOM) === null || _c$2 === void 0 ? void 0 : _c$2.inUse) && polyfillSupport$2 === undefined) {
1505
1525
  issueWarning$2('polyfill-support-missing', `Shadow DOM is being polyfilled via \`ShadyDOM\` but ` +
1506
1526
  `the \`polyfill-support\` module has not been loaded.`);
1507
1527
  }
@@ -1516,12 +1536,12 @@ const polyfillSupport$2 = window.reactiveElementPolyfillSupportDevMode
1516
1536
  });
1517
1537
  }
1518
1538
  const debugLogEvent$1 = (event) => {
1519
- const shouldEmit = window
1539
+ const shouldEmit = global$1
1520
1540
  .emitLitDebugLogEvents;
1521
1541
  if (!shouldEmit) {
1522
1542
  return;
1523
1543
  }
1524
- window.dispatchEvent(new CustomEvent('lit-debug', {
1544
+ global$1.dispatchEvent(new CustomEvent('lit-debug', {
1525
1545
  detail: event,
1526
1546
  }));
1527
1547
  }
@@ -1573,19 +1593,20 @@ const defaultPropertyDeclaration = {
1573
1593
  hasChanged: notEqual,
1574
1594
  };
1575
1595
  const finalized = 'finalized';
1576
- class ReactiveElement extends HTMLElement {
1596
+ class ReactiveElement
1597
+ extends HTMLElement {
1577
1598
  constructor() {
1578
1599
  super();
1579
1600
  this.__instanceProperties = new Map();
1580
1601
  this.isUpdatePending = false;
1581
1602
  this.hasUpdated = false;
1582
1603
  this.__reflectingProperty = null;
1583
- this._initialize();
1604
+ this.__initialize();
1584
1605
  }
1585
1606
  static addInitializer(initializer) {
1586
1607
  var _a;
1587
- (_a = this._initializers) !== null && _a !== void 0 ? _a : (this._initializers = []);
1588
- this._initializers.push(initializer);
1608
+ this.finalize();
1609
+ ((_a = this._initializers) !== null && _a !== void 0 ? _a : (this._initializers = [])).push(initializer);
1589
1610
  }
1590
1611
  static get observedAttributes() {
1591
1612
  this.finalize();
@@ -1644,6 +1665,9 @@ class ReactiveElement extends HTMLElement {
1644
1665
  this[finalized] = true;
1645
1666
  const superCtor = Object.getPrototypeOf(this);
1646
1667
  superCtor.finalize();
1668
+ if (superCtor._initializers !== undefined) {
1669
+ this._initializers = [...superCtor._initializers];
1670
+ }
1647
1671
  this.elementProperties = new Map(superCtor.elementProperties);
1648
1672
  this.__attributeToPropertyMap = new Map();
1649
1673
  if (this.hasOwnProperty(JSCompiler_renameProperty('properties'))) {
@@ -1694,7 +1718,7 @@ class ReactiveElement extends HTMLElement {
1694
1718
  ? name.toLowerCase()
1695
1719
  : undefined;
1696
1720
  }
1697
- _initialize() {
1721
+ __initialize() {
1698
1722
  var _a;
1699
1723
  this.__updatePromise = new Promise((res) => (this.enableUpdating = res));
1700
1724
  this._$changedProperties = new Map();
@@ -1744,11 +1768,14 @@ class ReactiveElement extends HTMLElement {
1744
1768
  this._$attributeToProperty(name, value);
1745
1769
  }
1746
1770
  __propertyToAttribute(name, value, options = defaultPropertyDeclaration) {
1747
- var _a, _b;
1771
+ var _a;
1748
1772
  const attr = this.constructor.__attributeNameForProperty(name, options);
1749
1773
  if (attr !== undefined && options.reflect === true) {
1750
- const toAttribute = (_b = (_a = options.converter) === null || _a === void 0 ? void 0 : _a.toAttribute) !== null && _b !== void 0 ? _b : defaultConverter.toAttribute;
1751
- const attrValue = toAttribute(value, options.type);
1774
+ const converter = ((_a = options.converter) === null || _a === void 0 ? void 0 : _a.toAttribute) !==
1775
+ undefined
1776
+ ? options.converter
1777
+ : defaultConverter;
1778
+ const attrValue = converter.toAttribute(value, options.type);
1752
1779
  if (this.constructor.enabledWarnings.indexOf('migration') >= 0 &&
1753
1780
  attrValue === undefined) {
1754
1781
  issueWarning$2('undefined-attribute-value', `The attribute value for the ${name} property is ` +
@@ -1767,17 +1794,19 @@ class ReactiveElement extends HTMLElement {
1767
1794
  }
1768
1795
  }
1769
1796
  _$attributeToProperty(name, value) {
1770
- var _a, _b, _c;
1797
+ var _a;
1771
1798
  const ctor = this.constructor;
1772
1799
  const propName = ctor.__attributeToPropertyMap.get(name);
1773
1800
  if (propName !== undefined && this.__reflectingProperty !== propName) {
1774
1801
  const options = ctor.getPropertyOptions(propName);
1775
- const converter = options.converter;
1776
- const fromAttribute = (_c = (_b = (_a = converter) === null || _a === void 0 ? void 0 : _a.fromAttribute) !== null && _b !== void 0 ? _b : (typeof converter === 'function'
1777
- ? converter
1778
- : null)) !== null && _c !== void 0 ? _c : defaultConverter.fromAttribute;
1802
+ const converter = typeof options.converter === 'function'
1803
+ ? { fromAttribute: options.converter }
1804
+ : ((_a = options.converter) === null || _a === void 0 ? void 0 : _a.fromAttribute) !== undefined
1805
+ ? options.converter
1806
+ : defaultConverter;
1779
1807
  this.__reflectingProperty = propName;
1780
- this[propName] = fromAttribute(value, options.type);
1808
+ this[propName] = converter.fromAttribute(value, options.type
1809
+ );
1781
1810
  this.__reflectingProperty = null;
1782
1811
  }
1783
1812
  }
@@ -1919,8 +1948,8 @@ class ReactiveElement extends HTMLElement {
1919
1948
  updated(_changedProperties) { }
1920
1949
  firstUpdated(_changedProperties) { }
1921
1950
  }
1922
- _d$1 = finalized;
1923
- ReactiveElement[_d$1] = true;
1951
+ _e = finalized;
1952
+ ReactiveElement[_e] = true;
1924
1953
  ReactiveElement.elementProperties = new Map();
1925
1954
  ReactiveElement.elementStyles = [];
1926
1955
  ReactiveElement.shadowRootOptions = { mode: 'open' };
@@ -1946,20 +1975,21 @@ polyfillSupport$2 === null || polyfillSupport$2 === void 0 ? void 0 : polyfillSu
1946
1975
  }
1947
1976
  };
1948
1977
  }
1949
- ((_c$2 = globalThis.reactiveElementVersions) !== null && _c$2 !== void 0 ? _c$2 : (globalThis.reactiveElementVersions = [])).push('1.3.2');
1950
- if (globalThis.reactiveElementVersions.length > 1) {
1978
+ ((_d$1 = global$1.reactiveElementVersions) !== null && _d$1 !== void 0 ? _d$1 : (global$1.reactiveElementVersions = [])).push('1.6.3');
1979
+ if (global$1.reactiveElementVersions.length > 1) {
1951
1980
  issueWarning$2('multiple-versions', `Multiple versions of Lit loaded. Loading multiple versions ` +
1952
1981
  `is not recommended.`);
1953
1982
  }
1954
1983
 
1955
1984
  var _a$4, _b$4, _c$1, _d;
1985
+ const global = window;
1956
1986
  const debugLogEvent = (event) => {
1957
- const shouldEmit = window
1987
+ const shouldEmit = global
1958
1988
  .emitLitDebugLogEvents;
1959
1989
  if (!shouldEmit) {
1960
1990
  return;
1961
1991
  }
1962
- window.dispatchEvent(new CustomEvent('lit-debug', {
1992
+ global.dispatchEvent(new CustomEvent('lit-debug', {
1963
1993
  detail: event,
1964
1994
  }));
1965
1995
  }
@@ -1967,23 +1997,23 @@ const debugLogEvent = (event) => {
1967
1997
  let debugLogRenderId = 0;
1968
1998
  let issueWarning$1;
1969
1999
  {
1970
- (_a$4 = globalThis.litIssuedWarnings) !== null && _a$4 !== void 0 ? _a$4 : (globalThis.litIssuedWarnings = new Set());
2000
+ (_a$4 = global.litIssuedWarnings) !== null && _a$4 !== void 0 ? _a$4 : (global.litIssuedWarnings = new Set());
1971
2001
  issueWarning$1 = (code, warning) => {
1972
2002
  warning += code
1973
2003
  ? ` See https://lit.dev/msg/${code} for more information.`
1974
2004
  : '';
1975
- if (!globalThis.litIssuedWarnings.has(warning)) {
2005
+ if (!global.litIssuedWarnings.has(warning)) {
1976
2006
  console.warn(warning);
1977
- globalThis.litIssuedWarnings.add(warning);
2007
+ global.litIssuedWarnings.add(warning);
1978
2008
  }
1979
2009
  };
1980
2010
  issueWarning$1('dev-mode', `Lit is in dev mode. Not recommended for production!`);
1981
2011
  }
1982
- const wrap = ((_b$4 = window.ShadyDOM) === null || _b$4 === void 0 ? void 0 : _b$4.inUse) &&
1983
- ((_c$1 = window.ShadyDOM) === null || _c$1 === void 0 ? void 0 : _c$1.noPatch) === true
1984
- ? window.ShadyDOM.wrap
2012
+ const wrap = ((_b$4 = global.ShadyDOM) === null || _b$4 === void 0 ? void 0 : _b$4.inUse) &&
2013
+ ((_c$1 = global.ShadyDOM) === null || _c$1 === void 0 ? void 0 : _c$1.noPatch) === true
2014
+ ? global.ShadyDOM.wrap
1985
2015
  : (node) => node;
1986
- const trustedTypes = globalThis.trustedTypes;
2016
+ const trustedTypes = global.trustedTypes;
1987
2017
  const policy = trustedTypes
1988
2018
  ? trustedTypes.createPolicy('lit-html', {
1989
2019
  createHTML: (s) => s,
@@ -2009,7 +2039,7 @@ const marker = `lit$${String(Math.random()).slice(9)}$`;
2009
2039
  const markerMatch = '?' + marker;
2010
2040
  const nodeMarker = `<${markerMatch}>`;
2011
2041
  const d = document;
2012
- const createMarker = (v = '') => d.createComment(v);
2042
+ const createMarker = () => d.createComment('');
2013
2043
  const isPrimitive = (value) => value === null || (typeof value != 'object' && typeof value != 'function');
2014
2044
  const isArray = Array.isArray;
2015
2045
  const isIterable = (value) => isArray(value) ||
@@ -2055,47 +2085,32 @@ const html = tag(HTML_RESULT);
2055
2085
  const noChange = Symbol.for('lit-noChange');
2056
2086
  const nothing = Symbol.for('lit-nothing');
2057
2087
  const templateCache = new WeakMap();
2058
- const render = (value, container, options) => {
2059
- var _a, _b;
2060
- if (container == null) {
2061
- throw new TypeError(`The container to render into may not be ${container}`);
2062
- }
2063
- const renderId = debugLogRenderId++ ;
2064
- const partOwnerNode = (_a = options === null || options === void 0 ? void 0 : options.renderBefore) !== null && _a !== void 0 ? _a : container;
2065
- let part = partOwnerNode['_$litPart$'];
2066
- debugLogEvent === null || debugLogEvent === void 0 ? void 0 : debugLogEvent({
2067
- kind: 'begin render',
2068
- id: renderId,
2069
- value,
2070
- container,
2071
- options,
2072
- part,
2073
- });
2074
- if (part === undefined) {
2075
- const endNode = (_b = options === null || options === void 0 ? void 0 : options.renderBefore) !== null && _b !== void 0 ? _b : null;
2076
- partOwnerNode['_$litPart$'] = part = new ChildPart(container.insertBefore(createMarker(), endNode), endNode, undefined, options !== null && options !== void 0 ? options : {});
2077
- }
2078
- part._$setValue(value);
2079
- debugLogEvent === null || debugLogEvent === void 0 ? void 0 : debugLogEvent({
2080
- kind: 'end render',
2081
- id: renderId,
2082
- value,
2083
- container,
2084
- options,
2085
- part,
2086
- });
2087
- return part;
2088
- };
2089
- {
2090
- render.setSanitizer = setSanitizer;
2091
- render.createSanitizer = createSanitizer;
2092
- {
2093
- render._testOnlyClearSanitizerFactoryDoNotCallOrElse =
2094
- _testOnlyClearSanitizerFactoryDoNotCallOrElse;
2095
- }
2096
- }
2097
2088
  const walker = d.createTreeWalker(d, 129 , null, false);
2098
2089
  let sanitizerFactoryInternal = noopSanitizer;
2090
+ function trustFromTemplateString(tsa, stringFromTSA) {
2091
+ if (!Array.isArray(tsa) || !tsa.hasOwnProperty('raw')) {
2092
+ let message = 'invalid template strings array';
2093
+ {
2094
+ message = `
2095
+ Internal Error: expected template strings to be an array
2096
+ with a 'raw' field. Faking a template strings array by
2097
+ calling html or svg like an ordinary function is effectively
2098
+ the same as calling unsafeHtml and can lead to major security
2099
+ issues, e.g. opening your code up to XSS attacks.
2100
+ If you're using the html or svg tagged template functions normally
2101
+ and still seeing this error, please file a bug at
2102
+ https://github.com/lit/lit/issues/new?template=bug_report.md
2103
+ and include information about your build tooling, if any.
2104
+ `
2105
+ .trim()
2106
+ .replace(/\n */g, '\n');
2107
+ }
2108
+ throw new Error(message);
2109
+ }
2110
+ return policy !== undefined
2111
+ ? policy.createHTML(stringFromTSA)
2112
+ : stringFromTSA;
2113
+ }
2099
2114
  const getTemplateHtml = (strings, type) => {
2100
2115
  const l = strings.length - 1;
2101
2116
  const attrNames = [];
@@ -2188,32 +2203,7 @@ const getTemplateHtml = (strings, type) => {
2188
2203
  (attrNameEndIndex === -2 ? (attrNames.push(undefined), i) : end);
2189
2204
  }
2190
2205
  const htmlResult = html + (strings[l] || '<?>') + (type === SVG_RESULT ? '</svg>' : '');
2191
- if (!Array.isArray(strings) || !strings.hasOwnProperty('raw')) {
2192
- let message = 'invalid template strings array';
2193
- {
2194
- message = `
2195
- Internal Error: expected template strings to be an array
2196
- with a 'raw' field. Faking a template strings array by
2197
- calling html or svg like an ordinary function is effectively
2198
- the same as calling unsafeHtml and can lead to major security
2199
- issues, e.g. opening your code up to XSS attacks.
2200
-
2201
- If you're using the html or svg tagged template functions normally
2202
- and and still seeing this error, please file a bug at
2203
- https://github.com/lit/lit/issues/new?template=bug_report.md
2204
- and include information about your build tooling, if any.
2205
- `
2206
- .trim()
2207
- .replace(/\n */g, '\n');
2208
- }
2209
- throw new Error(message);
2210
- }
2211
- return [
2212
- policy !== undefined
2213
- ? policy.createHTML(htmlResult)
2214
- : htmlResult,
2215
- attrNames,
2216
- ];
2206
+ return [trustFromTemplateString(strings, htmlResult), attrNames];
2217
2207
  };
2218
2208
  class Template {
2219
2209
  constructor(
@@ -2368,7 +2358,7 @@ function resolveDirective(part, value, parent = part, attributeIndex) {
2368
2358
  }
2369
2359
  class TemplateInstance {
2370
2360
  constructor(template, parent) {
2371
- this._parts = [];
2361
+ this._$parts = [];
2372
2362
  this._$disconnectableChildren = undefined;
2373
2363
  this._$template = template;
2374
2364
  this._$parent = parent;
@@ -2400,7 +2390,7 @@ class TemplateInstance {
2400
2390
  else if (templatePart.type === ELEMENT_PART) {
2401
2391
  part = new ElementPart(node, this, options);
2402
2392
  }
2403
- this._parts.push(part);
2393
+ this._$parts.push(part);
2404
2394
  templatePart = parts[++partIndex];
2405
2395
  }
2406
2396
  if (nodeIndex !== (templatePart === null || templatePart === void 0 ? void 0 : templatePart.index)) {
@@ -2408,11 +2398,12 @@ class TemplateInstance {
2408
2398
  nodeIndex++;
2409
2399
  }
2410
2400
  }
2401
+ walker.currentNode = d;
2411
2402
  return fragment;
2412
2403
  }
2413
2404
  _update(values) {
2414
2405
  let i = 0;
2415
- for (const part of this._parts) {
2406
+ for (const part of this._$parts) {
2416
2407
  if (part !== undefined) {
2417
2408
  debugLogEvent === null || debugLogEvent === void 0 ? void 0 : debugLogEvent({
2418
2409
  kind: 'set part',
@@ -2457,7 +2448,7 @@ class ChildPart {
2457
2448
  let parentNode = wrap(this._$startNode).parentNode;
2458
2449
  const parent = this._$parent;
2459
2450
  if (parent !== undefined &&
2460
- parentNode.nodeType === 11 ) {
2451
+ (parentNode === null || parentNode === void 0 ? void 0 : parentNode.nodeType) === 11 ) {
2461
2452
  parentNode = parent.parentNode;
2462
2453
  }
2463
2454
  return parentNode;
@@ -2469,6 +2460,7 @@ class ChildPart {
2469
2460
  return this._$endNode;
2470
2461
  }
2471
2462
  _$setValue(value, directiveParent = this) {
2463
+ var _a;
2472
2464
  if (this.parentNode === null) {
2473
2465
  throw new Error(`This \`ChildPart\` has no \`parentNode\` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's \`innerHTML\` or \`textContent\` can do this.`);
2474
2466
  }
@@ -2495,6 +2487,12 @@ class ChildPart {
2495
2487
  this._commitTemplateResult(value);
2496
2488
  }
2497
2489
  else if (value.nodeType !== undefined) {
2490
+ if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.host) === value) {
2491
+ this._commitText(`[probable mistake: rendered a template's host in itself ` +
2492
+ `(commonly caused by writing \${this} in a template]`);
2493
+ console.warn(`Attempted to render the template host`, value, `inside itself. This is almost always a mistake, and in dev mode `, `we render some warning text. In production however, we'll `, `render it, which will usually result in an error, and sometimes `, `in the element disappearing from the DOM.`);
2494
+ return;
2495
+ }
2498
2496
  this._commitNode(value);
2499
2497
  }
2500
2498
  else if (isIterable(value)) {
@@ -2504,8 +2502,8 @@ class ChildPart {
2504
2502
  this._commitText(value);
2505
2503
  }
2506
2504
  }
2507
- _insert(node, ref = this._$endNode) {
2508
- return wrap(wrap(this._$startNode).parentNode).insertBefore(node, ref);
2505
+ _insert(node) {
2506
+ return wrap(wrap(this._$startNode).parentNode).insertBefore(node, this._$endNode);
2509
2507
  }
2510
2508
  _commitNode(value) {
2511
2509
  var _a;
@@ -2566,7 +2564,7 @@ class ChildPart {
2566
2564
  }
2567
2565
  else {
2568
2566
  {
2569
- const textNode = document.createTextNode('');
2567
+ const textNode = d.createTextNode('');
2570
2568
  this._commitNode(textNode);
2571
2569
  if (this._textSanitizer === undefined) {
2572
2570
  this._textSanitizer = createSanitizer(textNode, 'data', 'property');
@@ -2589,14 +2587,14 @@ class ChildPart {
2589
2587
  const template = typeof type === 'number'
2590
2588
  ? this._$getTemplate(result)
2591
2589
  : (type.el === undefined &&
2592
- (type.el = Template.createElement(type.h, this.options)),
2590
+ (type.el = Template.createElement(trustFromTemplateString(type.h, type.h[0]), this.options)),
2593
2591
  type);
2594
2592
  if (((_a = this._$committedValue) === null || _a === void 0 ? void 0 : _a._$template) === template) {
2595
2593
  debugLogEvent === null || debugLogEvent === void 0 ? void 0 : debugLogEvent({
2596
2594
  kind: 'template updating',
2597
2595
  template,
2598
2596
  instance: this._$committedValue,
2599
- parts: this._$committedValue._parts,
2597
+ parts: this._$committedValue._$parts,
2600
2598
  options: this.options,
2601
2599
  values,
2602
2600
  });
@@ -2609,7 +2607,7 @@ class ChildPart {
2609
2607
  kind: 'template instantiated',
2610
2608
  template,
2611
2609
  instance,
2612
- parts: instance._parts,
2610
+ parts: instance._$parts,
2613
2611
  options: this.options,
2614
2612
  fragment,
2615
2613
  values,
@@ -2619,7 +2617,7 @@ class ChildPart {
2619
2617
  kind: 'template instantiated and updated',
2620
2618
  template,
2621
2619
  instance,
2622
- parts: instance._parts,
2620
+ parts: instance._$parts,
2623
2621
  options: this.options,
2624
2622
  fragment,
2625
2623
  values,
@@ -2884,14 +2882,53 @@ class ElementPart {
2884
2882
  resolveDirective(this, value);
2885
2883
  }
2886
2884
  }
2887
- const polyfillSupport$1 = window.litHtmlPolyfillSupportDevMode
2885
+ const polyfillSupport$1 = global.litHtmlPolyfillSupportDevMode
2888
2886
  ;
2889
2887
  polyfillSupport$1 === null || polyfillSupport$1 === void 0 ? void 0 : polyfillSupport$1(Template, ChildPart);
2890
- ((_d = globalThis.litHtmlVersions) !== null && _d !== void 0 ? _d : (globalThis.litHtmlVersions = [])).push('2.2.4');
2891
- if (globalThis.litHtmlVersions.length > 1) {
2888
+ ((_d = global.litHtmlVersions) !== null && _d !== void 0 ? _d : (global.litHtmlVersions = [])).push('2.8.0');
2889
+ if (global.litHtmlVersions.length > 1) {
2892
2890
  issueWarning$1('multiple-versions', `Multiple versions of Lit loaded. ` +
2893
2891
  `Loading multiple versions is not recommended.`);
2894
2892
  }
2893
+ const render = (value, container, options) => {
2894
+ var _a, _b;
2895
+ if (container == null) {
2896
+ throw new TypeError(`The container to render into may not be ${container}`);
2897
+ }
2898
+ const renderId = debugLogRenderId++ ;
2899
+ const partOwnerNode = (_a = options === null || options === void 0 ? void 0 : options.renderBefore) !== null && _a !== void 0 ? _a : container;
2900
+ let part = partOwnerNode['_$litPart$'];
2901
+ debugLogEvent === null || debugLogEvent === void 0 ? void 0 : debugLogEvent({
2902
+ kind: 'begin render',
2903
+ id: renderId,
2904
+ value,
2905
+ container,
2906
+ options,
2907
+ part,
2908
+ });
2909
+ if (part === undefined) {
2910
+ const endNode = (_b = options === null || options === void 0 ? void 0 : options.renderBefore) !== null && _b !== void 0 ? _b : null;
2911
+ partOwnerNode['_$litPart$'] = part = new ChildPart(container.insertBefore(createMarker(), endNode), endNode, undefined, options !== null && options !== void 0 ? options : {});
2912
+ }
2913
+ part._$setValue(value);
2914
+ debugLogEvent === null || debugLogEvent === void 0 ? void 0 : debugLogEvent({
2915
+ kind: 'end render',
2916
+ id: renderId,
2917
+ value,
2918
+ container,
2919
+ options,
2920
+ part,
2921
+ });
2922
+ return part;
2923
+ };
2924
+ {
2925
+ render.setSanitizer = setSanitizer;
2926
+ render.createSanitizer = createSanitizer;
2927
+ {
2928
+ render._testOnlyClearSanitizerFactoryDoNotCallOrElse =
2929
+ _testOnlyClearSanitizerFactoryDoNotCallOrElse;
2930
+ }
2931
+ }
2895
2932
 
2896
2933
  var _a$3, _b$3, _c;
2897
2934
  let issueWarning;
@@ -2967,7 +3004,7 @@ polyfillSupport === null || polyfillSupport === void 0 ? void 0 : polyfillSuppor
2967
3004
  return true;
2968
3005
  };
2969
3006
  }
2970
- ((_c = globalThis.litElementVersions) !== null && _c !== void 0 ? _c : (globalThis.litElementVersions = [])).push('3.2.0');
3007
+ ((_c = globalThis.litElementVersions) !== null && _c !== void 0 ? _c : (globalThis.litElementVersions = [])).push('3.3.3');
2971
3008
  if (globalThis.litElementVersions.length > 1) {
2972
3009
  issueWarning('multiple-versions', `Multiple versions of Lit loaded. Loading multiple versions ` +
2973
3010
  `is not recommended.`);
@@ -4020,6 +4057,9 @@ var MDCRippleFoundation = (function (_super) {
4020
4057
  }(MDCFoundation));
4021
4058
  var MDCRippleFoundation$1 = MDCRippleFoundation;
4022
4059
 
4060
+ const important = 'important';
4061
+ const importantFlag = ' !' + important;
4062
+ const flagTrim = 0 - importantFlag.length;
4023
4063
  class StyleMapDirective extends Directive {
4024
4064
  constructor(partInfo) {
4025
4065
  var _a;
@@ -4037,9 +4077,11 @@ class StyleMapDirective extends Directive {
4037
4077
  if (value == null) {
4038
4078
  return style;
4039
4079
  }
4040
- prop = prop
4041
- .replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, '-$&')
4042
- .toLowerCase();
4080
+ prop = prop.includes('-')
4081
+ ? prop
4082
+ : prop
4083
+ .replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, '-$&')
4084
+ .toLowerCase();
4043
4085
  return style + `${prop}:${value};`;
4044
4086
  }, '');
4045
4087
  }
@@ -4067,8 +4109,11 @@ class StyleMapDirective extends Directive {
4067
4109
  const value = styleInfo[name];
4068
4110
  if (value != null) {
4069
4111
  this._previousStyleProperties.add(name);
4070
- if (name.includes('-')) {
4071
- style.setProperty(name, value);
4112
+ const isImportant = typeof value === 'string' && value.endsWith(importantFlag);
4113
+ if (name.includes('-') || isImportant) {
4114
+ style.setProperty(name, isImportant
4115
+ ? value.slice(0, flagTrim)
4116
+ : value, isImportant ? important : '');
4072
4117
  }
4073
4118
  else {
4074
4119
  style[name] = value;