@maggioli-design-system/mds-tab 2.0.1 → 2.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.
Files changed (48) hide show
  1. package/dist/cjs/{index-a9e961fa.js → index-928add6f.js} +195 -155
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/mds-tab.cjs.entry.js +1 -1
  4. package/dist/cjs/mds-tab.cjs.js +2 -2
  5. package/dist/collection/collection-manifest.json +2 -2
  6. package/dist/collection/common/aria.js +19 -0
  7. package/dist/collection/components/mds-tab/mds-tab.js +21 -16
  8. package/dist/collection/components/mds-tab/test/mds-tab.stories.js +1 -4
  9. package/dist/collection/dictionary/typography.js +3 -3
  10. package/dist/esm/{index-ff5db4ec.js → index-18b5f438.js} +195 -155
  11. package/dist/esm/loader.js +2 -2
  12. package/dist/esm/mds-tab.entry.js +1 -1
  13. package/dist/esm/mds-tab.js +2 -2
  14. package/dist/esm/polyfills/css-shim.js +1 -1
  15. package/dist/esm-es5/index-18b5f438.js +2 -0
  16. package/dist/esm-es5/loader.js +1 -1
  17. package/dist/esm-es5/mds-tab.entry.js +1 -1
  18. package/dist/esm-es5/mds-tab.js +1 -1
  19. package/dist/mds-tab/mds-tab.esm.js +1 -1
  20. package/dist/mds-tab/mds-tab.js +2 -1
  21. package/dist/mds-tab/p-11ef3340.js +2 -0
  22. package/dist/mds-tab/p-2555fd7b.system.js +2 -0
  23. package/{www/build/p-67a450ed.entry.js → dist/mds-tab/p-35f2d92f.entry.js} +1 -1
  24. package/dist/mds-tab/{p-737c458e.system.entry.js → p-3625579e.system.entry.js} +1 -1
  25. package/dist/mds-tab/{p-b3d453a8.system.js → p-7a6f973a.system.js} +1 -1
  26. package/dist/stats.json +31 -29
  27. package/dist/types/common/aria.d.ts +4 -0
  28. package/dist/types/stencil-public-runtime.d.ts +20 -4
  29. package/dist/types/types/typography.d.ts +3 -3
  30. package/loader/package.json +1 -0
  31. package/package.json +4 -4
  32. package/src/common/aria.ts +27 -0
  33. package/src/components/mds-tab/.gitlab-ci.yml +2 -2
  34. package/src/dictionary/typography.ts +3 -3
  35. package/src/fixtures/icons.json +2 -2
  36. package/src/types/typography.ts +3 -3
  37. package/www/build/mds-tab.esm.js +1 -1
  38. package/www/build/mds-tab.js +2 -1
  39. package/www/build/p-11ef3340.js +2 -0
  40. package/www/build/p-2555fd7b.system.js +2 -0
  41. package/{dist/mds-tab/p-67a450ed.entry.js → www/build/p-35f2d92f.entry.js} +1 -1
  42. package/www/build/{p-737c458e.system.entry.js → p-3625579e.system.entry.js} +1 -1
  43. package/www/build/{p-b3d453a8.system.js → p-7a6f973a.system.js} +1 -1
  44. package/dist/esm-es5/index-ff5db4ec.js +0 -2
  45. package/dist/mds-tab/p-9e2e7a3e.js +0 -2
  46. package/dist/mds-tab/p-ac3bfea2.system.js +0 -2
  47. package/www/build/p-9e2e7a3e.js +0 -2
  48. package/www/build/p-ac3bfea2.system.js +0 -2
