@mhmo91/schmancy 0.9.17 → 0.9.19

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 (111) hide show
  1. package/custom-elements.json +85 -46
  2. package/dist/agent/index.es-Dymj8REP.js +489 -0
  3. package/dist/agent/index.es-Dymj8REP.js.map +1 -0
  4. package/dist/agent/schmancy.agent.js +239 -580
  5. package/dist/agent/schmancy.agent.js.map +1 -1
  6. package/dist/agent/schmancy.manifest.json +198 -18
  7. package/dist/badge.cjs +1 -1
  8. package/dist/badge.js +1 -1
  9. package/dist/breadcrumb.cjs.map +1 -1
  10. package/dist/breadcrumb.js.map +1 -1
  11. package/dist/content-drawer.cjs +1 -1
  12. package/dist/content-drawer.js +1 -1
  13. package/dist/dialog.cjs.map +1 -1
  14. package/dist/dialog.js.map +1 -1
  15. package/dist/dropdown.cjs.map +1 -1
  16. package/dist/dropdown.js.map +1 -1
  17. package/dist/{flow-BGkHnOnd.js.map → flow-BPDtbhLe.js.map} +1 -1
  18. package/dist/{flow-ClAJ6Qby.cjs.map → flow-Dn9AZktE.cjs.map} +1 -1
  19. package/dist/handover/agent-runtime-followups.md +1 -1
  20. package/dist/handover/agent-runtime-v1.md +3 -3
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.es-BgmFX1JM.cjs +1 -0
  23. package/dist/index.es-BgmFX1JM.cjs.map +1 -0
  24. package/dist/index.es-CLyb_o3Y.js +489 -0
  25. package/dist/index.es-CLyb_o3Y.js.map +1 -0
  26. package/dist/index.js +4 -4
  27. package/dist/list-BpjKUOzM.js.map +1 -1
  28. package/dist/list-CMWHu6cV.cjs.map +1 -1
  29. package/dist/menu-BIBUgS1T.js.map +1 -1
  30. package/dist/menu-DS8Iz4fJ.cjs.map +1 -1
  31. package/dist/nav-drawer.cjs +1 -1
  32. package/dist/nav-drawer.js +1 -1
  33. package/dist/navigation-bar.cjs +1 -1
  34. package/dist/navigation-bar.js +1 -1
  35. package/dist/navigation-rail.cjs.map +1 -1
  36. package/dist/navigation-rail.js.map +1 -1
  37. package/dist/sheet-DdlZhnDG.cjs.map +1 -1
  38. package/dist/sheet-LFVo5iN4.js.map +1 -1
  39. package/dist/{splash-screen-COg3Z6n8.js.map → splash-screen-BHgb3c3Q.js.map} +1 -1
  40. package/dist/{splash-screen-C9HqX2nR.cjs.map → splash-screen-DteUfSV3.cjs.map} +1 -1
  41. package/dist/splash-screen.cjs +1 -1
  42. package/dist/splash-screen.js +1 -1
  43. package/dist/{src-C7niWYur.js → src-BGj6ufWS.js} +4 -4
  44. package/dist/src-BGj6ufWS.js.map +1 -0
  45. package/dist/{src-I4M33WK2.cjs → src-BPKGdQdp.cjs} +1 -1
  46. package/dist/src-BPKGdQdp.cjs.map +1 -0
  47. package/dist/{table-B-DsOqzT.cjs → table-DFlJhG5E.cjs} +1 -1
  48. package/dist/{table-B-DsOqzT.cjs.map → table-DFlJhG5E.cjs.map} +1 -1
  49. package/dist/{table-hBEZRxM_.js → table-Dwt66SR6.js} +1 -1
  50. package/dist/{table-hBEZRxM_.js.map → table-Dwt66SR6.js.map} +1 -1
  51. package/dist/table.cjs +1 -1
  52. package/dist/table.js +1 -1
  53. package/dist/teleport.cjs +1 -1
  54. package/dist/teleport.js +1 -1
  55. package/dist/typewriter.cjs +123 -1
  56. package/dist/typewriter.cjs.map +1 -0
  57. package/dist/typewriter.js +214 -2
  58. package/dist/typewriter.js.map +1 -0
  59. package/dist/{utils-xBXLvebz.js.map → utils-Bp2jhyZc.js.map} +1 -1
  60. package/dist/{utils-2qrmPb78.cjs.map → utils-CBPQvxNW.cjs.map} +1 -1
  61. package/dist/utils.cjs +1 -1
  62. package/dist/utils.js +1 -1
  63. package/package.json +1 -1
  64. package/src/breadcrumb/breadcrumb.ts +14 -4
  65. package/src/dialog/dialog.component.ts +9 -9
  66. package/src/dropdown/dropdown-component.ts +13 -1
  67. package/src/dropdown/dropdown-content.ts +11 -3
  68. package/src/list/list-item.ts +10 -0
  69. package/src/list/list.ts +7 -8
  70. package/src/menu/menu-item.ts +13 -0
  71. package/src/menu/menu.ts +10 -22
  72. package/src/nav-drawer/appbar.ts +11 -0
  73. package/src/nav-drawer/content.ts +11 -0
  74. package/src/nav-drawer/drawer.ts +15 -0
  75. package/src/nav-drawer/navbar.ts +14 -0
  76. package/src/navigation-bar/navigation-bar-item.ts +3 -4
  77. package/src/navigation-bar/navigation-bar.ts +3 -9
  78. package/src/navigation-rail/navigation-rail-item.ts +3 -7
  79. package/src/navigation-rail/navigation-rail.ts +12 -8
  80. package/src/sheet/sheet.ts +17 -0
  81. package/src/typewriter/typewriter.ts +26 -4
  82. package/types/src/breadcrumb/breadcrumb.d.ts +14 -4
  83. package/types/src/dialog/dialog.component.d.ts +9 -9
  84. package/types/src/dropdown/dropdown-component.d.ts +13 -1
  85. package/types/src/dropdown/dropdown-content.d.ts +11 -3
  86. package/types/src/list/list-item.d.ts +10 -0
  87. package/types/src/list/list.d.ts +7 -8
  88. package/types/src/menu/menu-item.d.ts +13 -0
  89. package/types/src/menu/menu.d.ts +10 -22
  90. package/types/src/nav-drawer/appbar.d.ts +11 -0
  91. package/types/src/nav-drawer/content.d.ts +11 -0
  92. package/types/src/nav-drawer/drawer.d.ts +15 -0
  93. package/types/src/nav-drawer/navbar.d.ts +14 -0
  94. package/types/src/navigation-bar/navigation-bar-item.d.ts +3 -4
  95. package/types/src/navigation-bar/navigation-bar.d.ts +3 -9
  96. package/types/src/navigation-rail/navigation-rail-item.d.ts +3 -7
  97. package/types/src/navigation-rail/navigation-rail.d.ts +12 -8
  98. package/types/src/sheet/sheet.d.ts +17 -0
  99. package/types/src/typewriter/typewriter.d.ts +4 -1
  100. package/dist/src-C7niWYur.js.map +0 -1
  101. package/dist/src-I4M33WK2.cjs.map +0 -1
  102. package/dist/typewriter-DyN7xa0n.js +0 -701
  103. package/dist/typewriter-DyN7xa0n.js.map +0 -1
  104. package/dist/typewriter-LK0S4NEr.cjs +0 -123
  105. package/dist/typewriter-LK0S4NEr.cjs.map +0 -1
  106. /package/dist/{flow-BGkHnOnd.js → flow-BPDtbhLe.js} +0 -0
  107. /package/dist/{flow-ClAJ6Qby.cjs → flow-Dn9AZktE.cjs} +0 -0
  108. /package/dist/{splash-screen-COg3Z6n8.js → splash-screen-BHgb3c3Q.js} +0 -0
  109. /package/dist/{splash-screen-C9HqX2nR.cjs → splash-screen-DteUfSV3.cjs} +0 -0
  110. /package/dist/{utils-xBXLvebz.js → utils-Bp2jhyZc.js} +0 -0
  111. /package/dist/{utils-2qrmPb78.cjs → utils-CBPQvxNW.cjs} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"table-hBEZRxM_.js","names":["directive","__decorate","property"],"sources":["../src/table/row.ts","../node_modules/@lit-labs/virtualizer/events.js","../node_modules/@lit-labs/virtualizer/ScrollerController.js","../node_modules/@lit-labs/virtualizer/Virtualizer.js","../node_modules/@lit-labs/virtualizer/virtualize.js","../node_modules/@lit-labs/virtualizer/LitVirtualizer.js","../node_modules/@lit-labs/virtualizer/lit-virtualizer.js","../src/table/table.ts"],"sourcesContent":["import { $LitElement } from '@mixins/litElement.mixin'\nimport { html, TemplateResult } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { TableColumn } from './table' // Import TableColumn interface with updated types\n\n@customElement('schmancy-table-row')\nexport class SchmancyTableRow<T extends Record<string, any> = any> extends $LitElement() {\n\t@property({ type: Array, attribute: false })\n\tcolumns: TableColumn<T>[] = []\n\n\t@property({ type: Object, attribute: false })\n\titem!: T\n\n\t@property({ type: String })\n\tcols: string = this.columns.map(() => '1fr').join(' ')\n\n\t/**\n\t * Renders a cell based on column configuration.\n\t * Uses custom render function if provided, otherwise extracts data from item.\n\t */\n\tprivate renderCell(column: TableColumn<T>): TemplateResult {\n\t\t// Use the render function if provided\n\t\tif (column.render) {\n\t\t\treturn html`\n\t\t\t\t<div class=\"overflow-hidden text-ellipsis\">\n\t\t\t\t\t<schmancy-typography align=\"${column.align || 'left'}\" maxLines=\"2\" weight=\"${column.weight || 'normal'}\">\n\t\t\t\t\t\t${column.render(this.item)}\n\t\t\t\t\t</schmancy-typography>\n\t\t\t\t</div>\n\t\t\t`\n\t\t}\n\n\t\t// Otherwise extract data using the key if available\n\t\tconst value = column.key ? this.item[column.key] : ''\n\n\t\treturn html`\n\t\t\t<div class=\"overflow-hidden text-ellipsis\">\n\t\t\t\t<schmancy-typography align=\"${column.align || 'left'}\" maxLines=\"2\" weight=\"${column.weight || 'normal'}\">\n\t\t\t\t\t${value}\n\t\t\t\t</schmancy-typography>\n\t\t\t</div>\n\t\t`\n\t}\n\n\trender(): TemplateResult {\n\t\treturn html`\n\t\t\t<schmancy-list-item class=\"w-full\">\n\t\t\t\t<schmancy-grid .cols=${this.cols} align=\"center\" gap=\"md\">\n\t\t\t\t\t${this.columns.map(column => this.renderCell(column))}\n\t\t\t\t</schmancy-grid>\n\t\t\t</schmancy-list-item>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-table-row': SchmancyTableRow\n\t}\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nexport class RangeChangedEvent extends Event {\n constructor(range) {\n super(RangeChangedEvent.eventName, { bubbles: false });\n this.first = range.first;\n this.last = range.last;\n }\n}\nRangeChangedEvent.eventName = 'rangeChanged';\nexport class VisibilityChangedEvent extends Event {\n constructor(range) {\n super(VisibilityChangedEvent.eventName, { bubbles: false });\n this.first = range.first;\n this.last = range.last;\n }\n}\nVisibilityChangedEvent.eventName = 'visibilityChanged';\nexport class UnpinnedEvent extends Event {\n constructor() {\n super(UnpinnedEvent.eventName, { bubbles: false });\n }\n}\nUnpinnedEvent.eventName = 'unpinned';\n//# sourceMappingURL=events.js.map","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nexport class ScrollerShim {\n constructor(element) {\n this._element = null;\n const node = element ?? window;\n this._node = node;\n if (element) {\n this._element = element;\n }\n }\n get element() {\n return (this._element || document.scrollingElement || document.documentElement);\n }\n get scrollTop() {\n return this.element.scrollTop || window.scrollY;\n }\n get scrollLeft() {\n return this.element.scrollLeft || window.scrollX;\n }\n get scrollHeight() {\n return this.element.scrollHeight;\n }\n get scrollWidth() {\n return this.element.scrollWidth;\n }\n get viewportHeight() {\n return this._element\n ? this._element.getBoundingClientRect().height\n : window.innerHeight;\n }\n get viewportWidth() {\n return this._element\n ? this._element.getBoundingClientRect().width\n : window.innerWidth;\n }\n get maxScrollTop() {\n return this.scrollHeight - this.viewportHeight;\n }\n get maxScrollLeft() {\n return this.scrollWidth - this.viewportWidth;\n }\n}\nexport class ScrollerController extends ScrollerShim {\n constructor(client, element) {\n super(element);\n this._clients = new Set();\n this._retarget = null;\n this._end = null;\n this.__destination = null;\n this.correctingScrollError = false;\n this._checkForArrival = this._checkForArrival.bind(this);\n this._updateManagedScrollTo = this._updateManagedScrollTo.bind(this);\n this.scrollTo = this.scrollTo.bind(this);\n this.scrollBy = this.scrollBy.bind(this);\n const node = this._node;\n this._originalScrollTo = node.scrollTo;\n this._originalScrollBy = node.scrollBy;\n this._originalScroll = node.scroll;\n this._attach(client);\n }\n get _destination() {\n return this.__destination;\n }\n get scrolling() {\n return this._destination !== null;\n }\n scrollTo(p1, p2) {\n const options = typeof p1 === 'number' && typeof p2 === 'number'\n ? { left: p1, top: p2 }\n : p1;\n this._scrollTo(options);\n }\n scrollBy(p1, p2) {\n const options = typeof p1 === 'number' && typeof p2 === 'number'\n ? { left: p1, top: p2 }\n : p1;\n if (options.top !== undefined) {\n options.top += this.scrollTop;\n }\n if (options.left !== undefined) {\n options.left += this.scrollLeft;\n }\n this._scrollTo(options);\n }\n _nativeScrollTo(options) {\n this._originalScrollTo.bind(this._element || window)(options);\n }\n _scrollTo(options, retarget = null, end = null) {\n if (this._end !== null) {\n this._end();\n }\n if (options.behavior === 'smooth') {\n this._setDestination(options);\n this._retarget = retarget;\n this._end = end;\n }\n else {\n this._resetScrollState();\n }\n this._nativeScrollTo(options);\n }\n _setDestination(options) {\n let { top, left } = options;\n top =\n top === undefined\n ? undefined\n : Math.max(0, Math.min(top, this.maxScrollTop));\n left =\n left === undefined\n ? undefined\n : Math.max(0, Math.min(left, this.maxScrollLeft));\n if (this._destination !== null &&\n left === this._destination.left &&\n top === this._destination.top) {\n return false;\n }\n this.__destination = { top, left, behavior: 'smooth' };\n return true;\n }\n _resetScrollState() {\n this.__destination = null;\n this._retarget = null;\n this._end = null;\n }\n _updateManagedScrollTo(coordinates) {\n if (this._destination) {\n if (this._setDestination(coordinates)) {\n this._nativeScrollTo(this._destination);\n }\n }\n }\n managedScrollTo(options, retarget, end) {\n this._scrollTo(options, retarget, end);\n return this._updateManagedScrollTo;\n }\n correctScrollError(coordinates) {\n this.correctingScrollError = true;\n requestAnimationFrame(() => requestAnimationFrame(() => (this.correctingScrollError = false)));\n // Correct the error\n this._nativeScrollTo(coordinates);\n // Then, if we were headed for a specific destination, we continue scrolling:\n // First, we update our target destination, if applicable...\n if (this._retarget) {\n this._setDestination(this._retarget());\n }\n // Then we go ahead and resume scrolling\n if (this._destination) {\n this._nativeScrollTo(this._destination);\n }\n }\n _checkForArrival() {\n if (this._destination !== null) {\n const { scrollTop, scrollLeft } = this;\n let { top, left } = this._destination;\n top = Math.min(top || 0, this.maxScrollTop);\n left = Math.min(left || 0, this.maxScrollLeft);\n const topDiff = Math.abs(top - scrollTop);\n const leftDiff = Math.abs(left - scrollLeft);\n // We check to see if we've arrived at our destination.\n if (topDiff < 1 && leftDiff < 1) {\n if (this._end) {\n this._end();\n }\n this._resetScrollState();\n }\n }\n }\n detach(client) {\n this._clients.delete(client);\n /**\n * If there aren't any more clients, then return the node's default\n * scrolling methods\n */\n if (this._clients.size === 0) {\n this._node.scrollTo = this._originalScrollTo;\n this._node.scrollBy = this._originalScrollBy;\n this._node.scroll = this._originalScroll;\n this._node.removeEventListener('scroll', this._checkForArrival);\n }\n return null;\n }\n _attach(client) {\n this._clients.add(client);\n /**\n * The node should only have the methods shimmed when adding the first\n * client – otherwise it's redundant\n */\n if (this._clients.size === 1) {\n this._node.scrollTo = this.scrollTo;\n this._node.scrollBy = this.scrollBy;\n this._node.scroll = this.scrollTo;\n this._node.addEventListener('scroll', this._checkForArrival);\n }\n }\n}\n//# sourceMappingURL=ScrollerController.js.map","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nimport { RangeChangedEvent, VisibilityChangedEvent, UnpinnedEvent, } from './events.js';\nimport { ScrollerController } from './ScrollerController.js';\n// Virtualizer depends on `ResizeObserver`, which is supported in\n// all modern browsers. For developers whose browser support\n// matrix includes older browsers, we include a compatible\n// polyfill in the package; this bit of module state facilitates\n// a simple mechanism (see ./polyfillLoaders/ResizeObserver.js.)\n// for loading the polyfill.\nlet _ResizeObserver = typeof window !== 'undefined' ? window.ResizeObserver : undefined;\n/**\n * Call this function to provide a `ResizeObserver` polyfill for Virtualizer to use.\n * @param Ctor Constructor for a `ResizeObserver` polyfill (recommend using the one provided with the Virtualizer package)\n */\nexport function provideResizeObserver(Ctor) {\n _ResizeObserver = Ctor;\n}\nexport const virtualizerRef = Symbol('virtualizerRef');\nconst SIZER_ATTRIBUTE = 'virtualizer-sizer';\nlet DefaultLayoutConstructor;\n/**\n * Provides virtual scrolling boilerplate.\n *\n * Extensions of this class must set hostElement and layout.\n *\n * Extensions of this class must also override VirtualRepeater's DOM\n * manipulation methods.\n */\nexport class Virtualizer {\n constructor(config) {\n this._benchmarkStart = null;\n this._layout = null;\n this._clippingAncestors = [];\n /**\n * Layout provides these values, we set them on _render().\n * TODO @straversi: Can we find an XOR type, usable for the key here?\n */\n this._scrollSize = null;\n /**\n * Difference between scroll target's current and required scroll offsets.\n * Provided by layout.\n */\n this._scrollError = null;\n /**\n * A list of the positions (top, left) of the children in the current range.\n */\n this._childrenPos = null;\n // TODO: (graynorton): type\n this._childMeasurements = null;\n this._toBeMeasured = new Map();\n this._rangeChanged = true;\n this._itemsChanged = true;\n this._visibilityChanged = true;\n this._scrollerController = null;\n this._isScroller = false;\n this._sizer = null;\n /**\n * Resize observer attached to hostElement.\n */\n this._hostElementRO = null;\n /**\n * Resize observer attached to children.\n */\n this._childrenRO = null;\n this._mutationObserver = null;\n this._scrollEventListeners = [];\n this._scrollEventListenerOptions = {\n passive: true,\n };\n // TODO (graynorton): Rethink, per longer comment below\n this._loadListener = this._childLoaded.bind(this);\n /**\n * Index of element to scroll into view, plus scroll\n * behavior options, as imperatively specified via\n * `element(index).scrollIntoView()`\n */\n this._scrollIntoViewTarget = null;\n this._updateScrollIntoViewCoordinates = null;\n /**\n * Items to render. Set by items.\n */\n this._items = [];\n /**\n * Index of the first child in the range, not necessarily the first visible child.\n * TODO @straversi: Consider renaming these.\n */\n this._first = -1;\n /**\n * Index of the last child in the range.\n */\n this._last = -1;\n /**\n * Index of the first item intersecting the viewport.\n */\n this._firstVisible = -1;\n /**\n * Index of the last item intersecting the viewport.\n */\n this._lastVisible = -1;\n this._scheduled = new WeakSet();\n /**\n * Invoked at the end of each render cycle: children in the range are\n * measured, and their dimensions passed to this callback. Use it to layout\n * children as needed.\n */\n this._measureCallback = null;\n this._measureChildOverride = null;\n /**\n * State for `layoutComplete` promise\n */\n this._layoutCompletePromise = null;\n this._layoutCompleteResolver = null;\n this._layoutCompleteRejecter = null;\n this._pendingLayoutComplete = null;\n /**\n * Layout initialization is async because we dynamically load\n * the default layout if none is specified. This state is to track\n * whether init is complete.\n */\n this._layoutInitialized = null;\n /**\n * Track connection state to guard against errors / unnecessary work\n */\n this._connected = false;\n if (!config) {\n throw new Error('Virtualizer constructor requires a configuration object');\n }\n if (config.hostElement) {\n this._init(config);\n }\n else {\n throw new Error('Virtualizer configuration requires the \"hostElement\" property');\n }\n }\n set items(items) {\n if (Array.isArray(items) && items !== this._items) {\n this._itemsChanged = true;\n this._items = items;\n this._schedule(this._updateLayout);\n }\n }\n _init(config) {\n this._isScroller = !!config.scroller;\n this._initHostElement(config);\n // If no layout is specified, we make an empty\n // layout config, which will result in the default\n // layout with default parameters\n const layoutConfig = config.layout || {};\n // Save the promise returned by `_initLayout` as a state\n // variable we can check before updating layout config\n this._layoutInitialized = this._initLayout(layoutConfig);\n }\n _initObservers() {\n this._mutationObserver = new MutationObserver(this._finishDOMUpdate.bind(this));\n this._hostElementRO = new _ResizeObserver(() => this._hostElementSizeChanged());\n this._childrenRO = new _ResizeObserver(this._childrenSizeChanged.bind(this));\n }\n _initHostElement(config) {\n const hostElement = (this._hostElement = config.hostElement);\n this._applyVirtualizerStyles();\n hostElement[virtualizerRef] = this;\n }\n connected() {\n this._initObservers();\n const includeSelf = this._isScroller;\n this._clippingAncestors = getClippingAncestors(this._hostElement, includeSelf);\n this._scrollerController = new ScrollerController(this, this._clippingAncestors[0]);\n this._schedule(this._updateLayout);\n this._observeAndListen();\n this._connected = true;\n }\n _observeAndListen() {\n this._mutationObserver.observe(this._hostElement, { childList: true });\n this._hostElementRO.observe(this._hostElement);\n this._scrollEventListeners.push(window);\n window.addEventListener('scroll', this, this._scrollEventListenerOptions);\n this._clippingAncestors.forEach((ancestor) => {\n ancestor.addEventListener('scroll', this, this._scrollEventListenerOptions);\n this._scrollEventListeners.push(ancestor);\n this._hostElementRO.observe(ancestor);\n });\n this._hostElementRO.observe(this._scrollerController.element);\n this._children.forEach((child) => this._childrenRO.observe(child));\n this._scrollEventListeners.forEach((target) => target.addEventListener('scroll', this, this._scrollEventListenerOptions));\n }\n disconnected() {\n this._scrollEventListeners.forEach((target) => target.removeEventListener('scroll', this, this._scrollEventListenerOptions));\n this._scrollEventListeners = [];\n this._clippingAncestors = [];\n this._scrollerController?.detach(this);\n this._scrollerController = null;\n this._mutationObserver?.disconnect();\n this._mutationObserver = null;\n this._hostElementRO?.disconnect();\n this._hostElementRO = null;\n this._childrenRO?.disconnect();\n this._childrenRO = null;\n this._rejectLayoutCompletePromise('disconnected');\n this._connected = false;\n }\n _applyVirtualizerStyles() {\n const hostElement = this._hostElement;\n // Would rather set these CSS properties on the host using Shadow Root\n // style scoping (and falling back to a global stylesheet where native\n // Shadow DOM is not available), but this Mobile Safari bug is preventing\n // that from working: https://bugs.webkit.org/show_bug.cgi?id=226195\n const style = hostElement.style;\n style.display = style.display || 'block';\n style.position = style.position || 'relative';\n style.contain = style.contain || 'size layout';\n if (this._isScroller) {\n style.overflow = style.overflow || 'auto';\n style.minHeight = style.minHeight || '150px';\n }\n }\n _getSizer() {\n const hostElement = this._hostElement;\n if (!this._sizer) {\n // Use a preexisting sizer element if provided (for better integration\n // with vDOM renderers)\n let sizer = hostElement.querySelector(`[${SIZER_ATTRIBUTE}]`);\n if (!sizer) {\n sizer = document.createElement('div');\n sizer.setAttribute(SIZER_ATTRIBUTE, '');\n hostElement.appendChild(sizer);\n }\n // When the scrollHeight is large, the height of this element might be\n // ignored. Setting content and font-size ensures the element has a size.\n Object.assign(sizer.style, {\n position: 'absolute',\n margin: '-2px 0 0 0',\n padding: 0,\n visibility: 'hidden',\n fontSize: '2px',\n });\n sizer.textContent = '&nbsp;';\n sizer.setAttribute(SIZER_ATTRIBUTE, '');\n this._sizer = sizer;\n }\n return this._sizer;\n }\n async updateLayoutConfig(layoutConfig) {\n // If layout initialization hasn't finished yet, we wait\n // for it to finish so we can check whether the new config\n // is compatible with the existing layout before proceeding.\n await this._layoutInitialized;\n const Ctor = layoutConfig.type ||\n // The new config is compatible with the current layout,\n // so we update the config and return true to indicate\n // a successful update\n DefaultLayoutConstructor;\n if (typeof Ctor === 'function' && this._layout instanceof Ctor) {\n const config = { ...layoutConfig };\n delete config.type;\n this._layout.config = config;\n // The new config requires a different layout altogether, but\n // to limit implementation complexity we don't support dynamically\n // changing the layout of an existing virtualizer instance.\n // Returning false here lets the caller know that they should\n // instead make a new virtualizer instance with the desired layout.\n return true;\n }\n return false;\n }\n async _initLayout(layoutConfig) {\n let config;\n let Ctor;\n if (typeof layoutConfig.type === 'function') {\n // If we have a full LayoutSpecifier, the `type` property\n // gives us our constructor...\n Ctor = layoutConfig.type;\n // ...while the rest of the specifier is our layout config\n const copy = { ...layoutConfig };\n delete copy.type;\n config = copy;\n }\n else {\n // If we don't have a full LayoutSpecifier, we just\n // have a config for the default layout\n config = layoutConfig;\n }\n if (Ctor === undefined) {\n // If we don't have a constructor yet, load the default\n DefaultLayoutConstructor = Ctor = (await import('./layouts/flow.js'))\n .FlowLayout;\n }\n this._layout = new Ctor((message) => this._handleLayoutMessage(message), config);\n if (this._layout.measureChildren &&\n typeof this._layout.updateItemSizes === 'function') {\n if (typeof this._layout.measureChildren === 'function') {\n this._measureChildOverride = this._layout.measureChildren;\n }\n this._measureCallback = this._layout.updateItemSizes.bind(this._layout);\n }\n if (this._layout.listenForChildLoadEvents) {\n this._hostElement.addEventListener('load', this._loadListener, true);\n }\n this._schedule(this._updateLayout);\n }\n // TODO (graynorton): Rework benchmarking so that it has no API and\n // instead is always on except in production builds\n startBenchmarking() {\n if (this._benchmarkStart === null) {\n this._benchmarkStart = window.performance.now();\n }\n }\n stopBenchmarking() {\n if (this._benchmarkStart !== null) {\n const now = window.performance.now();\n const timeElapsed = now - this._benchmarkStart;\n const entries = performance.getEntriesByName('uv-virtualizing', 'measure');\n const virtualizationTime = entries\n .filter((e) => e.startTime >= this._benchmarkStart && e.startTime < now)\n .reduce((t, m) => t + m.duration, 0);\n this._benchmarkStart = null;\n return { timeElapsed, virtualizationTime };\n }\n return null;\n }\n _measureChildren() {\n const mm = {};\n const children = this._children;\n const fn = this._measureChildOverride || this._measureChild;\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n const idx = this._first + i;\n if (this._itemsChanged || this._toBeMeasured.has(child)) {\n mm[idx] = fn.call(this, child, this._items[idx]);\n }\n }\n this._childMeasurements = mm;\n this._schedule(this._updateLayout);\n this._toBeMeasured.clear();\n }\n /**\n * Returns the width, height, and margins of the given child.\n */\n _measureChild(element) {\n // offsetWidth doesn't take transforms in consideration, so we use\n // getBoundingClientRect which does.\n const { width, height } = element.getBoundingClientRect();\n return Object.assign({ width, height }, getMargins(element));\n }\n async _schedule(method) {\n if (!this._scheduled.has(method)) {\n this._scheduled.add(method);\n await Promise.resolve();\n this._scheduled.delete(method);\n method.call(this);\n }\n }\n async _updateDOM(state) {\n this._scrollSize = state.scrollSize;\n this._adjustRange(state.range);\n this._childrenPos = state.childPositions;\n this._scrollError = state.scrollError || null;\n const { _rangeChanged, _itemsChanged } = this;\n if (this._visibilityChanged) {\n this._notifyVisibility();\n this._visibilityChanged = false;\n }\n if (_rangeChanged || _itemsChanged) {\n this._notifyRange();\n this._rangeChanged = false;\n }\n this._finishDOMUpdate();\n }\n _finishDOMUpdate() {\n if (this._connected) {\n // _childrenRO should be non-null if we're connected\n this._children.forEach((child) => this._childrenRO.observe(child));\n this._checkScrollIntoViewTarget(this._childrenPos);\n this._positionChildren(this._childrenPos);\n this._sizeHostElement(this._scrollSize);\n this._correctScrollError();\n if (this._benchmarkStart && 'mark' in window.performance) {\n window.performance.mark('uv-end');\n }\n }\n }\n _updateLayout() {\n if (this._layout && this._connected) {\n this._layout.items = this._items;\n this._updateView();\n if (this._childMeasurements !== null) {\n // If the layout has been changed, we may have measurements but no callback\n if (this._measureCallback) {\n this._measureCallback(this._childMeasurements);\n }\n this._childMeasurements = null;\n }\n this._layout.reflowIfNeeded();\n if (this._benchmarkStart && 'mark' in window.performance) {\n window.performance.mark('uv-end');\n }\n }\n }\n _handleScrollEvent() {\n if (this._benchmarkStart && 'mark' in window.performance) {\n try {\n window.performance.measure('uv-virtualizing', 'uv-start', 'uv-end');\n }\n catch (e) {\n console.warn('Error measuring performance data: ', e);\n }\n window.performance.mark('uv-start');\n }\n if (this._scrollerController.correctingScrollError === false) {\n // This is a user-initiated scroll, so we unpin the layout\n this._layout?.unpin();\n }\n this._schedule(this._updateLayout);\n }\n handleEvent(event) {\n switch (event.type) {\n case 'scroll':\n if (event.currentTarget === window ||\n this._clippingAncestors.includes(event.currentTarget)) {\n this._handleScrollEvent();\n }\n break;\n default:\n console.warn('event not handled', event);\n }\n }\n _handleLayoutMessage(message) {\n if (message.type === 'stateChanged') {\n this._updateDOM(message);\n }\n else if (message.type === 'visibilityChanged') {\n this._firstVisible = message.firstVisible;\n this._lastVisible = message.lastVisible;\n this._notifyVisibility();\n }\n else if (message.type === 'unpinned') {\n this._hostElement.dispatchEvent(new UnpinnedEvent());\n }\n }\n get _children() {\n const arr = [];\n let next = this._hostElement.firstElementChild;\n while (next) {\n if (!next.hasAttribute(SIZER_ATTRIBUTE)) {\n arr.push(next);\n }\n next = next.nextElementSibling;\n }\n return arr;\n }\n _updateView() {\n const hostElement = this._hostElement;\n const scrollingElement = this._scrollerController?.element;\n const layout = this._layout;\n if (hostElement && scrollingElement && layout) {\n let top, left, bottom, right;\n const hostElementBounds = hostElement.getBoundingClientRect();\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n const ancestorBounds = this._clippingAncestors.map((ancestor) => ancestor.getBoundingClientRect());\n ancestorBounds.unshift(hostElementBounds);\n for (const bounds of ancestorBounds) {\n top = Math.max(top, bounds.top);\n left = Math.max(left, bounds.left);\n bottom = Math.min(bottom, bounds.bottom);\n right = Math.min(right, bounds.right);\n }\n const scrollingElementBounds = scrollingElement.getBoundingClientRect();\n const offsetWithinScroller = {\n left: hostElementBounds.left - scrollingElementBounds.left,\n top: hostElementBounds.top - scrollingElementBounds.top,\n };\n const totalScrollSize = {\n width: scrollingElement.scrollWidth,\n height: scrollingElement.scrollHeight,\n };\n const scrollTop = top - hostElementBounds.top + hostElement.scrollTop;\n const scrollLeft = left - hostElementBounds.left + hostElement.scrollLeft;\n const height = Math.max(0, bottom - top);\n const width = Math.max(0, right - left);\n layout.viewportSize = { width, height };\n layout.viewportScroll = { top: scrollTop, left: scrollLeft };\n layout.totalScrollSize = totalScrollSize;\n layout.offsetWithinScroller = offsetWithinScroller;\n }\n }\n /**\n * Styles the host element so that its size reflects the\n * total size of all items.\n */\n _sizeHostElement(size) {\n // Some browsers seem to crap out if the host element gets larger than\n // a certain size, so we clamp it here (this value based on ad hoc\n // testing in Chrome / Safari / Firefox Mac)\n const max = 8200000;\n const h = size && size.width !== null ? Math.min(max, size.width) : 0;\n const v = size && size.height !== null ? Math.min(max, size.height) : 0;\n if (this._isScroller) {\n this._getSizer().style.transform = `translate(${h}px, ${v}px)`;\n }\n else {\n const style = this._hostElement.style;\n style.minWidth = h ? `${h}px` : '100%';\n style.minHeight = v ? `${v}px` : '100%';\n }\n }\n /**\n * Sets the top and left transform style of the children from the values in\n * pos.\n */\n _positionChildren(pos) {\n if (pos) {\n pos.forEach(({ top, left, width, height, xOffset, yOffset }, index) => {\n const child = this._children[index - this._first];\n if (child) {\n child.style.position = 'absolute';\n child.style.boxSizing = 'border-box';\n child.style.transform = `translate(${left}px, ${top}px)`;\n if (width !== undefined) {\n child.style.width = width + 'px';\n }\n if (height !== undefined) {\n child.style.height = height + 'px';\n }\n child.style.left =\n xOffset === undefined ? null : xOffset + 'px';\n child.style.top =\n yOffset === undefined ? null : yOffset + 'px';\n }\n });\n }\n }\n async _adjustRange(range) {\n const { _first, _last, _firstVisible, _lastVisible } = this;\n this._first = range.first;\n this._last = range.last;\n this._firstVisible = range.firstVisible;\n this._lastVisible = range.lastVisible;\n this._rangeChanged =\n this._rangeChanged || this._first !== _first || this._last !== _last;\n this._visibilityChanged =\n this._visibilityChanged ||\n this._firstVisible !== _firstVisible ||\n this._lastVisible !== _lastVisible;\n }\n _correctScrollError() {\n if (this._scrollError) {\n const { scrollTop, scrollLeft } = this._scrollerController;\n const { top, left } = this._scrollError;\n this._scrollError = null;\n this._scrollerController.correctScrollError({\n top: scrollTop - top,\n left: scrollLeft - left,\n });\n }\n }\n element(index) {\n if (index === Infinity) {\n index = this._items.length - 1;\n }\n return this._items?.[index] === undefined\n ? undefined\n : {\n scrollIntoView: (options = {}) => this._scrollElementIntoView({ ...options, index }),\n };\n }\n _scrollElementIntoView(options) {\n if (options.index >= this._first && options.index <= this._last) {\n this._children[options.index - this._first].scrollIntoView(options);\n }\n else {\n options.index = Math.min(options.index, this._items.length - 1);\n if (options.behavior === 'smooth') {\n const coordinates = this._layout.getScrollIntoViewCoordinates(options);\n const { behavior } = options;\n this._updateScrollIntoViewCoordinates =\n this._scrollerController.managedScrollTo(Object.assign(coordinates, { behavior }), () => this._layout.getScrollIntoViewCoordinates(options), () => (this._scrollIntoViewTarget = null));\n this._scrollIntoViewTarget = options;\n }\n else {\n this._layout.pin = options;\n }\n }\n }\n /**\n * If we are smoothly scrolling to an element and the target element\n * is in the DOM, we update our target coordinates as needed\n */\n _checkScrollIntoViewTarget(pos) {\n const { index } = this._scrollIntoViewTarget || {};\n if (index && pos?.has(index)) {\n this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget));\n }\n }\n /**\n * Emits a rangechange event with the current first, last, firstVisible, and\n * lastVisible.\n */\n _notifyRange() {\n this._hostElement.dispatchEvent(new RangeChangedEvent({ first: this._first, last: this._last }));\n }\n _notifyVisibility() {\n this._hostElement.dispatchEvent(new VisibilityChangedEvent({\n first: this._firstVisible,\n last: this._lastVisible,\n }));\n }\n get layoutComplete() {\n // Lazily create promise\n if (!this._layoutCompletePromise) {\n this._layoutCompletePromise = new Promise((resolve, reject) => {\n this._layoutCompleteResolver = resolve;\n this._layoutCompleteRejecter = reject;\n });\n }\n return this._layoutCompletePromise;\n }\n _rejectLayoutCompletePromise(reason) {\n if (this._layoutCompleteRejecter !== null) {\n this._layoutCompleteRejecter(reason);\n }\n this._resetLayoutCompleteState();\n }\n _scheduleLayoutComplete() {\n // Don't do anything unless we have a pending promise\n // And only request a frame if we haven't already done so\n if (this._layoutCompletePromise && this._pendingLayoutComplete === null) {\n // Wait one additional frame to be sure the layout is stable\n this._pendingLayoutComplete = requestAnimationFrame(() => requestAnimationFrame(() => this._resolveLayoutCompletePromise()));\n }\n }\n _resolveLayoutCompletePromise() {\n if (this._layoutCompleteResolver !== null) {\n this._layoutCompleteResolver();\n }\n this._resetLayoutCompleteState();\n }\n _resetLayoutCompleteState() {\n this._layoutCompletePromise = null;\n this._layoutCompleteResolver = null;\n this._layoutCompleteRejecter = null;\n this._pendingLayoutComplete = null;\n }\n /**\n * Render and update the view at the next opportunity with the given\n * hostElement size.\n */\n _hostElementSizeChanged() {\n this._schedule(this._updateLayout);\n }\n // TODO (graynorton): Rethink how this works. Probably child loading is too specific\n // to have dedicated support for; might want some more generic lifecycle hooks for\n // layouts to use. Possibly handle measurement this way, too, or maybe that remains\n // a first-class feature?\n _childLoaded() { }\n // This is the callback for the ResizeObserver that watches the\n // virtualizer's children. We land here at the end of every virtualizer\n // update cycle that results in changes to physical items, and we also\n // end up here if one or more children change size independently of\n // the virtualizer update cycle.\n _childrenSizeChanged(changes) {\n // Only measure if the layout requires it\n if (this._layout?.measureChildren) {\n for (const change of changes) {\n this._toBeMeasured.set(change.target, change.contentRect);\n }\n this._measureChildren();\n }\n // If this is the end of an update cycle, we need to reset some\n // internal state. This should be a harmless no-op if we're handling\n // an out-of-cycle ResizeObserver callback, so we don't need to\n // distinguish between the two cases.\n this._scheduleLayoutComplete();\n this._itemsChanged = false;\n this._rangeChanged = false;\n }\n}\nfunction getMargins(el) {\n const style = window.getComputedStyle(el);\n return {\n marginTop: getMarginValue(style.marginTop),\n marginRight: getMarginValue(style.marginRight),\n marginBottom: getMarginValue(style.marginBottom),\n marginLeft: getMarginValue(style.marginLeft),\n };\n}\nfunction getMarginValue(value) {\n const float = value ? parseFloat(value) : NaN;\n return Number.isNaN(float) ? 0 : float;\n}\n// TODO (graynorton): Deal with iframes?\nfunction getParentElement(el) {\n if (el.assignedSlot !== null) {\n return el.assignedSlot;\n }\n if (el.parentElement !== null) {\n return el.parentElement;\n }\n const parentNode = el.parentNode;\n if (parentNode && parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n return parentNode.host || null;\n }\n return null;\n}\n///\nfunction getElementAncestors(el, includeSelf = false) {\n const ancestors = [];\n let parent = includeSelf ? el : getParentElement(el);\n while (parent !== null) {\n ancestors.push(parent);\n parent = getParentElement(parent);\n }\n return ancestors;\n}\nfunction getClippingAncestors(el, includeSelf = false) {\n let foundFixed = false;\n return getElementAncestors(el, includeSelf).filter((a) => {\n if (foundFixed) {\n return false;\n }\n const style = getComputedStyle(a);\n foundFixed = style.position === 'fixed';\n return style.overflow !== 'visible';\n });\n}\n//# sourceMappingURL=Virtualizer.js.map","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nimport { html, noChange } from 'lit';\nimport { directive, PartType } from 'lit/directive.js';\nimport { AsyncDirective } from 'lit/async-directive.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { Virtualizer } from './Virtualizer.js';\nexport { virtualizerRef } from './Virtualizer.js';\nexport const defaultKeyFunction = (item) => item;\nexport const defaultRenderItem = (item, idx) => html `${idx}: ${JSON.stringify(item, null, 2)}`;\nclass VirtualizeDirective extends AsyncDirective {\n constructor(part) {\n super(part);\n this._virtualizer = null;\n this._first = 0;\n this._last = -1;\n this._renderItem = (item, idx) => defaultRenderItem(item, idx + this._first);\n this._keyFunction = (item, idx) => defaultKeyFunction(item, idx + this._first);\n this._items = [];\n if (part.type !== PartType.CHILD) {\n throw new Error('The virtualize directive can only be used in child expressions');\n }\n }\n render(config) {\n if (config) {\n this._setFunctions(config);\n }\n const itemsToRender = [];\n if (this._first >= 0 && this._last >= this._first) {\n for (let i = this._first; i <= this._last; i++) {\n itemsToRender.push(this._items[i]);\n }\n }\n return repeat(itemsToRender, this._keyFunction, this._renderItem);\n }\n update(part, [config]) {\n this._setFunctions(config);\n const itemsChanged = this._items !== config.items;\n this._items = config.items || [];\n if (this._virtualizer) {\n this._updateVirtualizerConfig(part, config);\n }\n else {\n this._initialize(part, config);\n }\n return itemsChanged ? noChange : this.render();\n }\n async _updateVirtualizerConfig(part, config) {\n const compatible = await this._virtualizer.updateLayoutConfig(config.layout || {});\n if (!compatible) {\n const hostElement = part.parentNode;\n this._makeVirtualizer(hostElement, config);\n }\n this._virtualizer.items = this._items;\n }\n _setFunctions(config) {\n const { renderItem, keyFunction } = config;\n if (renderItem) {\n this._renderItem = (item, idx) => renderItem(item, idx + this._first);\n }\n if (keyFunction) {\n this._keyFunction = (item, idx) => keyFunction(item, idx + this._first);\n }\n }\n _makeVirtualizer(hostElement, config) {\n if (this._virtualizer) {\n this._virtualizer.disconnected();\n }\n const { layout, scroller, items } = config;\n this._virtualizer = new Virtualizer({ hostElement, layout, scroller });\n this._virtualizer.items = items;\n this._virtualizer.connected();\n }\n _initialize(part, config) {\n const hostElement = part.parentNode;\n if (hostElement && hostElement.nodeType === 1) {\n hostElement.addEventListener('rangeChanged', (e) => {\n this._first = e.first;\n this._last = e.last;\n this.setValue(this.render());\n });\n this._makeVirtualizer(hostElement, config);\n }\n }\n disconnected() {\n this._virtualizer?.disconnected();\n }\n reconnected() {\n this._virtualizer?.connected();\n }\n}\nexport const virtualize = directive(VirtualizeDirective);\n//# sourceMappingURL=virtualize.js.map","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nimport { __decorate } from \"tslib\";\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { virtualize, virtualizerRef, defaultRenderItem, defaultKeyFunction, } from './virtualize.js';\nexport class LitVirtualizer extends LitElement {\n constructor() {\n super(...arguments);\n this.items = [];\n this.renderItem = defaultRenderItem;\n this.keyFunction = defaultKeyFunction;\n this.layout = {};\n this.scroller = false;\n }\n createRenderRoot() {\n return this;\n }\n render() {\n const { items, renderItem, keyFunction, layout, scroller } = this;\n return html `${virtualize({\n items,\n renderItem,\n keyFunction,\n layout,\n scroller,\n })}`;\n }\n element(index) {\n return this[virtualizerRef]?.element(index);\n }\n get layoutComplete() {\n return this[virtualizerRef]?.layoutComplete;\n }\n /**\n * This scrollToIndex() shim is here to provide backwards compatibility with other 0.x versions of\n * lit-virtualizer. It is deprecated and will likely be removed in the 1.0.0 release.\n */\n scrollToIndex(index, position = 'start') {\n this.element(index)?.scrollIntoView({ block: position });\n }\n}\n__decorate([\n property({ attribute: false })\n], LitVirtualizer.prototype, \"items\", void 0);\n__decorate([\n property()\n], LitVirtualizer.prototype, \"renderItem\", void 0);\n__decorate([\n property()\n], LitVirtualizer.prototype, \"keyFunction\", void 0);\n__decorate([\n property({ attribute: false })\n], LitVirtualizer.prototype, \"layout\", void 0);\n__decorate([\n property({ reflect: true, type: Boolean })\n], LitVirtualizer.prototype, \"scroller\", void 0);\n//# sourceMappingURL=LitVirtualizer.js.map","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nimport { LitVirtualizer } from './LitVirtualizer.js';\nexport { LitVirtualizer };\nexport { RangeChangedEvent, VisibilityChangedEvent } from './events.js';\n/**\n * Import this module to declare the lit-virtualizer custom element.\n */\ncustomElements.define('lit-virtualizer', LitVirtualizer);\n//# sourceMappingURL=lit-virtualizer.js.map","import '@lit-labs/virtualizer'\nimport { $LitElement } from '@mixins/litElement.mixin'\nimport { html, TemplateResult } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport './row' // Import the schmancy-table-row component\n\n// Define a generic TableColumn interface.\n// The `key` is now a key of T, and the render function accepts T.\nexport interface TableColumn<T extends Record<string, any> = any> {\n\tname: string\n\tkey?: keyof T // Key to access the property on the data object.\n\talign?: 'left' | 'right' | 'center'\n\tweight?: 'normal' | 'bold'\n\trender?: (item: T) => TemplateResult | string | number // Custom render function for complex content\n\tsortable?: boolean // Whether this column is sortable\n\tvalue?: (item: T) => any // Custom value function for sorting\n}\n\n// Define an event detail interface for row events.\nexport interface RowEventDetail<T> {\n\titem: T\n\tindex: number\n}\n\n// Define sort direction type\nexport type SortDirection = 'asc' | 'desc' | null\n\n/**\n * SchmancyDataTable is a generic data table component.\n * It supports sorting, filtering, and custom rendering of rows.\n *\n */\n@customElement('schmancy-table')\nexport class SchmancyDataTable<T extends Record<string, any> = any> extends $LitElement() {\n\t@property({ type: Array, attribute: false })\n\tcolumns: TableColumn<T>[] = []\n\n\t@property({ type: Array, attribute: false })\n\tdata: T[] = []\n\n\t// The keyField is now of type keyof T.\n\t@property({ type: String })\n\tkeyField: keyof T = 'id' as keyof T\n\n\t@property({ type: String })\n\tcols: string = '1fr'\n\n\t// Sorting property\n\t@property({ type: Boolean })\n\tsortable: boolean = false\n\n\t// Internal state properties\n\t@state() private sortColumn: keyof T | null = null\n\t@state() private sortDirection: SortDirection = null\n\t@state() private filteredData: T[] = []\n\n\tconstructor() {\n\t\tsuper()\n\t\tthis.filteredData = this.data\n\t}\n\n\t// Process the data whenever our dependencies change\n\tprotected willUpdate(changedProperties: Map<PropertyKey, unknown>): void {\n\t\tif (\n\t\t\tchangedProperties.has('data') ||\n\t\t\tchangedProperties.has('sortColumn') ||\n\t\t\tchangedProperties.has('sortDirection')\n\t\t) {\n\t\t\tthis.processData()\n\t\t}\n\t}\n\n\t/**\n\t * Helper function to check if a value is a Date object in a type-safe way\n\t */\n\tprivate isDate(value: any): value is Date {\n\t\treturn value && typeof value === 'object' && Object.prototype.toString.call(value) === '[object Date]'\n\t}\n\n\tprivate processData(): void {\n\t\tlet result = [...this.data]\n\n\t\t// Apply sorting\n\t\tif (this.sortable && this.sortColumn && this.sortDirection) {\n\t\t\t// Find the column configuration for the sorting column\n\t\t\tconst sortColumnConfig = this.columns.find(col => col.key === this.sortColumn)\n\n\t\t\tresult.sort((a, b) => {\n\t\t\t\t// Use the value function if provided in the column configuration\n\t\t\t\tlet aValue, bValue\n\n\t\t\t\tif (sortColumnConfig && sortColumnConfig.value) {\n\t\t\t\t\t// Use custom value function for sorting\n\t\t\t\t\taValue = sortColumnConfig.value(a)\n\t\t\t\t\tbValue = sortColumnConfig.value(b)\n\t\t\t\t} else {\n\t\t\t\t\t// Use standard property access\n\t\t\t\t\taValue = a[this.sortColumn as keyof T]\n\t\t\t\t\tbValue = b[this.sortColumn as keyof T]\n\t\t\t\t}\n\n\t\t\t\t// Handle null/undefined values - always sort them to the end regardless of sort direction\n\t\t\t\tif (aValue === null || aValue === undefined) {\n\t\t\t\t\treturn this.sortDirection === 'asc' ? 1 : -1\n\t\t\t\t}\n\t\t\t\tif (bValue === null || bValue === undefined) {\n\t\t\t\t\treturn this.sortDirection === 'asc' ? -1 : 1\n\t\t\t\t}\n\n\t\t\t\t// Handle numbers\n\t\t\t\tif (typeof aValue === 'number' && typeof bValue === 'number') {\n\t\t\t\t\treturn this.sortDirection === 'asc' ? aValue - bValue : bValue - aValue\n\t\t\t\t}\n\n\t\t\t\t// Detect and handle numeric strings - convert to numbers if both values are numeric\n\t\t\t\tconst aNumeric = typeof aValue === 'string' && !isNaN(Number(aValue))\n\t\t\t\tconst bNumeric = typeof bValue === 'string' && !isNaN(Number(bValue))\n\n\t\t\t\tif (aNumeric && bNumeric) {\n\t\t\t\t\tconst aNum = parseFloat(aValue as string)\n\t\t\t\t\tconst bNum = parseFloat(bValue as string)\n\t\t\t\t\treturn this.sortDirection === 'asc' ? aNum - bNum : bNum - aNum\n\t\t\t\t}\n\n\t\t\t\t// Handle dates - with proper type checking\n\t\t\t\tif (this.isDate(aValue) && this.isDate(bValue)) {\n\t\t\t\t\treturn this.sortDirection === 'asc'\n\t\t\t\t\t\t? aValue.getTime() - bValue.getTime()\n\t\t\t\t\t\t: bValue.getTime() - aValue.getTime()\n\t\t\t\t}\n\n\t\t\t\t// Convert to strings for string comparison or fallback comparison\n\t\t\t\tconst aStr = String(aValue)\n\t\t\t\tconst bStr = String(bValue)\n\t\t\t\treturn this.sortDirection === 'asc' ? aStr.localeCompare(bStr) : bStr.localeCompare(aStr)\n\t\t\t})\n\t\t}\n\n\t\tthis.filteredData = result\n\t}\n\n\t// Toggle sort for a column\n\tprivate toggleSort(column: TableColumn<T>): void {\n\t\tif (!column.key || column.sortable === false) return\n\n\t\tconst columnKey = column.key\n\n\t\t// If clicking the same column, cycle through sort states: asc -> desc -> null\n\t\tif (columnKey === this.sortColumn) {\n\t\t\tif (this.sortDirection === 'asc') {\n\t\t\t\tthis.sortDirection = 'desc'\n\t\t\t} else if (this.sortDirection === 'desc') {\n\t\t\t\tthis.sortDirection = null\n\t\t\t} else {\n\t\t\t\tthis.sortDirection = 'asc'\n\t\t\t}\n\t\t} else {\n\t\t\t// New column, start with ascending\n\t\t\tthis.sortColumn = columnKey\n\t\t\tthis.sortDirection = 'asc'\n\t\t}\n\n\t\t// Dispatch sort event\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('sort-change', {\n\t\t\t\tdetail: {\n\t\t\t\t\tcolumn: this.sortColumn,\n\t\t\t\t\tdirection: this.sortDirection,\n\t\t\t\t},\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t// Render sort indicator\n\tprivate renderSortIndicator(column: TableColumn<T>): TemplateResult | null {\n\t\tif (!this.sortable || column.sortable === false || !column.key || column.key !== this.sortColumn) {\n\t\t\treturn null\n\t\t}\n\n\t\treturn html`\n\t\t\t<span class=\"ml-1\">\n\t\t\t\t${this.sortDirection === 'asc'\n\t\t\t\t\t? html`<schmancy-icon size=\"16px\">arrow_upward</schmancy-icon>`\n\t\t\t\t\t: this.sortDirection === 'desc'\n\t\t\t\t\t\t? html`<schmancy-icon size=\"16px\">arrow_downward</schmancy-icon>`\n\t\t\t\t\t\t: null}\n\t\t\t</span>\n\t\t`\n\t}\n\n\trender(): TemplateResult {\n\t\tconst columnHeadClasses = column => ({\n\t\t\t'flex items-center': true,\n\t\t\t'cursor-pointer gap-1': this.sortable && column.sortable !== false && column.key,\n\t\t})\n\t\treturn html`\n\t\t\t<schmancy-grid class=\"h-full w-full\" cols=\"1fr\" rows=\"auto 1fr\">\n\t\t\t\t<schmancy-surface rounded=\"top\" elevation=\"1\" type=\"glass\" class=\"sticky top-0 z-10\">\n\t\t\t\t\t<schmancy-grid align=\"center\" class=\"px-4 py-3\" .cols=${this.cols} gap=\"md\" rows=\"1fr\">\n\t\t\t\t\t\t${this.columns.map(\n\t\t\t\t\t\t\tcolumn => html`\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclass=${this.classMap(columnHeadClasses(column))}\n\t\t\t\t\t\t\t\t\t@click=${() => (this.sortable && column.sortable !== false ? this.toggleSort(column) : null)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<schmancy-typography align=${column.align ?? 'left'} weight=${column.weight ?? 'bold'}>\n\t\t\t\t\t\t\t\t\t\t${column.name}\n\t\t\t\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t\t\t\t${this.renderSortIndicator(column)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t</schmancy-grid>\n\t\t\t\t</schmancy-surface>\n\n\t\t\t\t${this.filteredData.length > 0\n\t\t\t\t\t? html`\n\t\t\t\t\t\t\t<lit-virtualizer\n\t\t\t\t\t\t\t\tscroller\n\t\t\t\t\t\t\t\tclass=\"w-full h-full relative overflow-auto\"\n\t\t\t\t\t\t\t\t.items=${this.filteredData}\n\t\t\t\t\t\t\t\t.keyFunction=${(item: T, index: number) => {\n\t\t\t\t\t\t\t\t\tconst keyValue = item?.[this.keyField]\n\t\t\t\t\t\t\t\t\tif (keyValue === undefined || keyValue === null) {\n\t\t\t\t\t\t\t\t\t\treturn index\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn typeof keyValue === 'string' || typeof keyValue === 'number' ? keyValue : String(keyValue)\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t.renderItem=${(item: T, index: number) =>\n\t\t\t\t\t\t\t\t\thtml`\n\t\t\t\t\t\t\t\t\t\t<schmancy-table-row\n\t\t\t\t\t\t\t\t\t\t\tclass=\"w-full border-b border-solid border-outlineVariant\"\n\t\t\t\t\t\t\t\t\t\t\t.columns=${this.columns}\n\t\t\t\t\t\t\t\t\t\t\t.item=${item}\n\t\t\t\t\t\t\t\t\t\t\tcols=${this.cols}\n\t\t\t\t\t\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\t\t\t\t\t\tconst detail = { item, index }\n\t\t\t\t\t\t\t\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\t\t\t\t\t\t\t\tnew CustomEvent('click', {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdetail,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t></schmancy-table-row>\n\t\t\t\t\t\t\t\t\t` as TemplateResult}\n\t\t\t\t\t\t\t></lit-virtualizer>\n\t\t\t\t\t\t`\n\t\t\t\t\t: html`\n\t\t\t\t\t\t\t<div class=\"flex items-center justify-center w-full h-full p-8 text-center\">\n\t\t\t\t\t\t\t\t<schmancy-typography type=\"body\" token=\"lg\"> No data available </schmancy-typography>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t`}\n\t\t\t</schmancy-grid>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-table': SchmancyDataTable\n\t}\n}\n"],"x_google_ignoreList":[1,2,3,4,5,6],"mappings":";;;;;;;;;AAMO,IAAA,IAAA,cAAoE,GAAA,CAAA;CAAA,YAAA,GAAA,GAAA;AAAA,QAAA,GAAA,EAAA,EAAA,KAAA,UAE9C,EAAA,EAAA,KAAA,OAMb,KAAK,QAAQ,UAAU,MAAA,CAAO,KAAK,IAAA;;CAMlD,WAAmB,GAAA;AAElB,MAAI,EAAO,OACV,QAAO,CAAI;;mCAEqB,EAAO,SAAS,OAAA,yBAAgC,EAAO,UAAU,SAAA;QAC5F,EAAO,OAAO,KAAK,KAAA,CAAA;;;;EAOzB,IAAM,IAAQ,EA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S,EAAE,MAAM,QAAA,CAAA,CAAA,EAAS,EAAA,WAAA,QAAA,KAAA,EAAA,EAAA,EAAA,CAI1B,EAAS,EAAE,MAAM,SAAA,CAAA,CAAA,EAAU,EAAA,WAAA,YAAA,KAAA,EAAA,EAAA,EAAA,CAI3B,GAAA,CAAA,EAAO,EAAA,WAAA,cAAA,KAAA,EAAA,EAAA,EAAA,CACP,GAAA,CAAA,EAAO,EAAA,WAAA,iBAAA,KAAA,EAAA,EAAA,EAAA,CACP,GAAA,CAAA,EAAO,EAAA,WAAA,gBAAA,KAAA,EAAA,EAAA,IAAA,EAAA,CAtBR,EAAc,iBAAA,CAAA,EAAiB,EAAA;AAAA,SAAA,KAAA,GAAA,KAAA"}
