@wcstack/fetch 4.23.0 → 4.24.0

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/dist/index.d.ts CHANGED
@@ -158,6 +158,18 @@ interface WcsFetchCoreValues<T = unknown> {
158
158
  interface WcsFetchValues<T = unknown> extends WcsFetchCoreValues<T> {
159
159
  trigger: boolean;
160
160
  }
161
+ /**
162
+ * What `<wcs-fetch>`'s `fetch(url, init)` takes beside the url, for that request only — a command token carries
163
+ * it: `this.$command.load.emit("/api/users", { method: "POST", body: user })`.
164
+ */
165
+ interface WcsFetchCommandInit {
166
+ /** The method, in place of the element's `method`. */
167
+ method?: string;
168
+ /** Headers added to the `<wcs-fetch-header>` ones (a same name replaces it). */
169
+ headers?: Record<string, string>;
170
+ /** The body, in place of the element's `body` — which is then kept for the next request. */
171
+ body?: unknown;
172
+ }
161
173
 
162
174
  declare function bootstrapFetch(userConfig?: IWritableConfig, registry?: CustomElementRegistry): void;
163
175
 
@@ -370,18 +382,64 @@ declare class Fetch extends HTMLElement {
370
382
  * change starts, which `[wcs/fetch-auto-unsafe]` reports.
371
383
  */
372
384
  private _warnBodyGone;
373
- fetch(): Promise<any>;
385
+ /**
386
+ * Runs a request. With no argument it is the element's: its `url`, `method`, headers and `body`.
387
+ *
388
+ * `url` and `init` are for this request only — the element's attributes do not change. They are what a command
389
+ * token carries (`this.$command.load.emit("/api/users", { method: "GET" })` with `command.fetch: $command.load`):
390
+ * a command runs before the bindings of its update, so a `url` written in the same handler has not reached the
391
+ * element yet, and the request went to the one before (docs/seam-apps.md, town-archive). `init` takes `method`,
392
+ * `headers` (added to the `<wcs-fetch-header>` ones, replacing a same name) and `body` (in place of the
393
+ * element's, which is then kept for the next request). Anything that is not a string in `url`'s place — the
394
+ * event an `on…: $command.x` binding emits first — is ignored, and `init` with it.
395
+ */
396
+ fetch(url?: unknown, init?: unknown): Promise<any>;
374
397
  attributeChangedCallback(name: string, _oldValue: string | null, _newValue: string | null): void;
375
398
  connectedCallback(): void;
376
399
  connectedMoveCallback(): void;
377
400
  disconnectedCallback(): void;
378
401
  }
379
402
 
403
+ /**
404
+ * Runs a `<wcs-fetch>` when this element — a sentinel after a list — comes on screen.
405
+ *
406
+ * An IntersectionObserver reports a change of visibility and nothing else, and an element that only acted on that
407
+ * report did not load in three cases (docs/seam-apps.md, town-archive):
408
+ * - the sentinel reported before the page had written the target's `url` (state binds a moment after the elements
409
+ * are defined): the request was refused, and the sentinel, still on screen, never reported again;
410
+ * - a page arrived and did not push the sentinel out — a tall window, a zoomed-out page, a short page;
411
+ * - the `url` changed with the sentinel on screen — a filter, with the list emptied — at rest or while a request
412
+ * was in flight.
413
+ *
414
+ * So, with the sentinel on screen, the element also runs the target's request
415
+ * - when its `url` is written or changed while no request is in flight (the first page; a filter);
416
+ * - when a request ends and the `url` changed while it was in flight (a filter typed meanwhile);
417
+ * - when a request ends without an answer — aborted — and the `url` is another one (a page that aborts the request
418
+ * on its way when the filter changes);
419
+ * - when a request ends, the page has added rows (the sentinel moved) and moved the `url` on.
420
+ *
421
+ * It never runs a `url` again from there: a failed request waits for the user to scroll away and back, or for the
422
+ * page's retry. And a response that added nothing ends it, whatever the page does to the `url`: a page that counts
423
+ * its page number up on an empty answer does not ask for ever.
424
+ */
380
425
  declare class InfiniteScroll extends HTMLElement {
381
426
  static get observedAttributes(): string[];
382
427
  private _observer;
383
428
  private _done;
384
429
  private _warnedTarget;
430
+ private _warnedRoot;
431
+ private _warnedMargin;
432
+ private _rootElement;
433
+ private _inView;
434
+ private _fetch;
435
+ private _urlObserver;
436
+ private _asked;
437
+ private _startedAt;
438
+ private _changedInFlight;
439
+ private _answered;
440
+ private _settling;
441
+ private _onResponse;
442
+ private _onLoadingChanged;
385
443
  get target(): string;
386
444
  set target(value: string);
387
445
  get root(): string | null;
@@ -399,8 +457,38 @@ declare class InfiniteScroll extends HTMLElement {
399
457
  attributeChangedCallback(): void;
400
458
  private _observe;
401
459
  private _disconnectObserver;
460
+ /**
461
+ * The scroll container: the element with that id, or — as `<wcs-intersect root>` spells it — the first one the
462
+ * value matches as a selector. A root that is given and not found, or that does not scroll, is said once per
463
+ * value: the viewport took its place without a word, and a root that does not clip its content counts
464
+ * everything in it as on screen (`root="main"` loaded page after page).
465
+ */
402
466
  private _resolveRoot;
403
- private _triggerFetch;
467
+ private _resolveTarget;
468
+ /** Follows `target`'s url and requests (or stops following, with null). */
469
+ private _follow;
470
+ /** Where the sentinel is in what scrolls: rows added before it move it, scrolling does not. */
471
+ private _position;
472
+ /** A request started on the target (this element's, or the page's own). */
473
+ private _started;
474
+ /**
475
+ * The request ended: once the page has had its frames to add rows and move the url on, the sentinel — if it is
476
+ * still on screen — runs the next request when the url changed while this one was in flight, when this one had no
477
+ * answer (aborted: a url written right after it is the page's own change, not its reaction to a response), or
478
+ * when this one added rows. A response that added nothing ends it there.
479
+ */
480
+ private _ended;
481
+ /**
482
+ * The target's url was written. In flight, and while the page settles after a response, the end of that request
483
+ * decides (_ended). At rest it is the page's own change — the first url, a filter: with the sentinel on screen
484
+ * it is asked for, at once when nothing was asked yet, otherwise once the emptied list is laid out.
485
+ */
486
+ private _urlChanged;
487
+ /**
488
+ * Runs the target's request. `edge`: the sentinel came on screen (a user who scrolls away and back asks again,
489
+ * also for the same url — the way a failed request is tried again); otherwise only a url not asked yet.
490
+ */
491
+ private _run;
404
492
  }
405
493
 
406
494
  /**
@@ -459,4 +547,4 @@ declare global {
459
547
  }
460
548
 
461
549
  export { FetchCore, TRUSTED_TYPES_POLICY_SLOT, WCS_FETCH_ERROR_CODE, Fetch as WcsFetch, FetchBody as WcsFetchBody, FetchHeader as WcsFetchHeader, InfiniteScroll as WcsInfiniteScroll, bootstrapFetch, getConfig, getTrustedTypesPolicy, setTrustedTypesPolicy };
462
- export type { FetchRequestOptions, IWcsTrustedTypesPolicy, IWritableConfig, IWritableTagNames, WcsFetchCoreValues, WcsFetchHttpError, WcsFetchValues, WcsIoErrorInfo, WcsIoErrorPhase };
550
+ export type { FetchRequestOptions, IWcsTrustedTypesPolicy, IWritableConfig, IWritableTagNames, WcsFetchCommandInit, WcsFetchCoreValues, WcsFetchHttpError, WcsFetchValues, WcsIoErrorInfo, WcsIoErrorPhase };
package/dist/index.esm.js CHANGED
@@ -68,7 +68,7 @@ function setConfig(partialConfig) {
68
68
  frozenConfig = null;
69
69
  }
70
70
 
71
- var pkg = {"name":"@wcstack/fetch","version":"4.23.0"};
71
+ var pkg = {"name":"@wcstack/fetch","version":"4.24.0"};
72
72
 
73
73
  // ===========================================================================
74
74
  // AUTO-GENERATED FILE - DO NOT EDIT.
@@ -1529,20 +1529,38 @@ class Fetch extends HTMLElement {
1529
1529
  "it wrote last, so the same string on a retry never arrives: write a new object each time " +
1530
1530
  "(this.payload = { ...entry }), or null between two sends. (Said once until a body is sent again.)", this);
1531
1531
  }
1532
- async fetch() {
1532
+ /**
1533
+ * Runs a request. With no argument it is the element's: its `url`, `method`, headers and `body`.
1534
+ *
1535
+ * `url` and `init` are for this request only — the element's attributes do not change. They are what a command
1536
+ * token carries (`this.$command.load.emit("/api/users", { method: "GET" })` with `command.fetch: $command.load`):
1537
+ * a command runs before the bindings of its update, so a `url` written in the same handler has not reached the
1538
+ * element yet, and the request went to the one before (docs/seam-apps.md, town-archive). `init` takes `method`,
1539
+ * `headers` (added to the `<wcs-fetch-header>` ones, replacing a same name) and `body` (in place of the
1540
+ * element's, which is then kept for the next request). Anything that is not a string in `url`'s place — the
1541
+ * event an `on…: $command.x` binding emits first — is ignored, and `init` with it.
1542
+ */
1543
+ async fetch(url, init) {
1544
+ const given = typeof url === "string" && url !== "";
1545
+ const requestUrl = given ? url : this.url;
1546
+ const options = (given && init !== null && typeof init === "object" ? init : {});
1533
1547
  // Record the url for the auto-fetch same-value guard. Every fetch (explicit
1534
1548
  // included) updates it so a later auto-write of the same url is treated as a
1535
1549
  // no-op rather than a duplicate request.
1536
- this._lastFetchedUrl = this.url;
1550
+ this._lastFetchedUrl = requestUrl;
1537
1551
  // ready again (a request starts): a trigger refused in the next outage is said again
1538
- if (this.url)
1552
+ if (requestUrl)
1539
1553
  this._toldTriggerWithoutUrl = false;
1540
- const headers = this._collectHeaders();
1554
+ const headers = { ...this._collectHeaders(), ...(typeof options.headers === "object" ? options.headers : null) };
1541
1555
  // Snapshot and reset `body` synchronously, before any await. The body is a
1542
1556
  // one-shot input; resetting it after the await (when another caller may have
1543
1557
  // already set a new body for the next request) would silently drop that value.
1544
- const bodySnapshot = this._body;
1545
- this._body = null;
1558
+ // (A body the command brought is this request's: the element's waits for the next.)
1559
+ let bodySnapshot = options.body ?? null;
1560
+ if (bodySnapshot === null) {
1561
+ bodySnapshot = this._body;
1562
+ this._body = null;
1563
+ }
1546
1564
  const { body, contentType } = this._collectBody(bodySnapshot);
1547
1565
  const auto = this._auto;
1548
1566
  this._auto = false;
@@ -1562,8 +1580,8 @@ class Fetch extends HTMLElement {
1562
1580
  "This drops the multipart boundary the browser adds automatically; remove the " +
1563
1581
  "Content-Type header (e.g. the <wcs-fetch-header>) to fix multipart uploads.");
1564
1582
  }
1565
- const result = await this._core.fetch(this.url, {
1566
- method: this.method,
1583
+ const result = await this._core.fetch(requestUrl, {
1584
+ method: typeof options.method === "string" && options.method ? options.method.toUpperCase() : this.method,
1567
1585
  headers,
1568
1586
  body,
1569
1587
  contentType,
@@ -1702,6 +1720,30 @@ class FetchBody extends HTMLElement {
1702
1720
  }
1703
1721
  }
1704
1722
 
1723
+ /** Frames the page gets after a response to add its rows and move its url on, before the sentinel is looked at again. */
1724
+ const SETTLE_FRAMES = 3;
1725
+ /**
1726
+ * Runs a `<wcs-fetch>` when this element — a sentinel after a list — comes on screen.
1727
+ *
1728
+ * An IntersectionObserver reports a change of visibility and nothing else, and an element that only acted on that
1729
+ * report did not load in three cases (docs/seam-apps.md, town-archive):
1730
+ * - the sentinel reported before the page had written the target's `url` (state binds a moment after the elements
1731
+ * are defined): the request was refused, and the sentinel, still on screen, never reported again;
1732
+ * - a page arrived and did not push the sentinel out — a tall window, a zoomed-out page, a short page;
1733
+ * - the `url` changed with the sentinel on screen — a filter, with the list emptied — at rest or while a request
1734
+ * was in flight.
1735
+ *
1736
+ * So, with the sentinel on screen, the element also runs the target's request
1737
+ * - when its `url` is written or changed while no request is in flight (the first page; a filter);
1738
+ * - when a request ends and the `url` changed while it was in flight (a filter typed meanwhile);
1739
+ * - when a request ends without an answer — aborted — and the `url` is another one (a page that aborts the request
1740
+ * on its way when the filter changes);
1741
+ * - when a request ends, the page has added rows (the sentinel moved) and moved the `url` on.
1742
+ *
1743
+ * It never runs a `url` again from there: a failed request waits for the user to scroll away and back, or for the
1744
+ * page's retry. And a response that added nothing ends it, whatever the page does to the `url`: a page that counts
1745
+ * its page number up on an empty answer does not ask for ever.
1746
+ */
1705
1747
  class InfiniteScroll extends HTMLElement {
1706
1748
  static get observedAttributes() {
1707
1749
  return ["target", "root", "root-margin", "threshold", "disabled"];
@@ -1710,6 +1752,37 @@ class InfiniteScroll extends HTMLElement {
1710
1752
  _done = false;
1711
1753
  // the target last warned about (once per value)
1712
1754
  _warnedTarget = null;
1755
+ // the root and the margin last warned about (once per value)
1756
+ _warnedRoot = null;
1757
+ _warnedMargin = null;
1758
+ // the scroll container in use (null: the viewport)
1759
+ _rootElement = null;
1760
+ // the sentinel's last report
1761
+ _inView = false;
1762
+ // the target whose url and requests it follows
1763
+ _fetch = null;
1764
+ _urlObserver = null;
1765
+ // the url of the request last started on the target (by this element or by the page)
1766
+ _asked = null;
1767
+ // where the sentinel was when that request started
1768
+ _startedAt = 0;
1769
+ // the url changed while that request was in flight
1770
+ _changedInFlight = false;
1771
+ // that request was answered (a response arrived, an HTTP error too): not aborted, not a network failure
1772
+ _answered = false;
1773
+ // a request has ended and the page is adding its rows (SETTLE_FRAMES)
1774
+ _settling = false;
1775
+ _onResponse = () => {
1776
+ this._answered = true;
1777
+ };
1778
+ _onLoadingChanged = (event) => {
1779
+ if (event.detail) {
1780
+ this._started();
1781
+ }
1782
+ else {
1783
+ this._ended();
1784
+ }
1785
+ };
1713
1786
  get target() {
1714
1787
  return this.getAttribute("target") || "";
1715
1788
  }
@@ -1767,6 +1840,7 @@ class InfiniteScroll extends HTMLElement {
1767
1840
  }
1768
1841
  disconnectedCallback() {
1769
1842
  this._disconnectObserver();
1843
+ this._follow(null);
1770
1844
  }
1771
1845
  attributeChangedCallback() {
1772
1846
  if (this.isConnected) {
@@ -1778,15 +1852,33 @@ class InfiniteScroll extends HTMLElement {
1778
1852
  if (this._done || this.disabled || !this.target || typeof IntersectionObserver === "undefined") {
1779
1853
  return;
1780
1854
  }
1781
- this._observer = new IntersectionObserver((entries) => {
1782
- if (entries.some((entry) => entry.isIntersecting)) {
1783
- this._triggerFetch();
1855
+ this._rootElement = this._resolveRoot();
1856
+ try {
1857
+ this._observer = new IntersectionObserver((entries) => {
1858
+ // the last entry is the sentinel's state now
1859
+ this._inView = entries[entries.length - 1].isIntersecting;
1860
+ if (this._inView) {
1861
+ this._run(true);
1862
+ }
1863
+ }, {
1864
+ root: this._rootElement,
1865
+ rootMargin: this.rootMargin,
1866
+ // (out of 0..1 the browser throws: only the margin is left to refuse)
1867
+ threshold: Math.min(1, Math.max(0, this.threshold)),
1868
+ });
1869
+ }
1870
+ catch (error) {
1871
+ // A margin with no unit ("200", "0 0 900 0"): the browser's own exception came out of this callback,
1872
+ // uncaught, and no page was loaded (docs/mistake-catalogue.md, "root-margin-unit").
1873
+ const margin = this.rootMargin;
1874
+ if (this._warnedMargin !== margin) {
1875
+ this._warnedMargin = margin;
1876
+ console.warn(`[@wcstack/fetch] [wcs/root-margin-unit] <${config.tagNames.infiniteScroll} root-margin="${margin}"> is not a margin ` +
1877
+ `the browser takes (${error.message}): write each length with px or %, as "240px 0px". ` +
1878
+ `Nothing is observed, so no page is loaded.`);
1784
1879
  }
1785
- }, {
1786
- root: this._resolveRoot(),
1787
- rootMargin: this.rootMargin,
1788
- threshold: this.threshold,
1789
- });
1880
+ return;
1881
+ }
1790
1882
  this._observer.observe(this);
1791
1883
  }
1792
1884
  _disconnectObserver() {
@@ -1794,13 +1886,44 @@ class InfiniteScroll extends HTMLElement {
1794
1886
  this._observer.disconnect();
1795
1887
  this._observer = null;
1796
1888
  }
1889
+ this._inView = false;
1797
1890
  }
1891
+ /**
1892
+ * The scroll container: the element with that id, or — as `<wcs-intersect root>` spells it — the first one the
1893
+ * value matches as a selector. A root that is given and not found, or that does not scroll, is said once per
1894
+ * value: the viewport took its place without a word, and a root that does not clip its content counts
1895
+ * everything in it as on screen (`root="main"` loaded page after page).
1896
+ */
1798
1897
  _resolveRoot() {
1799
- if (!this.root)
1898
+ const name = this.root;
1899
+ if (!name)
1800
1900
  return null;
1801
- return document.getElementById(this.root) || null;
1901
+ let found = document.getElementById(name);
1902
+ if (!found) {
1903
+ try {
1904
+ found = document.querySelector(name);
1905
+ }
1906
+ catch {
1907
+ // not a selector either
1908
+ }
1909
+ }
1910
+ if (this._warnedRoot !== name) {
1911
+ const tag = `<${config.tagNames.infiniteScroll} root="${name}">`;
1912
+ if (!found) {
1913
+ this._warnedRoot = name;
1914
+ console.warn(`[@wcstack/fetch] [wcs/infinite-scroll-root] ${tag}: no element has that id, and none matches it as a ` +
1915
+ `selector, so the viewport is the scroll root.`);
1916
+ }
1917
+ else if (doesNotScroll(found)) {
1918
+ this._warnedRoot = name;
1919
+ console.warn(`[@wcstack/fetch] [wcs/infinite-scroll-root] ${tag} is <${found.localName}>, which does not scroll ` +
1920
+ `(overflow: visible): everything inside it counts as on screen, so page after page is loaded. Name the ` +
1921
+ `element that scrolls, or leave root out for the viewport.`);
1922
+ }
1923
+ }
1924
+ return found;
1802
1925
  }
1803
- _triggerFetch() {
1926
+ _resolveTarget() {
1804
1927
  const target = document.getElementById(this.target);
1805
1928
  if (!(target instanceof Fetch)) {
1806
1929
  // Nothing to load from: say so once per target, instead of loading no more pages without a word
@@ -1810,18 +1933,115 @@ class InfiniteScroll extends HTMLElement {
1810
1933
  console.warn(`[@wcstack/fetch] [wcs/infinite-scroll-target] <${config.tagNames.infiniteScroll} target="${this.target}"> ` +
1811
1934
  `came into view, but no <${config.tagNames.fetch}> has that id, so no page was loaded.`);
1812
1935
  }
1813
- return;
1936
+ this._follow(null);
1937
+ return null;
1814
1938
  }
1939
+ this._follow(target);
1940
+ return target;
1941
+ }
1942
+ /** Follows `target`'s url and requests (or stops following, with null). */
1943
+ _follow(target) {
1944
+ if (this._fetch === target)
1945
+ return;
1946
+ this._fetch?.removeEventListener("wcs-fetch:loading-changed", this._onLoadingChanged);
1947
+ this._fetch?.removeEventListener("wcs-fetch:response", this._onResponse);
1948
+ this._urlObserver?.disconnect();
1949
+ this._urlObserver = null;
1950
+ this._fetch = target;
1951
+ this._settling = false;
1952
+ this._changedInFlight = false;
1953
+ if (!target)
1954
+ return;
1955
+ target.addEventListener("wcs-fetch:loading-changed", this._onLoadingChanged);
1956
+ target.addEventListener("wcs-fetch:response", this._onResponse);
1957
+ this._urlObserver = new MutationObserver(() => this._urlChanged());
1958
+ this._urlObserver.observe(target, { attributes: true, attributeFilter: ["url"] });
1959
+ }
1960
+ /** Where the sentinel is in what scrolls: rows added before it move it, scrolling does not. */
1961
+ _position() {
1962
+ return this.getBoundingClientRect().top + (this._rootElement ? this._rootElement.scrollTop : window.scrollY);
1963
+ }
1964
+ /** A request started on the target (this element's, or the page's own). */
1965
+ _started() {
1966
+ this._asked = this._fetch.url;
1967
+ this._startedAt = this._position();
1968
+ this._changedInFlight = false;
1969
+ this._answered = false;
1970
+ this._settling = false;
1971
+ }
1972
+ /**
1973
+ * The request ended: once the page has had its frames to add rows and move the url on, the sentinel — if it is
1974
+ * still on screen — runs the next request when the url changed while this one was in flight, when this one had no
1975
+ * answer (aborted: a url written right after it is the page's own change, not its reaction to a response), or
1976
+ * when this one added rows. A response that added nothing ends it there.
1977
+ */
1978
+ _ended() {
1979
+ this._settling = true;
1980
+ afterFrames(SETTLE_FRAMES, () => {
1981
+ if (!this._settling)
1982
+ return;
1983
+ this._settling = false;
1984
+ if (this._inView && (this._changedInFlight || !this._answered || this._position() !== this._startedAt)) {
1985
+ this._run(false);
1986
+ }
1987
+ });
1988
+ }
1989
+ /**
1990
+ * The target's url was written. In flight, and while the page settles after a response, the end of that request
1991
+ * decides (_ended). At rest it is the page's own change — the first url, a filter: with the sentinel on screen
1992
+ * it is asked for, at once when nothing was asked yet, otherwise once the emptied list is laid out.
1993
+ */
1994
+ _urlChanged() {
1995
+ const target = this._fetch;
1815
1996
  if (target.loading) {
1997
+ this._changedInFlight = true;
1816
1998
  return;
1817
1999
  }
2000
+ if (this._settling || !this._inView)
2001
+ return;
2002
+ if (this._asked === null) {
2003
+ this._run(false);
2004
+ return;
2005
+ }
2006
+ afterFrames(2, () => {
2007
+ if (this._inView)
2008
+ this._run(false);
2009
+ });
2010
+ }
2011
+ /**
2012
+ * Runs the target's request. `edge`: the sentinel came on screen (a user who scrolls away and back asks again,
2013
+ * also for the same url — the way a failed request is tried again); otherwise only a url not asked yet.
2014
+ */
2015
+ _run(edge) {
2016
+ const target = this._resolveTarget();
2017
+ if (!target) {
2018
+ return;
2019
+ }
2020
+ // a request in flight, or no url yet: its end, or the url when it is written, comes back here
2021
+ if (target.loading || !target.url) {
2022
+ return;
2023
+ }
2024
+ if (!edge && target.url === this._asked) {
2025
+ return;
2026
+ }
2027
+ this._asked = target.url;
1818
2028
  target.trigger = true;
1819
2029
  if (this.once) {
1820
2030
  this._done = true;
1821
2031
  this._disconnectObserver();
2032
+ this._follow(null);
1822
2033
  }
1823
2034
  }
1824
2035
  }
2036
+ /** Calls `fn` after `n` animation frames. */
2037
+ function afterFrames(n, fn) {
2038
+ requestAnimationFrame(() => (n > 1 ? afterFrames(n - 1, fn) : fn()));
2039
+ }
2040
+ /** Whether `element` clips nothing of what is in it: a scroll root must (`overflow` other than `visible`). */
2041
+ function doesNotScroll(element) {
2042
+ const style = getComputedStyle(element);
2043
+ return style.overflowX === "visible" && style.overflowY === "visible";
2044
+ }
1825
2045
 
1826
2046
  // ===========================================================================
1827
2047
  // AUTO-GENERATED FILE - DO NOT EDIT.