@@ -1,7 +1,7 @@
1
1
  const typographyDictionary = [
2
2
  'action',
3
3
  'caption',
4
- 'code',
4
+ 'snippet',
5
5
  'detail',
6
6
  'h1',
7
7
  'h2',
@@ -19,10 +19,10 @@ const typographyVariationsDictionary = [
19
19
  'title',
20
20
  'info',
21
21
  'read',
22
- 'mono',
22
+ 'code',
23
23
  ];
24
24
  const typographyMonoDictionary = [
25
- 'code',
25
+ 'snippet',
26
26
  'hack',
27
27
  ];
28
28
  const typographyTitleDictionary = [
@@ -1,60 +1,17 @@
1
1
  const NAMESPACE = 'mds-tab';
2
2
 
3
+ /**
4
+ * Virtual DOM patching algorithm based on Snabbdom by
5
+ * Simon Friis Vindum (@paldepind)
6
+ * Licensed under the MIT License
7
+ * https://github.com/snabbdom/snabbdom/blob/master/LICENSE
8
+ *
9
+ * Modified for Stencil's renderer and slot projection
10
+ */
3
11
  let scopeId;
4
12
  let hostTagName;
5
13
  let isSvgMode = false;
6
14
  let queuePending = false;
7
- const win = typeof window !== 'undefined' ? window : {};
8
- const doc = win.document || { head: {} };
9
- const plt = {
10
- $flags$: 0,
11
- $resourcesUrl$: '',
12
- jmp: (h) => h(),
13
- raf: (h) => requestAnimationFrame(h),
14
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
15
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
16
- ce: (eventName, opts) => new CustomEvent(eventName, opts),
17
- };
18
- const promiseResolve = (v) => Promise.resolve(v);
19
- const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
20
- try {
21
- new CSSStyleSheet();
22
- return typeof new CSSStyleSheet().replace === 'function';
23
- }
24
- catch (e) { }
25
- return false;
26
- })()
27
- ;
28
- const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
29
- if (listeners) {
30
- listeners.map(([flags, name, method]) => {
31
- const target = elm;
32
- const handler = hostListenerProxy(hostRef, method);
33
- const opts = hostListenerOpts(flags);
34
- plt.ael(target, name, handler, opts);
35
- (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
36
- });
37
- }
38
- };
39
- const hostListenerProxy = (hostRef, methodName) => (ev) => {
40
- try {
41
- {
42
- if (hostRef.$flags$ & 256 /* isListenReady */) {
43
- // instance is ready, let's call it's member method for this event
44
- hostRef.$lazyInstance$[methodName](ev);
45
- }
46
- else {
47
- (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
48
- }
49
- }
50
- }
51
- catch (e) {
52
- consoleError(e);
53
- }
54
- };
55
- // prettier-ignore
56
- const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
57
- const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
58
15
  const createTime = (fnName, tagName = '') => {
59
16
  {
60
17
  return () => {
@@ -69,71 +26,7 @@ const uniqueTime = (key, measureText) => {
69
26
  };
70
27
  }
71
28
  };
72
- const rootAppliedStyles = new WeakMap();
73
- const registerStyle = (scopeId, cssText, allowCS) => {
74
- let style = styles.get(scopeId);
75
- if (supportsConstructibleStylesheets && allowCS) {
76
- style = (style || new CSSStyleSheet());
77
- style.replace(cssText);
78
- }
79
- else {
80
- style = cssText;
81
- }
82
- styles.set(scopeId, style);
83
- };
84
- const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
85
- let scopeId = getScopeId(cmpMeta);
86
- const style = styles.get(scopeId);
87
- // if an element is NOT connected then getRootNode() will return the wrong root node
88
- // so the fallback is to always use the document for the root node in those cases
89
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
90
- if (style) {
91
- if (typeof style === 'string') {
92
- styleContainerNode = styleContainerNode.head || styleContainerNode;
93
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
94
- let styleElm;
95
- if (!appliedStyles) {
96
- rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
97
- }
98
- if (!appliedStyles.has(scopeId)) {
99
- {
100
- {
101
- styleElm = doc.createElement('style');
102
- styleElm.innerHTML = style;
103
- }
104
- styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
105
- }
106
- if (appliedStyles) {
107
- appliedStyles.add(scopeId);
108
- }
109
- }
110
- }
111
- else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
112
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
113
- }
114
- }
115
- return scopeId;
116
- };
117
- const attachStyles = (hostRef) => {
118
- const cmpMeta = hostRef.$cmpMeta$;
119
- const elm = hostRef.$hostElement$;
120
- const flags = cmpMeta.$flags$;
121
- const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
122
- const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
123
- if (flags & 10 /* needsScopedEncapsulation */) {
124
- // only required when we're NOT using native shadow dom (slot)
125
- // or this browser doesn't support native shadow dom
126
- // and this host element was NOT created with SSR
127
- // let's pick out the inner content for slot projection
128
- // create a node to represent where the original
129
- // content was first placed, which is useful later on
130
- // DOM WRITE!!
131
- elm['s-sc'] = scopeId;
132
- elm.classList.add(scopeId + '-h');
133
- }
134
- endAttachStyles();
135
- };
136
- const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
29
+ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
137
30
  /**
138
31
  * Default style mode id
139
32
  */
@@ -209,6 +102,89 @@ const newVNode = (tag, text) => {
209
102
  };
210
103
  const Host = {};
211
104
  const isHost = (node) => node && node.$tag$ === Host;
105
+ const getElement = (ref) => (getHostRef(ref).$hostElement$ );
106
+ /**
107
+ * Helper function to create & dispatch a custom Event on a provided target
108
+ * @param elm the target of the Event
109
+ * @param name the name to give the custom Event
110
+ * @param opts options for configuring a custom Event
111
+ * @returns the custom Event
112
+ */
113
+ const emitEvent = (elm, name, opts) => {
114
+ const ev = plt.ce(name, opts);
115
+ elm.dispatchEvent(ev);
116
+ return ev;
117
+ };
118
+ const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
119
+ const registerStyle = (scopeId, cssText, allowCS) => {
120
+ let style = styles.get(scopeId);
121
+ if (supportsConstructableStylesheets && allowCS) {
122
+ style = (style || new CSSStyleSheet());
123
+ if (typeof style === 'string') {
124
+ style = cssText;
125
+ }
126
+ else {
127
+ style.replaceSync(cssText);
128
+ }
129
+ }
130
+ else {
131
+ style = cssText;
132
+ }
133
+ styles.set(scopeId, style);
134
+ };
135
+ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
136
+ let scopeId = getScopeId(cmpMeta);
137
+ const style = styles.get(scopeId);
138
+ // if an element is NOT connected then getRootNode() will return the wrong root node
139
+ // so the fallback is to always use the document for the root node in those cases
140
+ styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
141
+ if (style) {
142
+ if (typeof style === 'string') {
143
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
144
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
145
+ let styleElm;
146
+ if (!appliedStyles) {
147
+ rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
148
+ }
149
+ if (!appliedStyles.has(scopeId)) {
150
+ {
151
+ {
152
+ styleElm = doc.createElement('style');
153
+ styleElm.innerHTML = style;
154
+ }
155
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
156
+ }
157
+ if (appliedStyles) {
158
+ appliedStyles.add(scopeId);
159
+ }
160
+ }
161
+ }
162
+ else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
163
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
164
+ }
165
+ }
166
+ return scopeId;
167
+ };
168
+ const attachStyles = (hostRef) => {
169
+ const cmpMeta = hostRef.$cmpMeta$;
170
+ const elm = hostRef.$hostElement$;
171
+ const flags = cmpMeta.$flags$;
172
+ const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
173
+ const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
174
+ if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
175
+ // only required when we're NOT using native shadow dom (slot)
176
+ // or this browser doesn't support native shadow dom
177
+ // and this host element was NOT created with SSR
178
+ // let's pick out the inner content for slot projection
179
+ // create a node to represent where the original
180
+ // content was first placed, which is useful later on
181
+ // DOM WRITE!!
182
+ elm['s-sc'] = scopeId;
183
+ elm.classList.add(scopeId + '-h');
184
+ }
185
+ endAttachStyles();
186
+ };
187
+ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
212
188
  /**
213
189
  * Production setAccessor() function based on Preact by
214
190
  * Jason Miller (@developit)
@@ -249,7 +225,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
249
225
  }
250
226
  }
251
227
  }
252
- else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
228
+ else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
253
229
  newValue = newValue === true ? '' : newValue;
254
230
  {
255
231
  elm.setAttribute(memberName, newValue);
@@ -262,7 +238,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
262
238
  // if the element passed in is a shadow root, which is a document fragment
263
239
  // then we want to be adding attrs/props to the shadow root's "host" element
264
240
  // if it's not a shadow root, then we add attrs/props to the same element
265
- const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
241
+ const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
266
242
  ? newVnode.$elm$.host
267
243
  : newVnode.$elm$;
268
244
  const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
@@ -272,6 +248,16 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
272
248
  setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
273
249
  }
274
250
  };
251
+ /**
252
+ * Create a DOM Node corresponding to one of the children of a given VNode.
253
+ *
254
+ * @param oldParentVNode the parent VNode from the previous render
255
+ * @param newParentVNode the parent VNode from the current render
256
+ * @param childIndex the index of the VNode, in the _new_ parent node's
257
+ * children, for which we will create a new DOM node
258
+ * @param parentElm the parent DOM node which our new node will be a child of
259
+ * @returns the newly created node
260
+ */
275
261
  const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