1
+ {"version":3,"file":"table-Dwt66SR6.js","names":["directive","__decorate","property"],"sources":["../src/table/row.ts","../node_modules/@lit-labs/virtualizer/events.js","../node_modules/@lit-labs/virtualizer/ScrollerController.js","../node_modules/@lit-labs/virtualizer/Virtualizer.js","../node_modules/@lit-labs/virtualizer/virtualize.js","../node_modules/@lit-labs/virtualizer/LitVirtualizer.js","../node_modules/@lit-labs/virtualizer/lit-virtualizer.js","../src/table/table.ts"],"sourcesContent":["import { $LitElement } from '@mixins/litElement.mixin'\nimport { html, TemplateResult } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { TableColumn } from './table' // Import TableColumn interface with updated types\n\n@customElement('schmancy-table-row')\nexport class SchmancyTableRow<T extends Record<string, any> = any> extends $LitElement() {\n\t@property({ type: Array, attribute: false })\n\tcolumns: TableColumn<T>[] = []\n\n\t@property({ type: Object, attribute: false })\n\titem!: T\n\n\t@property({ type: String })\n\tcols: string = this.columns.map(() => '1fr').join(' ')\n\n\t/**\n\t * Renders a cell based on column configuration.\n\t * Uses custom render function if provided, otherwise extracts data from item.\n\t */\n\tprivate renderCell(column: TableColumn<T>): TemplateResult {\n\t\t// Use the render function if provided\n\t\tif (column.render) {\n\t\t\treturn html`\n\t\t\t\t<div class=\"overflow-hidden text-ellipsis\">\n\t\t\t\t\t<schmancy-typography align=\"${column.align || 'left'}\" maxLines=\"2\" weight=\"${column.weight || 'normal'}\">\n\t\t\t\t\t\t${column.render(this.item)}\n\t\t\t\t\t</schmancy-typography>\n\t\t\t\t</div>\n\t\t\t`\n\t\t}\n\n\t\t// Otherwise extract data using the key if available\n\t\tconst value = column.key ? this.item[column.key] : ''\n\n\t\treturn html`\n\t\t\t<div class=\"overflow-hidden text-ellipsis\">\n\t\t\t\t<schmancy-typography align=\"${column.align || 'left'}\" maxLines=\"2\" weight=\"${column.weight || 'normal'}\">\n\t\t\t\t\t${value}\n\t\t\t\t</schmancy-typography>\n\t\t\t</div>\n\t\t`\n\t}\n\n\trender(): TemplateResult {\n\t\treturn html`\n\t\t\t<schmancy-list-item class=\"w-full\">\n\t\t\t\t<schmancy-grid .cols=${this.cols} align=\"center\" gap=\"md\">\n\t\t\t\t\t${this.columns.map(column => this.renderCell(column))}\n\t\t\t\t</schmancy-grid>\n\t\t\t</schmancy-list-item>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-table-row': SchmancyTableRow\n\t}\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nexport class RangeChangedEvent extends Event {\n constructor(range) {\n super(RangeChangedEvent.eventName, { bubbles: false });\n this.first = range.first;\n this.last = range.last;\n }\n}\nRangeChangedEvent.eventName = 'rangeChanged';\nexport class VisibilityChangedEvent extends Event {\n constructor(range) {\n super(VisibilityChangedEvent.eventName, { bubbles: false });\n this.first = range.first;\n this.last = range.last;\n }\n}\nVisibilityChangedEvent.eventName = 'visibilityChanged';\nexport class UnpinnedEvent extends Event {\n constructor() {\n super(UnpinnedEvent.eventName, { bubbles: false });\n }\n}\nUnpinnedEvent.eventName = 'unpinned';\n//# sourceMappingURL=events.js.map","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nexport class ScrollerShim {\n constructor(element) {\n this._element = null;\n const node = element ?? window;\n this._node = node;\n if (element) {\n this._element = element;\n }\n }\n get element() {\n return (this._element || document.scrollingElement || document.documentElement);\n }\n get scrollTop() {\n return this.element.scrollTop || window.scrollY;\n }\n get scrollLeft() {\n return this.element.scrollLeft || window.scrollX;\n }\n get scrollHeight() {\n return this.element.scrollHeight;\n }\n get scrollWidth() {\n return this.element.scrollWidth;\n }\n get viewportHeight() {\n return this._element\n ? this._element.getBoundingClientRect().height\n : window.innerHeight;\n }\n get viewportWidth() {\n return this._element\n ? this._element.getBoundingClientRect().width\n : window.innerWidth;\n }\n get maxScrollTop() {\n return this.scrollHeight - this.viewportHeight;\n }\n get maxScrollLeft() {\n return this.scrollWidth - this.viewportWidth;\n }\n}\nexport class ScrollerController extends ScrollerShim {\n constructor(client, element) {\n super(element);\n this._clients = new Set();\n this._retarget = null;\n this._end = null;\n this.__destination = null;\n this.correctingScrollError = false;\n this._checkForArrival = this._checkForArrival.bind(this);\n this._updateManagedScrollTo = this._updateManagedScrollTo.bind(this);\n this.scrollTo = this.scrollTo.bind(this);\n this.scrollBy = this.scrollBy.bind(this);\n const node = this._node;\n this._originalScrollTo = node.scrollTo;\n this._originalScrollBy = node.scrollBy;\n this._originalScroll = node.scroll;\n this._attach(client);\n }\n get _destination() {\n return this.__destination;\n }\n get scrolling() {\n return this._destination !== null;\n }\n scrollTo(p1, p2) {\n const options = typeof p1 === 'number' && typeof p2 === 'number'\n ? { left: p1, top: p2 }\n : p1;\n this._scrollTo(options);\n }\n scrollBy(p1, p2) {\n const options = typeof p1 === 'number' && typeof p2 === 'number'\n ? { left: p1, top: p2 }\n : p1;\n if (options.top !== undefined) {\n options.top += this.scrollTop;\n }\n if (options.left !== undefined) {\n options.left += this.scrollLeft;\n }\n this._scrollTo(options);\n }\n _nativeScrollTo(options) {\n this._originalScrollTo.bind(this._element || window)(options);\n }\n _scrollTo(options, retarget = null, end = null) {\n if (this._end !== null) {\n this._end();\n }\n if (options.behavior === 'smooth') {\n this._setDestination(options);\n this._retarget = retarget;\n this._end = end;\n }\n else {\n this._resetScrollState();\n }\n this._nativeScrollTo(options);\n }\n _setDestination(options) {\n let { top, left } = options;\n top =\n top === undefined\n ? undefined\n : Math.max(0, Math.min(top, this.maxScrollTop));\n left =\n left === undefined\n ? undefined\n : Math.max(0, Math.min(left, this.maxScrollLeft));\n if (this._destination !== null &&\n left === this._destination.left &&\n top === this._destination.top) {\n return false;\n }\n this.__destination = { top, left, behavior: 'smooth' };\n return true;\n }\n _resetScrollState() {\n this.__destination = null;\n this._retarget = null;\n this._end = null;\n }\n _updateManagedScrollTo(coordinates) {\n if (this._destination) {\n if (this._setDestination(coordinates)) {\n this._nativeScrollTo(this._destination);\n }\n }\n }\n managedScrollTo(options, retarget, end) {\n this._scrollTo(options, retarget, end);\n return this._updateManagedScrollTo;\n }\n correctScrollError(coordinates) {\n this.correctingScrollError = true;\n requestAnimationFrame(() => requestAnimationFrame(() => (this.correctingScrollError = false)));\n // Correct the error\n this._nativeScrollTo(coordinates);\n // Then, if we were headed for a specific destination, we continue scrolling:\n // First, we update our target destination, if applicable...\n if (this._retarget) {\n this._setDestination(this._retarget());\n }\n // Then we go ahead and resume scrolling\n if (this._destination) {\n this._nativeScrollTo(this._destination);\n }\n }\n _checkForArrival() {\n if (this._destination !== null) {\n const { scrollTop, scrollLeft } = this;\n let { top, left } = this._destination;\n top = Math.min(top || 0, this.maxScrollTop);\n left = Math.min(left || 0, this.maxScrollLeft);\n const topDiff = Math.abs(top - scrollTop);\n const leftDiff = Math.abs(left - scrollLeft);\n // We check to see if we've arrived at our destination.\n if (topDiff < 1 && leftDiff < 1) {\n if (this._end) {\n this._end();\n }\n this._resetScrollState();\n }\n }\n }\n detach(client) {\n this._clients.delete(client);\n /**\n * If there aren't any more clients, then return the node's default\n * scrolling methods\n */\n if (this._clients.size === 0) {\n this._node.scrollTo = this._originalScrollTo;\n this._node.scrollBy = this._originalScrollBy;\n this._node.scroll = this._originalScroll;\n this._node.removeEventListener('scroll', this._checkForArrival);\n }\n return null;\n }\n _attach(client) {\n this._clients.add(client);\n /**\n * The node should only have the methods shimmed when adding the first\n * client – otherwise it's redundant\n */\n if (this._clients.size === 1) {\n this._node.scrollTo = this.scrollTo;\n this._node.scrollBy = this.scrollBy;\n this._node.scroll = this.scrollTo;\n this._node.addEventListener('scroll', this._checkForArrival);\n }\n }\n}\n//# sourceMappingURL=ScrollerController.js.map","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nimport { RangeChangedEvent, VisibilityChangedEvent, UnpinnedEvent, } from './events.js';\nimport { ScrollerController } from './ScrollerController.js';\n// Virtualizer depends on `ResizeObserver`, which is supported in\n// all modern browsers. For developers whose browser support\n// matrix includes older browsers, we include a compatible\n// polyfill in the package; this bit of module state facilitates\n// a simple mechanism (see ./polyfillLoaders/ResizeObserver.js.)\n// for loading the polyfill.\nlet _ResizeObserver = typeof window !== 'undefined' ? window.ResizeObserver : undefined;\n/**\n * Call this function to provide a `ResizeObserver` polyfill for Virtualizer to use.\n * @param Ctor Constructor for a `ResizeObserver` polyfill (recommend using the one provided with the Virtualizer package)\n */\nexport function provideResizeObserver(Ctor) {\n _ResizeObserver = Ctor;\n}\nexport const virtualizerRef = Symbol('virtualizerRef');\nconst SIZER_ATTRIBUTE = 'virtualizer-sizer';\nlet DefaultLayoutConstructor;\n/**\n * Provides virtual scrolling boilerplate.\n *\n * Extensions of this class must set hostElement and layout.\n *\n * Extensions of this class must also override VirtualRepeater's DOM\n * manipulation methods.\n */\nexport class Virtualizer {\n constructor(config) {\n this._benchmarkStart = null;\n this._layout = null;\n this._clippingAncestors = [];\n /**\n * Layout provides these values, we set them on _render().\n * TODO @straversi: Can we find an XOR type, usable for the key here?\n */\n this._scrollSize = null;\n /**\n * Difference between scroll target's current and required scroll offsets.\n * Provided by layout.\n */\n this._scrollError = null;\n /**\n * A list of the positions (top, left) of the children in the current range.\n */\n this._childrenPos = null;\n // TODO: (graynorton): type\n this._childMeasurements = null;\n this._toBeMeasured = new Map();\n this._rangeChanged = true;\n this._itemsChanged = true;\n this._visibilityChanged = true;\n this._scrollerController = null;\n this._isScroller = false;\n this._sizer = null;\n /**\n * Resize observer attached to hostElement.\n */\n this._hostElementRO = null;\n /**\n * Resize observer attached to children.\n */\n this._childrenRO = null;\n this._mutationObserver = null;\n this._scrollEventListeners = [];\n this._scrollEventListenerOptions = {\n passive: true,\n };\n // TODO (graynorton): Rethink, per longer comment below\n this._loadListener = this._childLoaded.bind(this);\n /**\n * Index of element to scroll into view, plus scroll\n * behavior options, as imperatively specified via\n * `element(index).scrollIntoView()`\n */\n this._scrollIntoViewTarget = null;\n this._updateScrollIntoViewCoordinates = null;\n /**\n * Items to render. Set by items.\n */\n this._items = [];\n /**\n * Index of the first child in the range, not necessarily the first visible child.\n * TODO @straversi: Consider renaming these.\n */\n this._first = -1;\n /**\n * Index of the last child in the range.\n */\n this._last = -1;\n /**\n * Index of the first item intersecting the viewport.\n */\n this._firstVisible = -1;\n /**\n * Index of the last item intersecting the viewport.\n */\n this._lastVisible = -1;\n this._scheduled = new WeakSet();\n /**\n * Invoked at the end of each render cycle: children in the range are\n * measured, and their dimensions passed to this callback. Use it to layout\n * children as needed.\n */\n this._measureCallback = null;\n this._measureChildOverride = null;\n /**\n * State for `layoutComplete` promise\n */\n this._layoutCompletePromise = null;\n this._layoutCompleteResolver = null;\n this._layoutCompleteRejecter = null;\n this._pendingLayoutComplete = null;\n /**\n * Layout initialization is async because we dynamically load\n * the default layout if none is specified. This state is to track\n * whether init is complete.\n */\n this._layoutInitialized = null;\n /**\n * Track connection state to guard against errors / unnecessary work\n */\n this._connected = false;\n if (!config) {\n throw new Error('Virtualizer constructor requires a configuration object');\n }\n if (config.hostElement) {\n this._init(config);\n }\n else {\n throw new Error('Virtualizer configuration requires the \"hostElement\" property');\n }\n }\n set items(items) {\n if (Array.isArray(items) && items !== this._items) {\n this._itemsChanged = true;\n this._items = items;\n this._schedule(this._updateLayout);\n }\n }\n _init(config) {\n this._isScroller = !!config.scroller;\n this._initHostElement(config);\n // If no layout is specified, we make an empty\n // layout config, which will result in the default\n // layout with default parameters\n const layoutConfig = config.layout || {};\n // Save the promise returned by `_initLayout` as a state\n // variable we can check before updating layout config\n this._layoutInitialized = this._initLayout(layoutConfig);\n }\n _initObservers() {\n this._mutationObserver = new MutationObserver(this._finishDOMUpdate.bind(this));\n this._hostElementRO = new _ResizeObserver(() => this._hostElementSizeChanged());\n this._childrenRO = new _ResizeObserver(this._childrenSizeChanged.bind(this));\n }\n _initHostElement(config) {\n const hostElement = (this._hostElement = config.hostElement);\n this._applyVirtualizerStyles();\n hostElement[virtualizerRef] = this;\n }\n connected() {\n this._initObservers();\n const includeSelf = this._isScroller;\n this._clippingAncestors = getClippingAncestors(this._hostElement, includeSelf);\n this._scrollerController = new ScrollerController(this, this._clippingAncestors[0]);\n this._schedule(this._updateLayout);\n this._observeAndListen();\n this._connected = true;\n }\n _observeAndListen() {\n this._mutationObserver.observe(this._hostElement, { childList: true });\n this._hostElementRO.observe(this._hostElement);\n this._scrollEventListeners.push(window);\n window.addEventListener('scroll', this, this._scrollEventListenerOptions);\n this._clippingAncestors.forEach((ancestor) => {\n ancestor.addEventListener('scroll', this, this._scrollEventListenerOptions);\n this._scrollEventListeners.push(ancestor);\n this._hostElementRO.observe(ancestor);\n });\n this._hostElementRO.observe(this._scrollerController.element);\n this._children.forEach((child) => this._childrenRO.observe(child));\n this._scrollEventListeners.forEach((target) => target.addEventListener('scroll', this, this._scrollEventListenerOptions));\n }\n disconnected() {\n this._scrollEventListeners.forEach((target) => target.removeEventListener('scroll', this, this._scrollEventListenerOptions));\n this._scrollEventListeners = [];\n this._clippingAncestors = [];\n this._scrollerController?.detach(this);\n this._scrollerController = null;\n this._mutationObserver?.disconnect();\n this._mutationObserver = null;\n this._hostElementRO?.disconnect();\n this._hostElementRO = null;\n this._childrenRO?.disconnect();\n this._childrenRO = null;\n this._rejectLayoutCompletePromise('disconnected');\n this._connected = false;\n }\n _applyVirtualizerStyles() {\n const hostElement = this._hostElement;\n // Would rather set these CSS properties on the host using Shadow Root\n // style scoping (and falling back to a global stylesheet where native\n // Shadow DOM is not available), but this Mobile Safari bug is preventing\n // that from working: https://bugs.webkit.org/show_bug.cgi?id=226195\n const style = hostElement.style;\n style.display = style.display || 'block';\n style.position = style.position || 'relative';\n style.contain = style.contain || 'size layout';\n if (this._isScroller) {\n style.overflow = style.overflow || 'auto';\n style.minHeight = style.minHeight || '150px';\n }\n }\n _getSizer() {\n const hostElement = this._hostElement;\n if (!this._sizer) {\n // Use a preexisting sizer element if provided (for better integration\n // with vDOM renderers)\n let sizer = hostElement.querySelector(`[${SIZER_ATTRIBUTE}]`);\n if (!sizer) {\n sizer = document.createElement('div');\n sizer.setAttribute(SIZER_ATTRIBUTE, '');\n hostElement.appendChild(sizer);\n }\n // When the scrollHeight is large, the height of this element might be\n // ignored. Setting content and font-size ensures the element has a size.\n Object.assign(sizer.style, {\n position: 'absolute',\n margin: '-2px 0 0 0',\n padding: 0,\n visibility: 'hidden',\n fontSize: '2px',\n });\n sizer.textContent = '&nbsp;';\n sizer.setAttribute(SIZER_ATTRIBUTE, '');\n this._sizer = sizer;\n }\n return this._sizer;\n }\n async updateLayoutConfig(layoutConfig) {\n // If layout initialization hasn't finished yet, we wait\n // for it to finish so we can check whether the new config\n // is compatible with the existing layout before proceeding.\n await this._layoutInitialized;\n const Ctor = layoutConfig.type ||\n // The new config is compatible with the current layout,\n // so we update the config and return true to indicate\n // a successful update\n DefaultLayoutConstructor;\n if (typeof Ctor === 'function' && this._layout instanceof Ctor) {\n const config = { ...layoutConfig };\n delete config.type;\n this._layout.config = config;\n // The new config requires a different layout altogether, but\n // to limit implementation complexity we don't support dynamically\n // changing the layout of an existing virtualizer instance.\n // Returning false here lets the caller know that they should\n // instead make a new virtualizer instance with the desired layout.\n return true;\n }\n return false;\n }\n async _initLayout(layoutConfig) {\n let config;\n let Ctor;\n if (typeof layoutConfig.type === 'function') {\n // If we have a full LayoutSpecifier, the `type` property\n // gives us our constructor...\n Ctor = layoutConfig.type;\n // ...while the rest of the specifier is our layout config\n const copy = { ...layoutConfig };\n delete copy.type;\n config = copy;\n }\n else {\n // If we don't have a full LayoutSpecifier, we just\n // have a config for the default layout\n config = layoutConfig;\n }\n if (Ctor === undefined) {\n // If we don't have a constructor yet, load the default\n DefaultLayoutConstructor = Ctor = (await import('./layouts/flow.js'))\n .FlowLayout;\n }\n this._layout = new Ctor((message) => this._handleLayoutMessage(message), config);\n if (this._layout.measureChildren &&\n typeof this._layout.updateItemSizes === 'function') {\n if (typeof this._layout.measureChildren === 'function') {\n this._measureChildOverride = this._layout.measureChildren;\n }\n this._measureCallback = this._layout.updateItemSizes.bind(this._layout);\n }\n if (this._layout.listenForChildLoadEvents) {\n this._hostElement.addEventListener('load', this._loadListener, true);\n }\n this._schedule(this._updateLayout);\n }\n // TODO (graynorton): Rework benchmarking so that it has no API and\n // instead is always on except in production builds\n startBenchmarking() {\n if (this._benchmarkStart === null) {\n this._benchmarkStart = window.performance.now();\n }\n }\n stopBenchmarking() {\n if (this._benchmarkStart !== null) {\n const now = window.performance.now();\n const timeElapsed = now - this._benchmarkStart;\n const entries = performance.getEntriesByName('uv-virtualizing', 'measure');\n const virtualizationTime = entries\n .filter((e) => e.startTime >= this._benchmarkStart && e.startTime < now)\n .reduce((t, m) => t + m.duration, 0);\n this._benchmarkStart = null;\n return { timeElapsed, virtualizationTime };\n }\n return null;\n }\n _measureChildren() {\n const mm = {};\n const children = this._children;\n const fn = this._measureChildOverride || this._measureChild;\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n const idx = this._first + i;\n if (this._itemsChanged || this._toBeMeasured.has(child)) {\n mm[idx] = fn.call(this, child, this._items[idx]);\n }\n }\n this._childMeasurements = mm;\n this._schedule(this._updateLayout);\n this._toBeMeasured.clear();\n }\n /**\n * Returns the width, height, and margins of the given child.\n */\n _measureChild(element) {\n // offsetWidth doesn't take transforms in consideration, so we use\n // getBoundingClientRect which does.\n const { width, height } = element.getBoundingClientRect();\n return Object.assign({ width, height }, getMargins(element));\n }\n async _schedule(method) {\n if (!this._scheduled.has(method)) {\n this._scheduled.add(method);\n await Promise.resolve();\n this._scheduled.delete(method);\n method.call(this);\n }\n }\n async _updateDOM(state) {\n this._scrollSize = state.scrollSize;\n this._adjustRange(state.range);\n this._childrenPos = state.childPositions;\n this._scrollError = state.scrollError || null;\n const { _rangeChanged, _itemsChanged } = this;\n if (this._visibilityChanged) {\n this._notifyVisibility();\n this._visibilityChanged = false;\n }\n if (_rangeChanged || _itemsChanged) {\n this._notifyRange();\n this._rangeChanged = false;\n }\n this._finishDOMUpdate();\n }\n _finishDOMUpdate() {\n if (this._connected) {\n // _childrenRO should be non-null if we're connected\n this._children.forEach((child) => this._childrenRO.observe(child));\n this._checkScrollIntoViewTarget(this._childrenPos);\n this._positionChildren(this._childrenPos);\n this._sizeHostElement(this._scrollSize);\n this._correctScrollError();\n if (this._benchmarkStart && 'mark' in window.performance) {\n window.performance.mark('uv-end');\n }\n }\n }\n _updateLayout() {\n if (this._layout && this._connected) {\n this._layout.items = this._items;\n this._updateView();\n if (this._childMeasurements !== null) {\n // If the layout has been changed, we may have measurements but no callback\n if (this._measureCallback) {\n this._measureCallback(this._childMeasurements);\n }\n this._childMeasurements = null;\n }\n this._layout.reflowIfNeeded();\n if (this._benchmarkStart && 'mark' in window.performance) {\n window.performance.mark('uv-end');\n }\n }\n }\n _handleScrollEvent() {\n if (this._benchmarkStart && 'mark' in window.performance) {\n try {\n window.performance.measure('uv-virtualizing', 'uv-start', 'uv-end');\n }\n catch (e) {\n console.warn('Error measuring performance data: ', e);\n }\n window.performance.mark('uv-start');\n }\n if (this._scrollerController.correctingScrollError === false) {\n // This is a user-initiated scroll, so we unpin the layout\n this._layout?.unpin();\n }\n this._schedule(this._updateLayout);\n }\n handleEvent(event) {\n switch (event.type) {\n case 'scroll':\n if (event.currentTarget === window ||\n this._clippingAncestors.includes(event.currentTarget)) {\n this._handleScrollEvent();\n }\n break;\n default:\n console.warn('event not handled', event);\n }\n }\n _handleLayoutMessage(message) {\n if (message.type === 'stateChanged') {\n this._updateDOM(message);\n }\n else if (message.type === 'visibilityChanged') {\n this._firstVisible = message.firstVisible;\n this._lastVisible = message.lastVisible;\n this._notifyVisibility();\n }\n else if (message.type === 'unpinned') {\n this._hostElement.dispatchEvent(new UnpinnedEvent());\n }\n }\n get _children() {\n const arr = [];\n let next = this._hostElement.firstElementChild;\n while (next) {\n if (!next.hasAttribute(SIZER_ATTRIBUTE)) {\n arr.push(next);\n }\n next = next.nextElementSibling;\n }\n return arr;\n }\n _updateView() {\n const hostElement = this._hostElement;\n const scrollingElement = this._scrollerController?.element;\n const layout = this._layout;\n if (hostElement && scrollingElement && layout) {\n let top, left, bottom, right;\n const hostElementBounds = hostElement.getBoundingClientRect();\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n const ancestorBounds = this._clippingAncestors.map((ancestor) => ancestor.getBoundingClientRect());\n ancestorBounds.unshift(hostElementBounds);\n for (const bounds of ancestorBounds) {\n top = Math.max(top, bounds.top);\n left = Math.max(left, bounds.left);\n bottom = Math.min(bottom, bounds.bottom);\n right = Math.min(right, bounds.right);\n }\n const scrollingElementBounds = scrollingElement.getBoundingClientRect();\n const offsetWithinScroller = {\n left: hostElementBounds.left - scrollingElementBounds.left,\n top: hostElementBounds.top - scrollingElementBounds.top,\n };\n const totalScrollSize = {\n width: scrollingElement.scrollWidth,\n height: scrollingElement.scrollHeight,\n };\n const scrollTop = top - hostElementBounds.top + hostElement.scrollTop;\n const scrollLeft = left - hostElementBounds.left + hostElement.scrollLeft;\n const height = Math.max(0, bottom - top);\n const width = Math.max(0, right - left);\n layout.viewportSize = { width, height };\n layout.viewportScroll = { top: scrollTop, left: scrollLeft };\n layout.totalScrollSize = totalScrollSize;\n layout.offsetWithinScroller = offsetWithinScroller;\n }\n }\n /**\n * Styles the host element so that its size reflects the\n * total size of all items.\n */\n _sizeHostElement(size) {\n // Some browsers seem to crap out if the host element gets larger than\n // a certain size, so we clamp it here (this value based on ad hoc\n // testing in Chrome / Safari / Firefox Mac)\n const max = 8200000;\n const h = size && size.width !== null ? Math.min(max, size.width) : 0;\n const v = size && size.height !== null ? Math.min(max, size.height) : 0;\n if (this._isScroller) {\n this._getSizer().style.transform = `translate(${h}px, ${v}px)`;\n }\n else {\n const style = this._hostElement.style;\n style.minWidth = h ? `${h}px` : '100%';\n style.minHeight = v ? `${v}px` : '100%';\n }\n }\n /**\n * Sets the top and left transform style of the children from the values in\n * pos.\n */\n _positionChildren(pos) {\n if (pos) {\n pos.forEach(({ top, left, width, height, xOffset, yOffset }, index) => {\n const child = this._children[index - this._first];\n if (child) {\n child.style.position = 'absolute';\n child.style.boxSizing = 'border-box';\n child.style.transform = `translate(${left}px, ${top}px)`;\n if (width !== undefined) {\n child.style.width = width + 'px';\n }\n if (height !== undefined) {\n child.style.height = height + 'px';\n }\n child.style.left =\n xOffset === undefined ? null : xOffset + 'px';\n child.style.top =\n yOffset === undefined ? null : yOffset + 'px';\n }\n });\n }\n }\n async _adjustRange(range) {\n const { _first, _last, _firstVisible, _lastVisible } = this;\n this._first = range.first;\n this._last = range.last;\n this._firstVisible = range.firstVisible;\n this._lastVisible = range.lastVisible;\n this._rangeChanged =\n this._rangeChanged || this._first !== _first || this._last !== _last;\n this._visibilityChanged =\n this._visibilityChanged ||\n this._firstVisible !== _firstVisible ||\n this._lastVisible !== _lastVisible;\n }\n _correctScrollError() {\n if (this._scrollError) {\n const { scrollTop, scrollLeft } = this._scrollerController;\n const { top, left } = this._scrollError;\n this._scrollError = null;\n this._scrollerController.correctScrollError({\n top: scrollTop - top,\n left: scrollLeft - left,\n });\n }\n }\n element(index) {\n if (index === Infinity) {\n index = this._items.length - 1;\n }\n return this._items?.[index] === undefined\n ? undefined\n : {\n scrollIntoView: (options = {}) => this._scrollElementIntoView({ ...options, index }),\n };\n }\n _scrollElementIntoView(options) {\n if (options.index >= this._first && options.index <= this._last) {\n this._children[options.index - this._first].scrollIntoView(options);\n }\n else {\n options.index = Math.min(options.index, this._items.length - 1);\n if (options.behavior === 'smooth') {\n const coordinates = this._layout.getScrollIntoViewCoordinates(options);\n const { behavior } = options;\n this._updateScrollIntoViewCoordinates =\n this._scrollerController.managedScrollTo(Object.assign(coordinates, { behavior }), () => this._layout.getScrollIntoViewCoordinates(options), () => (this._scrollIntoViewTarget = null));\n this._scrollIntoViewTarget = options;\n }\n else {\n this._layout.pin = options;\n }\n }\n }\n /**\n * If we are smoothly scrolling to an element and the target element\n * is in the DOM, we update our target coordinates as needed\n */\n _checkScrollIntoViewTarget(pos) {\n const { index } = this._scrollIntoViewTarget || {};\n if (index && pos?.has(index)) {\n this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget));\n }\n }\n /**\n * Emits a rangechange event with the current first, last, firstVisible, and\n * lastVisible.\n */\n _notifyRange() {\n this._hostElement.dispatchEvent(new RangeChangedEvent({ first: this._first, last: this._last }));\n }\n _notifyVisibility() {\n this._hostElement.dispatchEvent(new VisibilityChangedEvent({\n first: this._firstVisible,\n last: this._lastVisible,\n }));\n }\n get layoutComplete() {\n // Lazily create promise\n if (!this._layoutCompletePromise) {\n this._layoutCompletePromise = new Promise((resolve, reject) => {\n this._layoutCompleteResolver = resolve;\n this._layoutCompleteRejecter = reject;\n });\n }\n return this._layoutCompletePromise;\n }\n _rejectLayoutCompletePromise(reason) {\n if (this._layoutCompleteRejecter !== null) {\n this._layoutCompleteRejecter(reason);\n }\n this._resetLayoutCompleteState();\n }\n _scheduleLayoutComplete() {\n // Don't do anything unless we have a pending promise\n // And only request a frame if we haven't already done so\n if (this._layoutCompletePromise && this._pendingLayoutComplete === null) {\n // Wait one additional frame to be sure the layout is stable\n this._pendingLayoutComplete = requestAnimationFrame(() => requestAnimationFrame(() => this._resolveLayoutCompletePromise()));\n }\n }\n _resolveLayoutCompletePromise() {\n if (this._layoutCompleteResolver !== null) {\n this._layoutCompleteResolver();\n }\n this._resetLayoutCompleteState();\n }\n _resetLayoutCompleteState() {\n this._layoutCompletePromise = null;\n this._layoutCompleteResolver = null;\n this._layoutCompleteRejecter = null;\n this._pendingLayoutComplete = null;\n }\n /**\n * Render and update the view at the next opportunity with the given\n * hostElement size.\n */\n _hostElementSizeChanged() {\n this._schedule(this._updateLayout);\n }\n // TODO (graynorton): Rethink how this works. Probably child loading is too specific\n // to have dedicated support for; might want some more generic lifecycle hooks for\n // layouts to use. Possibly handle measurement this way, too, or maybe that remains\n // a first-class feature?\n _childLoaded() { }\n // This is the callback for the ResizeObserver that watches the\n // virtualizer's children. We land here at the end of every virtualizer\n // update cycle that results in changes to physical items, and we also\n // end up here if one or more children change size independently of\n // the virtualizer update cycle.\n _childrenSizeChanged(changes) {\n // Only measure if the layout requires it\n if (this._layout?.measureChildren) {\n for (const change of changes) {\n this._toBeMeasured.set(change.target, change.contentRect);\n }\n this._measureChildren();\n }\n // If this is the end of an update cycle, we need to reset some\n // internal state. This should be a harmless no-op if we're handling\n // an out-of-cycle ResizeObserver callback, so we don't need to\n // distinguish between the two cases.\n this._scheduleLayoutComplete();\n this._itemsChanged = false;\n this._rangeChanged = false;\n }\n}\nfunction getMargins(el) {\n const style = window.getComputedStyle(el);\n return {\n marginTop: getMarginValue(style.marginTop),\n marginRight: getMarginValue(style.marginRight),\n marginBottom: getMarginValue(style.marginBottom),\n marginLeft: getMarginValue(style.marginLeft),\n };\n}\nfunction getMarginValue(value) {\n const float = value ? parseFloat(value) : NaN;\n return Number.isNaN(float) ? 0 : float;\n}\n// TODO (graynorton): Deal with iframes?\nfunction getParentElement(el) {\n if (el.assignedSlot !== null) {\n return el.assignedSlot;\n }\n if (el.parentElement !== null) {\n return el.parentElement;\n }\n const parentNode = el.parentNode;\n if (parentNode && parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n return parentNode.host || null;\n }\n return null;\n}\n///\nfunction getElementAncestors(el, includeSelf = false) {\n const ancestors = [];\n let parent = includeSelf ? el : getParentElement(el);\n while (parent !== null) {\n ancestors.push(parent);\n parent = getParentElement(parent);\n }\n return ancestors;\n}\nfunction getClippingAncestors(el, includeSelf = false) {\n let foundFixed = false;\n return getElementAncestors(el, includeSelf).filter((a) => {\n if (foundFixed) {\n return false;\n }\n const style = getComputedStyle(a);\n foundFixed = style.position === 'fixed';\n return style.overflow !== 'visible';\n });\n}\n//# sourceMappingURL=Virtualizer.js.map","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nimport { html, noChange } from 'lit';\nimport { directive, PartType } from 'lit/directive.js';\nimport { AsyncDirective } from 'lit/async-directive.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { Virtualizer } from './Virtualizer.js';\nexport { virtualizerRef } from './Virtualizer.js';\nexport const defaultKeyFunction = (item) => item;\nexport const defaultRenderItem = (item, idx) => html `${idx}: ${JSON.stringify(item, null, 2)}`;\nclass VirtualizeDirective extends AsyncDirective {\n constructor(part) {\n super(part);\n this._virtualizer = null;\n this._first = 0;\n this._last = -1;\n this._renderItem = (item, idx) => defaultRenderItem(item, idx + this._first);\n this._keyFunction = (item, idx) => defaultKeyFunction(item, idx + this._first);\n this._items = [];\n if (part.type !== PartType.CHILD) {\n throw new Error('The virtualize directive can only be used in child expressions');\n }\n }\n render(config) {\n if (config) {\n this._setFunctions(config);\n }\n const itemsToRender = [];\n if (this._first >= 0 && this._last >= this._first) {\n for (let i = this._first; i <= this._last; i++) {\n itemsToRender.push(this._items[i]);\n }\n }\n return repeat(itemsToRender, this._keyFunction, this._renderItem);\n }\n update(part, [config]) {\n this._setFunctions(config);\n const itemsChanged = this._items !== config.items;\n this._items = config.items || [];\n if (this._virtualizer) {\n this._updateVirtualizerConfig(part, config);\n }\n else {\n this._initialize(part, config);\n }\n return itemsChanged ? noChange : this.render();\n }\n async _updateVirtualizerConfig(part, config) {\n const compatible = await this._virtualizer.updateLayoutConfig(config.layout || {});\n if (!compatible) {\n const hostElement = part.parentNode;\n this._makeVirtualizer(hostElement, config);\n }\n this._virtualizer.items = this._items;\n }\n _setFunctions(config) {\n const { renderItem, keyFunction } = config;\n if (renderItem) {\n this._renderItem = (item, idx) => renderItem(item, idx + this._first);\n }\n if (keyFunction) {\n this._keyFunction = (item, idx) => keyFunction(item, idx + this._first);\n }\n }\n _makeVirtualizer(hostElement, config) {\n if (this._virtualizer) {\n this._virtualizer.disconnected();\n }\n const { layout, scroller, items } = config;\n this._virtualizer = new Virtualizer({ hostElement, layout, scroller });\n this._virtualizer.items = items;\n this._virtualizer.connected();\n }\n _initialize(part, config) {\n const hostElement = part.parentNode;\n if (hostElement && hostElement.nodeType === 1) {\n hostElement.addEventListener('rangeChanged', (e) => {\n this._first = e.first;\n this._last = e.last;\n this.setValue(this.render());\n });\n this._makeVirtualizer(hostElement, config);\n }\n }\n disconnected() {\n this._virtualizer?.disconnected();\n }\n reconnected() {\n this._virtualizer?.connected();\n }\n}\nexport const virtualize = directive(VirtualizeDirective);\n//# sourceMappingURL=virtualize.js.map","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nimport { __decorate } from \"tslib\";\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { virtualize, virtualizerRef, defaultRenderItem, defaultKeyFunction, } from './virtualize.js';\nexport class LitVirtualizer extends LitElement {\n constructor() {\n super(...arguments);\n this.items = [];\n this.renderItem = defaultRenderItem;\n this.keyFunction = defaultKeyFunction;\n this.layout = {};\n this.scroller = false;\n }\n createRenderRoot() {\n return this;\n }\n render() {\n const { items, renderItem, keyFunction, layout, scroller } = this;\n return html `${virtualize({\n items,\n renderItem,\n keyFunction,\n layout,\n scroller,\n })}`;\n }\n element(index) {\n return this[virtualizerRef]?.element(index);\n }\n get layoutComplete() {\n return this[virtualizerRef]?.layoutComplete;\n }\n /**\n * This scrollToIndex() shim is here to provide backwards compatibility with other 0.x versions of\n * lit-virtualizer. It is deprecated and will likely be removed in the 1.0.0 release.\n */\n scrollToIndex(index, position = 'start') {\n this.element(index)?.scrollIntoView({ block: position });\n }\n}\n__decorate([\n property({ attribute: false })\n], LitVirtualizer.prototype, \"items\", void 0);\n__decorate([\n property()\n], LitVirtualizer.prototype, \"renderItem\", void 0);\n__decorate([\n property()\n], LitVirtualizer.prototype, \"keyFunction\", void 0);\n__decorate([\n property({ attribute: false })\n], LitVirtualizer.prototype, \"layout\", void 0);\n__decorate([\n property({ reflect: true, type: Boolean })\n], LitVirtualizer.prototype, \"scroller\", void 0);\n//# sourceMappingURL=LitVirtualizer.js.map","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nimport { LitVirtualizer } from './LitVirtualizer.js';\nexport { LitVirtualizer };\nexport { RangeChangedEvent, VisibilityChangedEvent } from './events.js';\n/**\n * Import this module to declare the lit-virtualizer custom element.\n */\ncustomElements.define('lit-virtualizer', LitVirtualizer);\n//# sourceMappingURL=lit-virtualizer.js.map","import '@lit-labs/virtualizer'\nimport { $LitElement } from '@mixins/litElement.mixin'\nimport { html, TemplateResult } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport './row' // Import the schmancy-table-row component\n\n// Define a generic TableColumn interface.\n// The `key` is now a key of T, and the render function accepts T.\nexport interface TableColumn<T extends Record<string, any> = any> {\n\tname: string\n\tkey?: keyof T // Key to access the property on the data object.\n\talign?: 'left' | 'right' | 'center'\n\tweight?: 'normal' | 'bold'\n\trender?: (item: T) => TemplateResult | string | number // Custom render function for complex content\n\tsortable?: boolean // Whether this column is sortable\n\tvalue?: (item: T) => any // Custom value function for sorting\n}\n\n// Define an event detail interface for row events.\nexport interface RowEventDetail<T> {\n\titem: T\n\tindex: number\n}\n\n// Define sort direction type\nexport type SortDirection = 'asc' | 'desc' | null\n\n/**\n * SchmancyDataTable is a generic data table component.\n * It supports sorting, filtering, and custom rendering of rows.\n *\n */\n@customElement('schmancy-table')\nexport class SchmancyDataTable<T extends Record<string, any> = any> extends $LitElement() {\n\t@property({ type: Array, attribute: false })\n\tcolumns: TableColumn<T>[] = []\n\n\t@property({ type: Array, attribute: false })\n\tdata: T[] = []\n\n\t// The keyField is now of type keyof T.\n\t@property({ type: String })\n\tkeyField: keyof T = 'id' as keyof T\n\n\t@property({ type: String })\n\tcols: string = '1fr'\n\n\t// Sorting property\n\t@property({ type: Boolean })\n\tsortable: boolean = false\n\n\t// Internal state properties\n\t@state() private sortColumn: keyof T | null = null\n\t@state() private sortDirection: SortDirection = null\n\t@state() private filteredData: T[] = []\n\n\tconstructor() {\n\t\tsuper()\n\t\tthis.filteredData = this.data\n\t}\n\n\t// Process the data whenever our dependencies change\n\tprotected willUpdate(changedProperties: Map<PropertyKey, unknown>): void {\n\t\tif (\n\t\t\tchangedProperties.has('data') ||\n\t\t\tchangedProperties.has('sortColumn') ||\n\t\t\tchangedProperties.has('sortDirection')\n\t\t) {\n\t\t\tthis.processData()\n\t\t}\n\t}\n\n\t/**\n\t * Helper function to check if a value is a Date object in a type-safe way\n\t */\n\tprivate isDate(value: any): value is Date {\n\t\treturn value && typeof value === 'object' && Object.prototype.toString.call(value) === '[object Date]'\n\t}\n\n\tprivate processData(): void {\n\t\tlet result = [...this.data]\n\n\t\t// Apply sorting\n\t\tif (this.sortable && this.sortColumn && this.sortDirection) {\n\t\t\t// Find the column configuration for the sorting column\n\t\t\tconst sortColumnConfig = this.columns.find(col => col.key === this.sortColumn)\n\n\t\t\tresult.sort((a, b) => {\n\t\t\t\t// Use the value function if provided in the column configuration\n\t\t\t\tlet aValue, bValue\n\n\t\t\t\tif (sortColumnConfig && sortColumnConfig.value) {\n\t\t\t\t\t// Use custom value function for sorting\n\t\t\t\t\taValue = sortColumnConfig.value(a)\n\t\t\t\t\tbValue = sortColumnConfig.value(b)\n\t\t\t\t} else {\n\t\t\t\t\t// Use standard property access\n\t\t\t\t\taValue = a[this.sortColumn as keyof T]\n\t\t\t\t\tbValue = b[this.sortColumn as keyof T]\n\t\t\t\t}\n\n\t\t\t\t// Handle null/undefined values - always sort them to the end regardless of sort direction\n\t\t\t\tif (aValue === null || aValue === undefined) {\n\t\t\t\t\treturn this.sortDirection === 'asc' ? 1 : -1\n\t\t\t\t}\n\t\t\t\tif (bValue === null || bValue === undefined) {\n\t\t\t\t\treturn this.sortDirection === 'asc' ? -1 : 1\n\t\t\t\t}\n\n\t\t\t\t// Handle numbers\n\t\t\t\tif (typeof aValue === 'number' && typeof bValue === 'number') {\n\t\t\t\t\treturn this.sortDirection === 'asc' ? aValue - bValue : bValue - aValue\n\t\t\t\t}\n\n\t\t\t\t// Detect and handle numeric strings - convert to numbers if both values are numeric\n\t\t\t\tconst aNumeric = typeof aValue === 'string' && !isNaN(Number(aValue))\n\t\t\t\tconst bNumeric = typeof bValue === 'string' && !isNaN(Number(bValue))\n\n\t\t\t\tif (aNumeric && bNumeric) {\n\t\t\t\t\tconst aNum = parseFloat(aValue as string)\n\t\t\t\t\tconst bNum = parseFloat(bValue as string)\n\t\t\t\t\treturn this.sortDirection === 'asc' ? aNum - bNum : bNum - aNum\n\t\t\t\t}\n\n\t\t\t\t// Handle dates - with proper type checking\n\t\t\t\tif (this.isDate(aValue) && this.isDate(bValue)) {\n\t\t\t\t\treturn this.sortDirection === 'asc'\n\t\t\t\t\t\t? aValue.getTime() - bValue.getTime()\n\t\t\t\t\t\t: bValue.getTime() - aValue.getTime()\n\t\t\t\t}\n\n\t\t\t\t// Convert to strings for string comparison or fallback comparison\n\t\t\t\tconst aStr = String(aValue)\n\t\t\t\tconst bStr = String(bValue)\n\t\t\t\treturn this.sortDirection === 'asc' ? aStr.localeCompare(bStr) : bStr.localeCompare(aStr)\n\t\t\t})\n\t\t}\n\n\t\tthis.filteredData = result\n\t}\n\n\t// Toggle sort for a column\n\tprivate toggleSort(column: TableColumn<T>): void {\n\t\tif (!column.key || column.sortable === false) return\n\n\t\tconst columnKey = column.key\n\n\t\t// If clicking the same column, cycle through sort states: asc -> desc -> null\n\t\tif (columnKey === this.sortColumn) {\n\t\t\tif (this.sortDirection === 'asc') {\n\t\t\t\tthis.sortDirection = 'desc'\n\t\t\t} else if (this.sortDirection === 'desc') {\n\t\t\t\tthis.sortDirection = null\n\t\t\t} else {\n\t\t\t\tthis.sortDirection = 'asc'\n\t\t\t}\n\t\t} else {\n\t\t\t// New column, start with ascending\n\t\t\tthis.sortColumn = columnKey\n\t\t\tthis.sortDirection = 'asc'\n\t\t}\n\n\t\t// Dispatch sort event\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('sort-change', {\n\t\t\t\tdetail: {\n\t\t\t\t\tcolumn: this.sortColumn,\n\t\t\t\t\tdirection: this.sortDirection,\n\t\t\t\t},\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t// Render sort indicator\n\tprivate renderSortIndicator(column: TableColumn<T>): TemplateResult | null {\n\t\tif (!this.sortable || column.sortable === false || !column.key || column.key !== this.sortColumn) {\n\t\t\treturn null\n\t\t}\n\n\t\treturn html`\n\t\t\t<span class=\"ml-1\">\n\t\t\t\t${this.sortDirection === 'asc'\n\t\t\t\t\t? html`<schmancy-icon size=\"16px\">arrow_upward</schmancy-icon>`\n\t\t\t\t\t: this.sortDirection === 'desc'\n\t\t\t\t\t\t? html`<schmancy-icon size=\"16px\">arrow_downward</schmancy-icon>`\n\t\t\t\t\t\t: null}\n\t\t\t</span>\n\t\t`\n\t}\n\n\trender(): TemplateResult {\n\t\tconst columnHeadClasses = column => ({\n\t\t\t'flex items-center': true,\n\t\t\t'cursor-pointer gap-1': this.sortable && column.sortable !== false && column.key,\n\t\t})\n\t\treturn html`\n\t\t\t<schmancy-grid class=\"h-full w-full\" cols=\"1fr\" rows=\"auto 1fr\">\n\t\t\t\t<schmancy-surface rounded=\"top\" elevation=\"1\" type=\"glass\" class=\"sticky top-0 z-10\">\n\t\t\t\t\t<schmancy-grid align=\"center\" class=\"px-4 py-3\" .cols=${this.cols} gap=\"md\" rows=\"1fr\">\n\t\t\t\t\t\t${this.columns.map(\n\t\t\t\t\t\t\tcolumn => html`\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclass=${this.classMap(columnHeadClasses(column))}\n\t\t\t\t\t\t\t\t\t@click=${() => (this.sortable && column.sortable !== false ? this.toggleSort(column) : null)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<schmancy-typography align=${column.align ?? 'left'} weight=${column.weight ?? 'bold'}>\n\t\t\t\t\t\t\t\t\t\t${column.name}\n\t\t\t\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t\t\t\t${this.renderSortIndicator(column)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t</schmancy-grid>\n\t\t\t\t</schmancy-surface>\n\n\t\t\t\t${this.filteredData.length > 0\n\t\t\t\t\t? html`\n\t\t\t\t\t\t\t<lit-virtualizer\n\t\t\t\t\t\t\t\tscroller\n\t\t\t\t\t\t\t\tclass=\"w-full h-full relative overflow-auto\"\n\t\t\t\t\t\t\t\t.items=${this.filteredData}\n\t\t\t\t\t\t\t\t.keyFunction=${(item: T, index: number) => {\n\t\t\t\t\t\t\t\t\tconst keyValue = item?.[this.keyField]\n\t\t\t\t\t\t\t\t\tif (keyValue === undefined || keyValue === null) {\n\t\t\t\t\t\t\t\t\t\treturn index\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn typeof keyValue === 'string' || typeof keyValue === 'number' ? keyValue : String(keyValue)\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t.renderItem=${(item: T, index: number) =>\n\t\t\t\t\t\t\t\t\thtml`\n\t\t\t\t\t\t\t\t\t\t<schmancy-table-row\n\t\t\t\t\t\t\t\t\t\t\tclass=\"w-full border-b border-solid border-outlineVariant\"\n\t\t\t\t\t\t\t\t\t\t\t.columns=${this.columns}\n\t\t\t\t\t\t\t\t\t\t\t.item=${item}\n\t\t\t\t\t\t\t\t\t\t\tcols=${this.cols}\n\t\t\t\t\t\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\t\t\t\t\t\tconst detail = { item, index }\n\t\t\t\t\t\t\t\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\t\t\t\t\t\t\t\tnew CustomEvent('click', {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdetail,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t></schmancy-table-row>\n\t\t\t\t\t\t\t\t\t` as TemplateResult}\n\t\t\t\t\t\t\t></lit-virtualizer>\n\t\t\t\t\t\t`\n\t\t\t\t\t: html`\n\t\t\t\t\t\t\t<div class=\"flex items-center justify-center w-full h-full p-8 text-center\">\n\t\t\t\t\t\t\t\t<schmancy-typography type=\"body\" token=\"lg\"> No data available </schmancy-typography>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t`}\n\t\t\t</schmancy-grid>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-table': SchmancyDataTable\n\t}\n}\n"],"x_google_ignoreList":[1,2,3,4,5,6],"mappings":";;;;;;;;;AAMO,IAAA,IAAA,cAAoE,GAAA,CAAA;CAAA,YAAA,GAAA,GAAA;AAAA,QAAA,GAAA,EAAA,EAAA,KAAA,UAE9C,EAAA,EAAA,KAAA,OAMb,KAAK,QAAQ,UAAU,MAAA,CAAO,KAAK,IAAA;;CAMlD,WAAmB,GAAA;AAElB,MAAI,EAAO,OACV,QAAO,CAAI;;mCAEqB,EAAO,SAAS,OAAA,yBAAgC,EAAO,UAAU,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AAA,CAAA,EAAS,EAAA,WAAA,YAAA,KAAA,EAAA,EAAA,EAAA,CAG1B,EAAS,EAAE,MAAM,QAAA,CAAA,CAAA,EAAS,EAAA,WAAA,QAAA,KAAA,EAAA,EAAA,EAAA,CAI1B,EAAS,EAAE,MAAM,SAAA,CAAA,CAAA,EAAU,EAAA,WAAA,YAAA,KAAA,EAAA,EAAA,EAAA,CAI3B,GAAA,CAAA,EAAO,EAAA,WAAA,cAAA,KAAA,EAAA,EAAA,EAAA,CACP,GAAA,CAAA,EAAO,EAAA,WAAA,iBAAA,KAAA,EAAA,EAAA,EAAA,CACP,GAAA,CAAA,EAAO,EAAA,WAAA,gBAAA,KAAA,EAAA,EAAA,IAAA,EAAA,CAtBR,EAAc,iBAAA,CAAA,EAAiB,EAAA;AAAA,SAAA,KAAA,GAAA,KAAA"}
package/dist/table.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./table-B-DsOqzT.cjs`);Object.defineProperty(exports,`SchmancyDataTable`,{enumerable:!0,get:function(){return e.t}}),Object.defineProperty(exports,`SchmancyTableRow`,{enumerable:!0,get:function(){return e.n}});
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./table-DFlJhG5E.cjs`);Object.defineProperty(exports,`SchmancyDataTable`,{enumerable:!0,get:function(){return e.t}}),Object.defineProperty(exports,`SchmancyTableRow`,{enumerable:!0,get:function(){return e.n}});
package/dist/table.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./table-hBEZRxM_.js";
1
+ import { n as e, t } from "./table-Dwt66SR6.js";
2
2
  export { t as SchmancyDataTable, e as SchmancyTableRow };
package/dist/teleport.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./src-I4M33WK2.cjs`);exports.HereMorty=e.r,Object.defineProperty(exports,`SchmancyTeleportation`,{enumerable:!0,get:function(){return e.n}}),exports.WhereAreYouRicky=e.i,exports.teleport=e.a;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./src-BPKGdQdp.cjs`);exports.HereMorty=e.r,Object.defineProperty(exports,`SchmancyTeleportation`,{enumerable:!0,get:function(){return e.n}}),exports.WhereAreYouRicky=e.i,exports.teleport=e.a;
package/dist/teleport.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as e, i as t, n, r } from "./src-C7niWYur.js";
1
+ import { a as e, i as t, n, r } from "./src-BGj6ufWS.js";
2
2
  export { r as HereMorty, n as SchmancyTeleportation, t as WhereAreYouRicky, e as teleport };
@@ -1 +1,123 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./typewriter-LK0S4NEr.cjs`);Object.defineProperty(exports,`TypewriterElement`,{enumerable:!0,get:function(){return e.t}});
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./chunk-CncqDLb2.cjs`);const e=require(`./tailwind.mixin-Bh58QnlW.cjs`),t=require(`./decorate-F9CuyeHg.cjs`),n=require(`./litElement.mixin-CtQOmwq6.cjs`);require(`./mixins.cjs`);const r=require(`./delay-Bu4WMQlV.cjs`),i=require(`./hashContent-CahnEuut.cjs`),a=require(`./intersection-DqBqnpgh.cjs`);let o=require(`lit/decorators.js`),s=require(`lit`);var c=null,l=class extends n.t(s.css`
2
+ :host {
3
+ display: inline-block;
4
+ }
5
+
6
+ #typewriter {
7
+ position: relative;
8
+ }
9
+
10
+ /* Enhanced cursor with glow effect */
11
+ #typewriter :global(.ti-cursor) {
12
+ animation: cursor-pulse 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
13
+ color: currentColor;
14
+ filter: drop-shadow(0 0 8px currentColor);
15
+ }
16
+
17
+ @keyframes cursor-pulse {
18
+ 0%, 100% {
19
+ opacity: 1;
20
+ transform: scale(1);
21
+ }
22
+ 50% {
23
+ opacity: 0.3;
24
+ transform: scale(0.95);
25
+ }
26
+ }
27
+
28
+ /* Character entrance animation */
29
+ #typewriter :global(.ti-container *) {
30
+ animation: char-entrance 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
31
+ }
32
+
33
+ @keyframes char-entrance {
34
+ 0% {
35
+ opacity: 0;
36
+ transform: scale(0.3) translateY(10px);
37
+ filter: blur(4px);
38
+ }
39
+ 50% {
40
+ opacity: 0.8;
41
+ transform: scale(1.1) translateY(-2px);
42
+ }
43
+ 100% {
44
+ opacity: 1;
45
+ transform: scale(1) translateY(0);
46
+ filter: blur(0);
47
+ }
48
+ }
49
+
50
+ /* Subtle character wobble on appear */
51
+ #typewriter :global(.ti-container *:nth-child(odd)) {
52
+ animation: char-entrance 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) backwards,
53
+ char-wobble 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s backwards;
54
+ }
55
+
56
+ @keyframes char-wobble {
57
+ 0%, 100% {
58
+ transform: rotate(0deg);
59
+ }
60
+ 25% {
61
+ transform: rotate(2deg);
62
+ }
63
+ 75% {
64
+ transform: rotate(-2deg);
65
+ }
66
+ }
67
+
68
+ /* Deletion animation - fade out and scale down */
69
+ #typewriter :global(.ti-container .deleting) {
70
+ animation: char-delete 0.2s cubic-bezier(0.4, 0, 1, 1) forwards;
71
+ }
72
+
73
+ @keyframes char-delete {
74
+ 0% {
75
+ opacity: 1;
76
+ transform: scale(1);
77
+ filter: blur(0);
78
+ }
79
+ 50% {
80
+ opacity: 0.5;
81
+ transform: scale(0.8) translateY(-3px);
82
+ }
83
+ 100% {
84
+ opacity: 0;
85
+ transform: scale(0.4) translateY(-8px);
86
+ filter: blur(3px);
87
+ }
88
+ }
89
+
90
+ /* Gradient text effect on typed text */
91
+ #typewriter :global(.ti-container) {
92
+ background: linear-gradient(
93
+ 90deg,
94
+ currentColor 0%,
95
+ currentColor 70%,
96
+ transparent 100%
97
+ );
98
+ -webkit-background-clip: text;
99
+ background-clip: text;
100
+ animation: gradient-shift 3s ease-in-out infinite;
101
+ }
102
+
103
+ @keyframes gradient-shift {
104
+ 0%, 100% {
105
+ filter: brightness(1) saturate(1);
106
+ }
107
+ 50% {
108
+ filter: brightness(1.15) saturate(1.2);
109
+ }
110
+ }
111
+
112
+ /* Smooth transitions for all text */
113
+ #typewriter * {
114
+ transition: opacity 0.15s ease-out, transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
115
+ }
116
+ `){constructor(...e){super(...e),this.speed=35,this.delay=0,this.autoStart=!0,this.cursorChar=``,this.deleteSpeed=20,this.once=!0,this.loop=!1,this.cyclePause=1500,this.typeItInstance=null,this.sessionKey=``}disconnectedCallback(){super.disconnectedCallback(),this._destroyTypeIt()}async _startTyping(){if(this._destroyTypeIt(),this.sessionKey=this.generateSessionKey(),this.once&&sessionStorage.getItem(this.sessionKey)===`true`)return void this.shadowRoot?.querySelector(`slot`)?.removeAttribute(`hidden`);if(!this.typewriterContainer)return;let e={speed:this.speed,startDelay:this.delay,cursor:!!this.cursorChar,cursorChar:this.cursorChar,deleteSpeed:this.deleteSpeed,loop:this.loop,afterComplete:()=>{if(this.once&&!this.loop)try{sessionStorage.setItem(this.sessionKey,`true`)}catch{}this.dispatchEvent(new CustomEvent(`typeit-complete`,{bubbles:!0,composed:!0})),this.loop||this.typewriterContainer.style.setProperty(`--ti-cursor-display`,`none`)}},t=await(c||=Promise.resolve().then(()=>require(`./index.es-BgmFX1JM.cjs`)).then(e=>e.default));this.isConnected&&(this.typeItInstance=new t(this.typewriterContainer,e),this._getSlottedNodes.forEach(e=>{if(e.nodeType===Node.TEXT_NODE){let t=e.textContent||``;t.trim()&&this.typeItInstance?.type(t)}else e instanceof HTMLElement&&this._processCustomElement(e)}),a.t(this.shadowRoot?.host).subscribe(()=>{this.typeItInstance?.go()}))}generateSessionKey(){let e=this._getSlottedElements.map(e=>e.outerHTML).join(``);return this.once?i.t(e):``}_destroyTypeIt(){if(this.typeItInstance){try{this.typeItInstance.destroy()}catch{}this.typeItInstance=null}}_processCustomElement(e){let t=e.getAttribute(`action`),n=e.getAttribute(`value`),r=e.getAttribute(`cycle`);if(r){let t=r.split(`|`).map(e=>e.trim());this._processCycle(t,e);return}switch(t){case`pause`:this.typeItInstance?.pause(parseInt(n||`0`,10));break;case`delete`:this.typeItInstance?.delete(parseInt(n||`0`,10));break;default:e.tagName===`P`&&this.typeItInstance?.break(),this.typeItInstance?.type(e.textContent||``)}}_processCycle(e,t){if(e.length===0)return;let n=t.getAttribute(`pause`),r=n?parseInt(n,10):this.cyclePause;e.forEach((t,n)=>{this.typeItInstance?.type(t),(n<e.length-1||this.loop)&&this.typeItInstance?.pause(r),(n<e.length-1||this.loop)&&this.typeItInstance?.delete(t.length)})}render(){return s.html`<div id="typewriter" aria-live="polite"></div>
117
+
118
+ <div class="typewriter">
119
+ <slot
120
+ hidden
121
+ @slotchange=${()=>{this._startTyping()}}
122
+ ></slot>
123
+ </div> `}};t.t([(0,o.property)({type:Number})],l.prototype,`speed`,void 0),t.t([e.a({context:r.n,subscribe:!0}),(0,o.property)({type:Number})],l.prototype,`delay`,void 0),t.t([(0,o.property)({type:Boolean})],l.prototype,`autoStart`,void 0),t.t([(0,o.property)({type:String})],l.prototype,`cursorChar`,void 0),t.t([(0,o.property)({type:Number})],l.prototype,`deleteSpeed`,void 0),t.t([(0,o.property)({type:Boolean})],l.prototype,`once`,void 0),t.t([(0,o.property)({type:Boolean})],l.prototype,`loop`,void 0),t.t([(0,o.property)({type:Number})],l.prototype,`cyclePause`,void 0),t.t([(0,o.query)(`#typewriter`)],l.prototype,`typewriterContainer`,void 0),t.t([(0,o.queryAssignedNodes)({flatten:!0})],l.prototype,`_getSlottedNodes`,void 0),t.t([(0,o.queryAssignedElements)({flatten:!0})],l.prototype,`_getSlottedElements`,void 0),l=t.t([(0,o.customElement)(`schmancy-typewriter`)],l),Object.defineProperty(exports,`TypewriterElement`,{enumerable:!0,get:function(){return l}});
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typewriter.cjs","names":[],"sources":["../src/typewriter/typewriter.ts"],"sourcesContent":["import { consume } from '@lit/context'\nimport { $LitElement } from '@mixins/index'\nimport { delayContext } from '@schmancy/delay'\nimport hashContent from '@schmancy/utils/hashContent'\nimport { intersection$ } from '@schmancy/utils/intersection'\nimport { css, html, TemplateResult } from 'lit'\nimport { customElement, property, query, queryAssignedElements, queryAssignedNodes } from 'lit/decorators.js'\n// TypeIt is loaded lazily on first render — see ADR 0014 in the parent\n// monorepo. The static import was replaced with a type-only import plus a\n// memoised dynamic loader so the ~15 KB gzipped vendor chunk stays out of\n// the agent bundle's first paint for pages that don't render a typewriter.\nimport type { Options as TypeItOptions } from 'typeit'\ntype TypeItCtor = typeof import('typeit').default\ntype TypeItInstance = InstanceType<TypeItCtor>\n\nlet typeItPromise: Promise<TypeItCtor> | null = null\nfunction loadTypeIt(): Promise<TypeItCtor> {\n\tif (typeItPromise) return typeItPromise\n\ttypeItPromise = import('typeit').then(m => m.default)\n\treturn typeItPromise\n}\n\n@customElement('schmancy-typewriter')\nexport class TypewriterElement extends $LitElement(css`\n\t:host {\n\t\tdisplay: inline-block;\n\t}\n\n\t#typewriter {\n\t\tposition: relative;\n\t}\n\n\t/* Enhanced cursor with glow effect */\n\t#typewriter :global(.ti-cursor) {\n\t\tanimation: cursor-pulse 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n\t\tcolor: currentColor;\n\t\tfilter: drop-shadow(0 0 8px currentColor);\n\t}\n\n\t@keyframes cursor-pulse {\n\t\t0%, 100% {\n\t\t\topacity: 1;\n\t\t\ttransform: scale(1);\n\t\t}\n\t\t50% {\n\t\t\topacity: 0.3;\n\t\t\ttransform: scale(0.95);\n\t\t}\n\t}\n\n\t/* Character entrance animation */\n\t#typewriter :global(.ti-container *) {\n\t\tanimation: char-entrance 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;\n\t}\n\n\t@keyframes char-entrance {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t\ttransform: scale(0.3) translateY(10px);\n\t\t\tfilter: blur(4px);\n\t\t}\n\t\t50% {\n\t\t\topacity: 0.8;\n\t\t\ttransform: scale(1.1) translateY(-2px);\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t\ttransform: scale(1) translateY(0);\n\t\t\tfilter: blur(0);\n\t\t}\n\t}\n\n\t/* Subtle character wobble on appear */\n\t#typewriter :global(.ti-container *:nth-child(odd)) {\n\t\tanimation: char-entrance 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) backwards,\n\t\t char-wobble 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s backwards;\n\t}\n\n\t@keyframes char-wobble {\n\t\t0%, 100% {\n\t\t\ttransform: rotate(0deg);\n\t\t}\n\t\t25% {\n\t\t\ttransform: rotate(2deg);\n\t\t}\n\t\t75% {\n\t\t\ttransform: rotate(-2deg);\n\t\t}\n\t}\n\n\t/* Deletion animation - fade out and scale down */\n\t#typewriter :global(.ti-container .deleting) {\n\t\tanimation: char-delete 0.2s cubic-bezier(0.4, 0, 1, 1) forwards;\n\t}\n\n\t@keyframes char-delete {\n\t\t0% {\n\t\t\topacity: 1;\n\t\t\ttransform: scale(1);\n\t\t\tfilter: blur(0);\n\t\t}\n\t\t50% {\n\t\t\topacity: 0.5;\n\t\t\ttransform: scale(0.8) translateY(-3px);\n\t\t}\n\t\t100% {\n\t\t\topacity: 0;\n\t\t\ttransform: scale(0.4) translateY(-8px);\n\t\t\tfilter: blur(3px);\n\t\t}\n\t}\n\n\t/* Gradient text effect on typed text */\n\t#typewriter :global(.ti-container) {\n\t\tbackground: linear-gradient(\n\t\t\t90deg,\n\t\t\tcurrentColor 0%,\n\t\t\tcurrentColor 70%,\n\t\t\ttransparent 100%\n\t\t);\n\t\t-webkit-background-clip: text;\n\t\tbackground-clip: text;\n\t\tanimation: gradient-shift 3s ease-in-out infinite;\n\t}\n\n\t@keyframes gradient-shift {\n\t\t0%, 100% {\n\t\t\tfilter: brightness(1) saturate(1);\n\t\t}\n\t\t50% {\n\t\t\tfilter: brightness(1.15) saturate(1.2);\n\t\t}\n\t}\n\n\t/* Smooth transitions for all text */\n\t#typewriter * {\n\t\ttransition: opacity 0.15s ease-out, transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);\n\t}\n`) {\n\t/**\n\t * Typing speed in milliseconds per character.\n\t */\n\t@property({ type: Number })\n\tspeed: number = 35\n\n\t/**\n\t * Delay before typing starts (ms).\n\t */\n\t@consume({ context: delayContext, subscribe: true })\n\t@property({ type: Number })\n\tdelay: number = 0\n\n\t/**\n\t * Automatically start typing on initialization.\n\t */\n\t@property({ type: Boolean })\n\tautoStart: boolean = true\n\n\t/**\n\t * The cursor character.\n\t */\n\t@property({ type: String })\n\tcursorChar: string = ''\n\n\t/**\n\t * Typing speed for deletions (ms per character).\n\t */\n\t@property({ type: Number })\n\tdeleteSpeed: number = 20\n\n\t/**\n\t * Only animate once per session.\n\t */\n\t@property({ type: Boolean }) once = true\n\n\t/**\n\t * Loop the animation infinitely (overrides once).\n\t */\n\t@property({ type: Boolean }) loop = false\n\n\t/**\n\t * Default pause duration for cycling (ms).\n\t */\n\t@property({ type: Number }) cyclePause = 1500\n\t/**\n\t * TypeIt instance. Populated after `loadTypeIt()` resolves inside\n\t * `_startTyping()` — null until then, which is correct for a cold start\n\t * where the vendor chunk hasn't loaded yet.\n\t */\n\tprivate typeItInstance: TypeItInstance | null = null\n\n\t/**\n\t * Reference to the typewriter container.\n\t */\n\t@query('#typewriter')\n\tprivate typewriterContainer!: HTMLElement\n\n\t@queryAssignedNodes({\n\t\tflatten: true,\n\t})\n\tprivate _getSlottedNodes!: Node[]\n\n\t@queryAssignedElements({\n\t\tflatten: true,\n\t})\n\tprivate _getSlottedElements!: HTMLElement[]\n\t/**\n\t * Lifecycle method called when the component is disconnected from the DOM.\n\t * Ensures that TypeIt instances are properly cleaned up.\n\t */\n\n\tprivate sessionKey = ''\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis._destroyTypeIt()\n\t}\n\n\t/**\n\t * Initializes the TypeIt instance with the provided slotted content.\n\t * Async because TypeIt itself is lazy-loaded on first render.\n\t */\n\tprivate async _startTyping() {\n\t\t// Destroy any existing TypeIt instance\n\t\tthis._destroyTypeIt()\n\n\t\tthis.sessionKey = this.generateSessionKey()\n\n\t\tif (this.once && sessionStorage.getItem(this.sessionKey) === 'true') {\n\t\t\t// Skip delay and render immediately if once is set and already rendered\n\t\t\tthis.shadowRoot?.querySelector('slot')?.removeAttribute('hidden')\n\t\t\treturn\n\t\t}\n\n\t\tif (!this.typewriterContainer) {\n\t\t\tconsole.warn('Typewriter container not found.')\n\t\t\treturn\n\t\t}\n\n\t\t// Configure TypeIt options\n\t\tconst typeItOptions: TypeItOptions = {\n\t\t\tspeed: this.speed,\n\t\t\tstartDelay: this.delay,\n\t\t\tcursor: !!this.cursorChar,\n\t\t\tcursorChar: this.cursorChar,\n\t\t\tdeleteSpeed: this.deleteSpeed,\n\t\t\tloop: this.loop,\n\t\t\tafterComplete: () => {\n\t\t\t\tif (this.once && !this.loop) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tsessionStorage.setItem(this.sessionKey, 'true')\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconsole.error('Error saving to session storage:', error)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Dispatch the custom event\n\t\t\t\tthis.dispatchEvent(new CustomEvent('typeit-complete', { bubbles: true, composed: true }))\n\n\t\t\t\t// Hide the cursor (unless looping)\n\t\t\t\tif (!this.loop) {\n\t\t\t\t\tthis.typewriterContainer.style.setProperty('--ti-cursor-display', 'none')\n\t\t\t\t}\n\t\t\t},\n\t\t}\n\n\t\t// Load TypeIt lazily on first call (module-scope memoised promise).\n\t\tconst TypeIt = await loadTypeIt()\n\t\t// Bail if we were disconnected during the load — avoids attaching to\n\t\t// a detached host.\n\t\tif (!this.isConnected) return\n\n\t\t// Initialize TypeIt\n\t\tthis.typeItInstance = new TypeIt(this.typewriterContainer, typeItOptions)\n\n\t\t// Process slotted content as actions\n\t\tconst slottedNodes = this._getSlottedNodes\n\t\tslottedNodes.forEach(node => {\n\t\t\tif (node.nodeType === Node.TEXT_NODE) {\n\t\t\t\t// Handle plain text - skip whitespace-only text nodes\n\t\t\t\tconst textContent = node.textContent || ''\n\t\t\t\tif (textContent.trim()) {\n\t\t\t\t\tthis.typeItInstance?.type(textContent)\n\t\t\t\t}\n\t\t\t} else if (node instanceof HTMLElement) {\n\t\t\t\t// Handle custom element\n\t\t\t\tthis._processCustomElement(node)\n\t\t\t}\n\t\t})\n\n\t\t// Start the typing animation if autoStart is enabled\n\t\t// use rxjs to detect once we are in the view port\n\t\tintersection$(this.shadowRoot?.host as Element).subscribe(() => {\n\t\t\t// alert('in view')\n\t\t\tthis.typeItInstance?.go()\n\t\t})\n\t\t// Start the typing animation if autoStart is enabled\n\t}\n\n\tprivate generateSessionKey(): string {\n\t\tconst slotContent = this._getSlottedElements.map(el => el.outerHTML).join('')\n\t\treturn this.once ? hashContent(slotContent) : ''\n\t}\n\t/**\n\t * Destroys the current TypeIt instance if it exists.\n\t */\n\tprivate _destroyTypeIt() {\n\t\tif (this.typeItInstance) {\n\t\t\ttry {\n\t\t\t\tthis.typeItInstance.destroy()\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('Error destroying TypeIt instance:', error)\n\t\t\t}\n\t\t\tthis.typeItInstance = null\n\t\t}\n\t}\n\n\t/**\n\t * Processes a custom element for its typing behavior.\n\t */\n\tprivate _processCustomElement(element: HTMLElement) {\n\t\tconst action = element.getAttribute('action')\n\t\tconst value = element.getAttribute('value')\n\t\tconst cycle = element.getAttribute('cycle')\n\n\t\t// Handle cycle attribute - simple pipe-separated list\n\t\tif (cycle) {\n\t\t\tconst items = cycle.split('|').map(item => item.trim())\n\t\t\tthis._processCycle(items, element)\n\t\t\treturn\n\t\t}\n\n\t\tswitch (action) {\n\t\t\tcase 'pause':\n\t\t\t\tthis.typeItInstance?.pause(parseInt(value || '0', 10))\n\t\t\t\tbreak\n\t\t\tcase 'delete':\n\t\t\t\tthis.typeItInstance?.delete(parseInt(value || '0', 10))\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tif (element.tagName === 'P') {\n\t\t\t\t\tthis.typeItInstance?.break()\n\t\t\t\t}\n\t\t\t\t// Treat as text if no action is defined\n\t\t\t\tthis.typeItInstance?.type(element.textContent || '')\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\t/**\n\t * Processes cycling text with auto-calculated delete counts.\n\t */\n\tprivate _processCycle(items: string[], element: HTMLElement) {\n\t\tif (items.length === 0) return\n\n\t\tconst customPause = element.getAttribute('pause')\n\t\tconst pauseDuration = customPause ? parseInt(customPause, 10) : this.cyclePause\n\n\t\t// Type each item with automatic deletion\n\t\titems.forEach((item, index) => {\n\t\t\t// Type the item\n\t\t\tthis.typeItInstance?.type(item)\n\n\t\t\t// Pause after typing (except after last item when not looping)\n\t\t\tif (index < items.length - 1 || this.loop) {\n\t\t\t\tthis.typeItInstance?.pause(pauseDuration)\n\t\t\t}\n\n\t\t\t// Delete back to start (except for last item when not looping)\n\t\t\tif (index < items.length - 1) {\n\t\t\t\tthis.typeItInstance?.delete(item.length)\n\t\t\t} else if (this.loop) {\n\t\t\t\t// For looping, delete and start over\n\t\t\t\tthis.typeItInstance?.delete(item.length)\n\t\t\t}\n\t\t})\n\t}\n\n\t/**\n\t * Renders the component's HTML.\n\t */\n\trender(): TemplateResult {\n\t\treturn html`<div id=\"typewriter\" aria-live=\"polite\"></div>\n\n\t\t\t<div class=\"typewriter\">\n\t\t\t\t<slot\n\t\t\t\t\thidden\n\t\t\t\t\t@slotchange=${() => {\n\t\t\t\t\t\tthis._startTyping()\n\t\t\t\t\t}}\n\t\t\t\t></slot>\n\t\t\t</div> `\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-typewriter': TypewriterElement\n\t}\n}\n"],"mappings":"2aAeA,IAAI,EAA4C,KAQzC,EAAA,cAAgC,EAAA,EAAY,EA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