276
262
  // tslint:disable-next-line: prefer-const
277
263
  const newVNode = newParentVNode.$children$[childIndex];
@@ -320,12 +306,19 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
320
306
  }
321
307
  }
322
308
  };
309
+ /**
310
+ * Handle reconciling an outdated VNode with a new one which corresponds to
311
+ * it. This function handles flushing updates to the DOM and reconciling the
312
+ * children of the two nodes (if any).
313
+ *
314
+ * @param oldVNode an old VNode whose DOM element and children we want to update
315
+ * @param newVNode a new VNode representing an updated version of the old one
316
+ */
323
317
  const patch = (oldVNode, newVNode) => {
324
318
  const elm = (newVNode.$elm$ = oldVNode.$elm$);
325
319
  const newChildren = newVNode.$children$;
326
320
  const tag = newVNode.$tag$;
327
321
  {
328
- // element node
329
322
  {
330
323
  if (tag === 'slot')
331
324
  ;
@@ -349,7 +342,7 @@ const renderVdom = (hostRef, renderFnResults) => {
349
342
  const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
350
343
  hostTagName = hostElm.tagName;
351
344
  rootVnode.$tag$ = null;
352
- rootVnode.$flags$ |= 4 /* isHost */;
345
+ rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
353
346
  hostRef.$vnode$ = rootVnode;
354
347
  rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
355
348
  {
@@ -358,27 +351,14 @@ const renderVdom = (hostRef, renderFnResults) => {
358
351
  // synchronous patch
359
352
  patch(oldVNode, rootVnode);
360
353
  };
361
- const getElement = (ref) => (getHostRef(ref).$hostElement$ );
362
- /**
363
- * Helper function to create & dispatch a custom Event on a provided target
364
- * @param elm the target of the Event
365
- * @param name the name to give the custom Event
366
- * @param opts options for configuring a custom Event
367
- * @returns the custom Event
368
- */
369
- const emitEvent = (elm, name, opts) => {
370
- const ev = plt.ce(name, opts);
371
- elm.dispatchEvent(ev);
372
- return ev;
373
- };
374
354
  const attachToAncestor = (hostRef, ancestorComponent) => {
375
355
  if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
376
356
  ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
377
357
  }
378
358
  };
379
359
  const scheduleUpdate = (hostRef, isInitialLoad) => {
380
- if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
381
- hostRef.$flags$ |= 512 /* needsRerender */;
360
+ if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
361
+ hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
382
362
  return;
383
363
  }
384
364
  attachToAncestor(hostRef, hostRef.$ancestorComponent$);
@@ -394,7 +374,7 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
394
374
  let promise;
395
375
  if (isInitialLoad) {
396
376
  {
397
- hostRef.$flags$ |= 256 /* isListenReady */;
377
+ hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
398
378
  if (hostRef.$queuedListeners$) {
399
379
  hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
400
380
  hostRef.$queuedListeners$ = null;
@@ -437,7 +417,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
437
417
  }
438
418
  else {
439
419
  Promise.all(childrenPromises).then(postUpdate);
440
- hostRef.$flags$ |= 4 /* isWaitingForChildren */;
420
+ hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
441
421
  childrenPromises.length = 0;
442
422
  }
443
423
  }
@@ -446,7 +426,7 @@ const callRender = (hostRef, instance, elm) => {
446
426
  try {
447
427
  instance = instance.render() ;
448
428
  {
449
- hostRef.$flags$ |= 2 /* hasRendered */;
429
+ hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
450
430
  }
451
431
  {
452
432
  {
@@ -469,8 +449,8 @@ const postUpdateComponent = (hostRef) => {
469
449
  const elm = hostRef.$hostElement$;
470
450
  const endPostUpdate = createTime('postUpdate', tagName);
471
451
  const ancestorComponent = hostRef.$ancestorComponent$;
472
- if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
473
- hostRef.$flags$ |= 64 /* hasLoadedComponent */;
452
+ if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
453
+ hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
474
454
  {
475
455
  // DOM WRITE!
476
456
  addHydratedFlag(elm);
@@ -493,10 +473,10 @@ const postUpdateComponent = (hostRef) => {
493
473
  hostRef.$onRenderResolve$();
494
474
  hostRef.$onRenderResolve$ = undefined;
495
475
  }
496
- if (hostRef.$flags$ & 512 /* needsRerender */) {
476
+ if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
497
477
  nextTick(() => scheduleUpdate(hostRef, false));
498
478
  }
499
- hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
479
+ hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
500
480
  }
501
481
  // ( •_•)
502
482
  // ( •_•)>⌐■-■
@@ -526,6 +506,16 @@ const then = (promise, thenFn) => {
526
506
  };
527
507
  const addHydratedFlag = (elm) => elm.classList.add('hydrated')
528
508
  ;
509
+ /**
510
+ * Attach a series of runtime constructs to a compiled Stencil component
511
+ * constructor, including getters and setters for the `@Prop` and `@State`
512
+ * decorators, callbacks for when attributes change, and so on.
513
+ *
514
+ * @param Cstr the constructor for a component that we need to process
515
+ * @param cmpMeta metadata collected previously about the component
516
+ * @param flags a number used to store a series of bit flags
517
+ * @returns a reference to the same constructor passed in (but now mutated)
518
+ */
529
519
  const proxyComponent = (Cstr, cmpMeta, flags) => {
530
520
  if (cmpMeta.$members$) {
531
521
  // It's better to have a const than two Object.entries()
@@ -537,10 +527,10 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
537
527
  };
538
528
  const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
539
529
  // initializeComponent
540
- if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
530
+ if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
541
531
  {
542
532
  // we haven't initialized this element yet
543
- hostRef.$flags$ |= 32 /* hasInitializedComponent */;
533
+ hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
544
534
  // lazy loaded components
545
535
  // request the component's implementation to be
546
536
  // wired up with the host element
@@ -560,7 +550,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
560
550
  // but let's keep track of when we start and stop
561
551
  // so that the getters/setters don't incorrectly step on data
562
552
  {
563
- hostRef.$flags$ |= 8 /* isConstructingInstance */;
553
+ hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
564
554
  }
565
555
  // construct the lazy-loaded component implementation
566
556
  // passing the hostRef is very important during
@@ -573,7 +563,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
573
563
  consoleError(e);
574
564
  }
575
565
  {
576
- hostRef.$flags$ &= ~8 /* isConstructingInstance */;
566
+ hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
577
567
  }
578
568
  endNewInstance();
579
569
  }
@@ -583,7 +573,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
583
573
  const scopeId = getScopeId(cmpMeta);
584
574
  if (!styles.has(scopeId)) {
585
575
  const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
586
- registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
576
+ registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
587
577
  endRegisterStyles();
588
578
  }
589
579
  }
@@ -605,13 +595,13 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
605
595
  }
606
596
  };
607
597
  const connectedCallback = (elm) => {
608
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
598
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
609
599
  const hostRef = getHostRef(elm);
610
600
  const cmpMeta = hostRef.$cmpMeta$;
611
601
  const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
612
- if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
602
+ if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
613
603
  // first time this component has connected
614
- hostRef.$flags$ |= 1 /* hasConnected */;
604
+ hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
615
605
  {
616
606
  // find the first ancestor component (if there is one) and register
617
607
  // this component as one of the actively loading child components for its ancestor
@@ -641,7 +631,7 @@ const connectedCallback = (elm) => {
641
631
  }
642
632
  };
643
633
  const disconnectedCallback = (elm) => {
644
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
634
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
645
635
  const hostRef = getHostRef(elm);
646
636
  {
647
637
  if (hostRef.$rmListeners$) {
@@ -686,7 +676,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
686
676
  super(self);
687
677
  self = this;
688
678
  registerHost(self, cmpMeta);
689
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
679
+ if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
690
680
  // this component is using shadow dom
691
681
  // and this browser supports shadow dom
692
682
  // add the read-only property "shadowRoot" to the host element
@@ -743,7 +733,36 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
743
733
  // Fallback appLoad event
744
734
  endBootstrap();
745
735
  };
746
- const hostRefs = new WeakMap();
736
+ const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
737
+ if (listeners) {
738
+ listeners.map(([flags, name, method]) => {
739
+ const target = elm;
740
+ const handler = hostListenerProxy(hostRef, method);
741
+ const opts = hostListenerOpts(flags);
742
+ plt.ael(target, name, handler, opts);
743
+ (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
744
+ });
745
+ }
746
+ };
747
+ const hostListenerProxy = (hostRef, methodName) => (ev) => {
748
+ try {
749
+ {
750
+ if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
751
+ // instance is ready, let's call it's member method for this event
752
+ hostRef.$lazyInstance$[methodName](ev);
753
+ }
754
+ else {
755
+ (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
756
+ }
757
+ }
758
+ }
759
+ catch (e) {
760
+ consoleError(e);
761
+ }
762
+ };
763
+ // prettier-ignore
764
+ const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
765
+ const hostRefs = /*@__PURE__*/ new WeakMap();
747
766
  const getHostRef = (ref) => hostRefs.get(ref);
748
767
  const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
749
768
  const registerHost = (elm, cmpMeta) => {
@@ -785,14 +804,35 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
785
804
  return importedModule[exportName];
786
805
  }, consoleError);
787
806
  };
788
- const styles = new Map();
807
+ const styles = /*@__PURE__*/ new Map();
808
+ const win = typeof window !== 'undefined' ? window : {};
809
+ const doc = win.document || { head: {} };
810
+ const plt = {
811
+ $flags$: 0,
812
+ $resourcesUrl$: '',
813
+ jmp: (h) => h(),
814
+ raf: (h) => requestAnimationFrame(h),
815
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
816
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
817
+ ce: (eventName, opts) => new CustomEvent(eventName, opts),
818
+ };
819
+ const promiseResolve = (v) => Promise.resolve(v);
820
+ const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
821
+ try {
822
+ new CSSStyleSheet();
823
+ return typeof new CSSStyleSheet().replaceSync === 'function';
824
+ }
825
+ catch (e) { }
826
+ return false;
827
+ })()
828
+ ;
789
829
  const queueDomReads = [];
790
830
  const queueDomWrites = [];
791
831
  const queueTask = (queue, write) => (cb) => {
792
832
  queue.push(cb);
793
833
  if (!queuePending) {
794
834
  queuePending = true;
795
- if (write && plt.$flags$ & 4 /* queueSync */) {
835
+ if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
796
836
  nextTick(flush);
797
837
  }
798
838
  else {
@@ -1,7 +1,7 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-ff5db4ec.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-18b5f438.js';
2
2
 
3
3
  /*
4
- Stencil Client Patch Esm v2.17.0 | MIT Licensed | https://stenciljs.com
4
+ Stencil Client Patch Esm v2.19.3 | MIT Licensed | https://stenciljs.com
5
5
  */
6
6
  const patchEsm = () => {
7
7
  return promiseResolve();
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, H as Host, g as getElement } from './index-ff5db4ec.js';
1
+ import { r as registerInstance, h, H as Host, g as getElement } from './index-18b5f438.js';
2
2
 
3
3
  const mdsTabCss = ".fixed{position:fixed}.absolute{position:absolute}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host{--background:rgb(var(--tone-neutral-09));--button-background-hover:transparent;--button-background-selected:rgb(var(--tone-neutral));--button-background:transparent;--button-color-hover:rgb(var(--tone-neutral-02));--button-color-selected:rgb(var(--tone-neutral-02));--button-color:rgb(var(--tone-neutral-04));--button-radius:0.5rem;--button-shadow-selected:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--radius:1rem;display:-ms-flexbox;display:flex;gap:0.5rem;overflow:auto;padding:0.5rem;background-color:var(--background);border-radius:var(--radius);-webkit-overflow-scrolling:touch;-ms-overflow-style:none;scroll-behavior:smooth;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;scrollbar-width:none}:host::-webkit-scrollbar{display:none}@media (max-width: 767px){.mobile\\:flex-1{-ms-flex:1 1 0%;flex:1 1 0%}}";
4
4
 
@@ -1,7 +1,7 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-ff5db4ec.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-18b5f438.js';
2
2
 
3
3
  /*
4
- Stencil Client Patch Browser v2.17.0 | MIT Licensed | https://stenciljs.com
4
+ Stencil Client Patch Browser v2.19.3 | MIT Licensed | https://stenciljs.com
5
5
  */
6
6
  const patchBrowser = () => {
7
7
  const importMeta = import.meta.url;
@@ -1 +1 @@
1
- var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)},StyleNode=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector=""};function parse(e){return parseCss(lex(e=clean(e)),e)}function clean(e){return e.replace(RX.comments,"").replace(RX.port,"")}function lex(e){var t=new StyleNode;t.start=0,t.end=e.length;for(var r=t,n=0,s=e.length;n<s;n++)if(e[n]===OPEN_BRACE){r.rules||(r.rules=[]);var o=r,a=o.rules[o.rules.length-1]||null;(r=new StyleNode).start=n+1,r.parent=o,r.previous=a,o.rules.push(r)}else e[n]===CLOSE_BRACE&&(r.end=n+1,r=r.parent||t);return t}function parseCss(e,t){var r=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=r.trim(),e.parent){var n=e.previous?e.previous.end:e.parent.start;r=(r=(r=_expandUnicodeEscapes(r=t.substring(n,e.start-1))).replace(RX.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var s=e.parsedSelector=e.selector=r.trim();e.atRule=0===s.indexOf(AT_START),e.atRule?0===s.indexOf(MEDIA_START)?e.type=types.MEDIA_RULE:s.match(RX.keyframesRule)&&(e.type=types.KEYFRAMES_RULE,e.keyframesName=e.selector.split(RX.multipleSpaces).pop()):0===s.indexOf(VAR_START)?e.type=types.MIXIN_RULE:e.type=types.STYLE_RULE}var o=e.rules;if(o)for(var a=0,i=o.length,l=void 0;a<i&&(l=o[a]);a++)parseCss(l,t);return e}function _expandUnicodeEscapes(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return"\\"+e}))}var types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE="{",CLOSE_BRACE="}",RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},VAR_START="--",MEDIA_START="@media",AT_START="@";function findRegex(e,t,r){e.lastIndex=0;var n=t.substring(r).match(e);if(n){var s=r+n.index;return{start:s,end:s+n[0].length}}return null}var VAR_USAGE_START=/\bvar\(/,VAR_ASSIGN_START=/\B--[\w-]+\s*:/,COMMENTS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,TRAILING_LINES=/^[\t ]+\n/gm;function resolveVar(e,t,r){return e[t]?e[t]:r?executeTemplate(r,e):""}function findVarEndIndex(e,t){for(var r=0,n=t;n<e.length;n++){var s=e[n];if("("===s)r++;else if(")"===s&&--r<=0)return n+1}return n}function parseVar(e,t){var r=findRegex(VAR_USAGE_START,e,t);if(!r)return null;var n=findVarEndIndex(e,r.start),s=e.substring(r.end,n-1).split(","),o=s[0],a=s.slice(1);return{start:r.start,end:n,propName:o.trim(),fallback:a.length>0?a.join(",").trim():void 0}}function compileVar(e,t,r){var n=parseVar(e,r);if(!n)return t.push(e.substring(r,e.length)),e.length;var s=n.propName,o=null!=n.fallback?compileTemplate(n.fallback):void 0;return t.push(e.substring(r,n.start),(function(e){return resolveVar(e,s,o)})),n.end}function executeTemplate(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];r+="string"==typeof s?s:s(t)}return r}function findEndValue(e,t){for(var r=!1,n=!1,s=t;s<e.length;s++){var o=e[s];if(r)n&&'"'===o&&(r=!1),n||"'"!==o||(r=!1);else if('"'===o)r=!0,n=!0;else if("'"===o)r=!0,n=!1;else{if(";"===o)return s+1;if("}"===o)return s}}return s}function removeCustomAssigns(e){for(var t="",r=0;;){var n=findRegex(VAR_ASSIGN_START,e,r),s=n?n.start:e.length;if(t+=e.substring(r,s),!n)break;r=findEndValue(e,s)}return t}function compileTemplate(e){var t=0;e=removeCustomAssigns(e=e.replace(COMMENTS,"")).replace(TRAILING_LINES,"");for(var r=[];t<e.length;)t=compileVar(e,r,t);return r}function resolveValues(e){var t={};e.forEach((function(e){e.declarations.forEach((function(e){t[e.prop]=e.value}))}));for(var r={},n=Object.entries(t),s=function(e){var t=!1;if(n.forEach((function(e){var n=e[0],s=executeTemplate(e[1],r);s!==r[n]&&(r[n]=s,t=!0)})),!t)return"break"},o=0;o<10;o++){if("break"===s())break}return r}function getSelectors(e,t){if(void 0===t&&(t=0),!e.rules)return[];var r=[];return e.rules.filter((function(e){return e.type===types.STYLE_RULE})).forEach((function(e){var n=getDeclarations(e.cssText);n.length>0&&e.parsedSelector.split(",").forEach((function(e){e=e.trim(),r.push({selector:e,declarations:n,specificity:computeSpecificity(),nu:t})})),t++})),r}function computeSpecificity(e){return 1}var IMPORTANT="!important",FIND_DECLARATIONS=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function getDeclarations(e){for(var t,r=[];t=FIND_DECLARATIONS.exec(e.trim());){var n=normalizeValue(t[2]),s=n.value,o=n.important;r.push({prop:t[1].trim(),value:compileTemplate(s),important:o})}return r}function normalizeValue(e){var t=(e=e.replace(/\s+/gim," ").trim()).endsWith(IMPORTANT);return t&&(e=e.slice(0,e.length-IMPORTANT.length).trim()),{value:e,important:t}}function getActiveSelectors(e,t,r){var n=[],s=getScopesForElement(t,e);return r.forEach((function(e){return n.push(e)})),s.forEach((function(e){return n.push(e)})),sortSelectors(getSelectorsForScopes(n).filter((function(t){return matches(e,t.selector)})))}function getScopesForElement(e,t){for(var r=[];t;){var n=e.get(t);n&&r.push(n),t=t.parentElement}return r}function getSelectorsForScopes(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.selectors)})),t}function sortSelectors(e){return e.sort((function(e,t){return e.specificity===t.specificity?e.nu-t.nu:e.specificity-t.specificity})),e}function matches(e,t){return":root"===t||"html"===t||e.matches(t)}function parseCSS(e){var t=parse(e),r=compileTemplate(e);return{original:e,template:r,selectors:getSelectors(t),usesCssVars:r.length>1}}function addGlobalStyle(e,t){if(e.some((function(e){return e.styleEl===t})))return!1;var r=parseCSS(t.textContent);return r.styleEl=t,e.push(r),!0}function updateGlobalScopes(e){var t=resolveValues(getSelectorsForScopes(e));e.forEach((function(e){e.usesCssVars&&(e.styleEl.textContent=executeTemplate(e.template,t))}))}function reScope(e,t){var r=e.template.map((function(r){return"string"==typeof r?replaceScope(r,e.scopeId,t):r})),n=e.selectors.map((function(r){return __assign(__assign({},r),{selector:replaceScope(r.selector,e.scopeId,t)})}));return __assign(__assign({},e),{template:r,selectors:n,scopeId:t})}function replaceScope(e,t,r){return e=replaceAll(e,"\\.".concat(t),".".concat(r))}function replaceAll(e,t,r){return e.replace(new RegExp(t,"g"),r)}function loadDocument(e,t){return loadDocumentStyles(e,t),loadDocumentLinks(e,t).then((function(){updateGlobalScopes(t)}))}function startWatcher(e,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){loadDocumentStyles(e,t)&&updateGlobalScopes(t)})).observe(document.head,{childList:!0})}function loadDocumentLinks(e,t){for(var r=[],n=e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s<n.length;s++)r.push(addGlobalLink(e,t,n[s]));return Promise.all(r)}function loadDocumentStyles(e,t){return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(e){return addGlobalStyle(t,e)})).some(Boolean)}function addGlobalLink(e,t,r){var n=r.href;return fetch(n).then((function(e){return e.text()})).then((function(s){if(hasCssVariables(s)&&r.parentNode){hasRelativeUrls(s)&&(s=fixRelativeUrls(s,n));var o=e.createElement("style");o.setAttribute("data-styles",""),o.textContent=s,addGlobalStyle(t,o),r.parentNode.insertBefore(o,r),r.remove()}})).catch((function(e){console.error(e)}))}var CSS_VARIABLE_REGEXP=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function hasCssVariables(e){return e.indexOf("var(")>-1||CSS_VARIABLE_REGEXP.test(e)}var CSS_URL_REGEXP=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function hasRelativeUrls(e){return CSS_URL_REGEXP.lastIndex=0,CSS_URL_REGEXP.test(e)}function fixRelativeUrls(e,t){var r=t.replace(/[^/]*$/,"");return e.replace(CSS_URL_REGEXP,(function(e,t){var n=r+t;return e.replace(t,n)}))}var CustomStyle=function(){function e(e,t){this.win=e,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1}return e.prototype.i=function(){var e=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){e.win.requestAnimationFrame((function(){startWatcher(e.doc,e.globalScopes),loadDocument(e.doc,e.globalScopes).then((function(){return t()}))}))})))},e.prototype.addLink=function(e){var t=this;return addGlobalLink(this.doc,this.globalScopes,e).then((function(){t.updateGlobal()}))},e.prototype.addGlobalStyle=function(e){addGlobalStyle(this.globalScopes,e)&&this.updateGlobal()},e.prototype.createHostStyle=function(e,t,r,n){if(this.hostScopeMap.has(e))throw new Error("host style already created");var s=this.registerHostTemplate(r,t,n),o=this.doc.createElement("style");return o.setAttribute("data-no-shim",""),s.usesCssVars?n?(o["s-sc"]=t="".concat(s.scopeId,"-").concat(this.count),o.textContent="/*needs update*/",this.hostStyleMap.set(e,o),this.hostScopeMap.set(e,reScope(s,t)),this.count++):(s.styleEl=o,s.usesCssVars||(o.textContent=executeTemplate(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(e,s)):o.textContent=r,o},e.prototype.removeHost=function(e){var t=this.hostStyleMap.get(e);t&&t.remove(),this.hostStyleMap.delete(e),this.hostScopeMap.delete(e)},e.prototype.updateHost=function(e){var t=this.hostScopeMap.get(e);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(e);if(r){var n=resolveValues(getActiveSelectors(e,this.hostScopeMap,this.globalScopes));r.textContent=executeTemplate(t.template,n)}}},e.prototype.updateGlobal=function(){updateGlobalScopes(this.globalScopes)},e.prototype.registerHostTemplate=function(e,t,r){var n=this.scopesMap.get(t);return n||((n=parseCSS(e)).scopeId=t,n.isScoped=r,this.scopesMap.set(t,n)),n},e}();!function(e){!e||e.__cssshim||e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")||(e.__cssshim=new CustomStyle(e,e.document))}("undefined"!=typeof window&&window);
1
+ var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)},StyleNode=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector=""};function parse(e){return parseCss(lex(e=clean(e)),e)}function clean(e){return e.replace(RX.comments,"").replace(RX.port,"")}function lex(e){var t=new StyleNode;t.start=0,t.end=e.length;for(var r=t,n=0,s=e.length;n<s;n++)if(e[n]===OPEN_BRACE){r.rules||(r.rules=[]);var o=r,a=o.rules[o.rules.length-1]||null;(r=new StyleNode).start=n+1,r.parent=o,r.previous=a,o.rules.push(r)}else e[n]===CLOSE_BRACE&&(r.end=n+1,r=r.parent||t);return t}function parseCss(e,t){var r=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=r.trim(),e.parent){var n=e.previous?e.previous.end:e.parent.start;r=(r=(r=_expandUnicodeEscapes(r=t.substring(n,e.start-1))).replace(RX.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var s=e.parsedSelector=e.selector=r.trim();e.atRule=0===s.indexOf(AT_START),e.atRule?0===s.indexOf(MEDIA_START)?e.type=types.MEDIA_RULE:s.match(RX.keyframesRule)&&(e.type=types.KEYFRAMES_RULE,e.keyframesName=e.selector.split(RX.multipleSpaces).pop()):0===s.indexOf(VAR_START)?e.type=types.MIXIN_RULE:e.type=types.STYLE_RULE}var o=e.rules;if(o)for(var a=0,i=o.length,l=void 0;a<i&&(l=o[a]);a++)parseCss(l,t);return e}function _expandUnicodeEscapes(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return"\\"+e}))}var types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE="{",CLOSE_BRACE="}",RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},VAR_START="--",MEDIA_START="@media",AT_START="@",VAR_USAGE_START=/\bvar\(/,VAR_ASSIGN_START=/\B--[\w-]+\s*:/,COMMENTS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,TRAILING_LINES=/^[\t ]+\n/gm;function findRegex(e,t,r){e.lastIndex=0;var n=t.substring(r).match(e);if(n){var s=r+n.index;return{start:s,end:s+n[0].length}}return null}function resolveVar(e,t,r){return e[t]?e[t]:r?executeTemplate(r,e):""}function findVarEndIndex(e,t){for(var r=0,n=t;n<e.length;n++){var s=e[n];if("("===s)r++;else if(")"===s&&--r<=0)return n+1}return n}function parseVar(e,t){var r=findRegex(VAR_USAGE_START,e,t);if(!r)return null;var n=findVarEndIndex(e,r.start),s=e.substring(r.end,n-1).split(","),o=s[0],a=s.slice(1);return{start:r.start,end:n,propName:o.trim(),fallback:a.length>0?a.join(",").trim():void 0}}function compileVar(e,t,r){var n=parseVar(e,r);if(!n)return t.push(e.substring(r,e.length)),e.length;var s=n.propName,o=null!=n.fallback?compileTemplate(n.fallback):void 0;return t.push(e.substring(r,n.start),(function(e){return resolveVar(e,s,o)})),n.end}function executeTemplate(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];r+="string"==typeof s?s:s(t)}return r}function findEndValue(e,t){for(var r=!1,n=!1,s=t;s<e.length;s++){var o=e[s];if(r)n&&'"'===o&&(r=!1),n||"'"!==o||(r=!1);else if('"'===o)r=!0,n=!0;else if("'"===o)r=!0,n=!1;else{if(";"===o)return s+1;if("}"===o)return s}}return s}function removeCustomAssigns(e){for(var t="",r=0;;){var n=findRegex(VAR_ASSIGN_START,e,r),s=n?n.start:e.length;if(t+=e.substring(r,s),!n)break;r=findEndValue(e,s)}return t}function compileTemplate(e){var t=0;e=removeCustomAssigns(e=e.replace(COMMENTS,"")).replace(TRAILING_LINES,"");for(var r=[];t<e.length;)t=compileVar(e,r,t);return r}function resolveValues(e){var t={};e.forEach((function(e){e.declarations.forEach((function(e){t[e.prop]=e.value}))}));for(var r={},n=Object.entries(t),s=function(e){var t=!1;if(n.forEach((function(e){var n=e[0],s=executeTemplate(e[1],r);s!==r[n]&&(r[n]=s,t=!0)})),!t)return"break"},o=0;o<10;o++){if("break"===s())break}return r}function getSelectors(e,t){if(void 0===t&&(t=0),!e.rules)return[];var r=[];return e.rules.filter((function(e){return e.type===types.STYLE_RULE})).forEach((function(e){var n=getDeclarations(e.cssText);n.length>0&&e.parsedSelector.split(",").forEach((function(e){e=e.trim(),r.push({selector:e,declarations:n,specificity:computeSpecificity(),nu:t})})),t++})),r}function computeSpecificity(e){return 1}var IMPORTANT="!important",FIND_DECLARATIONS=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function getDeclarations(e){for(var t,r=[];t=FIND_DECLARATIONS.exec(e.trim());){var n=normalizeValue(t[2]),s=n.value,o=n.important;r.push({prop:t[1].trim(),value:compileTemplate(s),important:o})}return r}function normalizeValue(e){var t=(e=e.replace(/\s+/gim," ").trim()).endsWith(IMPORTANT);return t&&(e=e.slice(0,e.length-IMPORTANT.length).trim()),{value:e,important:t}}function getActiveSelectors(e,t,r){var n=[],s=getScopesForElement(t,e);return r.forEach((function(e){return n.push(e)})),s.forEach((function(e){return n.push(e)})),sortSelectors(getSelectorsForScopes(n).filter((function(t){return matches(e,t.selector)})))}function getScopesForElement(e,t){for(var r=[];t;){var n=e.get(t);n&&r.push(n),t=t.parentElement}return r}function getSelectorsForScopes(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.selectors)})),t}function sortSelectors(e){return e.sort((function(e,t){return e.specificity===t.specificity?e.nu-t.nu:e.specificity-t.specificity})),e}function matches(e,t){return":root"===t||"html"===t||e.matches(t)}function parseCSS(e){var t=parse(e),r=compileTemplate(e);return{original:e,template:r,selectors:getSelectors(t),usesCssVars:r.length>1}}function addGlobalStyle(e,t){if(e.some((function(e){return e.styleEl===t})))return!1;var r=parseCSS(t.textContent);return r.styleEl=t,e.push(r),!0}function updateGlobalScopes(e){var t=resolveValues(getSelectorsForScopes(e));e.forEach((function(e){e.usesCssVars&&(e.styleEl.textContent=executeTemplate(e.template,t))}))}function reScope(e,t){var r=e.template.map((function(r){return"string"==typeof r?replaceScope(r,e.scopeId,t):r})),n=e.selectors.map((function(r){return __assign(__assign({},r),{selector:replaceScope(r.selector,e.scopeId,t)})}));return __assign(__assign({},e),{template:r,selectors:n,scopeId:t})}function replaceScope(e,t,r){return e=replaceAll(e,"\\.".concat(t),".".concat(r))}function replaceAll(e,t,r){return e.replace(new RegExp(t,"g"),r)}function loadDocument(e,t){return loadDocumentStyles(e,t),loadDocumentLinks(e,t).then((function(){updateGlobalScopes(t)}))}function startWatcher(e,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){loadDocumentStyles(e,t)&&updateGlobalScopes(t)})).observe(document.head,{childList:!0})}function loadDocumentLinks(e,t){for(var r=[],n=e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s<n.length;s++)r.push(addGlobalLink(e,t,n[s]));return Promise.all(r)}function loadDocumentStyles(e,t){return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(e){return addGlobalStyle(t,e)})).some(Boolean)}function addGlobalLink(e,t,r){var n=r.href;return fetch(n).then((function(e){return e.text()})).then((function(s){if(hasCssVariables(s)&&r.parentNode){hasRelativeUrls(s)&&(s=fixRelativeUrls(s,n));var o=e.createElement("style");o.setAttribute("data-styles",""),o.textContent=s,addGlobalStyle(t,o),r.parentNode.insertBefore(o,r),r.remove()}})).catch((function(e){console.error(e)}))}var CSS_VARIABLE_REGEXP=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function hasCssVariables(e){return e.indexOf("var(")>-1||CSS_VARIABLE_REGEXP.test(e)}var CSS_URL_REGEXP=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function hasRelativeUrls(e){return CSS_URL_REGEXP.lastIndex=0,CSS_URL_REGEXP.test(e)}function fixRelativeUrls(e,t){var r=t.replace(/[^/]*$/,"");return e.replace(CSS_URL_REGEXP,(function(e,t){var n=r+t;return e.replace(t,n)}))}var CustomStyle=function(){function e(e,t){this.win=e,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1}return e.prototype.i=function(){var e=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){e.win.requestAnimationFrame((function(){startWatcher(e.doc,e.globalScopes),loadDocument(e.doc,e.globalScopes).then((function(){return t()}))}))})))},e.prototype.addLink=function(e){var t=this;return addGlobalLink(this.doc,this.globalScopes,e).then((function(){t.updateGlobal()}))},e.prototype.addGlobalStyle=function(e){addGlobalStyle(this.globalScopes,e)&&this.updateGlobal()},e.prototype.createHostStyle=function(e,t,r,n){if(this.hostScopeMap.has(e))throw new Error("host style already created");var s=this.registerHostTemplate(r,t,n),o=this.doc.createElement("style");return o.setAttribute("data-no-shim",""),s.usesCssVars?n?(o["s-sc"]=t="".concat(s.scopeId,"-").concat(this.count),o.textContent="/*needs update*/",this.hostStyleMap.set(e,o),this.hostScopeMap.set(e,reScope(s,t)),this.count++):(s.styleEl=o,s.usesCssVars||(o.textContent=executeTemplate(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(e,s)):o.textContent=r,o},e.prototype.removeHost=function(e){var t=this.hostStyleMap.get(e);t&&t.remove(),this.hostStyleMap.delete(e),this.hostScopeMap.delete(e)},e.prototype.updateHost=function(e){var t=this.hostScopeMap.get(e);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(e);if(r){var n=resolveValues(getActiveSelectors(e,this.hostScopeMap,this.globalScopes));r.textContent=executeTemplate(t.template,n)}}},e.prototype.updateGlobal=function(){updateGlobalScopes(this.globalScopes)},e.prototype.registerHostTemplate=function(e,t,r){var n=this.scopesMap.get(t);return n||((n=parseCSS(e)).scopeId=t,n.isScoped=r,this.scopesMap.set(t,n)),n},e}();!function(e){!e||e.__cssshim||e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")||(e.__cssshim=new CustomStyle(e,e.document))}("undefined"!=typeof window&&window);