@aceshooting/lyra-ui 30.9.0 → 31.1.1

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 (283) hide show
  1. package/CHANGELOG.md +361 -335
  2. package/dist/ai/adapters/ag-ui.js +1 -1
  3. package/dist/autoloader-cdn.js +1 -1
  4. package/dist/components/agent-tools/activity-feed/activity-feed.class.js +1 -1
  5. package/dist/components/agent-tools/budget-meter/budget-meter.class.d.ts +12 -1
  6. package/dist/components/agent-tools/budget-meter/budget-meter.class.js +4 -4
  7. package/dist/components/agent-tools/compare-panel/compare-panel.class.js +1 -1
  8. package/dist/components/agent-tools/eval-dataset/eval-dataset.class.js +1 -1
  9. package/dist/components/agent-tools/thinking-panel/thinking-panel.class.js +1 -1
  10. package/dist/components/agent-tools/tool-select-dialog/tool-select-dialog.class.js +1 -1
  11. package/dist/components/charts/chart/box-plot.class.js +2 -2
  12. package/dist/components/charts/chart/chart-sync.js +1 -1
  13. package/dist/components/charts/chart/chart.class.d.ts +1 -1
  14. package/dist/components/charts/chart/chart.class.js +4 -4
  15. package/dist/components/charts/chart/lite-chart-axis-layout.js +1 -1
  16. package/dist/components/charts/chart/lite-chart.class.js +2 -2
  17. package/dist/components/conversation/chat-composer/chat-composer.class.d.ts +26 -11
  18. package/dist/components/conversation/chat-composer/chat-composer.class.js +11 -9
  19. package/dist/components/conversation/chat-composer/chat-composer.styles.js +1 -1
  20. package/dist/components/conversation/chat-message/chat-message.class.d.ts +27 -3
  21. package/dist/components/conversation/chat-message/chat-message.class.js +14 -12
  22. package/dist/components/conversation/chat-message/chat-message.styles.js +1 -1
  23. package/dist/components/conversation/chat-viewport/chat-viewport.class.d.ts +29 -2
  24. package/dist/components/conversation/chat-viewport/chat-viewport.class.js +2 -2
  25. package/dist/components/conversation/chat-viewport/chat-viewport.styles.js +1 -1
  26. package/dist/components/conversation/code-block/code-block-shared.js +1 -1
  27. package/dist/components/conversation/markdown/markdown-base.class.d.ts +1 -1
  28. package/dist/components/conversation/markdown/markdown-base.class.js +1 -1
  29. package/dist/components/conversation/markdown/markdown-code-header.js +1 -1
  30. package/dist/components/conversation/markdown/markdown-core.class.d.ts +10 -0
  31. package/dist/components/conversation/markdown/markdown-core.class.js +1 -1
  32. package/dist/components/conversation/markdown/markdown-shared.d.ts +7 -2
  33. package/dist/components/conversation/markdown/markdown-shared.js +3 -3
  34. package/dist/components/conversation/markdown/markdown.class.d.ts +10 -0
  35. package/dist/components/conversation/markdown/markdown.class.js +1 -1
  36. package/dist/components/conversation/message-feedback/message-feedback.class.d.ts +11 -3
  37. package/dist/components/conversation/message-feedback/message-feedback.class.js +12 -6
  38. package/dist/components/conversation/message-feedback/message-feedback.styles.js +1 -1
  39. package/dist/components/conversation/message-parts/message-parts.class.js +1 -1
  40. package/dist/components/conversation/prompt-input/prompt-input.class.d.ts +8 -4
  41. package/dist/components/conversation/prompt-input/prompt-input.class.js +3 -2
  42. package/dist/components/conversation/push-to-talk/push-to-talk.class.js +1 -1
  43. package/dist/components/conversation/streaming-text/streaming-text-base.class.d.ts +4 -0
  44. package/dist/components/conversation/streaming-text/streaming-text-base.class.js +1 -1
  45. package/dist/components/conversation/streaming-text/streaming-text-core.class.d.ts +1 -1
  46. package/dist/components/conversation/streaming-text/streaming-text-core.class.js +1 -0
  47. package/dist/components/conversation/streaming-text/streaming-text.class.d.ts +1 -1
  48. package/dist/components/conversation/streaming-text/streaming-text.class.js +1 -0
  49. package/dist/components/conversation/suggestion-chips/suggestion-chips.class.d.ts +17 -3
  50. package/dist/components/conversation/suggestion-chips/suggestion-chips.class.js +3 -3
  51. package/dist/components/conversation/suggestion-chips/suggestion-chips.d.ts +1 -1
  52. package/dist/components/conversation/suggestion-chips/suggestion-chips.js +1 -1
  53. package/dist/components/conversation/suggestion-chips/suggestion-chips.styles.js +1 -1
  54. package/dist/components/conversation/thread-list/thread-list.class.d.ts +1 -1
  55. package/dist/components/conversation/thread-list/thread-list.class.js +3 -3
  56. package/dist/components/conversation/transcript-feed/transcript-feed.class.js +1 -1
  57. package/dist/components/data/data-grid/data-grid.class.d.ts +10 -10
  58. package/dist/components/data/data-grid/data-grid.class.js +1 -1
  59. package/dist/components/data/document-library/document-library-cursor.js +1 -0
  60. package/dist/components/data/document-library/document-library-types.d.ts +20 -0
  61. package/dist/components/data/document-library/document-library.class.d.ts +37 -26
  62. package/dist/components/data/document-library/document-library.class.js +20 -11
  63. package/dist/components/data/document-library/document-library.styles.js +1 -1
  64. package/dist/components/data/file-tree/file-tree.class.js +1 -1
  65. package/dist/components/data/flow-canvas/flow-canvas.class.d.ts +1 -1
  66. package/dist/components/data/flow-canvas/flow-canvas.class.js +2 -2
  67. package/dist/components/data/heatmap/heatmap.class.d.ts +1 -1
  68. package/dist/components/data/heatmap/heatmap.class.js +1 -1
  69. package/dist/components/data/pagination/pagination.class.js +1 -1
  70. package/dist/components/data/table/table.class.d.ts +31 -2
  71. package/dist/components/data/table/table.class.js +3 -3
  72. package/dist/components/data/table/table.styles.js +1 -1
  73. package/dist/components/data/timeline/timeline-cluster.js +1 -1
  74. package/dist/components/data/timeline/timeline-item.class.d.ts +10 -3
  75. package/dist/components/data/timeline/timeline-item.class.js +16 -12
  76. package/dist/components/data/timeline/timeline-item.styles.js +1 -1
  77. package/dist/components/data/timeline/timeline.class.d.ts +14 -2
  78. package/dist/components/data/timeline/timeline.class.js +9 -5
  79. package/dist/components/data/tree/tree-item.class.js +1 -1
  80. package/dist/components/data/tree/tree.class.d.ts +2 -0
  81. package/dist/components/data/tree/tree.class.js +1 -1
  82. package/dist/components/forms/button/button.class.d.ts +8 -6
  83. package/dist/components/forms/button/button.class.js +2 -2
  84. package/dist/components/forms/checkbox-group/checkbox-group.class.js +1 -1
  85. package/dist/components/forms/color-picker/color-core.js +1 -1
  86. package/dist/components/forms/combobox/combobox.class.d.ts +20 -12
  87. package/dist/components/forms/combobox/combobox.class.js +2 -2
  88. package/dist/components/forms/date-picker/date-input.class.d.ts +1 -1
  89. package/dist/components/forms/date-picker/date-input.class.js +1 -1
  90. package/dist/components/forms/icon-button/icon-button.class.d.ts +4 -2
  91. package/dist/components/forms/icon-button/icon-button.class.js +2 -2
  92. package/dist/components/forms/input/input-shared.js +2 -2
  93. package/dist/components/forms/input/number-input-locale.js +1 -0
  94. package/dist/components/forms/input/number-input.class.d.ts +19 -2
  95. package/dist/components/forms/input/number-input.class.js +2 -2
  96. package/dist/components/forms/locale-picker/locale-picker.class.d.ts +3 -3
  97. package/dist/components/forms/locale-picker/locale-picker.class.js +1 -1
  98. package/dist/components/layout/app-rail-group/app-rail-group.class.js +1 -1
  99. package/dist/components/layout/details/accordion-item.class.js +1 -1
  100. package/dist/components/layout/dock-panel/dock-panel.class.d.ts +1 -1
  101. package/dist/components/layout/dock-panel/dock-panel.class.js +1 -1
  102. package/dist/components/layout/menu/menu.class.js +1 -1
  103. package/dist/components/layout/multi-split/multi-split.class.js +1 -1
  104. package/dist/components/layout/navigation-menu-item/navigation-menu-item.class.js +1 -1
  105. package/dist/components/layout/page/page.class.d.ts +3 -3
  106. package/dist/components/layout/page/page.class.js +1 -1
  107. package/dist/components/layout/segmented/segmented.class.d.ts +20 -7
  108. package/dist/components/layout/segmented/segmented.class.js +34 -24
  109. package/dist/components/layout/segmented/segmented.styles.js +1 -1
  110. package/dist/components/layout/stepper/stepper.styles.js +1 -1
  111. package/dist/components/layout/tab-group/tab-group.class.d.ts +8 -1
  112. package/dist/components/layout/tab-group/tab-group.class.js +1 -1
  113. package/dist/components/layout/tab-group/tab.class.d.ts +7 -1
  114. package/dist/components/layout/tab-group/tab.class.js +1 -1
  115. package/dist/components/layout/virtual-list/virtual-list.class.d.ts +2 -2
  116. package/dist/components/layout/virtual-list/virtual-list.class.js +1 -1
  117. package/dist/components/media/animated-image/animated-image.class.js +1 -1
  118. package/dist/components/media/attachment-chip/attachment-chip.class.d.ts +21 -14
  119. package/dist/components/media/attachment-chip/attachment-chip.class.js +1 -1
  120. package/dist/components/media/attachment-trigger/attachment-trigger.class.d.ts +36 -12
  121. package/dist/components/media/attachment-trigger/attachment-trigger.class.js +3 -3
  122. package/dist/components/media/drop-zone/drop-zone.class.d.ts +23 -5
  123. package/dist/components/media/drop-zone/drop-zone.class.js +2 -2
  124. package/dist/components/media/drop-zone/drop-zone.styles.js +1 -1
  125. package/dist/components/media/file-icon/file-icon.class.js +1 -1
  126. package/dist/components/media/flag/flag-url-resolver.js +1 -1
  127. package/dist/components/media/image-viewer/image-viewer.class.d.ts +2 -2
  128. package/dist/components/media/image-viewer/image-viewer.class.js +1 -1
  129. package/dist/components/media/map/map-anchor-controller.js +1 -1
  130. package/dist/components/media/map/map-canvas-target.js +1 -0
  131. package/dist/components/media/map/map-owned-features.js +1 -1
  132. package/dist/components/media/map/map-scene-elevated-lines.js +2 -2
  133. package/dist/components/media/map/map-scene-render-controller.js +1 -1
  134. package/dist/components/media/map/map.class.d.ts +15 -6
  135. package/dist/components/media/map/map.class.js +4 -4
  136. package/dist/components/media/map/map.styles.js +1 -1
  137. package/dist/components/media/pan-zoom/pan-zoom.class.js +1 -1
  138. package/dist/components/media/sequence-playback/sequence-playback.class.d.ts +21 -9
  139. package/dist/components/media/sequence-playback/sequence-playback.class.js +7 -6
  140. package/dist/components/media/sequence-playback/sequence-playback.styles.js +1 -1
  141. package/dist/components/media/video/video.class.d.ts +3 -3
  142. package/dist/components/media/video/video.class.js +3 -1
  143. package/dist/components/media/video-playlist/video-playlist.class.js +1 -1
  144. package/dist/components/overlays/chip/chip.class.js +1 -1
  145. package/dist/components/overlays/overlay/dropdown.class.js +1 -1
  146. package/dist/components/overlays/overlay/overlay.styles.js +1 -1
  147. package/dist/components/overlays/overlay/tooltip.class.d.ts +5 -1
  148. package/dist/components/overlays/overlay/tooltip.class.js +3 -3
  149. package/dist/components/retrieval/embedding-explorer/embedding-explorer-engine.js +1 -1
  150. package/dist/components/retrieval/graph/graph-node-renderer.js +1 -1
  151. package/dist/components/retrieval/graph/graph-spatial-controller.js +1 -1
  152. package/dist/components/retrieval/graph/graph.class.d.ts +1 -1
  153. package/dist/components/retrieval/graph/graph.class.js +1 -1
  154. package/dist/components/retrieval/ingestion-queue/ingestion-queue-presentation.d.ts +11 -0
  155. package/dist/components/retrieval/ingestion-queue/ingestion-queue-presentation.js +1 -0
  156. package/dist/components/retrieval/ingestion-queue/ingestion-queue.class.d.ts +18 -7
  157. package/dist/components/retrieval/ingestion-queue/ingestion-queue.class.js +13 -26
  158. package/dist/components/retrieval/ingestion-queue/ingestion-queue.styles.js +1 -1
  159. package/dist/components/retrieval/mind-map/mind-map.class.js +1 -1
  160. package/dist/components/retrieval/neighbor-list/neighbor-list.class.d.ts +1 -1
  161. package/dist/components/retrieval/neighbor-list/neighbor-list.class.js +3 -3
  162. package/dist/components/retrieval/retrieval-results/retrieval-results.class.js +1 -1
  163. package/dist/components/utility/diff-view/diff-view.class.d.ts +5 -5
  164. package/dist/components/utility/diff-view/diff-view.class.js +1 -1
  165. package/dist/components/utility/icon/icon.class.js +1 -1
  166. package/dist/components/utility/json-viewer/json-viewer.class.d.ts +16 -1
  167. package/dist/components/utility/json-viewer/json-viewer.class.js +4 -4
  168. package/dist/components/utility/json-viewer/json-viewer.styles.js +1 -1
  169. package/dist/components/utility/known-date/known-date.class.js +1 -1
  170. package/dist/components/utility/mention-popover/mention-popover.class.js +1 -1
  171. package/dist/components/viewers/archive-viewer/archive-viewer.class.js +1 -1
  172. package/dist/components/viewers/calendar-viewer/calendar-viewer.class.js +1 -1
  173. package/dist/components/viewers/contact-viewer/contact-viewer.class.js +1 -1
  174. package/dist/components/viewers/csv-viewer/csv-viewer.class.js +1 -1
  175. package/dist/components/viewers/dataset-viewer/dataset-viewer.class.js +1 -1
  176. package/dist/components/viewers/document-preview/document-preview.class.js +2 -2
  177. package/dist/components/viewers/docx-viewer/docx-viewer.class.d.ts +1 -1
  178. package/dist/components/viewers/docx-viewer/docx-viewer.class.js +2 -2
  179. package/dist/components/viewers/ebook-viewer/ebook-viewer.class.js +1 -1
  180. package/dist/components/viewers/email-viewer/email-viewer.class.d.ts +1 -1
  181. package/dist/components/viewers/email-viewer/email-viewer.class.js +2 -2
  182. package/dist/components/viewers/html-viewer/html-viewer.class.js +1 -1
  183. package/dist/components/viewers/include/include.class.js +1 -1
  184. package/dist/components/viewers/model-viewer/model-viewer.class.js +1 -1
  185. package/dist/components/viewers/notebook-viewer/notebook-viewer.class.js +2 -2
  186. package/dist/components/viewers/pdf-viewer/pdf-viewer.class.d.ts +2 -2
  187. package/dist/components/viewers/pdf-viewer/pdf-viewer.class.js +2 -2
  188. package/dist/components/viewers/pptx-viewer/pptx-viewer.class.js +1 -1
  189. package/dist/components/viewers/spreadsheet-viewer/spreadsheet-viewer.class.js +1 -1
  190. package/dist/components/viewers/svg-viewer/svg-viewer.class.js +1 -1
  191. package/dist/components/viewers/table-viewer-shared.js +4 -4
  192. package/dist/components/viewers/xml-viewer/xml-viewer.class.js +2 -2
  193. package/dist/data-sources.d.ts +10 -0
  194. package/dist/events.d.ts +9 -4
  195. package/dist/framework-types.d.ts +1 -1
  196. package/dist/internal/anchored-overlay-runtime.js +1 -1
  197. package/dist/internal/catalog-picker.js +1 -1
  198. package/dist/internal/default-strings/conversation.generated.js +1 -1
  199. package/dist/internal/default-strings/data.generated.js +1 -1
  200. package/dist/internal/default-strings/retrieval.generated.js +1 -1
  201. package/dist/internal/document-tokens.js +2 -2
  202. package/dist/internal/drop-session-controller.js +1 -1
  203. package/dist/internal/engine-3d.js +1 -1
  204. package/dist/internal/icon-only-content.js +1 -1
  205. package/dist/internal/layered-layout.js +1 -1
  206. package/dist/internal/localization-types.d.ts +1 -1
  207. package/dist/internal/localization.js +1 -1
  208. package/dist/internal/lyra-element.js +2 -2
  209. package/dist/internal/map-custom-layer-controller.js +1 -1
  210. package/dist/internal/media-panorama.js +1 -1
  211. package/dist/internal/native-modal-context.js +1 -1
  212. package/dist/internal/overlay-manager.js +1 -1
  213. package/dist/internal/overlay-order.js +1 -1
  214. package/dist/internal/overlay-stack.js +1 -1
  215. package/dist/internal/package-metadata.js +1 -1
  216. package/dist/internal/runtime-diagnostics.js +1 -0
  217. package/dist/internal/safe-url.js +1 -1
  218. package/dist/internal/scoped-definitions.generated.js +1 -1
  219. package/dist/internal/scroll-overflow.js +1 -1
  220. package/dist/internal/source-cursor-controller.js +1 -0
  221. package/dist/internal/source-cursor-projection.js +1 -0
  222. package/dist/internal/source-page-scope.js +1 -1
  223. package/dist/internal/source-window-controller.js +1 -1
  224. package/dist/internal/text-quote.js +1 -1
  225. package/dist/internal/viewer-search.js +1 -1
  226. package/dist/lyra.d.ts +1 -1
  227. package/dist/sequence-time-binding.js +1 -1
  228. package/dist/simulation-clock.js +1 -1
  229. package/dist/styles/reservations.css +1 -1
  230. package/dist/styles/reservations.styles.js +1 -1
  231. package/dist/testing/happy-dom-shims.js +1 -1
  232. package/dist/theme/theme-bootstrap.js +1 -1
  233. package/dist/theme/theme.js +1 -1
  234. package/dist/utilities/overlay-manager.d.ts +2 -0
  235. package/llms/components/lr-attachment-chip.md +27 -12
  236. package/llms/components/lr-attachment-trigger.md +27 -7
  237. package/llms/components/lr-budget-meter.md +31 -0
  238. package/llms/components/lr-button.md +6 -4
  239. package/llms/components/lr-chat-composer.md +26 -9
  240. package/llms/components/lr-chat-message.md +44 -3
  241. package/llms/components/lr-chat-viewport.md +39 -2
  242. package/llms/components/lr-combobox.md +27 -1
  243. package/llms/components/lr-data-grid.md +2 -0
  244. package/llms/components/lr-dialog.md +10 -0
  245. package/llms/components/lr-diff-view.md +6 -0
  246. package/llms/components/lr-document-library.md +90 -6
  247. package/llms/components/lr-drop-zone.md +26 -2
  248. package/llms/components/lr-graph.md +5 -0
  249. package/llms/components/lr-icon-button.md +2 -1
  250. package/llms/components/lr-ingestion-queue.md +76 -8
  251. package/llms/components/lr-json-viewer.md +51 -0
  252. package/llms/components/lr-lite-chart.md +2 -1
  253. package/llms/components/lr-locale-picker.md +5 -0
  254. package/llms/components/lr-map.md +33 -0
  255. package/llms/components/lr-markdown-core.md +2 -1
  256. package/llms/components/lr-markdown.md +20 -4
  257. package/llms/components/lr-menu.md +3 -1
  258. package/llms/components/lr-message-feedback.md +38 -3
  259. package/llms/components/lr-number-input.md +28 -1
  260. package/llms/components/lr-page.md +4 -2
  261. package/llms/components/lr-prompt-input.md +6 -3
  262. package/llms/components/lr-segmented.md +30 -10
  263. package/llms/components/lr-sequence-playback.md +47 -12
  264. package/llms/components/lr-streaming-text-core.md +3 -2
  265. package/llms/components/lr-streaming-text.md +4 -1
  266. package/llms/components/lr-suggestion-chips.md +28 -5
  267. package/llms/components/lr-tab-group.md +13 -1
  268. package/llms/components/lr-tab.md +5 -0
  269. package/llms/components/lr-table.md +25 -4
  270. package/llms/components/lr-timeline-item.md +1 -1
  271. package/llms/components/lr-timeline.md +38 -4
  272. package/llms/components/lr-tooltip.md +3 -1
  273. package/llms/components/lr-tree.md +4 -0
  274. package/llms/components/lr-virtual-list.md +4 -1
  275. package/llms/peers.md +2 -2
  276. package/llms/shared/events-and-types.md +61 -2
  277. package/llms/shared/forms-and-accessibility.md +46 -4
  278. package/llms/shared/imports-and-registration.md +154 -110
  279. package/llms/shared/testing-and-utilities.md +5 -1
  280. package/llms/shared.md +266 -117
  281. package/locales.json +1 -1
  282. package/package.json +22 -21
  283. package/registrations.json +1 -1
@@ -1,3 +1,3 @@
1
- import{__decorate}from"tslib";import{LitElement}from"lit";import{property}from"lit/decorators.js";import{hostTokens}from"./host-tokens.styles.js";import{ensureLyraTokens,primeLyraTokens}from"./document-tokens.js";import{DOCUMENT_TOKEN_SCOPE_ATTRIBUTES}from"./document-tokens.generated.js";import{resolveIntlLocale}from"./intl-cache.js";import{devWarnOnce,warnThemeScopeUsage,warnUnknownAttributes}from"./dev-mode-attribute-warning.js";let deprecatedAliasSyncHook,deprecatedAliasAttributeHook;function registerDeprecatedAliasSupport(sync,attribute){deprecatedAliasSyncHook=sync,deprecatedAliasAttributeHook=attribute}const FORM_CONTROL_LABEL_FACTORY=Symbol("lr-form-control-label-factory");let formInternalsHook,externalLabelFactory;function registerFormControlLabelSupport(hook,factory){formInternalsHook=hook,factory&&(externalLabelFactory=factory)}import{observeInheritedContext,beginInheritedContextUpdate,finishInheritedContextUpdate,markInheritedContextUpdateRendered,queueInheritedDirectionChange,recordInheritedDirectionRead,recordInheritedLocaleRead}from"./inherited-context-observer.js";import{emptyLyraLocaleStrings,enableLyraLocaleCache,invalidateLyraLocaleCache,lyraLocaleCatalogVersion,peekLyraLocale,recordLyraOwnerDocumentConnection,resolveLyraDirection,resolveLyraLocaleWithHostOverride,resolveLyraStringWithLocale,resolveLyraLocale,snapshotLyraLocaleStrings,subscribeLyraLocaleForHost,trustedLyraDefaultStrings}from"./localization-runtime.js";import{trackInputModality}from"./focus-modality.js";const collectionSupportByPrototype=new WeakMap;function collectionSupportFor(host){const start=Object.getPrototypeOf(host);if(!start)return;const known=collectionSupportByPrototype.get(start);if(known!==void 0)return known??void 0;let found=null;for(let prototype=start;prototype&&prototype!==LitElement.prototype;){const constructor=Object.getOwnPropertyDescriptor(prototype,"constructor")?.value;if(typeof constructor=="function"){const support=constructor.collectionSupport;if(support){found=support;break}}prototype=Object.getPrototypeOf(prototype)}return collectionSupportByPrototype.set(start,found),found??void 0}const SEED_FIRST_RENDER_STATE=Symbol("lr-seed-first-render-state"),SLOT_PRESENCE_UNRESOLVED=Symbol("lr-slot-presence-unresolved"),REACTIVE_HOST_ATTRIBUTES=["aria-label","aria-describedby","lang","dir"],DIRECTION_HOST_ATTRIBUTES=["class","style","slot"],SCOPE_HOST_ATTRIBUTES=[...DOCUMENT_TOKEN_SCOPE_ATTRIBUTES,"class"],adoptedComponentSheets=new WeakMap;function isCrossDocumentStyleSheetRejection(error){return typeof error=="object"&&error!==null&&error.name==="NotAllowedError"}function hasOwnAutofocusAccessor(host){let prototype=Object.getPrototypeOf(host);for(;prototype&&prototype!==HTMLElement.prototype;){if(Object.getOwnPropertyDescriptor(prototype,"autofocus"))return!0;prototype=Object.getPrototypeOf(prototype)}return!1}class LyraElement extends LitElement{static{this.styles=[hostTokens]}static{this.ownedCollectionProperties=Object.freeze([])}static{this.identityCollectionProperties=Object.freeze([])}static{this.identityCollectionObjectProperties=Object.freeze([])}static{this.immutableEventDetails=Object.freeze([])}static{this.identityEventDetailProperties=Object.freeze({})}static{this.identityEventDetailCollectionItems=Object.freeze({})}static{this.defaultStrings=Object.freeze({})}static get observedAttributes(){const attributes=[...new Set([...super.observedAttributes,...REACTIVE_HOST_ATTRIBUTES,...DIRECTION_HOST_ATTRIBUTES,...SCOPE_HOST_ATTRIBUTES])];return this.collectionSupport?.installProperties(this),primeLyraTokens(),Object.hasOwn(this,"deprecatedAliases")&&this.deprecatedAliases&&!deprecatedAliasSyncHook&&devWarnOnce(`lyra-deprecated-alias-installer:${this.name}`,`${this.name} declares deprecatedAliases; call installDeprecatedAliases() in a static block.`),attributes}get strings(){return this.stringsValue}set strings(value){if(value===this.stringsSource||value===this.stringsValue)return;const previous=this.stringsValue;this.stringsSource=value,this.stringsValue=snapshotLyraLocaleStrings(value),this.requestUpdate("strings",previous)}constructor(){if(super(),this.locale="",this.stringsValue=emptyLyraLocaleStrings(),this.localeSubscriptionNeeded=!1,this.componentStylesAreInline=!1,this.constructor.formAssociated){const controller=(this.constructor[FORM_CONTROL_LABEL_FACTORY]??externalLabelFactory)?.(this);controller&&this.addController(controller)}}attachInternals(){const internals=super.attachInternals();return formInternalsHook?.(this,internals),internals}createRenderRoot(){try{return super.createRenderRoot()}catch(error){if(!isCrossDocumentStyleSheetRejection(error))throw error;const constructor=this.constructor,renderRoot=this.shadowRoot??this.attachShadow(constructor.shadowRootOptions),owner=this.ownerDocument;for(const style of constructor.elementStyles){const element=owner.createElement("style");element.textContent=style instanceof CSSStyleSheet?Array.from(style.cssRules,rule=>rule.cssText).join(`
1
+ import{__decorate}from"tslib";import{LitElement}from"lit";import{property}from"lit/decorators.js";import{hostTokens}from"./host-tokens.styles.js";import{ensureLyraTokens,primeLyraTokens}from"./document-tokens.js";import{DOCUMENT_TOKEN_SCOPE_ATTRIBUTES}from"./document-tokens.generated.js";import{resolveIntlLocale}from"./intl-cache.js";import{claimDocumentRuntime}from"./runtime-diagnostics.js";import{devWarnOnce,warnThemeScopeUsage,warnUnknownAttributes}from"./dev-mode-attribute-warning.js";let deprecatedAliasSyncHook,deprecatedAliasAttributeHook;function registerDeprecatedAliasSupport(sync,attribute){deprecatedAliasSyncHook=sync,deprecatedAliasAttributeHook=attribute}const FORM_CONTROL_LABEL_FACTORY=Symbol("lr-form-control-label-factory");let formInternalsHook,externalLabelFactory;function registerFormControlLabelSupport(hook,factory){formInternalsHook=hook,factory&&(externalLabelFactory=factory)}import{observeInheritedContext,beginInheritedContextUpdate,finishInheritedContextUpdate,markInheritedContextUpdateRendered,queueInheritedDirectionChange,recordInheritedDirectionRead,recordInheritedLocaleRead}from"./inherited-context-observer.js";import{emptyLyraLocaleStrings,enableLyraLocaleCache,invalidateLyraLocaleCache,lyraLocaleCatalogVersion,peekLyraLocale,recordLyraOwnerDocumentConnection,resolveLyraDirection,resolveLyraLocaleWithHostOverride,resolveLyraStringWithLocale,resolveLyraLocale,snapshotLyraLocaleStrings,subscribeLyraLocaleForHost,trustedLyraDefaultStrings}from"./localization-runtime.js";import{trackInputModality}from"./focus-modality.js";const collectionSupportByPrototype=new WeakMap;function collectionSupportFor(host){const start=Object.getPrototypeOf(host);if(!start)return;const known=collectionSupportByPrototype.get(start);if(known!==void 0)return known??void 0;let found=null;for(let prototype=start;prototype&&prototype!==LitElement.prototype;){const constructor=Object.getOwnPropertyDescriptor(prototype,"constructor")?.value;if(typeof constructor=="function"){const support=constructor.collectionSupport;if(support){found=support;break}}prototype=Object.getPrototypeOf(prototype)}return collectionSupportByPrototype.set(start,found),found??void 0}const SEED_FIRST_RENDER_STATE=Symbol("lr-seed-first-render-state"),SLOT_PRESENCE_UNRESOLVED=Symbol("lr-slot-presence-unresolved"),REACTIVE_HOST_ATTRIBUTES=["aria-label","aria-describedby","lang","dir"],DIRECTION_HOST_ATTRIBUTES=["class","style","slot"],SCOPE_HOST_ATTRIBUTES=[...DOCUMENT_TOKEN_SCOPE_ATTRIBUTES,"class"],adoptedComponentSheets=new WeakMap;function isCrossDocumentStyleSheetRejection(error){return typeof error=="object"&&error!==null&&error.name==="NotAllowedError"}function hasOwnAutofocusAccessor(host){let prototype=Object.getPrototypeOf(host);for(;prototype&&prototype!==HTMLElement.prototype;){if(Object.getOwnPropertyDescriptor(prototype,"autofocus"))return!0;prototype=Object.getPrototypeOf(prototype)}return!1}class LyraElement extends LitElement{static{this.styles=[hostTokens]}static{this.ownedCollectionProperties=Object.freeze([])}static{this.identityCollectionProperties=Object.freeze([])}static{this.identityCollectionObjectProperties=Object.freeze([])}static{this.immutableEventDetails=Object.freeze([])}static{this.identityEventDetailProperties=Object.freeze({})}static{this.identityEventDetailCollectionItems=Object.freeze({})}static{this.defaultStrings=Object.freeze({})}static get observedAttributes(){const attributes=[...new Set([...super.observedAttributes,...REACTIVE_HOST_ATTRIBUTES,...DIRECTION_HOST_ATTRIBUTES,...SCOPE_HOST_ATTRIBUTES])];return this.collectionSupport?.installProperties(this),primeLyraTokens(),Object.hasOwn(this,"deprecatedAliases")&&this.deprecatedAliases&&!deprecatedAliasSyncHook&&devWarnOnce(`lyra-deprecated-alias-installer:${this.name}`,`${this.name} declares deprecatedAliases; call installDeprecatedAliases() in a static block.`),attributes}get strings(){return this.stringsValue}set strings(value){if(value===this.stringsSource||value===this.stringsValue)return;const previous=this.stringsValue;this.stringsSource=value,this.stringsValue=snapshotLyraLocaleStrings(value),this.requestUpdate("strings",previous)}constructor(){if(super(),this.locale="",this.stringsValue=emptyLyraLocaleStrings(),this.localeSubscriptionNeeded=!1,this.componentStylesAreInline=!1,this.constructor.formAssociated){const controller=(this.constructor[FORM_CONTROL_LABEL_FACTORY]??externalLabelFactory)?.(this);controller&&this.addController(controller)}}attachInternals(){const internals=super.attachInternals();return formInternalsHook?.(this,internals),internals}createRenderRoot(){try{return super.createRenderRoot()}catch(error){if(!isCrossDocumentStyleSheetRejection(error))throw error;const constructor=this.constructor,renderRoot=this.shadowRoot??this.attachShadow(constructor.shadowRootOptions),owner=this.ownerDocument;for(const style of constructor.elementStyles){const element=owner.createElement("style");element.textContent=style instanceof CSSStyleSheet?Array.from(style.cssRules,rule=>rule.cssText).join(`
2
2
  `):style.cssText,renderRoot.appendChild(element)}return this.componentStylesAreInline=!0,this.renderOptions.renderBefore??=renderRoot.firstChild,renderRoot}}restoreAdoptedComponentStyles(){const root=this.renderRoot,owner=this.ownerDocument,Sheet=owner?.defaultView?.CSSStyleSheet;if(!root||this.componentStylesAreInline||!Sheet||!("adoptedStyleSheets"in root))return;const originals=this.constructor.elementStyles.map(style=>"cssRules"in style?style:style.styleSheet);if(originals.some(sheet=>!sheet))return;const componentSheets=originals,retained=root.adoptedStyleSheets.filter(sheet=>!componentSheets.includes(sheet)&&!this.installedComponentSheets?.includes(sheet));try{root.adoptedStyleSheets=[...componentSheets,...retained],this.installedComponentSheets=componentSheets}catch(error){if(!isCrossDocumentStyleSheetRejection(error))throw error;let cache=adoptedComponentSheets.get(owner);cache||adoptedComponentSheets.set(owner,cache=new WeakMap);const replacements=componentSheets.map(original=>{let sheet=cache.get(original);return sheet||(sheet=new Sheet({disabled:original.disabled,media:original.media.mediaText}),sheet.replaceSync(Array.from(original.cssRules,rule=>rule.cssText).join(`
3
- `)),cache.set(original,sheet)),sheet});root.adoptedStyleSheets=[...replacements,...retained],this.installedComponentSheets=replacements}}connectedCallback(){this.hydratingServerShadow??=!this.hasUpdated&&this.shadowRoot!==null,ensureLyraTokens(this),super.connectedCallback(),warnUnknownAttributes(this),warnThemeScopeUsage(this),recordLyraOwnerDocumentConnection(this),trackInputModality(this.ownerDocument),enableLyraLocaleCache(this),invalidateLyraLocaleCache(this),this.stopInheritedContextObservation?.(),this.stopInheritedContextObservation=observeInheritedContext(this),this.localeSubscriptionNeeded&&this.ensureLocaleSubscription(),this.lastLocalizedCatalogVersion!==void 0&&lyraLocaleCatalogVersion(resolveLyraLocale(this))!==this.lastLocalizedCatalogVersion&&this.requestUpdate();const deferred=this.deferredAfterUpdate;if(deferred){this.deferredAfterUpdate=void 0;for(const[key,callback]of deferred)this.scheduleAfterUpdate(callback,key)}}disconnectedCallback(){this.pendingLoadController?.abort(),this.pendingLoadController=void 0,this.lastLocalizedLocale!==void 0&&(this.lastLocalizedCatalogVersion=lyraLocaleCatalogVersion(this.lastLocalizedLocale)),this.stopLocaleSubscription?.(),this.stopLocaleSubscription=void 0,this.stopInheritedContextObservation?.(),this.stopInheritedContextObservation=void 0,invalidateLyraLocaleCache(this),super.disconnectedCallback()}adoptedCallback(){this.restoreAdoptedComponentStyles(),this.stopLocaleSubscription?.(),this.stopLocaleSubscription=void 0,invalidateLyraLocaleCache(this),this.isConnected&&this.localeSubscriptionNeeded&&this.ensureLocaleSubscription()}firstUpdated(changedProperties){super.firstUpdated(changedProperties),!(typeof Node>"u")&&this.autofocus&&(hasOwnAutofocusAccessor(this)||this.focus!==HTMLElement.prototype.focus&&this.scheduleAfterUpdate(()=>this.focus(),"lr-global-autofocus"))}requestUpdate(...args){invalidateLyraLocaleCache(this),super.requestUpdate(...args),deprecatedAliasSyncHook?.(this,args[0],args[1])}performUpdate(){beginInheritedContextUpdate(this);try{super.performUpdate()}finally{finishInheritedContextUpdate(this)}}update(changedProperties){super.update(changedProperties),markInheritedContextUpdateRendered(this)}ensureLocaleSubscription(){this.localeSubscriptionNeeded=!0,!(!this.isConnected||this.stopLocaleSubscription)&&(this.stopLocaleSubscription=subscribeLyraLocaleForHost(this))}attributeChangedCallback(name,oldValue,value){const directionHostAttribute=oldValue!==value&&DIRECTION_HOST_ATTRIBUTES.includes(name);directionHostAttribute&&queueInheritedDirectionChange(this,name==="slot"),oldValue!==value&&this.isConnected&&SCOPE_HOST_ATTRIBUTES.includes(name)&&ensureLyraTokens(this);const finishAliasWarning=oldValue!==value?deprecatedAliasAttributeHook?.(this,name):void 0;super.attributeChangedCallback(name,oldValue,value),finishAliasWarning?.(),oldValue!==value&&REACTIVE_HOST_ATTRIBUTES.includes(name)?this.requestUpdate():directionHostAttribute&&invalidateLyraLocaleCache(this)}seedFirstRenderState(seed){this.hasUpdated||this[SEED_FIRST_RENDER_STATE](seed)}[SEED_FIRST_RENDER_STATE](seed){if(typeof Node>"u")return;if(!this.hydratingServerShadow){seed();return}const pending=this.deferredFirstRenderSeeds??=new Set;pending.add(seed),!(pending.size>1)&&this.updateComplete.then(()=>{setTimeout(()=>{this.hydratingServerShadow=!1;const seeds=this.deferredFirstRenderSeeds;this.deferredFirstRenderSeeds=void 0;for(const deferred of seeds??[])deferred();this.requestUpdate()},0)},()=>{this.hydratingServerShadow=!1,this.deferredFirstRenderSeeds=void 0})}updateBrowserDerivedState(update){this[SEED_FIRST_RENDER_STATE](update)}renderSlotPresence(present){return present||this[SLOT_PRESENCE_UNRESOLVED]()}[SLOT_PRESENCE_UNRESOLVED](){return typeof Node>"u"||this.hydratingServerShadow===!0}beginAbortableLoad(){this.pendingLoadController?.abort(),this.pendingLoadController=void 0;const AbortControllerCtor=this.ownerDocument?.defaultView?.AbortController;if(AbortControllerCtor)return this.pendingLoadController=new AbortControllerCtor,this.pendingLoadController.signal}scheduleAfterUpdate(callback,key="load"){const pending=this.afterUpdateCallbacks??=new Map;pending.has(key)||(pending.set(key,callback),!(pending.size>1)&&queueMicrotask(()=>{const due=this.afterUpdateCallbacks;if(this.afterUpdateCallbacks=void 0,!due)return;if(this.isConnected){const errors=[];for(const due_callback of due.values())try{due_callback()}catch(error){errors.push(error)}if(errors.length===1)throw errors[0];if(errors.length>1)throw new AggregateError(errors,`${errors.length} after-update callbacks failed.`);return}const held=this.deferredAfterUpdate??=new Map;for(const[heldKey,heldCallback]of due)held.has(heldKey)||held.set(heldKey,heldCallback)}))}localize(key,fallback,values){let effectiveLocale;const message=resolveLyraStringWithLocale(()=>effectiveLocale??=this.effectiveMessageLocale,key,this.strings,fallback,values,trustedLyraDefaultStrings(this.constructor.defaultStrings)),locale=effectiveLocale??peekLyraLocale(this);return(effectiveLocale===void 0||this.locale)&&recordInheritedLocaleRead(this,locale),locale!==void 0&&(this.lastLocalizedLocale=locale,this.isConnected||(this.lastLocalizedCatalogVersion=lyraLocaleCatalogVersion(locale)),this.ensureLocaleSubscription()),message}get effectiveMessageLocale(){const locale=resolveLyraLocaleWithHostOverride(this,this.locale);return this.locale||(recordInheritedLocaleRead(this,locale),this.ensureLocaleSubscription()),locale}get effectiveLocale(){return resolveIntlLocale(this.effectiveMessageLocale)}get effectiveIntlLocale(){return this.effectiveLocale}get effectiveDirection(){const direction=resolveLyraDirection(this);return recordInheritedDirectionRead(this,direction),direction}addEventListener(type,listener,options){super.addEventListener(type,listener,options)}removeEventListener(type,listener,options){super.removeEventListener(type,listener,options)}emit(name,...args){const[detail,options]=args,ownerDocument=this.ownerDocument;let CustomEventCtor=ownerDocument?.defaultView?.CustomEvent;if(!CustomEventCtor&&ownerDocument)try{const candidate=ownerDocument.createEvent("CustomEvent").constructor;typeof candidate=="function"&&(CustomEventCtor=candidate)}catch{}CustomEventCtor??=globalThis.CustomEvent;const support=collectionSupportFor(this),event=new CustomEventCtor(name,{detail:detail===void 0?null:support?support.snapshotEvent(this,name,detail):detail,bubbles:!0,composed:!0,cancelable:options?.cancelable??!1});return this.dispatchEvent(event),event}}__decorate([property({reflect:!0})],LyraElement.prototype,"locale",void 0),__decorate([property({attribute:!1})],LyraElement.prototype,"strings",null);export{FORM_CONTROL_LABEL_FACTORY,LyraElement,SEED_FIRST_RENDER_STATE,SLOT_PRESENCE_UNRESOLVED,registerDeprecatedAliasSupport,registerFormControlLabelSupport};
3
+ `)),cache.set(original,sheet)),sheet});root.adoptedStyleSheets=[...replacements,...retained],this.installedComponentSheets=replacements}}connectedCallback(){claimDocumentRuntime(this.ownerDocument),this.hydratingServerShadow??=!this.hasUpdated&&this.shadowRoot!==null,ensureLyraTokens(this),super.connectedCallback(),warnUnknownAttributes(this),warnThemeScopeUsage(this),recordLyraOwnerDocumentConnection(this),trackInputModality(this.ownerDocument),enableLyraLocaleCache(this),invalidateLyraLocaleCache(this),this.stopInheritedContextObservation?.(),this.stopInheritedContextObservation=observeInheritedContext(this),this.localeSubscriptionNeeded&&this.ensureLocaleSubscription(),this.lastLocalizedCatalogVersion!==void 0&&lyraLocaleCatalogVersion(resolveLyraLocale(this))!==this.lastLocalizedCatalogVersion&&this.requestUpdate();const deferred=this.deferredAfterUpdate;if(deferred){this.deferredAfterUpdate=void 0;for(const[key,callback]of deferred)this.scheduleAfterUpdate(callback,key)}}disconnectedCallback(){this.pendingLoadController?.abort(),this.pendingLoadController=void 0,this.lastLocalizedLocale!==void 0&&(this.lastLocalizedCatalogVersion=lyraLocaleCatalogVersion(this.lastLocalizedLocale)),this.stopLocaleSubscription?.(),this.stopLocaleSubscription=void 0,this.stopInheritedContextObservation?.(),this.stopInheritedContextObservation=void 0,invalidateLyraLocaleCache(this),super.disconnectedCallback()}adoptedCallback(){this.restoreAdoptedComponentStyles(),this.stopLocaleSubscription?.(),this.stopLocaleSubscription=void 0,invalidateLyraLocaleCache(this),this.isConnected&&this.localeSubscriptionNeeded&&this.ensureLocaleSubscription()}firstUpdated(changedProperties){super.firstUpdated(changedProperties),!(typeof Node>"u")&&this.autofocus&&(hasOwnAutofocusAccessor(this)||this.focus!==HTMLElement.prototype.focus&&this.scheduleAfterUpdate(()=>this.focus(),"lr-global-autofocus"))}requestUpdate(...args){invalidateLyraLocaleCache(this),super.requestUpdate(...args),deprecatedAliasSyncHook?.(this,args[0],args[1])}performUpdate(){beginInheritedContextUpdate(this);try{super.performUpdate()}finally{finishInheritedContextUpdate(this)}}update(changedProperties){super.update(changedProperties),markInheritedContextUpdateRendered(this)}ensureLocaleSubscription(){this.localeSubscriptionNeeded=!0,!(!this.isConnected||this.stopLocaleSubscription)&&(this.stopLocaleSubscription=subscribeLyraLocaleForHost(this))}attributeChangedCallback(name,oldValue,value){const directionHostAttribute=oldValue!==value&&DIRECTION_HOST_ATTRIBUTES.includes(name);directionHostAttribute&&queueInheritedDirectionChange(this,name==="slot"),oldValue!==value&&this.isConnected&&SCOPE_HOST_ATTRIBUTES.includes(name)&&ensureLyraTokens(this);const finishAliasWarning=oldValue!==value?deprecatedAliasAttributeHook?.(this,name):void 0;super.attributeChangedCallback(name,oldValue,value),finishAliasWarning?.(),oldValue!==value&&REACTIVE_HOST_ATTRIBUTES.includes(name)?this.requestUpdate():directionHostAttribute&&invalidateLyraLocaleCache(this)}seedFirstRenderState(seed){this.hasUpdated||this[SEED_FIRST_RENDER_STATE](seed)}[SEED_FIRST_RENDER_STATE](seed){if(typeof Node>"u")return;if(!this.hydratingServerShadow){seed();return}const pending=this.deferredFirstRenderSeeds??=new Set;pending.add(seed),!(pending.size>1)&&this.updateComplete.then(()=>{setTimeout(()=>{this.hydratingServerShadow=!1;const seeds=this.deferredFirstRenderSeeds;this.deferredFirstRenderSeeds=void 0;for(const deferred of seeds??[])deferred();this.requestUpdate()},0)},()=>{this.hydratingServerShadow=!1,this.deferredFirstRenderSeeds=void 0})}updateBrowserDerivedState(update){this[SEED_FIRST_RENDER_STATE](update)}renderSlotPresence(present){return present||this[SLOT_PRESENCE_UNRESOLVED]()}[SLOT_PRESENCE_UNRESOLVED](){return typeof Node>"u"||this.hydratingServerShadow===!0}beginAbortableLoad(){this.pendingLoadController?.abort(),this.pendingLoadController=void 0;const AbortControllerCtor=this.ownerDocument?.defaultView?.AbortController;if(AbortControllerCtor)return this.pendingLoadController=new AbortControllerCtor,this.pendingLoadController.signal}scheduleAfterUpdate(callback,key="load"){const pending=this.afterUpdateCallbacks??=new Map;pending.has(key)||(pending.set(key,callback),!(pending.size>1)&&queueMicrotask(()=>{const due=this.afterUpdateCallbacks;if(this.afterUpdateCallbacks=void 0,!due)return;if(this.isConnected){const errors=[];for(const due_callback of due.values())try{due_callback()}catch(error){errors.push(error)}if(errors.length===1)throw errors[0];if(errors.length>1)throw new AggregateError(errors,`${errors.length} after-update callbacks failed.`);return}const held=this.deferredAfterUpdate??=new Map;for(const[heldKey,heldCallback]of due)held.has(heldKey)||held.set(heldKey,heldCallback)}))}localize(key,fallback,values){let effectiveLocale;const message=resolveLyraStringWithLocale(()=>effectiveLocale??=this.effectiveMessageLocale,key,this.strings,fallback,values,trustedLyraDefaultStrings(this.constructor.defaultStrings)),locale=effectiveLocale??peekLyraLocale(this);return(effectiveLocale===void 0||this.locale)&&recordInheritedLocaleRead(this,locale),locale!==void 0&&(this.lastLocalizedLocale=locale,this.isConnected||(this.lastLocalizedCatalogVersion=lyraLocaleCatalogVersion(locale)),this.ensureLocaleSubscription()),message}get effectiveMessageLocale(){const locale=resolveLyraLocaleWithHostOverride(this,this.locale);return this.locale||(recordInheritedLocaleRead(this,locale),this.ensureLocaleSubscription()),locale}get effectiveLocale(){return resolveIntlLocale(this.effectiveMessageLocale)}get effectiveIntlLocale(){return this.effectiveLocale}get effectiveDirection(){const direction=resolveLyraDirection(this);return recordInheritedDirectionRead(this,direction),direction}addEventListener(type,listener,options){super.addEventListener(type,listener,options)}removeEventListener(type,listener,options){super.removeEventListener(type,listener,options)}emit(name,...args){const[detail,options]=args,ownerDocument=this.ownerDocument;let CustomEventCtor=ownerDocument?.defaultView?.CustomEvent;if(!CustomEventCtor&&ownerDocument)try{const candidate=ownerDocument.createEvent("CustomEvent").constructor;typeof candidate=="function"&&(CustomEventCtor=candidate)}catch{}CustomEventCtor??=globalThis.CustomEvent;const support=collectionSupportFor(this),event=new CustomEventCtor(name,{detail:detail===void 0?null:support?support.snapshotEvent(this,name,detail):detail,bubbles:!0,composed:!0,cancelable:options?.cancelable??!1});return this.dispatchEvent(event),event}}__decorate([property({reflect:!0})],LyraElement.prototype,"locale",void 0),__decorate([property({attribute:!1})],LyraElement.prototype,"strings",null);export{FORM_CONTROL_LABEL_FACTORY,LyraElement,SEED_FIRST_RENDER_STATE,SLOT_PRESENCE_UNRESOLVED,registerDeprecatedAliasSupport,registerFormControlLabelSupport};
@@ -1 +1 @@
1
- import{mapCustomLayerAttachment}from"./map-custom-layer-attachment.js";import{isMapSceneLayerHandle,loadMapSceneLayerRuntime}from"./map-scene-layer-runtime.js";const text=value=>typeof value=="string"&&value.trim().length>0;function ownValue(record,key){const descriptor=Object.getOwnPropertyDescriptor(record,key);if(descriptor&&!("value"in descriptor))throw new TypeError(`Map custom layer ${key} must be a data property.`);return descriptor?.value}function admitLayer(layer){if(typeof layer!="object"||layer===null)throw new TypeError("A map custom layer must be an object.");const id=ownValue(layer,"id"),label=ownValue(layer,"label"),before=ownValue(layer,"before"),create=layer.create;if(!text(id)||!text(label)||typeof create!="function"||before!==void 0&&!text(before))throw new TypeError("A map custom layer needs a nonblank id and label, a create() function and an optional nonblank before.");return Object.freeze({id,label,...before===void 0?{}:{before},create:context=>Reflect.apply(create,layer,[context])})}function nativeCall(map,method,name,listener){const callable=Reflect.get(map,method);typeof callable=="function"&&Reflect.apply(callable,map,[name,listener])}function eventPoint(event){if(typeof event!="object"||event===null)return;const point=Reflect.get(event,"point");if(typeof point!="object"||point===null)return;const x=Reflect.get(point,"x"),y=Reflect.get(point,"y");return typeof x=="number"&&typeof y=="number"&&Number.isFinite(x)&&Number.isFinite(y)?[x,y]:void 0}function createMapCustomLayerController(element,input,options={}){const layer=admitLayer(input),attachment=mapCustomLayerAttachment(element);if(!attachment)throw new TypeError("addMapCustomLayer() requires a connected lr-map.");const onStateChange=options.onStateChange;let status=Object.freeze({state:"loading"}),removed=!1,visible=!0,attempt=0,engine,engineMap,abort,lease;function setStatus(state,code){if(!(removed&&state!=="removed")&&!(status.state===state&&status.code===code)){status=Object.freeze(code===void 0?{state}:{state,code});try{onStateChange?.(status)}catch{}}}const onClick=event=>{const target=engine,point=eventPoint(event);!target||!visible||removed||!point||target.pick(point).then(hit=>{!hit||target!==engine||removed||typeof event!="object"||event===null||lease?.activate({id:hit.id,layerId:layer.id,...hit.position?{position:hit.position}:{}},event)},()=>{})};function stop(){attempt++,abort?.abort(),abort=void 0;const previous=engine;engine=void 0;try{previous?.dispose()}catch{}if(engineMap)try{nativeCall(engineMap,"off","click",onClick)}catch{}engineMap=void 0}function start(map){stop();const ticket=attempt,controller=abort=new AbortController;engineMap=map,setStatus("loading");try{nativeCall(map,"on","click",onClick)}catch{}loadMapSceneLayerRuntime().then(runtime=>{if(removed||ticket!==attempt)return;let created;try{if(created=runtime.createSceneLayer(map,layer,{signal:controller.signal,onState:(state,code)=>{!removed&&ticket===attempt&&setStatus(state,code)},reducedMotion:()=>lease?.reducedMotion()??!1}),!isMapSceneLayerHandle(created))throw new TypeError("Map custom layers are unavailable")}catch{if(controller.abort(),isMapSceneLayerHandle(created))try{created.dispose()}catch{}ticket===attempt&&setStatus("unavailable","engine");return}if(removed||ticket!==attempt){created.dispose();return}engine=created,visible||created.setVisible(!1)},()=>{!removed&&ticket===attempt&&setStatus("unavailable","engine")})}function remove(){if(removed)return;stop(),removed=!0;const owned=lease;lease=void 0,owned?.release(),status=Object.freeze({state:"removed"});try{onStateChange?.(status)}catch{}}lease=attachment.acquire({styleReady(map){if(!removed){if(engineMap===map){engine?.styleReady();return}start(map)}},styleInvalidated(){removed||engine?.invalidateStyle()},mapRemoved(){removed||(stop(),setStatus("loading"))},released:remove});const initial=lease.nativeMap();return initial&&start(initial),Object.freeze({id:layer.id,get status(){return status},requestRender(){removed||engine?.requestFrame()},setVisible(value){visible=!!value,removed||engine?.setVisible(visible)},async pick(point){const target=engine;if(!target||removed)return null;const hit=await target.pick(point);return target===engine&&!removed?hit:null},remove})}export{createMapCustomLayerController};
1
+ import{mapCustomLayerAttachment}from"./map-custom-layer-attachment.js";import{isMapSceneLayerHandle,loadMapSceneLayerRuntime}from"./map-scene-layer-runtime.js";const text=value=>typeof value=="string"&&value.trim().length>0;function ownValue(record,key){const descriptor=Object.getOwnPropertyDescriptor(record,key);if(descriptor&&!("value"in descriptor))throw new TypeError(`Map custom layer ${key} must be a data property.`);return descriptor?.value}function admitLayer(layer){if(typeof layer!="object"||layer===null)throw new TypeError("A map custom layer must be an object.");const id=ownValue(layer,"id"),label=ownValue(layer,"label"),before=ownValue(layer,"before"),create=layer.create;if(!text(id)||!text(label)||typeof create!="function"||before!==void 0&&!text(before))throw new TypeError("A map custom layer needs a nonblank id and label, a create() function and an optional nonblank before.");return Object.freeze({id,label,...before===void 0?{}:{before},create:context=>Reflect.apply(create,layer,[context])})}function nativeCall(map,method,name,listener){const callable=Reflect.get(map,method);typeof callable=="function"&&Reflect.apply(callable,map,[name,listener])}function eventPoint(event){if(typeof event!="object"||event===null)return;const point=Reflect.get(event,"point");if(typeof point!="object"||point===null)return;const x=Reflect.get(point,"x"),y=Reflect.get(point,"y");return typeof x=="number"&&typeof y=="number"&&Number.isFinite(x)&&Number.isFinite(y)?[x,y]:void 0}function createMapCustomLayerController(element,input,options={}){const layer=admitLayer(input),attachment=mapCustomLayerAttachment(element);if(!attachment)throw new TypeError("addMapCustomLayer() requires a connected lr-map.");const onStateChange=options.onStateChange;let status=Object.freeze({state:"loading"}),removed=!1,visible=!0,attempt=0,engine,engineMap,abort,lease;function setStatus(state,code){if(!(removed&&state!=="removed")&&!(status.state===state&&status.code===code)){status=Object.freeze(code===void 0?{state}:{state,code});try{onStateChange?.(status)}catch{}}}const onClick=event=>{const target=engine,point=eventPoint(event);!target||!visible||removed||!point||target.pick(point).then(hit=>{!hit||target!==engine||removed||typeof event!="object"||event===null||lease?.activate({id:hit.id,layerId:layer.id,...hit.position?{position:hit.position}:{}},event)},()=>{})};function stop(){attempt++,abort?.abort(),abort=void 0;const previous=engine;engine=void 0;try{previous?.dispose()}catch{}if(engineMap)try{nativeCall(engineMap,"off","click",onClick)}catch{}engineMap=void 0}function start(map){stop();const ticket=attempt,controller=abort=new AbortController;engineMap=map,setStatus("loading");try{nativeCall(map,"on","click",onClick)}catch{}loadMapSceneLayerRuntime().then(runtime=>{if(removed||ticket!==attempt)return;let created;try{if(created=runtime.createSceneLayer(map,layer,{signal:controller.signal,onState:(state,code)=>{!removed&&ticket===attempt&&setStatus(state,code)},reducedMotion:()=>lease?.reducedMotion()??!1}),!isMapSceneLayerHandle(created))throw new TypeError("Map custom layers are unavailable")}catch{if(controller.abort(),typeof created=="object"&&created!==null)try{const dispose=Reflect.get(created,"dispose");typeof dispose=="function"&&Reflect.apply(dispose,created,[])}catch{}ticket===attempt&&setStatus("unavailable","engine");return}if(removed||ticket!==attempt){created.dispose();return}engine=created,visible||created.setVisible(!1)},()=>{!removed&&ticket===attempt&&setStatus("unavailable","engine")})}function remove(){if(removed)return;stop(),removed=!0;const owned=lease;lease=void 0,owned?.release(),status=Object.freeze({state:"removed"});try{onStateChange?.(status)}catch{}}lease=attachment.acquire({styleReady(map){if(!removed){if(engineMap===map){engine?.styleReady();return}start(map)}},styleInvalidated(){removed||engine?.invalidateStyle()},mapRemoved(){removed||(stop(),setStatus("loading"))},released:remove});const initial=lease.nativeMap();return initial&&start(initial),Object.freeze({id:layer.id,get status(){return status},requestRender(){removed||engine?.requestFrame()},setVisible(value){visible=!!value,removed||engine?.setVisible(visible)},async pick(point){const target=engine;if(!target||removed)return null;const hit=await target.pick(point);return target===engine&&!removed?hit:null},remove})}export{createMapCustomLayerController};
@@ -1,4 +1,4 @@
1
- import{html,nothing}from"lit";import{literalSetConverter}from"./converters.js";import{snapshotPublicCollection}from"./collection-snapshot.js";import{isObjectValue,readOwnDataValue}from"./data-descriptors.js";import{finiteRange}from"./numbers.js";import{createEngine3dLoader}from"./engine-3d-loader.js";import{Engine3dSelection,ENGINE_3D_REASON_MESSAGE,ENGINE_3D_SHOWING_MESSAGE,engine3dFailureReason,webgl2Available}from"./engine-3d.js";import{AnnouncementSinkController}from"./announcer.js";import{isAccessibilityVisible}from"./accessibility-visibility.js";import{resolveCanvasColor}from"./canvas-color.js";import{tag}from"./prefix.js";const PANORAMA_PROJECTION=literalSetConverter(["flat","equirectangular"],"flat"),PANORAMA_DEFAULT_CAMERA=Object.freeze({yaw:0,pitch:0,fieldOfView:75}),panoramaLoader=createEngine3dLoader({entry:"panorama",tag:tag("image-viewer"),load:()=>(async()=>{try{return await import("@aceshooting/lyra-3d/panorama")}catch(e){throw e}})()}),panoramaEnvironment={available:owner=>webgl2Available(()=>owner.createElement("canvas"))};function normalizePanoramaCamera(value){if(!isObjectValue(value))return PANORAMA_DEFAULT_CAMERA;const number=key=>{const entry=readOwnDataValue(value,key);return typeof entry=="number"?entry:NaN},yaw=finiteRange(number("yaw"),0);return Object.freeze({yaw:((yaw+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI,pitch:finiteRange(number("pitch"),0,-Math.PI/2+.01,Math.PI/2-.01),fieldOfView:finiteRange(number("fieldOfView"),75,20,100)})}function snapshotPanoramaHotspots(value,owner){const source=snapshotPublicCollection(value,owner);if(!Array.isArray(source))return Object.freeze([]);const seen=new Set,result=[];for(const item of source){const id=readOwnDataValue(item,"id"),yaw=readOwnDataValue(item,"yaw"),pitch=readOwnDataValue(item,"pitch"),label=readOwnDataValue(item,"label");typeof id!="string"||!id.trim()||seen.has(id)||typeof yaw!="number"||!Number.isFinite(yaw)||typeof pitch!="number"||!Number.isFinite(pitch)||Math.abs(pitch)>Math.PI/2||(seen.add(id),result.push(Object.freeze({id,yaw:normalizePanoramaCamera({yaw}).yaw,pitch,...typeof label=="string"?{label}:{}})))}return Object.freeze(result)}class PanoramaController{constructor(host,options){this.host=host,this.options=options,this.selection=new Engine3dSelection(!0),this.ready=!1,this.loading=!1,this.notice=null,this.software=!1,this.enabled=!1,this.media=null,this.mediaRevision=-1,this.hotspots=[],this.camera=PANORAMA_DEFAULT_CAMERA,this.container=null,this.generation=0,this.revision=0,this.attempted=!1,this.pending=!1,this.intersecting=!1,this.cleanups=[],this.cursor=0,this.announcements=new AnnouncementSinkController(host,{eager:["assertive"]})}release(){this.generation++,this.intersection?.disconnect(),this.intersection=void 0,this.eligibility?.disconnect(),this.eligibility=void 0,this.intersecting=!1,this.resize?.disconnect(),this.resize=void 0,this.theme?.disconnect(),this.theme=void 0;for(const cleanup of this.cleanups)cleanup();this.cleanups=[];const engine=this.engine;this.engine=void 0,this.ready=this.loading=this.pending=!1,engine?.dispose()}invalidate(){this.release(),this.attempted=!1,this.notice=null,this.software=!1,this.selection.prefer(this.enabled?"webgl":"builtin")}disconnect(){this.invalidate(),this.media=null,this.container=null}adopted(){this.disconnect(),this.announcements.adopted()}update(enabled,media,mediaRevision,hotspots,camera,container){(enabled!==this.enabled||media!==this.media||mediaRevision!==this.mediaRevision||hotspots!==this.hotspots||container!==this.container)&&(this.invalidate(),this.enabled=enabled,this.media=media,this.mediaRevision=mediaRevision,this.hotspots=hotspots,this.container=container,this.cursor=Math.min(this.cursor,Math.max(0,hotspots.length-1)),this.selection.prefer(enabled?"webgl":"builtin"),this.options.changed());const cameraChanged=camera!==this.camera;if(this.camera=camera,!enabled||!media||!container||!this.host.isConnected)return;if(this.ready){cameraChanged&&this.command(()=>this.engine?.setCamera(camera));return}if(this.pending||this.attempted||this.intersection||this.eligibility)return;const view=this.host.ownerDocument.defaultView,generation=this.generation;this.intersecting=view?.IntersectionObserver===void 0;const admit=()=>{generation!==this.generation||this.pending||this.attempted||!this.intersecting||!isAccessibilityVisible(this.host)||(this.intersection?.disconnect(),this.intersection=void 0,this.eligibility?.disconnect(),this.eligibility=void 0,this.start())};if(view?.IntersectionObserver&&(this.intersection=new view.IntersectionObserver(entries=>{if(generation===this.generation){for(const entry of entries)entry.target===container&&(this.intersecting=entry.isIntersecting);admit()}}),this.intersection.observe(container)),view?.MutationObserver){this.eligibility=new view.MutationObserver(admit);let ancestor=this.host,depth=0;for(;ancestor&&depth++<=256;){this.eligibility.observe(ancestor,{attributes:!0,attributeFilter:["aria-hidden","inert","hidden","style","class","open"]});const root=ancestor.getRootNode();ancestor=ancestor.assignedSlot??ancestor.parentElement??(root instanceof view.ShadowRoot?root.host:null)}}admit()}fail(reason){const detail=this.selection.renderer==="webgl"?this.selection.fail(reason):null;this.ready=this.loading=!1,reason!=="context-lost"&&(this.release(),this.attempted=!0),detail&&(this.notice=detail,this.options.changed(),this.announcements.announceAssertive(this.options.localize(ENGINE_3D_REASON_MESSAGE[detail.reason])),this.announcements.announcePolite(this.options.localize(ENGINE_3D_SHOWING_MESSAGE[detail.to])),this.options.fallback(detail))}command(run){const generation=this.generation,engine=this.engine;try{run()}catch{generation===this.generation&&engine===this.engine&&this.fail("error")}}async start(){const owner=this.host.ownerDocument,container=this.container,media=this.media,hotspots=this.hotspots;if(!this.enabled||!container||!media||!this.host.isConnected)return;const generation=this.generation,current=()=>generation===this.generation&&this.host.isConnected&&this.host.ownerDocument===owner;if(this.pending=this.attempted=!0,!panoramaEnvironment.available(owner)){this.fail("unsupported");return}this.loading=!0,this.options.changed();let engine=null,owned=!1;try{if(engine=await panoramaLoader.create(),!current()){engine?.dispose();return}if(!engine){this.fail("unavailable");return}if(this.engine=engine,owned=!0,await engine.mount(container,{hover:index=>{current()&&this.ready&&this.command(()=>engine.setState?.({selected:new Set,dimmed:new Set,hover:index??-1,focus:this.cursor}))},pick:index=>{current()&&this.ready&&index!==null&&this.activate(index)},camera:value=>{current()&&this.ready&&(this.camera=normalizePanoramaCamera(value),this.options.camera(this.camera))},lost:reason=>{current()&&this.fail(reason)},restored:()=>{!current()||!this.engine||!this.selection.restore()||this.command(()=>{engine.setStyle(this.style()),current()&&(engine.setCamera(this.camera),current()&&(engine.setState?.({selected:new Set,dimmed:new Set,hover:-1,focus:this.cursor}),current()&&(this.ready=!0,this.notice=null,this.options.changed())))})},rendering:value=>{current()&&(this.software=value.software,this.options.changed())}}),!current()||(engine.setStyle(this.style()),!current()))return;const angles=new Float32Array(hotspots.length*2);if(hotspots.forEach((hotspot,index)=>{angles[index*2]=hotspot.yaw,angles[index*2+1]=hotspot.pitch}),engine.setData({source:media.localName==="video"?{kind:"video",video:media}:{kind:"image",image:media},hotspotAngles:angles},++this.revision),!current()||(engine.setCamera(this.camera),!current()))return;const resize=()=>{if(!current())return;const box=container.getBoundingClientRect();engine.resize(Math.max(1,box.width),Math.max(1,box.height))};if(resize(),!current())return;const view=owner.defaultView;view?.ResizeObserver&&(this.resize=new view.ResizeObserver(()=>{current()&&this.ready&&this.command(resize)}),this.resize.observe(container));const restyle=()=>{current()&&this.ready&&this.command(()=>engine.setStyle(this.style()))};if(view?.MutationObserver){this.theme=new view.MutationObserver(restyle);let ancestor=this.host;for(;ancestor;){this.theme.observe(ancestor,{attributes:!0});const root=ancestor.getRootNode();ancestor=ancestor.parentElement??(root instanceof view.ShadowRoot?root.host:null)}}for(const query of["(prefers-reduced-motion: reduce)","(forced-colors: active)","(prefers-color-scheme: dark)"]){const mediaQuery=view?.matchMedia(query);mediaQuery?.addEventListener("change",restyle),mediaQuery&&this.cleanups.push(()=>mediaQuery.removeEventListener("change",restyle))}this.pending=this.loading=!1,this.ready=this.selection.renderer==="webgl",this.options.changed()}catch(error){if(!current()){owned||engine?.dispose();return}this.fail(engine3dFailureReason(error))}}style(){const view=this.host.ownerDocument.defaultView,computed=view.getComputedStyle(this.host),canvas=this.host.ownerDocument.createElement("canvas");canvas.width=canvas.height=1;const context=canvas.getContext("2d",{willReadFrequently:!0}),color=name=>{const value=resolveCanvasColor(this.host,`var(${name})`,computed.color);if(!context)return value;context.clearRect(0,0,1,1),context.fillStyle=value,context.fillRect(0,0,1,1);const rgba=context.getImageData(0,0,1,1).data;return`rgba(${rgba[0]}, ${rgba[1]}, ${rgba[2]}, ${rgba[3]/255})`};return{background:color("--lr-color-surface"),foreground:color("--lr-color-text"),muted:color("--lr-color-text-quiet"),accent:color("--lr-color-brand"),focus:color("--lr-focus-ring-color"),palette:[color("--lr-color-brand")],fontFamily:computed.fontFamily,fontSize:finiteRange(Number.parseFloat(computed.fontSize),14,1,128),pointSize:24,lineWidth:1,devicePixelRatio:finiteRange(view.devicePixelRatio,1,.25,4),reducedMotion:view.matchMedia("(prefers-reduced-motion: reduce)").matches,forcedColors:view.matchMedia("(forced-colors: active)").matches}}activate(index){const hotspot=this.hotspots[index];!hotspot||!Number.isSafeInteger(index)||(this.cursor=index,this.options.changed(),this.options.pick({hotspot,id:hotspot.id,index}))}keydown(event,direction){if(!this.ready||event.target!==event.currentTarget)return;const sign=direction==="rtl"?-1:1;let{yaw,pitch,fieldOfView}=this.camera;switch(event.key){case"ArrowLeft":yaw-=sign*Math.PI/18;break;case"ArrowRight":yaw+=sign*Math.PI/18;break;case"ArrowUp":pitch+=Math.PI/18;break;case"ArrowDown":pitch-=Math.PI/18;break;case"+":case"=":fieldOfView-=5;break;case"-":case"_":fieldOfView+=5;break;case"Home":yaw=pitch=0,fieldOfView=75;break;default:return}event.preventDefault(),event.stopPropagation(),this.camera=normalizePanoramaCamera({yaw,pitch,fieldOfView});const generation=this.generation;this.command(()=>this.engine?.setCamera(this.camera)),generation===this.generation&&this.ready&&this.options.camera(this.camera)}renderViewport(label,enabled){return enabled?html`<div part="panorama" role="group" aria-label=${label} aria-description=${this.options.localize("panoramaInstructions")}
1
+ import{html,nothing}from"lit";import{literalSetConverter}from"./converters.js";import{snapshotPublicCollection}from"./collection-snapshot.js";import{isObjectValue,readOwnDataValue}from"./data-descriptors.js";import{finiteRange}from"./numbers.js";import{createEngine3dLoader}from"./engine-3d-loader.js";import{Engine3dSelection,ENGINE_3D_REASON_MESSAGE,ENGINE_3D_SHOWING_MESSAGE,engine3dFailureReason,webgl2Available}from"./engine-3d.js";import{AnnouncementSinkController}from"./announcer.js";import{isAccessibilityVisible}from"./accessibility-visibility.js";import{resolveCanvasColor}from"./canvas-color.js";import{tag}from"./prefix.js";const PANORAMA_PROJECTION=literalSetConverter(["flat","equirectangular"],"flat"),PANORAMA_DEFAULT_CAMERA=Object.freeze({yaw:0,pitch:0,fieldOfView:75}),panoramaLoader=createEngine3dLoader({entry:"panorama",tag:tag("image-viewer"),load:()=>(async()=>{try{return await import("@aceshooting/lyra-3d/panorama")}catch(e){throw e}})()}),panoramaEnvironment={available:owner=>webgl2Available(()=>owner.createElement("canvas"))};function normalizePanoramaCamera(value){if(!isObjectValue(value))return PANORAMA_DEFAULT_CAMERA;const number=key=>{const entry=readOwnDataValue(value,key);return typeof entry=="number"?entry:NaN},yaw=finiteRange(number("yaw"),0);return Object.freeze({yaw:((yaw+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI,pitch:finiteRange(number("pitch"),0,-Math.PI/2+.01,Math.PI/2-.01),fieldOfView:finiteRange(number("fieldOfView"),75,20,100)})}function snapshotPanoramaHotspots(value,owner){const source=snapshotPublicCollection(value,owner);if(!Array.isArray(source))return Object.freeze([]);const seen=new Set,result=[];for(const item of source){const id=readOwnDataValue(item,"id"),yaw=readOwnDataValue(item,"yaw"),pitch=readOwnDataValue(item,"pitch"),label=readOwnDataValue(item,"label");typeof id!="string"||!id.trim()||seen.has(id)||typeof yaw!="number"||!Number.isFinite(yaw)||typeof pitch!="number"||!Number.isFinite(pitch)||Math.abs(pitch)>Math.PI/2||(seen.add(id),result.push(Object.freeze({id,yaw:normalizePanoramaCamera({yaw}).yaw,pitch,...typeof label=="string"?{label}:{}})))}return Object.freeze(result)}function disposePanoramaEngine(engine){try{engine?.dispose()}catch{}}class PanoramaController{constructor(host,options){this.host=host,this.options=options,this.selection=new Engine3dSelection(!0),this.ready=!1,this.loading=!1,this.notice=null,this.software=!1,this.enabled=!1,this.media=null,this.mediaRevision=-1,this.hotspots=[],this.camera=PANORAMA_DEFAULT_CAMERA,this.container=null,this.generation=0,this.revision=0,this.attempted=!1,this.pending=!1,this.intersecting=!1,this.cleanups=[],this.cursor=0,this.announcements=new AnnouncementSinkController(host,{eager:["assertive"]})}release(){this.generation++,this.intersection?.disconnect(),this.intersection=void 0,this.eligibility?.disconnect(),this.eligibility=void 0,this.intersecting=!1,this.resize?.disconnect(),this.resize=void 0,this.theme?.disconnect(),this.theme=void 0;for(const cleanup of this.cleanups)cleanup();this.cleanups=[];const engine=this.engine;this.engine=void 0,this.ready=this.loading=this.pending=!1,disposePanoramaEngine(engine)}invalidate(){this.release(),this.attempted=!1,this.notice=null,this.software=!1,this.selection.prefer(this.enabled?"webgl":"builtin")}disconnect(){this.invalidate(),this.media=null,this.container=null}adopted(){this.disconnect(),this.announcements.adopted()}update(enabled,media,mediaRevision,hotspots,camera,container){(enabled!==this.enabled||media!==this.media||mediaRevision!==this.mediaRevision||hotspots!==this.hotspots||container!==this.container)&&(this.invalidate(),this.enabled=enabled,this.media=media,this.mediaRevision=mediaRevision,this.hotspots=hotspots,this.container=container,this.cursor=Math.min(this.cursor,Math.max(0,hotspots.length-1)),this.selection.prefer(enabled?"webgl":"builtin"),this.options.changed());const cameraChanged=camera!==this.camera;if(this.camera=camera,!enabled||!media||!container||!this.host.isConnected)return;if(this.ready){cameraChanged&&this.command(()=>this.engine?.setCamera(camera));return}if(this.pending||this.attempted||this.intersection||this.eligibility)return;const view=this.host.ownerDocument.defaultView,generation=this.generation;this.intersecting=view?.IntersectionObserver===void 0;const admit=()=>{generation!==this.generation||this.pending||this.attempted||!this.intersecting||!isAccessibilityVisible(this.host)||(this.intersection?.disconnect(),this.intersection=void 0,this.eligibility?.disconnect(),this.eligibility=void 0,this.start())};if(view?.IntersectionObserver&&(this.intersection=new view.IntersectionObserver(entries=>{if(generation===this.generation){for(const entry of entries)entry.target===container&&(this.intersecting=entry.isIntersecting);admit()}}),this.intersection.observe(container)),view?.MutationObserver){this.eligibility=new view.MutationObserver(admit);let ancestor=this.host,depth=0;for(;ancestor&&depth++<=256;){this.eligibility.observe(ancestor,{attributes:!0,attributeFilter:["aria-hidden","inert","hidden","style","class","open"]});const root=ancestor.getRootNode();ancestor=ancestor.assignedSlot??ancestor.parentElement??(root instanceof view.ShadowRoot?root.host:null)}}admit()}fail(reason){const detail=this.selection.renderer==="webgl"?this.selection.fail(reason):null;this.ready=this.loading=!1,reason!=="context-lost"&&(this.release(),this.attempted=!0),detail&&(this.notice=detail,this.options.changed(),this.announcements.announceAssertive(this.options.localize(ENGINE_3D_REASON_MESSAGE[detail.reason])),this.announcements.announcePolite(this.options.localize(ENGINE_3D_SHOWING_MESSAGE[detail.to])),this.options.fallback(detail))}command(run){const generation=this.generation,engine=this.engine;try{run()}catch{generation===this.generation&&engine===this.engine&&this.fail("error")}}async start(){const owner=this.host.ownerDocument,container=this.container,media=this.media,hotspots=this.hotspots;if(!this.enabled||!container||!media||!this.host.isConnected)return;const generation=this.generation,current=()=>generation===this.generation&&this.host.isConnected&&this.host.ownerDocument===owner;if(this.pending=this.attempted=!0,!panoramaEnvironment.available(owner)){this.fail("unsupported");return}this.loading=!0,this.options.changed();let engine=null,owned=!1;try{if(engine=await panoramaLoader.create(),!current()){disposePanoramaEngine(engine);return}if(!engine){this.fail("unavailable");return}if(this.engine=engine,owned=!0,await engine.mount(container,{hover:index=>{current()&&this.ready&&this.command(()=>engine.setState?.({selected:new Set,dimmed:new Set,hover:index??-1,focus:this.cursor}))},pick:index=>{current()&&this.ready&&index!==null&&this.activate(index)},camera:value=>{current()&&this.ready&&(this.camera=normalizePanoramaCamera(value),this.options.camera(this.camera))},lost:reason=>{current()&&this.fail(reason)},restored:()=>{!current()||!this.engine||!this.selection.restore()||this.command(()=>{engine.setStyle(this.style()),current()&&(engine.setCamera(this.camera),current()&&(engine.setState?.({selected:new Set,dimmed:new Set,hover:-1,focus:this.cursor}),current()&&(this.ready=!0,this.notice=null,this.options.changed())))})},rendering:value=>{current()&&(this.software=value.software,this.options.changed())}}),!current()||(engine.setStyle(this.style()),!current()))return;const angles=new Float32Array(hotspots.length*2);if(hotspots.forEach((hotspot,index)=>{angles[index*2]=hotspot.yaw,angles[index*2+1]=hotspot.pitch}),engine.setData({source:media.localName==="video"?{kind:"video",video:media}:{kind:"image",image:media},hotspotAngles:angles},++this.revision),!current()||(engine.setCamera(this.camera),!current()))return;const resize=()=>{if(!current())return;const box=container.getBoundingClientRect();engine.resize(Math.max(1,box.width),Math.max(1,box.height))};if(resize(),!current())return;const view=owner.defaultView;view?.ResizeObserver&&(this.resize=new view.ResizeObserver(()=>{current()&&this.ready&&this.command(resize)}),this.resize.observe(container));const restyle=()=>{current()&&this.ready&&this.command(()=>engine.setStyle(this.style()))};if(view?.MutationObserver){this.theme=new view.MutationObserver(restyle);let ancestor=this.host;for(;ancestor;){this.theme.observe(ancestor,{attributes:!0});const root=ancestor.getRootNode();ancestor=ancestor.parentElement??(root instanceof view.ShadowRoot?root.host:null)}}for(const query of["(prefers-reduced-motion: reduce)","(forced-colors: active)","(prefers-color-scheme: dark)"]){const mediaQuery=view?.matchMedia(query);mediaQuery?.addEventListener("change",restyle),mediaQuery&&this.cleanups.push(()=>mediaQuery.removeEventListener("change",restyle))}this.pending=this.loading=!1,this.ready=this.selection.renderer==="webgl",this.options.changed()}catch(error){if(!current()){owned||disposePanoramaEngine(engine);return}this.fail(engine3dFailureReason(error))}}style(){const view=this.host.ownerDocument.defaultView,computed=view.getComputedStyle(this.host),canvas=this.host.ownerDocument.createElement("canvas");canvas.width=canvas.height=1;const context=canvas.getContext("2d",{willReadFrequently:!0}),color=name=>{const value=resolveCanvasColor(this.host,`var(${name})`,computed.color);if(!context)return value;context.clearRect(0,0,1,1),context.fillStyle=value,context.fillRect(0,0,1,1);const rgba=context.getImageData(0,0,1,1).data;return`rgba(${rgba[0]}, ${rgba[1]}, ${rgba[2]}, ${rgba[3]/255})`};return{background:color("--lr-color-surface"),foreground:color("--lr-color-text"),muted:color("--lr-color-text-quiet"),accent:color("--lr-color-brand"),focus:color("--lr-focus-ring-color"),palette:[color("--lr-color-brand")],fontFamily:computed.fontFamily,fontSize:finiteRange(Number.parseFloat(computed.fontSize),14,1,128),pointSize:24,lineWidth:1,devicePixelRatio:finiteRange(view.devicePixelRatio,1,.25,4),reducedMotion:view.matchMedia("(prefers-reduced-motion: reduce)").matches,forcedColors:view.matchMedia("(forced-colors: active)").matches}}activate(index){const hotspot=this.hotspots[index];!hotspot||!Number.isSafeInteger(index)||(this.cursor=index,this.options.changed(),this.options.pick({hotspot,id:hotspot.id,index}))}keydown(event,direction){if(!this.ready||event.target!==event.currentTarget)return;const sign=direction==="rtl"?-1:1;let{yaw,pitch,fieldOfView}=this.camera;switch(event.key){case"ArrowLeft":yaw-=sign*Math.PI/18;break;case"ArrowRight":yaw+=sign*Math.PI/18;break;case"ArrowUp":pitch+=Math.PI/18;break;case"ArrowDown":pitch-=Math.PI/18;break;case"+":case"=":fieldOfView-=5;break;case"-":case"_":fieldOfView+=5;break;case"Home":yaw=pitch=0,fieldOfView=75;break;default:return}event.preventDefault(),event.stopPropagation(),this.camera=normalizePanoramaCamera({yaw,pitch,fieldOfView});const generation=this.generation;this.command(()=>this.engine?.setCamera(this.camera)),generation===this.generation&&this.ready&&this.options.camera(this.camera)}renderViewport(label,enabled){return enabled?html`<div part="panorama" role="group" aria-label=${label} aria-description=${this.options.localize("panoramaInstructions")}
2
2
  tabindex=${this.ready?"0":"-1"} ?data-ready=${this.ready} ?hidden=${this.notice!==null}
3
3
  @keydown=${event=>this.keydown(event,this.options.direction())}><div part="panorama-engine" aria-hidden="true"></div></div>`:nothing}renderNotice(){const notice=this.notice;return notice?html`<div part="panorama-notice"><p>${this.options.localize(ENGINE_3D_REASON_MESSAGE[notice.reason])}</p><p>${this.options.localize(ENGINE_3D_SHOWING_MESSAGE[notice.to])}</p></div>`:!this.loading&&!this.software?nothing:html`<p part="panorama-notice">${this.options.localize(this.loading?"engine3dLoading":"engine3dSoftwareRendering")}</p>`}renderHotspots(enabled){if(!enabled||!this.hotspots.length)return nothing;const start=Math.floor(this.cursor/200)*200,end=Math.min(this.hotspots.length,start+200),generation=this.generation,current=()=>this.host.isConnected&&generation===this.generation,move=(index,focus=!1)=>{current()&&(this.cursor=Math.max(0,Math.min(this.hotspots.length-1,index)),this.options.changed(),this.ready&&this.command(()=>this.engine?.setState?.({selected:new Set,dimmed:new Set,hover:-1,focus:this.cursor})),focus&&this.options.updated().then(()=>{current()&&this.host.shadowRoot?.querySelector(`[data-panorama-index="${this.cursor}"]`)?.focus()}))};return html`<div part="panorama-hotspots" role="group" aria-label=${this.options.localize("panoramaHotspotsLabel")}>
4
4
  ${this.hotspots.slice(start,end).map((hotspot,offset)=>{const index=start+offset;return html`<button part="panorama-hotspot" type="button" data-panorama-index=${index} tabindex=${index===this.cursor?"0":"-1"}
@@ -1 +1 @@
1
- import{composedParentElement,deepActiveElementIn}from"./active-element.js";import{tag}from"./prefix.js";const SHARED_LIVE_REGION_ATTRIBUTE=`data-${tag("live-region")}`;function isPageHelperRegion(element){return element.localName===tag("toast")||element.hasAttribute(SHARED_LIVE_REGION_ATTRIBUTE)}const contexts=new WeakMap;function registerNativeModalContext(modal,contentHost,mountTarget=contentHost){const context={contentHost,mountTarget};return contexts.set(modal,context),forgetNativeModalProbe(modal.ownerDocument),()=>{contexts.get(modal)===context&&contexts.delete(modal),forgetNativeModalProbe(modal.ownerDocument)}}const probes=new WeakMap,focusWatchedDocuments=new WeakSet;function forgetNativeModalProbe(doc){doc&&probes.delete(doc)}function forgetProbeOnFocusChange(doc){if(focusWatchedDocuments.has(doc))return;focusWatchedDocuments.add(doc);const forget=()=>{probes.delete(doc)};doc.addEventListener("focusin",forget,!0),doc.addEventListener("focusout",forget,!0)}function isNativeModal(dialog){try{return dialog.isConnected&&dialog.matches(":modal")}catch{return!1}}function getNativeModalMountTarget(modal){return contexts.get(modal)?.mountTarget??modal}function modalAncestor(element){for(let current=element;current;current=composedParentElement(current))if(current.localName==="dialog")try{if(current.matches(":modal"))return current}catch{return null}return null}function mayHaveNativeModal(doc){const roots=[doc];let budget=4096;for(;roots.length>0;){const root=roots.pop(),walker=doc.createTreeWalker(root,1);let node;for(;node=walker.nextNode();){if(--budget<0)return!0;const element=node;if(element.localName==="dialog")try{if(element.matches(":modal"))return!0}catch{return!1}element.shadowRoot&&roots.push(element.shadowRoot)}}return!1}function getActiveNativeModal(doc){if(!doc)return null;const remembered=probes.get(doc);if(remembered&&(remembered.modal===null||isNativeModal(remembered.modal)))return remembered.modal;const probe={modal:probeActiveNativeModal(doc)};return probes.set(doc,probe),forgetProbeOnFocusChange(doc),Promise.resolve().then(()=>{probes.get(doc)===probe&&probes.delete(doc)}),probe.modal}function probeActiveNativeModal(doc){const focused=modalAncestor(deepActiveElementIn(doc));if(typeof doc.elementFromPoint!="function")return focused;if(!focused&&!mayHaveNativeModal(doc))return null;const width=doc.documentElement.clientWidth,height=doc.documentElement.clientHeight,points=[[0,0],[width/2,height/2],[Math.max(0,width-1),Math.max(0,height-1)]];for(const[x,y]of points){let hit=doc.elementFromPoint(x,y);const visited=new Set;for(;hit?.shadowRoot&&!visited.has(hit);){visited.add(hit);const inner=hit.shadowRoot.elementFromPoint?.(x,y);if(!inner||inner===hit)break;hit=inner}const modal=modalAncestor(hit);if(modal)return modal}return focused}function isInNativeModalContext(source,modal){if(source===contexts.get(modal)?.contentHost)return!0;for(let current=source;current;current=composedParentElement(current))if(current===modal)return!0;return!1}export{SHARED_LIVE_REGION_ATTRIBUTE,getActiveNativeModal,getNativeModalMountTarget,isInNativeModalContext,isPageHelperRegion,registerNativeModalContext};
1
+ import{composedParentElement,deepActiveElementIn}from"./active-element.js";import{tag}from"./prefix.js";import{claimDocumentRuntime}from"./runtime-diagnostics.js";const SHARED_LIVE_REGION_ATTRIBUTE=`data-${tag("live-region")}`;function isPageHelperRegion(element){return element.localName===tag("toast")||element.hasAttribute(SHARED_LIVE_REGION_ATTRIBUTE)}const contexts=new WeakMap;function registerNativeModalContext(modal,contentHost,mountTarget=contentHost){claimDocumentRuntime(modal.ownerDocument);const context={contentHost,mountTarget};return contexts.set(modal,context),forgetNativeModalProbe(modal.ownerDocument),()=>{contexts.get(modal)===context&&contexts.delete(modal),forgetNativeModalProbe(modal.ownerDocument)}}const probes=new WeakMap,focusWatchedDocuments=new WeakSet;function forgetNativeModalProbe(doc){doc&&probes.delete(doc)}function forgetProbeOnFocusChange(doc){if(focusWatchedDocuments.has(doc))return;focusWatchedDocuments.add(doc);const forget=()=>{probes.delete(doc)};doc.addEventListener("focusin",forget,!0),doc.addEventListener("focusout",forget,!0)}function isNativeModal(dialog){try{return dialog.isConnected&&dialog.matches(":modal")}catch{return!1}}function getNativeModalMountTarget(modal){return contexts.get(modal)?.mountTarget??modal}function modalAncestor(element){for(let current=element;current;current=composedParentElement(current))if(current.localName==="dialog")try{if(current.matches(":modal"))return current}catch{return null}return null}function mayHaveNativeModal(doc){const roots=[doc];let budget=4096;for(;roots.length>0;){const root=roots.pop(),walker=doc.createTreeWalker(root,1);let node;for(;node=walker.nextNode();){if(--budget<0)return!0;const element=node;if(element.localName==="dialog")try{if(element.matches(":modal"))return!0}catch{return!1}element.shadowRoot&&roots.push(element.shadowRoot)}}return!1}function getActiveNativeModal(doc){if(!doc)return null;claimDocumentRuntime(doc);const remembered=probes.get(doc);if(remembered&&(remembered.modal===null||isNativeModal(remembered.modal)))return remembered.modal;const probe={modal:probeActiveNativeModal(doc)};return probes.set(doc,probe),forgetProbeOnFocusChange(doc),Promise.resolve().then(()=>{probes.get(doc)===probe&&probes.delete(doc)}),probe.modal}function probeActiveNativeModal(doc){const focused=modalAncestor(deepActiveElementIn(doc));if(typeof doc.elementFromPoint!="function")return focused;if(!focused&&!mayHaveNativeModal(doc))return null;const width=doc.documentElement.clientWidth,height=doc.documentElement.clientHeight,points=[[0,0],[width/2,height/2],[Math.max(0,width-1),Math.max(0,height-1)]];for(const[x,y]of points){let hit=doc.elementFromPoint(x,y);const visited=new Set;for(;hit?.shadowRoot&&!visited.has(hit);){visited.add(hit);const inner=hit.shadowRoot.elementFromPoint?.(x,y);if(!inner||inner===hit)break;hit=inner}const modal=modalAncestor(hit);if(modal)return modal}return focused}function isInNativeModalContext(source,modal){if(source===contexts.get(modal)?.contentHost)return!0;for(let current=source;current;current=composedParentElement(current))if(current===modal)return!0;return!1}export{SHARED_LIVE_REGION_ATTRIBUTE,getActiveNativeModal,getNativeModalMountTarget,isInNativeModalContext,isPageHelperRegion,registerNativeModalContext};
@@ -1 +1 @@
1
- import{getActiveNativeModal,isPageHelperRegion}from"./native-modal-context.js";import{activateNonmodalOverlay}from"./nonmodal-overlay-manager.js";import{RenderedStateController}from"./rendered-state.js";import{lockScroll}from"./scroll-lock.js";import{acquireOverlayRoutingSuspension,activateOverlayStack,composedContains,observeOverlayStack}from"./overlay-stack.js";const EMPTY_STACK={entries:[]},modalStates=new WeakMap;function authoredOverlayInert(host){const state=modalStates.get(host.ownerDocument);if(!state)return host.inert;const records=state.observer?.takeRecords();return records?.length&&handleMutations(state,records),state.inerted.get(host)??host.inert}function modalStateFor(doc){const existing=modalStates.get(doc);if(existing)return existing;const state={document:doc,snapshot:EMPTY_STACK,registrations:0,externalModalSuspensions:new Set,inerted:new Map,pendingInertWrites:new Map,observedRoots:new Set,allowedParents:new Set,inertUpdateQueued:!1,started:!1};return modalStates.set(doc,state),state}function scheduleInertUpdate(state){state.inertUpdateQueued||(state.inertUpdateQueued=!0,queueMicrotask(()=>{state.inertUpdateQueued=!1,applyTopmostInert(state)}))}function pruneExternalModalSuspensions(state){let changed=!1;for(const entry of state.externalModalSuspensions)entry.root.isConnected&&entry.root.ownerDocument===state.document||(entry.active=!1,state.externalModalSuspensions.delete(entry),entry.releaseRouting(),changed=!0);return changed}function movesStackHost(state,record){for(const entry of state.snapshot.entries)for(const list of[record.addedNodes,record.removedNodes])for(const node of list)if(node.contains(entry.host))return!0;return!1}function handleMutations(state,records){const prunedExternalModal=pruneExternalModalSuspensions(state);let needsInertUpdate=prunedExternalModal;for(let index=0;index<records.length;index++){const record=records[index];if(!record)continue;if(record.type==="childList"){(state.allowedParents.has(record.target)||movesStackHost(state,record))&&(needsInertUpdate=!0);continue}if(record.attributeName==="open"){needsInertUpdate=!0;continue}const element=record.target;let nextRecord;for(let nextIndex=index+1;nextIndex<records.length;nextIndex++){const candidate=records[nextIndex];if(candidate?.type==="attributes"&&candidate.attributeName==="inert"&&candidate.target===element){nextRecord=candidate;break}}const newValue=nextRecord?nextRecord.oldValue!==null:element.hasAttribute("inert"),pending=state.pendingInertWrites.get(element);if(pending?.[0]===newValue){pending.shift(),pending.length===0&&state.pendingInertWrites.delete(element);continue}state.inerted.has(element)&&(state.inerted.set(element,newValue),needsInertUpdate=!0)}needsInertUpdate&&(prunedExternalModal?applyTopmostInert(state):scheduleInertUpdate(state)),stopModalStateIfIdle(state)}const mutationObserverOptions={attributeFilter:["inert","open"],attributeOldValue:!0,attributes:!0,childList:!0,subtree:!0};function observeMutationRoot(state,root){!state.observer||state.observedRoots.has(root)||(state.observer.observe(root===state.document?state.document.documentElement:root,mutationObserverOptions),state.observedRoots.add(root))}function startModalState(state){if(state.started)return;state.started=!0;const Observer=state.document.defaultView?.MutationObserver??MutationObserver;state.observer=new Observer(records=>handleMutations(state,records)),observeMutationRoot(state,state.document),state.unsubscribeStack=observeOverlayStack(state.document,snapshot=>{state.snapshot=snapshot,applyTopmostInert(state)})}function stopModalState(state){if(state.started){state.started=!1,state.unsubscribeStack?.(),state.unsubscribeStack=void 0;for(const[element,intended]of state.inerted)element.inert=intended;state.inerted.clear(),state.observer?.disconnect(),state.observer=void 0,state.observedRoots.clear(),state.pendingInertWrites.clear(),state.snapshot=EMPTY_STACK}}function stopModalStateIfIdle(state){state.registrations===0&&state.externalModalSuspensions.size===0&&stopModalState(state)}function retainModalState(doc){const state=modalStateFor(doc);state.registrations++,startModalState(state);let active=!0;return()=>{active&&(active=!1,state.registrations--,stopModalStateIfIdle(state))}}function setInertByManager(state,element,value){if(element.inert!==value){if(state.observer&&state.observedRoots.has(element.getRootNode())){let pending=state.pendingInertWrites.get(element);pending||(pending=[],state.pendingInertWrites.set(element,pending)),pending.push(value)}else state.pendingInertWrites.delete(element);element.inert=value}}function inertElement(state,element,desired){if(!("inert"in element)||element.localName==="dialog"&&element.matches(":modal")||isPageHelperRegion(element))return;const htmlElement=element;desired.add(htmlElement),state.inerted.has(htmlElement)||state.inerted.set(htmlElement,htmlElement.inert),setInertByManager(state,htmlElement,!0)}function pathParent(element){return element.assignedSlot??element.parentNode}function parentPathElement(parent){return parent.nodeType===Node.ELEMENT_NODE?parent:parent.host??null}function composedChildren(parent){return parent.localName==="slot"?parent.assignedElements({flatten:!0}):"children"in parent?Array.from(parent.children):[]}function isShadowRoot(node){return node.nodeType===11&&"host"in node}function addAllowedPath(allowed,host,doc){let current=host;for(;current&&current!==doc.body&&current!==doc.documentElement;){const parent=pathParent(current);if(!parent)break;let children=allowed.get(parent);children||(children=new Set,allowed.set(parent,children)),children.add(current),current=parentPathElement(parent)}}function modalAllowedRoot(entry,doc){const explicit=entry.modalRoot?.()??null;return explicit?.isConnected&&explicit.ownerDocument===doc?explicit:entry.host}function applyTopmostInert(state){let modalIndex=-1;for(let index=state.snapshot.entries.length-1;index>=0;index--)if(state.snapshot.entries[index]?.modal){modalIndex=index;break}const desired=new Set;if(state.allowedParents=new Set,state.externalModalSuspensions.size>0){const allowed=new Map;for(const suspension of state.externalModalSuspensions)addAllowedPath(allowed,suspension.root,state.document);inertOutsideAllowedPaths(state,allowed,desired)}else if(modalIndex!==-1){const allowed=new Map,interactiveRoots=[];for(const entry of state.snapshot.entries.slice(modalIndex)){if(!entry.host.isConnected||interactiveRoots.some(root=>composedContains(root,entry.host)))continue;const modalRoot=modalAllowedRoot(entry,state.document);addAllowedPath(allowed,modalRoot,state.document),interactiveRoots.push(modalRoot);for(const root of entry.auxiliaryRoots?.()??[])root.isConnected&&root.ownerDocument===state.document&&(addAllowedPath(allowed,root,state.document),interactiveRoots.push(root))}const nativeModal=getActiveNativeModal(state.document);nativeModal&&addAllowedPath(allowed,nativeModal,state.document),inertOutsideAllowedPaths(state,allowed,desired)}for(const[element,intended]of state.inerted)desired.has(element)||(setInertByManager(state,element,intended),state.inerted.delete(element))}function inertOutsideAllowedPaths(state,allowed,desired){for(const[parent,children]of allowed){state.allowedParents.add(parent),isShadowRoot(parent)&&observeMutationRoot(state,parent);for(const child of composedChildren(parent))children.has(child)||inertElement(state,child,desired)}}function activateOverlay(options){if(options.modal===!1&&options.trapFocus===!1&&!options.suspendWhenUnrendered&&!options.lockScroll)return activateNonmodalOverlay(options);const modal=options.modal!==!1;let releaseModalState,releaseScrollLock,renderedState,explicitlySuspended=!1;const coreHandle=activateOverlayStack({...options,initiallySuspended:options.suspendWhenUnrendered===!0,modal,trapFocus:options.trapFocus!==!1,onRegistered:doc=>{modal&&(releaseModalState=retainModalState(doc)),options.lockScroll&&(releaseScrollLock=lockScroll(doc))},onUnregistered:(_doc,deferResourceRelease)=>{const releaseModal=releaseModalState;releaseModalState=void 0;const release=releaseScrollLock;releaseScrollLock=void 0;const deferredRelease=release&&deferResourceRelease?release:void 0;return release&&!deferResourceRelease&&release(),releaseModal?.(),deferredRelease},onDeactivate:()=>renderedState?.stop()});return coreHandle.isActive()?(options.suspendWhenUnrendered&&(renderedState=new RenderedStateController(options.host,options.panel,rendered=>{if(!coreHandle.isActive())return;if(!rendered||explicitlySuspended){coreHandle.suspend();return}const wasTopmost=coreHandle.isTopmost();coreHandle.resume(),!wasTopmost&&coreHandle.isTopmost()&&queueMicrotask(()=>coreHandle.focusInitial())}),renderedState.start()),{focusInitial:()=>{renderedState?.check(),coreHandle.focusInitial()},focusAutofocus:()=>(renderedState?.check(),coreHandle.focusAutofocus()),updateRestoreFocusTo:target=>coreHandle.updateRestoreFocusTo(target),deactivate:deactivateOptions=>coreHandle.deactivate(deactivateOptions),suspend:()=>{explicitlySuspended=!0,coreHandle.suspend()},resume:()=>{explicitlySuspended=!1,!(renderedState&&!renderedState.check())&&coreHandle.resume()},isTopmost:()=>(renderedState?.check(),coreHandle.isTopmost()),isActive:()=>coreHandle.isActive(),dismissBackdrop:()=>(renderedState?.check(),coreHandle.dismissBackdrop())}):coreHandle}function suspendLyraModalsFor(externalModal){if(!externalModal.isConnected)return()=>{};const state=modalStateFor(externalModal.ownerDocument);startModalState(state);const entry={root:externalModal,active:!0,releaseRouting:()=>{},state};return state.externalModalSuspensions.add(entry),entry.releaseRouting=acquireOverlayRoutingSuspension(state.document),applyTopmostInert(state),()=>{entry.active&&(entry.active=!1,entry.state.externalModalSuspensions.delete(entry),entry.releaseRouting(),applyTopmostInert(entry.state),stopModalStateIfIdle(entry.state))}}import{collectAutofocusElements,collectFocusableElements,composedContains as composedContains2,deepActiveElement}from"./overlay-stack.js";export{activateOverlay,authoredOverlayInert,collectAutofocusElements,collectFocusableElements,composedContains2 as composedContains,deepActiveElement,suspendLyraModalsFor};
1
+ import{claimDocumentRuntime}from"./runtime-diagnostics.js";import{getActiveNativeModal,isPageHelperRegion}from"./native-modal-context.js";import{activateNonmodalOverlay}from"./nonmodal-overlay-manager.js";import{RenderedStateController}from"./rendered-state.js";import{lockScroll}from"./scroll-lock.js";import{acquireOverlayRoutingSuspension,activateOverlayStack,composedContains,observeOverlayStack}from"./overlay-stack.js";const EMPTY_STACK={entries:[]},modalStates=new WeakMap;function authoredOverlayInert(host){const state=modalStates.get(host.ownerDocument);if(!state)return host.inert;const records=state.observer?.takeRecords();return records?.length&&handleMutations(state,records),state.inerted.get(host)??host.inert}function modalStateFor(doc){claimDocumentRuntime(doc);const existing=modalStates.get(doc);if(existing)return existing;const state={document:doc,snapshot:EMPTY_STACK,registrations:0,externalModalSuspensions:new Set,inerted:new Map,pendingInertWrites:new Map,observedRoots:new Set,allowedParents:new Set,inertUpdateQueued:!1,started:!1};return modalStates.set(doc,state),state}function scheduleInertUpdate(state){state.inertUpdateQueued||(state.inertUpdateQueued=!0,queueMicrotask(()=>{state.inertUpdateQueued=!1,applyTopmostInert(state)}))}function pruneExternalModalSuspensions(state){let changed=!1;for(const entry of state.externalModalSuspensions)entry.root.isConnected&&entry.root.ownerDocument===state.document||(entry.active=!1,state.externalModalSuspensions.delete(entry),entry.releaseRouting(),changed=!0);return changed}function movesStackHost(state,record){for(const entry of state.snapshot.entries)for(const list of[record.addedNodes,record.removedNodes])for(const node of list)if(node.contains(entry.host))return!0;return!1}function handleMutations(state,records){const prunedExternalModal=pruneExternalModalSuspensions(state);let needsInertUpdate=prunedExternalModal;for(let index=0;index<records.length;index++){const record=records[index];if(!record)continue;if(record.type==="childList"){(state.allowedParents.has(record.target)||movesStackHost(state,record))&&(needsInertUpdate=!0);continue}if(record.attributeName==="open"){needsInertUpdate=!0;continue}const element=record.target;let nextRecord;for(let nextIndex=index+1;nextIndex<records.length;nextIndex++){const candidate=records[nextIndex];if(candidate?.type==="attributes"&&candidate.attributeName==="inert"&&candidate.target===element){nextRecord=candidate;break}}const newValue=nextRecord?nextRecord.oldValue!==null:element.hasAttribute("inert"),pending=state.pendingInertWrites.get(element);if(pending?.[0]===newValue){pending.shift(),pending.length===0&&state.pendingInertWrites.delete(element);continue}state.inerted.has(element)&&(state.inerted.set(element,newValue),needsInertUpdate=!0)}needsInertUpdate&&(prunedExternalModal?applyTopmostInert(state):scheduleInertUpdate(state)),stopModalStateIfIdle(state)}const mutationObserverOptions={attributeFilter:["inert","open"],attributeOldValue:!0,attributes:!0,childList:!0,subtree:!0};function observeMutationRoot(state,root){!state.observer||state.observedRoots.has(root)||(state.observer.observe(root===state.document?state.document.documentElement:root,mutationObserverOptions),state.observedRoots.add(root))}function startModalState(state){if(state.started)return;state.started=!0;const Observer=state.document.defaultView?.MutationObserver??MutationObserver;state.observer=new Observer(records=>handleMutations(state,records)),observeMutationRoot(state,state.document),state.unsubscribeStack=observeOverlayStack(state.document,snapshot=>{state.snapshot=snapshot,applyTopmostInert(state)})}function stopModalState(state){if(state.started){state.started=!1,state.unsubscribeStack?.(),state.unsubscribeStack=void 0;for(const[element,intended]of state.inerted)element.inert=intended;state.inerted.clear(),state.observer?.disconnect(),state.observer=void 0,state.observedRoots.clear(),state.pendingInertWrites.clear(),state.snapshot=EMPTY_STACK}}function stopModalStateIfIdle(state){state.registrations===0&&state.externalModalSuspensions.size===0&&stopModalState(state)}function retainModalState(doc){const state=modalStateFor(doc);state.registrations++,startModalState(state);let active=!0;return()=>{active&&(active=!1,state.registrations--,stopModalStateIfIdle(state))}}function setInertByManager(state,element,value){if(element.inert!==value){if(state.observer&&state.observedRoots.has(element.getRootNode())){let pending=state.pendingInertWrites.get(element);pending||(pending=[],state.pendingInertWrites.set(element,pending)),pending.push(value)}else state.pendingInertWrites.delete(element);element.inert=value}}function inertElement(state,element,desired){if(!("inert"in element)||element.localName==="dialog"&&element.matches(":modal")||isPageHelperRegion(element))return;const htmlElement=element;desired.add(htmlElement),state.inerted.has(htmlElement)||state.inerted.set(htmlElement,htmlElement.inert),setInertByManager(state,htmlElement,!0)}function pathParent(element){return element.assignedSlot??element.parentNode}function parentPathElement(parent){return parent.nodeType===Node.ELEMENT_NODE?parent:parent.host??null}function composedChildren(parent){return parent.localName==="slot"?parent.assignedElements({flatten:!0}):"children"in parent?Array.from(parent.children):[]}function isShadowRoot(node){return node.nodeType===11&&"host"in node}function addAllowedPath(allowed,host,doc){let current=host;for(;current&&current!==doc.body&&current!==doc.documentElement;){const parent=pathParent(current);if(!parent)break;let children=allowed.get(parent);children||(children=new Set,allowed.set(parent,children)),children.add(current),current=parentPathElement(parent)}}function modalAllowedRoot(entry,doc){const explicit=entry.modalRoot?.()??null;return explicit?.isConnected&&explicit.ownerDocument===doc?explicit:entry.host}function applyTopmostInert(state){let modalIndex=-1;for(let index=state.snapshot.entries.length-1;index>=0;index--)if(state.snapshot.entries[index]?.modal){modalIndex=index;break}const desired=new Set;if(state.allowedParents=new Set,state.externalModalSuspensions.size>0){const allowed=new Map;for(const suspension of state.externalModalSuspensions)addAllowedPath(allowed,suspension.root,state.document);inertOutsideAllowedPaths(state,allowed,desired)}else if(modalIndex!==-1){const allowed=new Map,interactiveRoots=[];for(const entry of state.snapshot.entries.slice(modalIndex)){if(!entry.host.isConnected||interactiveRoots.some(root=>composedContains(root,entry.host)))continue;const modalRoot=modalAllowedRoot(entry,state.document);addAllowedPath(allowed,modalRoot,state.document),interactiveRoots.push(modalRoot);for(const root of entry.auxiliaryRoots?.()??[])root.isConnected&&root.ownerDocument===state.document&&(addAllowedPath(allowed,root,state.document),interactiveRoots.push(root))}const nativeModal=getActiveNativeModal(state.document);nativeModal&&addAllowedPath(allowed,nativeModal,state.document),inertOutsideAllowedPaths(state,allowed,desired)}for(const[element,intended]of state.inerted)desired.has(element)||(setInertByManager(state,element,intended),state.inerted.delete(element))}function inertOutsideAllowedPaths(state,allowed,desired){for(const[parent,children]of allowed){state.allowedParents.add(parent),isShadowRoot(parent)&&observeMutationRoot(state,parent);for(const child of composedChildren(parent))children.has(child)||inertElement(state,child,desired)}}function activateOverlay(options){if(options.modal===!1&&options.trapFocus===!1&&!options.suspendWhenUnrendered&&!options.lockScroll)return activateNonmodalOverlay(options);const modal=options.modal!==!1;let releaseModalState,releaseScrollLock,renderedState,explicitlySuspended=!1;const coreHandle=activateOverlayStack({...options,initiallySuspended:options.suspendWhenUnrendered===!0,modal,trapFocus:options.trapFocus!==!1,onRegistered:doc=>{modal&&(releaseModalState=retainModalState(doc)),options.lockScroll&&(releaseScrollLock=lockScroll(doc))},onUnregistered:(_doc,deferResourceRelease)=>{const releaseModal=releaseModalState;releaseModalState=void 0;const release=releaseScrollLock;releaseScrollLock=void 0;const deferredRelease=release&&deferResourceRelease?release:void 0;return release&&!deferResourceRelease&&release(),releaseModal?.(),deferredRelease},onDeactivate:()=>renderedState?.stop()});return coreHandle.isActive()?(options.suspendWhenUnrendered&&(renderedState=new RenderedStateController(options.host,options.panel,rendered=>{if(!coreHandle.isActive())return;if(!rendered||explicitlySuspended){coreHandle.suspend();return}const wasTopmost=coreHandle.isTopmost();coreHandle.resume(),!wasTopmost&&coreHandle.isTopmost()&&queueMicrotask(()=>coreHandle.focusInitial())}),renderedState.start()),{focusInitial:()=>{renderedState?.check(),coreHandle.focusInitial()},focusAutofocus:()=>(renderedState?.check(),coreHandle.focusAutofocus()),updateRestoreFocusTo:target=>coreHandle.updateRestoreFocusTo(target),deactivate:deactivateOptions=>coreHandle.deactivate(deactivateOptions),suspend:()=>{explicitlySuspended=!0,coreHandle.suspend()},resume:()=>{explicitlySuspended=!1,!(renderedState&&!renderedState.check())&&coreHandle.resume()},isTopmost:()=>(renderedState?.check(),coreHandle.isTopmost()),isActive:()=>coreHandle.isActive(),dismissBackdrop:()=>(renderedState?.check(),coreHandle.dismissBackdrop())}):coreHandle}function suspendLyraModalsFor(externalModal){if(!externalModal.isConnected)return()=>{};const state=modalStateFor(externalModal.ownerDocument);startModalState(state);const entry={root:externalModal,active:!0,releaseRouting:()=>{},state};return state.externalModalSuspensions.add(entry),entry.releaseRouting=acquireOverlayRoutingSuspension(state.document),applyTopmostInert(state),()=>{entry.active&&(entry.active=!1,entry.state.externalModalSuspensions.delete(entry),entry.releaseRouting(),applyTopmostInert(entry.state),stopModalStateIfIdle(entry.state))}}import{collectAutofocusElements,collectFocusableElements,composedContains as composedContains2,deepActiveElement}from"./overlay-stack.js";export{activateOverlay,authoredOverlayInert,collectAutofocusElements,collectFocusableElements,composedContains2 as composedContains,deepActiveElement,suspendLyraModalsFor};
@@ -1 +1 @@
1
- const nextOrders=new WeakMap;function nextOrder(document){const order=nextOrders.get(document)??0;return nextOrders.set(document,order+1),order}function reserveOverlayOrder(document){let order=nextOrder(document);return destination=>{const reserved=destination===document?order:void 0;return order=void 0,reserved}}function takeOverlayOrder(document,reservation){return reservation?.(document)??nextOrder(document)}export{reserveOverlayOrder,takeOverlayOrder};
1
+ import{claimDocumentRuntime}from"./runtime-diagnostics.js";const nextOrders=new WeakMap;function nextOrder(document){const order=nextOrders.get(document)??0;return nextOrders.set(document,order+1),order}function reserveOverlayOrder(document){claimDocumentRuntime(document);let order=nextOrder(document);return destination=>{const reserved=destination===document?order:void 0;return order=void 0,reserved}}function takeOverlayOrder(document,reservation){return reservation?.(document)??nextOrder(document)}export{reserveOverlayOrder,takeOverlayOrder};
@@ -1 +1 @@
1
- import{getActiveNativeModal}from"./native-modal-context.js";import{takeOverlayOrder}from"./overlay-order.js";import{deepActiveElementIn}from"./active-element.js";import{composedContains,flattenedParentElement}from"./composed-tree.js";import{scheduleDeferredFocusReturn,cancelDeferredFocusReturn}from"./deferred-focus-return.js";import{collectComposedAutofocusElements,collectComposedFocusTargets,isComposedFocusAvailable}from"./focus-navigation.js";import{isHtmlElement}from"./dom-guards.js";import{leaseInlineStyleProperty}from"./style-property-lease.js";const STACK_PROPERTY="--lr-overlay-stack-index",STACK_BASE=1e3,STACK_STEP=2,states=new WeakMap,hostEntries=new WeakMap;function createInactiveOverlayHandle(){return{focusInitial:()=>{},focusAutofocus:()=>!1,updateRestoreFocusTo:()=>{},deactivate:()=>{},suspend:()=>{},resume:()=>{},isTopmost:()=>!1,isActive:()=>!1,dismissBackdrop:()=>!1}}function deepActiveElement(doc=typeof document>"u"?void 0:document){return deepActiveElementIn(doc)}function collectFocusableElements(root){return collectComposedFocusTargets(root).elements}function collectAutofocusElements(root){return collectComposedAutofocusElements(root).elements}function tryFocus(target){if(!target||!isComposedFocusAvailable(target))return!1;target.focus();const active=deepActiveElement(target.ownerDocument);return active===target||composedContains(target,active)}function focusAutofocusTarget(panel){for(const candidate of collectAutofocusElements(panel)){if(tryFocus(candidate))return!0;for(const inner of collectFocusableElements(candidate))if(tryFocus(inner))return!0}return!1}function auxiliaryRoots(entry){const panel=entry.options.panel();return[...new Set(entry.options.auxiliaryRoots?.()??[])].filter(root=>root.isConnected&&root.ownerDocument===entry.state.document&&(!panel||!composedContains(panel,root)))}function entryContainsFocus(entry,panel,active){return entry.options.auxiliaryRoots?active!==null&&isComposedFocusAvailable(active)&&[panel,...auxiliaryRoots(entry)].some(root=>composedContains(root,active)):composedContains(panel,active)}function entryTabStops(entry,panel){const roots=entry.options.auxiliaryRoots?[panel,...auxiliaryRoots(entry)]:[panel];return[...new Set(roots.flatMap(root=>collectComposedFocusTargets(root,{browserTabOrder:!0}).elements))]}function composedPath(element){const path=[];for(let current=element;current;current=flattenedParentElement(current))path.unshift(current);return path}function precedes(first,second){let index=0;for(;first[index]&&first[index]===second[index];)index+=1;return first[index]?!!(second[index]&&first[index].compareDocumentPosition(second[index])&4):!!second[index]}function focusEntry(entry,preserveCurrent=!0){const panel=entry.options.panel();if(!panel)return;const active=deepActiveElement(entry.state.document);if(preserveCurrent&&entryContainsFocus(entry,panel,active)||(entry.initialFocusDecision===void 0&&(entry.initialFocusDecision=entry.options.beforeInitialFocus?.()!==!1),!entry.initialFocusDecision)||focusAutofocusTarget(panel))return;const preferred=entry.options.preferredInitialFocus?.()??null;if(!(preferred&&composedContains(panel,preferred)&&tryFocus(preferred))){for(const target of collectFocusableElements(panel))if(tryFocus(target))return;panel.focus()}}function handleTab(state,entry,event){const panel=entry.options.panel();if(!panel)return;const focusable=entryTabStops(entry,panel);if(focusable.length===0){event.preventDefault(),panel.focus();return}const active=deepActiveElement(state.document),first=focusable[0],last=focusable[focusable.length-1],activeIndex=active?focusable.indexOf(active):-1;if(activeIndex===-1){let target;const roots=entry.options.auxiliaryRoots?[panel,...auxiliaryRoots(entry)]:[panel];if(active&&roots.some(root=>composedContains(root,active))){const activePath=composedPath(active);if(event.shiftKey)for(let index=focusable.length-1;index>=0&&!target;index-=1)precedes(composedPath(focusable[index]),activePath)&&(target=focusable[index]);else target=focusable.find(stop=>precedes(activePath,composedPath(stop)));if(target&&target.tabIndex>=0&&!entry.options.auxiliaryRoots)return}event.preventDefault(),(target??(event.shiftKey?last:first)).focus()}else if(event.shiftKey&&active===first)event.preventDefault(),last.focus();else if(!event.shiftKey&&active===last)event.preventDefault(),first.focus();else{const next=focusable[activeIndex+(event.shiftKey?-1:1)];next&&(next.tabIndex<0||auxiliaryRoots(entry).length>0)&&(event.preventDefault(),next.focus())}}function nearestTrappingEntryBelowTop(state){for(let index=state.stack.length-2;index>=0;index-=1){const entry=state.stack[index];if(entry&&entry.options.trapFocus!==!1)return entry}}function snapshotFor(state){return{entries:state.stack.map(entry=>({host:entry.options.host,order:entry.stackOrder,modal:entry.options.modal,modalRoot:entry.options.modalRoot,auxiliaryRoots:entry.options.auxiliaryRoots}))}}function notifyStackObservers(state){if(state.observers.size===0)return;const snapshot=snapshotFor(state);for(const observer of state.observers)observer(snapshot)}function startState(state){state.started||(state.started=!0,state.document.addEventListener("keydown",state.onKeyDown))}function stopState(state){state.started&&(state.started=!1,state.document.removeEventListener("keydown",state.onKeyDown))}function stopStateIfIdle(state){state.stack.length===0&&stopState(state)}function createState(doc){const state={};return state.document=doc,state.stack=[],state.routingSuspensions=new Set,state.observers=new Set,state.started=!1,state.onKeyDown=event=>{if(event.defaultPrevented||event.isComposing||event.keyCode===229||state.routingSuspensions.size>0)return;const entry=state.stack[state.stack.length-1];if(!entry||event.key!=="Escape"&&event.key!=="Tab")return;const nativeModal=getActiveNativeModal(doc),panel=entry.options.panel();if(!(nativeModal&&(!panel||!composedContains(nativeModal,panel)))){if(event.key==="Escape")event.preventDefault(),entry.options.onEscape();else if(event.key==="Tab"){if(entry.options.trapFocus!==!1){handleTab(state,entry,event);return}entry.options.onTab?.();const trapping=nearestTrappingEntryBelowTop(state),trappingPanel=trapping?.options.panel();trapping&&trappingPanel&&!event.defaultPrevented&&(!nativeModal||composedContains(nativeModal,trappingPanel))&&entryContainsFocus(trapping,trappingPanel,deepActiveElement(doc))&&handleTab(state,trapping,event)}}},states.set(doc,state),state}function stateFor(doc){return states.get(doc)??createState(doc)}function observeOverlayStack(doc,observer){const state=stateFor(doc);return state.observers.add(observer),observer(snapshotFor(state)),()=>{state.observers.delete(observer)}}function acquireOverlayRoutingSuspension(doc){const state=stateFor(doc),token=Symbol();let active=!0;return state.routingSuspensions.add(token),()=>{active&&(active=!1,state.routingSuspensions.delete(token))}}function restoreStackStyle(entry){entry.stackStyleLease?.release(),entry.stackStyleLease=void 0}function updateStackStyles(state){state.stack.forEach((entry,index)=>{const value=String(STACK_BASE+index*STACK_STEP);entry.stackStyleLease?entry.stackStyleLease.set(value):entry.stackStyleLease=leaseInlineStyleProperty(entry.options.host,STACK_PROPERTY,value)})}function registerEntry(entry,state,preserveStackOrder=!1){if(entry.registered)return;startState(state),(!preserveStackOrder||entry.state!==state)&&(entry.stackOrder=takeOverlayOrder(state.document)),entry.state=state,entry.registered=!0,entry.options.onRegistered?.(state.document);const nextIndex=state.stack.findIndex(candidate=>candidate.stackOrder>entry.stackOrder);nextIndex===-1?state.stack.push(entry):state.stack.splice(nextIndex,0,entry),updateStackStyles(state),notifyStackObservers(state)}function unregisterEntry(entry,deferResourceRelease=!1){if(!entry.registered){const hasHigherEntry=entry.state.stack.some(candidate=>candidate.stackOrder>entry.stackOrder);return entry.state.routingSuspensions.size===0&&entry.wasTopmostOnSuspend&&!hasHigherEntry}const state=entry.state,index=state.stack.indexOf(entry),wasTopmost=state.routingSuspensions.size===0&&index===state.stack.length-1;return index!==-1&&state.stack.splice(index,1),entry.registered=!1,entry.wasTopmostOnSuspend=wasTopmost,entry.deferredResourceRelease=entry.options.onUnregistered?.(state.document,deferResourceRelease),restoreStackStyle(entry),updateStackStyles(state),notifyStackObservers(state),stopStateIfIdle(state),wasTopmost}function syncEntryRegistration(entry){if(!entry.active||entry.manuallySuspended){unregisterEntry(entry);return}const state=stateFor(entry.options.host.ownerDocument);registerEntry(entry,state,entry.state===state)}function validRestoreFocusElement(value,doc){return isHtmlElement(value)&&value.ownerDocument===doc?value:null}function resolveRestoreFocusTarget(entry){const source=entry.restoreFocusTo;if(typeof source!="function")return validRestoreFocusElement(source,entry.state.document);try{return validRestoreFocusElement(source(),entry.state.document)}catch{return null}}function rebaseReturnTargets(entry){for(const candidate of entry.state.stack){if(candidate===entry||candidate.stackOrder<=entry.stackOrder)continue;const candidateTarget=typeof candidate.restoreFocusTo=="function"?null:validRestoreFocusElement(candidate.restoreFocusTo,entry.state.document);candidateTarget&&composedContains(entry.options.host,candidateTarget)&&(candidate.restoreFocusTo=entry.restoreFocusTo)}}function restoreEntryFocus(entry){if(tryFocus(resolveRestoreFocusTarget(entry)))return;const next=entry.state.stack[entry.state.stack.length-1];next&&focusEntry(next,!1)}function deactivateEntry(entry,restoreFocus,deferResourceRelease=!1){if(!entry.active)return;const host=entry.options.host;cancelDeferredFocusReturn(host);const release=deactivateActiveEntry(entry,restoreFocus,deferResourceRelease);if(restoreFocus){const pass=entry.options.deferredReturn?.();pass&&scheduleDeferredFocusReturn({...pass,host})}return release}function deactivateActiveEntry(entry,restoreFocus,deferResourceRelease){const heldFocus=panelHoldsFocus(entry);rebaseReturnTargets(entry);const wasTopmost=unregisterEntry(entry,deferResourceRelease),deferredResourceRelease=entry.deferredResourceRelease;if(entry.deferredResourceRelease=void 0,entry.active=!1,entry.manuallySuspended=!1,entry.suspendGeneration++,entry.options.onDeactivate?.(),hostEntries.get(entry.options.host)===entry&&hostEntries.delete(entry.options.host),!wasTopmost)return deferredResourceRelease;if(restoreFocus)return restoreEntryFocus(entry),deferredResourceRelease;const next=entry.state.stack[entry.state.stack.length-1];if(!next)return deferredResourceRelease;if(heldFocus)focusEntry(next);else if(next.options.trapFocus){const doc=entry.state.document,active=deepActiveElement(doc);!entry.options.host.isConnected||active&&active!==doc.body&&active!==doc.documentElement?focusEntry(next):setTimeout(()=>{next.active&&next.registered&&entry.state.stack[entry.state.stack.length-1]===next&&focusEntry(next)},0)}return deferredResourceRelease}function panelHoldsFocus(entry){const panel=entry.options.panel();return panel!==null&&entryContainsFocus(entry,panel,deepActiveElement(entry.state.document))}function activateOverlayStack(options){cancelDeferredFocusReturn(options.host);const previous=hostEntries.get(options.host),inheritedReturnTarget=previous?.active?previous.restoreFocusTo:void 0;previous?.active&&previous.handle.deactivate({restoreFocus:!1});const doc=options.host.ownerDocument;if(!doc)return createInactiveOverlayHandle();const active=deepActiveElement(doc),captured=active&&typeof active.focus=="function"?active:null,entry={};return entry.options=options,entry.restoreFocusTo=options.restoreFocusTo!==void 0?options.restoreFocusTo:inheritedReturnTarget??captured,entry.active=!0,entry.registered=!1,entry.manuallySuspended=options.initiallySuspended===!0,entry.initialFocusDecision=void 0,entry.wasTopmostOnSuspend=!1,entry.suspendGeneration=0,entry.state=stateFor(doc),entry.stackOrder=takeOverlayOrder(doc,options.orderReservation),entry.handle={focusInitial:()=>{entry.active&&entry.registered&&entry.state.routingSuspensions.size===0&&entry.state.stack[entry.state.stack.length-1]===entry&&focusEntry(entry)},focusAutofocus:()=>{if(!entry.active||!entry.registered||entry.state.routingSuspensions.size>0)return!1;const panel=entry.options.panel();if(!panel)return!1;const active2=deepActiveElement(entry.state.document);return entryContainsFocus(entry,panel,active2)?!1:focusAutofocusTarget(panel)},updateRestoreFocusTo:target=>{entry.active&&(entry.restoreFocusTo=target)},deactivate:(deactivateOptions={})=>deactivateEntry(entry,deactivateOptions.restoreFocus!==!1,deactivateOptions.deferScrollLockRelease===!0),suspend:()=>{if(!entry.active||entry.manuallySuspended)return;entry.manuallySuspended=!0,syncEntryRegistration(entry);const generation=++entry.suspendGeneration;queueMicrotask(()=>{entry.active&&!entry.registered&&entry.suspendGeneration===generation&&!entry.options.host.isConnected&&deactivateEntry(entry,!0)})},resume:()=>{!entry.active||!entry.manuallySuspended||(entry.suspendGeneration++,entry.manuallySuspended=!1,syncEntryRegistration(entry))},isTopmost:()=>entry.active&&entry.registered&&entry.state.routingSuspensions.size===0&&entry.state.stack[entry.state.stack.length-1]===entry,isActive:()=>entry.active,dismissBackdrop:()=>!entry.handle.isTopmost()||!entry.options.onBackdrop?!1:(entry.options.onBackdrop(),!0)},hostEntries.set(options.host,entry),entry.manuallySuspended||registerEntry(entry,entry.state,!0),entry.handle}export{acquireOverlayRoutingSuspension,activateOverlayStack,collectAutofocusElements,collectFocusableElements,composedContains,deepActiveElement,observeOverlayStack};
1
+ import{claimDocumentRuntime}from"./runtime-diagnostics.js";import{getActiveNativeModal}from"./native-modal-context.js";import{takeOverlayOrder}from"./overlay-order.js";import{deepActiveElementIn}from"./active-element.js";import{composedContains,flattenedParentElement}from"./composed-tree.js";import{scheduleDeferredFocusReturn,cancelDeferredFocusReturn}from"./deferred-focus-return.js";import{collectComposedAutofocusElements,collectComposedFocusTargets,isComposedFocusAvailable}from"./focus-navigation.js";import{isHtmlElement}from"./dom-guards.js";import{leaseInlineStyleProperty}from"./style-property-lease.js";const STACK_PROPERTY="--lr-overlay-stack-index",STACK_BASE=1e3,STACK_STEP=2,states=new WeakMap,hostEntries=new WeakMap;function createInactiveOverlayHandle(){return{focusInitial:()=>{},focusAutofocus:()=>!1,updateRestoreFocusTo:()=>{},deactivate:()=>{},suspend:()=>{},resume:()=>{},isTopmost:()=>!1,isActive:()=>!1,dismissBackdrop:()=>!1}}function deepActiveElement(doc=typeof document>"u"?void 0:document){return deepActiveElementIn(doc)}function collectFocusableElements(root){return collectComposedFocusTargets(root).elements}function collectAutofocusElements(root){return collectComposedAutofocusElements(root).elements}function tryFocus(target){if(!target||!isComposedFocusAvailable(target))return!1;target.focus();const active=deepActiveElement(target.ownerDocument);return active===target||composedContains(target,active)}function focusAutofocusTarget(panel){for(const candidate of collectAutofocusElements(panel)){if(tryFocus(candidate))return!0;for(const inner of collectFocusableElements(candidate))if(tryFocus(inner))return!0}return!1}function auxiliaryRoots(entry){const panel=entry.options.panel();return[...new Set(entry.options.auxiliaryRoots?.()??[])].filter(root=>root.isConnected&&root.ownerDocument===entry.state.document&&(!panel||!composedContains(panel,root)))}function entryContainsFocus(entry,panel,active){return entry.options.auxiliaryRoots?active!==null&&isComposedFocusAvailable(active)&&[panel,...auxiliaryRoots(entry)].some(root=>composedContains(root,active)):composedContains(panel,active)}function entryTabStops(entry,panel){const roots=entry.options.auxiliaryRoots?[panel,...auxiliaryRoots(entry)]:[panel];return[...new Set(roots.flatMap(root=>collectComposedFocusTargets(root,{browserTabOrder:!0}).elements))]}function composedPath(element){const path=[];for(let current=element;current;current=flattenedParentElement(current))path.unshift(current);return path}function precedes(first,second){let index=0;for(;first[index]&&first[index]===second[index];)index+=1;return first[index]?!!(second[index]&&first[index].compareDocumentPosition(second[index])&4):!!second[index]}function focusEntry(entry,preserveCurrent=!0){const panel=entry.options.panel();if(!panel)return;const active=deepActiveElement(entry.state.document);if(preserveCurrent&&entryContainsFocus(entry,panel,active)||(entry.initialFocusDecision===void 0&&(entry.initialFocusDecision=entry.options.beforeInitialFocus?.()!==!1),!entry.initialFocusDecision)||focusAutofocusTarget(panel))return;const preferred=entry.options.preferredInitialFocus?.()??null;if(!(preferred&&composedContains(panel,preferred)&&tryFocus(preferred))){for(const target of collectFocusableElements(panel))if(tryFocus(target))return;panel.focus()}}function handleTab(state,entry,event){const panel=entry.options.panel();if(!panel)return;const focusable=entryTabStops(entry,panel);if(focusable.length===0){event.preventDefault(),panel.focus();return}const active=deepActiveElement(state.document),first=focusable[0],last=focusable[focusable.length-1],activeIndex=active?focusable.indexOf(active):-1;if(activeIndex===-1){let target;const roots=entry.options.auxiliaryRoots?[panel,...auxiliaryRoots(entry)]:[panel];if(active&&roots.some(root=>composedContains(root,active))){const activePath=composedPath(active);if(event.shiftKey)for(let index=focusable.length-1;index>=0&&!target;index-=1)precedes(composedPath(focusable[index]),activePath)&&(target=focusable[index]);else target=focusable.find(stop=>precedes(activePath,composedPath(stop)));if(target&&target.tabIndex>=0&&!entry.options.auxiliaryRoots)return}event.preventDefault(),(target??(event.shiftKey?last:first)).focus()}else if(event.shiftKey&&active===first)event.preventDefault(),last.focus();else if(!event.shiftKey&&active===last)event.preventDefault(),first.focus();else{const next=focusable[activeIndex+(event.shiftKey?-1:1)];next&&(next.tabIndex<0||auxiliaryRoots(entry).length>0)&&(event.preventDefault(),next.focus())}}function nearestTrappingEntryBelowTop(state){for(let index=state.stack.length-2;index>=0;index-=1){const entry=state.stack[index];if(entry&&entry.options.trapFocus!==!1)return entry}}function snapshotFor(state){return{entries:state.stack.map(entry=>({host:entry.options.host,order:entry.stackOrder,modal:entry.options.modal,modalRoot:entry.options.modalRoot,auxiliaryRoots:entry.options.auxiliaryRoots}))}}function notifyStackObservers(state){if(state.observers.size===0)return;const snapshot=snapshotFor(state);for(const observer of state.observers)observer(snapshot)}function startState(state){state.started||(state.started=!0,state.document.addEventListener("keydown",state.onKeyDown))}function stopState(state){state.started&&(state.started=!1,state.document.removeEventListener("keydown",state.onKeyDown))}function stopStateIfIdle(state){state.stack.length===0&&stopState(state)}function createState(doc){const state={};return state.document=doc,state.stack=[],state.routingSuspensions=new Set,state.observers=new Set,state.started=!1,state.onKeyDown=event=>{if(event.defaultPrevented||event.isComposing||event.keyCode===229||state.routingSuspensions.size>0)return;const entry=state.stack[state.stack.length-1];if(!entry||event.key!=="Escape"&&event.key!=="Tab")return;const nativeModal=getActiveNativeModal(doc),panel=entry.options.panel();if(!(nativeModal&&(!panel||!composedContains(nativeModal,panel)))){if(event.key==="Escape")event.preventDefault(),entry.options.onEscape();else if(event.key==="Tab"){if(entry.options.trapFocus!==!1){handleTab(state,entry,event);return}entry.options.onTab?.();const trapping=nearestTrappingEntryBelowTop(state),trappingPanel=trapping?.options.panel();trapping&&trappingPanel&&!event.defaultPrevented&&(!nativeModal||composedContains(nativeModal,trappingPanel))&&entryContainsFocus(trapping,trappingPanel,deepActiveElement(doc))&&handleTab(state,trapping,event)}}},states.set(doc,state),state}function stateFor(doc){return claimDocumentRuntime(doc),states.get(doc)??createState(doc)}function observeOverlayStack(doc,observer){const state=stateFor(doc);return state.observers.add(observer),observer(snapshotFor(state)),()=>{state.observers.delete(observer)}}function acquireOverlayRoutingSuspension(doc){const state=stateFor(doc),token=Symbol();let active=!0;return state.routingSuspensions.add(token),()=>{active&&(active=!1,state.routingSuspensions.delete(token))}}function restoreStackStyle(entry){entry.stackStyleLease?.release(),entry.stackStyleLease=void 0}function updateStackStyles(state){state.stack.forEach((entry,index)=>{const value=String(STACK_BASE+index*STACK_STEP);entry.stackStyleLease?entry.stackStyleLease.set(value):entry.stackStyleLease=leaseInlineStyleProperty(entry.options.host,STACK_PROPERTY,value)})}function registerEntry(entry,state,preserveStackOrder=!1){if(entry.registered)return;startState(state),(!preserveStackOrder||entry.state!==state)&&(entry.stackOrder=takeOverlayOrder(state.document)),entry.state=state,entry.registered=!0,entry.options.onRegistered?.(state.document);const nextIndex=state.stack.findIndex(candidate=>candidate.stackOrder>entry.stackOrder);nextIndex===-1?state.stack.push(entry):state.stack.splice(nextIndex,0,entry),updateStackStyles(state),notifyStackObservers(state)}function unregisterEntry(entry,deferResourceRelease=!1){if(!entry.registered){const hasHigherEntry=entry.state.stack.some(candidate=>candidate.stackOrder>entry.stackOrder);return entry.state.routingSuspensions.size===0&&entry.wasTopmostOnSuspend&&!hasHigherEntry}const state=entry.state,index=state.stack.indexOf(entry),wasTopmost=state.routingSuspensions.size===0&&index===state.stack.length-1;return index!==-1&&state.stack.splice(index,1),entry.registered=!1,entry.wasTopmostOnSuspend=wasTopmost,entry.deferredResourceRelease=entry.options.onUnregistered?.(state.document,deferResourceRelease),restoreStackStyle(entry),updateStackStyles(state),notifyStackObservers(state),stopStateIfIdle(state),wasTopmost}function syncEntryRegistration(entry){if(!entry.active||entry.manuallySuspended){unregisterEntry(entry);return}const state=stateFor(entry.options.host.ownerDocument);registerEntry(entry,state,entry.state===state)}function validRestoreFocusElement(value,doc){return isHtmlElement(value)&&value.ownerDocument===doc?value:null}function resolveRestoreFocusTarget(entry){const source=entry.restoreFocusTo;if(typeof source!="function")return validRestoreFocusElement(source,entry.state.document);try{return validRestoreFocusElement(source(),entry.state.document)}catch{return null}}function rebaseReturnTargets(entry){for(const candidate of entry.state.stack){if(candidate===entry||candidate.stackOrder<=entry.stackOrder)continue;const candidateTarget=typeof candidate.restoreFocusTo=="function"?null:validRestoreFocusElement(candidate.restoreFocusTo,entry.state.document);candidateTarget&&composedContains(entry.options.host,candidateTarget)&&(candidate.restoreFocusTo=entry.restoreFocusTo)}}function restoreEntryFocus(entry){if(tryFocus(resolveRestoreFocusTarget(entry)))return;const next=entry.state.stack[entry.state.stack.length-1];next&&focusEntry(next,!1)}function deactivateEntry(entry,restoreFocus,deferResourceRelease=!1){if(!entry.active)return;const host=entry.options.host;cancelDeferredFocusReturn(host);const release=deactivateActiveEntry(entry,restoreFocus,deferResourceRelease);if(restoreFocus){const pass=entry.options.deferredReturn?.();pass&&scheduleDeferredFocusReturn({...pass,host})}return release}function deactivateActiveEntry(entry,restoreFocus,deferResourceRelease){const heldFocus=panelHoldsFocus(entry);rebaseReturnTargets(entry);const wasTopmost=unregisterEntry(entry,deferResourceRelease),deferredResourceRelease=entry.deferredResourceRelease;if(entry.deferredResourceRelease=void 0,entry.active=!1,entry.manuallySuspended=!1,entry.suspendGeneration++,entry.options.onDeactivate?.(),hostEntries.get(entry.options.host)===entry&&hostEntries.delete(entry.options.host),!wasTopmost)return deferredResourceRelease;if(restoreFocus)return restoreEntryFocus(entry),deferredResourceRelease;const next=entry.state.stack[entry.state.stack.length-1];if(!next)return deferredResourceRelease;if(heldFocus)focusEntry(next);else if(next.options.trapFocus){const doc=entry.state.document,active=deepActiveElement(doc);!entry.options.host.isConnected||active&&active!==doc.body&&active!==doc.documentElement?focusEntry(next):setTimeout(()=>{next.active&&next.registered&&entry.state.stack[entry.state.stack.length-1]===next&&focusEntry(next)},0)}return deferredResourceRelease}function panelHoldsFocus(entry){const panel=entry.options.panel();return panel!==null&&entryContainsFocus(entry,panel,deepActiveElement(entry.state.document))}function activateOverlayStack(options){cancelDeferredFocusReturn(options.host);const previous=hostEntries.get(options.host),inheritedReturnTarget=previous?.active?previous.restoreFocusTo:void 0;previous?.active&&previous.handle.deactivate({restoreFocus:!1});const doc=options.host.ownerDocument;if(!doc)return createInactiveOverlayHandle();const active=deepActiveElement(doc),captured=active&&typeof active.focus=="function"?active:null,entry={};return entry.options=options,entry.restoreFocusTo=options.restoreFocusTo!==void 0?options.restoreFocusTo:inheritedReturnTarget??captured,entry.active=!0,entry.registered=!1,entry.manuallySuspended=options.initiallySuspended===!0,entry.initialFocusDecision=void 0,entry.wasTopmostOnSuspend=!1,entry.suspendGeneration=0,entry.state=stateFor(doc),entry.stackOrder=takeOverlayOrder(doc,options.orderReservation),entry.handle={focusInitial:()=>{entry.active&&entry.registered&&entry.state.routingSuspensions.size===0&&entry.state.stack[entry.state.stack.length-1]===entry&&focusEntry(entry)},focusAutofocus:()=>{if(!entry.active||!entry.registered||entry.state.routingSuspensions.size>0)return!1;const panel=entry.options.panel();if(!panel)return!1;const active2=deepActiveElement(entry.state.document);return entryContainsFocus(entry,panel,active2)?!1:focusAutofocusTarget(panel)},updateRestoreFocusTo:target=>{entry.active&&(entry.restoreFocusTo=target)},deactivate:(deactivateOptions={})=>deactivateEntry(entry,deactivateOptions.restoreFocus!==!1,deactivateOptions.deferScrollLockRelease===!0),suspend:()=>{if(!entry.active||entry.manuallySuspended)return;entry.manuallySuspended=!0,syncEntryRegistration(entry);const generation=++entry.suspendGeneration;queueMicrotask(()=>{entry.active&&!entry.registered&&entry.suspendGeneration===generation&&!entry.options.host.isConnected&&deactivateEntry(entry,!0)})},resume:()=>{!entry.active||!entry.manuallySuspended||(entry.suspendGeneration++,entry.manuallySuspended=!1,syncEntryRegistration(entry))},isTopmost:()=>entry.active&&entry.registered&&entry.state.routingSuspensions.size===0&&entry.state.stack[entry.state.stack.length-1]===entry,isActive:()=>entry.active,dismissBackdrop:()=>!entry.handle.isTopmost()||!entry.options.onBackdrop?!1:(entry.options.onBackdrop(),!0)},hostEntries.set(options.host,entry),entry.manuallySuspended||registerEntry(entry,entry.state,!0),entry.handle}export{acquireOverlayRoutingSuspension,activateOverlayStack,collectAutofocusElements,collectFocusableElements,composedContains,deepActiveElement,observeOverlayStack};
@@ -1 +1 @@
1
- const LYRA_PACKAGE_NAME="@aceshooting/lyra-ui",LYRA_PACKAGE_VERSION="30.9.0";export{LYRA_PACKAGE_NAME,LYRA_PACKAGE_VERSION};
1
+ const LYRA_PACKAGE_NAME="@aceshooting/lyra-ui",LYRA_PACKAGE_VERSION="31.1.1";export{LYRA_PACKAGE_NAME,LYRA_PACKAGE_VERSION};
@@ -0,0 +1 @@
1
+ import{LYRA_PACKAGE_NAME,LYRA_PACKAGE_VERSION}from"./package-metadata.js";const markerKey=Symbol.for("@aceshooting/lyra-ui.document-runtime-diagnostics.v1"),runtimeToken=Symbol(),claimedDocuments=new WeakSet;function warn(message){try{console.warn(message)}catch{}}function unavailable(){warn(`[lr-runtime-diagnostic-unavailable] Cannot check ${LYRA_PACKAGE_NAME} runtime copies in this document. Resolve all public imports and lazy chunks from one application package context; overlay coordination still requires one runtime.`)}function claimDocumentRuntime(document){if(!claimedDocuments.has(document)){claimedDocuments.add(document);try{const descriptor=Object.getOwnPropertyDescriptor(document,markerKey);if(!descriptor){const marker2=Object.preventExtensions(Object.defineProperties(Object.create(null),{schema:{value:1},token:{value:runtimeToken},version:{value:LYRA_PACKAGE_VERSION},warned:{value:!1,writable:!0}}));Object.defineProperty(document,markerKey,{value:marker2});return}const marker=descriptor.value;if(!("value"in descriptor)||descriptor.configurable||descriptor.writable||descriptor.enumerable||marker===null||typeof marker!="object"){unavailable();return}const schema=Object.getOwnPropertyDescriptor(marker,"schema"),token=Object.getOwnPropertyDescriptor(marker,"token"),version=Object.getOwnPropertyDescriptor(marker,"version"),warned=Object.getOwnPropertyDescriptor(marker,"warned"),immutable=field=>!!field&&"value"in field&&!field.writable&&!field.configurable;if(!immutable(schema)||schema?.value!==1||!immutable(token)||typeof token?.value!="symbol"||!immutable(version)||typeof version?.value!="string"||!/^[\dA-Za-z.+-]{1,128}$/u.test(version.value)||!warned||!("value"in warned)||typeof warned.value!="boolean"||!warned.writable||warned.configurable||Object.isExtensible(marker)){unavailable();return}if(token.value===runtimeToken||warned.value)return;Object.defineProperty(marker,"warned",{value:!0}),warn(`[lr-runtime-duplicate] Multiple ${LYRA_PACKAGE_NAME} runtime copies are active in one document (versions: ${version.value}, ${LYRA_PACKAGE_VERSION}). Overlay coordination requires one application-owned runtime. Resolve all ${LYRA_PACKAGE_NAME} public imports, including lazy chunks, from the same application package context; matching versions alone is insufficient. See the imports and registration guide.`)}catch{unavailable()}}}export{claimDocumentRuntime};
@@ -1 +1 @@
1
- const SAFE_RESOURCE_SCHEMES=new Set(["http:","https:","blob:","data:"]),SAFE_DOWNLOAD_SCHEMES=new Set(["http:","https:","blob:"]),SAFE_LINK_SCHEMES=new Set(["http:","https:","blob:","mailto:"]),PARSE_BASE="https://lyra.invalid/";function safeUrlOrNull(url,allowedSchemes,URLCtor){if(typeof url!="string")return null;const trimmed=url.trim();if(trimmed==="")return null;try{const protocol=new URLCtor(trimmed,PARSE_BASE).protocol;return allowedSchemes.has(protocol)?trimmed:null}catch{return null}}function safeMediaSrc(url,URLCtor=URL){return safeUrlOrNull(url,SAFE_RESOURCE_SCHEMES,URLCtor)}function safeFetchUrl(url,URLCtor=URL){return safeUrlOrNull(url,SAFE_RESOURCE_SCHEMES,URLCtor)}function safeLinkHref(url,URLCtor=URL){return safeUrlOrNull(url,SAFE_LINK_SCHEMES,URLCtor)}function safeDownloadHref(url,URLCtor=URL){return safeUrlOrNull(url,SAFE_DOWNLOAD_SCHEMES,URLCtor)}const SAFE_DOCUMENT_NAVIGATION_SCHEMES=new Set(["http:","https:"]);function safeDocumentNavigationUrl(url,URLCtor=URL){return safeUrlOrNull(url,SAFE_DOCUMENT_NAVIGATION_SCHEMES,URLCtor)}function safeFrameSrc(url,URLCtor=URL){return safeDocumentNavigationUrl(url,URLCtor)}export{safeDocumentNavigationUrl,safeDownloadHref,safeFetchUrl,safeFrameSrc,safeLinkHref,safeMediaSrc};
1
+ const SAFE_RESOURCE_SCHEMES=new Set(["http:","https:","blob:","data:"]),SAFE_DOWNLOAD_SCHEMES=new Set(["http:","https:","blob:"]),SAFE_LINK_SCHEMES=new Set(["http:","https:","blob:","mailto:"]),PARSE_BASE="https://lyra.invalid/";function safeUrlOrNull(url,allowedSchemes,URLCtor){if(typeof url!="string")return null;const trimmed=url.trim();if(trimmed==="")return null;try{const protocol=new URLCtor(trimmed,PARSE_BASE).protocol;return allowedSchemes.has(protocol)?trimmed:null}catch{return null}}function safeMediaSrc(url,URLCtor=URL){return safeUrlOrNull(url,SAFE_RESOURCE_SCHEMES,URLCtor)}function safeFetchUrl(url,URLCtor=URL){return safeUrlOrNull(url,SAFE_RESOURCE_SCHEMES,URLCtor)}function safeLinkHref(url,URLCtor=URL){return safeUrlOrNull(url,SAFE_LINK_SCHEMES,URLCtor)}function safeDownloadHref(url,URLCtor=URL){return safeUrlOrNull(url,SAFE_DOWNLOAD_SCHEMES,URLCtor)}const SAFE_ACTION_LINK_SCHEMES=new Set([...SAFE_LINK_SCHEMES,"tel:","sms:"]);function safeActionLinkHref(url,URLCtor=URL){return safeUrlOrNull(url,SAFE_ACTION_LINK_SCHEMES,URLCtor)}const SAFE_DOCUMENT_NAVIGATION_SCHEMES=new Set(["http:","https:"]);function safeDocumentNavigationUrl(url,URLCtor=URL){return safeUrlOrNull(url,SAFE_DOCUMENT_NAVIGATION_SCHEMES,URLCtor)}function safeFrameSrc(url,URLCtor=URL){return safeDocumentNavigationUrl(url,URLCtor)}const RELATIVE_LINK_TOKEN="relative";function parseLinkSchemes(value){if(value==null)return null;const allowed=new Set;for(const raw of String(value).split(/[\s,]+/)){const token=raw.trim().toLowerCase().replace(/:$/,"");token===RELATIVE_LINK_TOKEN?allowed.add(RELATIVE_LINK_TOKEN):token!==""&&SAFE_LINK_SCHEMES.has(`${token}:`)&&allowed.add(`${token}:`)}return allowed}function safeLinkHrefWithin(url,allowed,URLCtor=URL){const safe=safeUrlOrNull(url,SAFE_LINK_SCHEMES,URLCtor);if(safe===null)return null;let protocol;try{protocol=new URLCtor(safe).protocol}catch{protocol=null}return protocol===null?allowed.has(RELATIVE_LINK_TOKEN)?safe:null:allowed.has(protocol)?safe:null}export{parseLinkSchemes,safeActionLinkHref,safeDocumentNavigationUrl,safeDownloadHref,safeFetchUrl,safeFrameSrc,safeLinkHref,safeLinkHrefWithin,safeMediaSrc};
@@ -1 +1 @@
1
- const scopedDefinitionClosures=Object.freeze({"lr-accordion":["lr-accordion"],"lr-accordion-item":["lr-accordion-item"],"lr-activity-feed":["lr-activity-feed","lr-live-region","lr-virtual-list"],"lr-agent-eval-dashboard":["lr-agent-eval-dashboard","lr-badge","lr-lite-chart","lr-live-region","lr-stat"],"lr-agent-question":["lr-agent-question","lr-number-input","lr-option","lr-select","lr-tool-param-form"],"lr-agent-run":["lr-agent-run","lr-badge","lr-empty","lr-generation-metrics","lr-live-region","lr-task-list","lr-usage-badge","lr-virtual-list"],"lr-agent-trace":["lr-agent-trace","lr-empty","lr-graph-legend","lr-handoff-divider","lr-live-region","lr-trace-tree","lr-virtual-list"],"lr-agent-workspace":["lr-agent-run","lr-agent-workspace","lr-attachment-chip","lr-badge","lr-button","lr-card","lr-chat-composer","lr-chat-message","lr-chat-viewport","lr-checkbox","lr-chunk-inspector","lr-citation-badge","lr-claim-evidence","lr-context-inspector","lr-context-meter","lr-copy-button","lr-details","lr-empty","lr-export-button","lr-generation-metrics","lr-grounding-summary","lr-icon-button","lr-json-viewer","lr-live-region","lr-markdown","lr-media-card","lr-message-parts","lr-pagination","lr-result-card","lr-result-field","lr-retrieval-results","lr-skeleton","lr-spinner","lr-stat","lr-task-list","lr-thinking-panel","lr-tool-approval-dialog","lr-tool-call-block","lr-tool-call-chip","lr-tool-result-view","lr-tool-timeline","lr-tooltip","lr-usage-badge","lr-virtual-list","lr-widget-renderer"],"lr-alert":["lr-alert","lr-toast","lr-toast-item"],"lr-animated-image":["lr-animated-image"],"lr-animation":["lr-animation"],"lr-app-rail":["lr-app-rail","lr-app-rail-item"],"lr-app-rail-group":["lr-app-rail-group"],"lr-app-rail-item":["lr-app-rail-item"],"lr-approval-queue":["lr-approval-queue","lr-badge","lr-button","lr-json-viewer","lr-tool-approval-dialog","lr-virtual-list"],"lr-archive-viewer":["lr-archive-viewer","lr-virtual-list"],"lr-artifact-panel":["lr-artifact-panel","lr-live-region"],"lr-attachment-chip":["lr-attachment-chip"],"lr-attachment-trigger":["lr-attachment-trigger","lr-dropdown","lr-icon-button","lr-menu","lr-menu-item"],"lr-audio-visualizer":["lr-audio-visualizer"],"lr-av-player":["lr-av-player","lr-virtual-list"],"lr-avatar":["lr-avatar"],"lr-avatar-group":["lr-avatar-group"],"lr-background-runs":["lr-background-runs"],"lr-badge":["lr-badge"],"lr-bar-chart":["lr-bar-chart","lr-chart","lr-skeleton"],"lr-box-plot":["lr-box-plot","lr-skeleton"],"lr-branch-picker":["lr-branch-picker","lr-live-region"],"lr-breadcrumb":["lr-breadcrumb"],"lr-breadcrumb-item":["lr-breadcrumb-item"],"lr-browser-frame":["lr-browser-frame"],"lr-bubble-chart":["lr-bubble-chart","lr-chart","lr-skeleton"],"lr-budget-meter":["lr-budget-meter"],"lr-button":["lr-button"],"lr-button-group":["lr-button-group"],"lr-calendar":["lr-calendar"],"lr-calendar-viewer":["lr-calendar-viewer"],"lr-callout":["lr-callout","lr-icon-button"],"lr-card":["lr-card"],"lr-carousel":["lr-carousel"],"lr-carousel-item":["lr-carousel-item"],"lr-change-review":["lr-change-review","lr-diff-view"],"lr-chart":["lr-chart","lr-skeleton"],"lr-chart-3d":["lr-chart-3d"],"lr-chat-composer":["lr-chat-composer"],"lr-chat-message":["lr-chat-message"],"lr-chat-viewport":["lr-chat-viewport"],"lr-checkbox":["lr-checkbox"],"lr-checkbox-group":["lr-checkbox-group"],"lr-checkpoint":["lr-checkpoint"],"lr-chip":["lr-chip"],"lr-chip-group":["lr-chip-group"],"lr-chunk-inspector":["lr-chunk-inspector","lr-empty","lr-virtual-list"],"lr-citation-badge":["lr-citation-badge"],"lr-claim-evidence":["lr-badge","lr-citation-badge","lr-claim-evidence","lr-empty"],"lr-code-block":["lr-code-block","lr-icon-button","lr-skeleton"],"lr-code-block-core":["lr-code-block-core","lr-icon-button","lr-skeleton"],"lr-code-editor":["lr-code-editor"],"lr-color-picker":["lr-color-picker"],"lr-combobox":["lr-combobox","lr-empty","lr-option"],"lr-command-palette":["lr-command-palette"],"lr-commit-card":["lr-commit-card"],"lr-community-card":["lr-button","lr-chip","lr-community-card","lr-empty"],"lr-compare-panel":["lr-compare-panel","lr-live-region"],"lr-condition-builder":["lr-button","lr-combobox","lr-condition-builder","lr-date-input","lr-date-picker","lr-empty","lr-icon","lr-icon-button","lr-input","lr-option","lr-select"],"lr-confirm-bar":["lr-button","lr-confirm-bar","lr-details","lr-json-viewer","lr-live-region","lr-virtual-list"],"lr-connector-manager":["lr-button","lr-connector-manager"],"lr-contact-viewer":["lr-contact-viewer"],"lr-context-inspector":["lr-citation-badge","lr-context-inspector","lr-context-meter","lr-copy-button","lr-empty","lr-export-button","lr-icon-button","lr-tooltip"],"lr-context-menu":["lr-context-menu","lr-dropdown","lr-menu","lr-menu-item"],"lr-context-meter":["lr-context-meter"],"lr-control-group":["lr-control-group"],"lr-conversation-item":["lr-conversation-item"],"lr-copy-button":["lr-copy-button","lr-icon-button","lr-tooltip"],"lr-country-picker":["lr-combobox","lr-country-picker","lr-empty","lr-option","lr-select"],"lr-csv-viewer":["lr-csv-viewer","lr-virtual-list"],"lr-currency-picker":["lr-combobox","lr-currency-picker","lr-empty","lr-option","lr-select"],"lr-dashboard-grid":["lr-badge","lr-button","lr-card","lr-dashboard-grid","lr-empty","lr-markdown","lr-media-card","lr-result-card","lr-result-field","lr-stat","lr-widget","lr-widget-renderer"],"lr-data-grid":["lr-button","lr-data-grid","lr-dropdown","lr-dropdown-item","lr-empty","lr-menu","lr-menu-item"],"lr-dataset-viewer":["lr-dataset-viewer","lr-virtual-list"],"lr-date-input":["lr-date-input","lr-date-picker"],"lr-date-picker":["lr-date-picker"],"lr-details":["lr-details"],"lr-dialog":["lr-dialog","lr-icon-button"],"lr-diff-view":["lr-diff-view"],"lr-divider":["lr-divider"],"lr-dock-panel":["lr-dock-panel"],"lr-document-compare":["lr-diff-view","lr-document-compare","lr-document-preview","lr-pan-zoom"],"lr-document-library":["lr-checkbox","lr-chip","lr-chip-group","lr-combobox","lr-document-library","lr-empty","lr-file-icon","lr-input","lr-option","lr-pagination","lr-skeleton","lr-spinner","lr-table"],"lr-document-preview":["lr-document-preview","lr-pan-zoom"],"lr-document-viewer":["lr-dialog","lr-document-preview","lr-document-viewer","lr-icon-button","lr-pan-zoom"],"lr-docx-viewer":["lr-docx-viewer"],"lr-doughnut-chart":["lr-chart","lr-doughnut-chart","lr-skeleton"],"lr-drawer":["lr-drawer","lr-icon-button"],"lr-drilldown-panel":["lr-badge","lr-breadcrumb","lr-breadcrumb-item","lr-button","lr-chip","lr-document-preview","lr-drilldown-panel","lr-empty","lr-entity-card","lr-pan-zoom","lr-result-field","lr-source-card","lr-tab","lr-tab-group","lr-tab-panel"],"lr-drop-zone":["lr-drop-zone"],"lr-dropdown":["lr-dropdown","lr-menu","lr-menu-item"],"lr-dropdown-item":["lr-dropdown-item","lr-menu","lr-menu-item"],"lr-ebook-viewer":["lr-ebook-viewer"],"lr-email-viewer":["lr-email-viewer"],"lr-embedding-explorer":["lr-embedding-explorer"],"lr-emoji-picker":["lr-emoji-picker"],"lr-empty":["lr-empty"],"lr-entity-card":["lr-badge","lr-button","lr-chip","lr-empty","lr-entity-card","lr-result-field"],"lr-entity-chip":["lr-entity-chip"],"lr-entity-dossier":["lr-badge","lr-button","lr-chip","lr-chunk-inspector","lr-community-card","lr-empty","lr-entity-card","lr-entity-chip","lr-entity-dossier","lr-neighbor-list","lr-pagination","lr-path-strip","lr-provenance-panel","lr-result-field","lr-scroller","lr-stat","lr-tab","lr-tab-group","lr-tab-panel","lr-virtual-list"],"lr-env-list":["lr-empty","lr-env-list"],"lr-eval-dataset":["lr-chip","lr-chip-group","lr-empty","lr-eval-dataset","lr-export-button","lr-file-input","lr-input","lr-pagination","lr-skeleton","lr-spinner","lr-table"],"lr-eval-result":["lr-checkbox","lr-checkbox-group","lr-diff-view","lr-empty","lr-eval-result","lr-option","lr-pagination","lr-rubric-form","lr-segmented","lr-select","lr-skeleton","lr-slider","lr-spinner","lr-table","lr-textarea"],"lr-eval-run":["lr-badge","lr-button","lr-citation-badge","lr-claim-evidence","lr-code-block","lr-copy-button","lr-details","lr-empty","lr-eval-run","lr-grounding-summary","lr-icon-button","lr-json-viewer","lr-live-region","lr-markdown","lr-progress-bar","lr-skeleton","lr-stat","lr-tool-approval-dialog","lr-tool-call-chip","lr-tool-result-view","lr-tool-timeline","lr-tooltip","lr-virtual-list"],"lr-export-button":["lr-export-button"],"lr-file-icon":["lr-file-icon"],"lr-file-input":["lr-file-input"],"lr-file-tree":["lr-empty","lr-file-icon","lr-file-tree","lr-live-region","lr-tree","lr-tree-item","lr-virtual-list"],"lr-filter-bar":["lr-button","lr-chip","lr-chip-group","lr-combobox","lr-date-input","lr-date-picker","lr-dropdown","lr-dropdown-item","lr-empty","lr-filter-bar","lr-input","lr-menu","lr-menu-item","lr-option","lr-select","lr-spinner"],"lr-flag":["lr-flag","lr-skeleton"],"lr-flow-canvas":["lr-empty","lr-flow-canvas","lr-flow-node"],"lr-flow-controls":["lr-flow-controls"],"lr-flow-minimap":["lr-flow-minimap"],"lr-flow-node":["lr-flow-node"],"lr-flow-run-status":["lr-flow-run-status"],"lr-format-bytes":["lr-format-bytes"],"lr-format-date":["lr-format-date"],"lr-format-number":["lr-format-number"],"lr-funnel":["lr-funnel"],"lr-gauge":["lr-gauge"],"lr-generation-metrics":["lr-generation-metrics"],"lr-geojson-viewer":["lr-geojson-viewer","lr-json-viewer","lr-map","lr-skeleton","lr-virtual-list"],"lr-graph":["lr-graph","lr-pagination","lr-skeleton"],"lr-graph-legend":["lr-graph-legend"],"lr-graph-query-builder":["lr-chip","lr-chip-group","lr-graph-query-builder","lr-input","lr-option","lr-select"],"lr-grounding-summary":["lr-badge","lr-citation-badge","lr-claim-evidence","lr-empty","lr-grounding-summary","lr-stat"],"lr-handoff-divider":["lr-handoff-divider"],"lr-heatmap":["lr-heatmap"],"lr-highlight-layer":["lr-highlight-layer"],"lr-histogram":["lr-chart","lr-histogram","lr-skeleton"],"lr-html-viewer":["lr-html-viewer"],"lr-icon":["lr-icon"],"lr-icon-button":["lr-icon","lr-icon-button"],"lr-image-comparer":["lr-image-comparer"],"lr-image-viewer":["lr-image-viewer","lr-live-region","lr-pan-zoom"],"lr-include":["lr-include"],"lr-ingestion-queue":["lr-badge","lr-empty","lr-ingestion-queue","lr-pagination","lr-progress-bar","lr-virtual-list"],"lr-input":["lr-input"],"lr-intersection-observer":["lr-intersection-observer"],"lr-json-schema-viewer":["lr-badge","lr-empty","lr-json-schema-viewer"],"lr-json-viewer":["lr-json-viewer","lr-virtual-list"],"lr-kbd":["lr-kbd"],"lr-knowledge-base":["lr-badge","lr-button","lr-dropdown","lr-empty","lr-knowledge-base","lr-menu","lr-menu-item","lr-pagination","lr-skeleton","lr-spinner","lr-stat","lr-table"],"lr-knowledge-base-admin":["lr-badge","lr-button","lr-dropdown","lr-empty","lr-ingestion-queue","lr-knowledge-base","lr-knowledge-base-admin","lr-menu","lr-menu-item","lr-pagination","lr-progress-bar","lr-skeleton","lr-spinner","lr-stat","lr-table","lr-virtual-list"],"lr-knowledge-graph-explorer":["lr-badge","lr-button","lr-chip","lr-empty","lr-entity-card","lr-graph","lr-graph-legend","lr-input","lr-knowledge-graph-explorer","lr-neighbor-list","lr-pagination","lr-path-strip","lr-popover","lr-result-field","lr-scroller","lr-skeleton","lr-virtual-list"],"lr-known-date":["lr-known-date"],"lr-lightbox":["lr-lightbox","lr-pan-zoom"],"lr-line-chart":["lr-chart","lr-line-chart","lr-skeleton"],"lr-lite-chart":["lr-lite-chart","lr-live-region"],"lr-live-region":["lr-live-region"],"lr-locale-picker":["lr-flag","lr-locale-picker","lr-skeleton"],"lr-map":["lr-map","lr-skeleton"],"lr-map-anchor":["lr-map-anchor"],"lr-markdown":["lr-markdown"],"lr-markdown-core":["lr-markdown-core"],"lr-mcp-app":["lr-mcp-app"],"lr-media-card":["lr-media-card"],"lr-memory-panel":["lr-button","lr-chip","lr-chunk-inspector","lr-community-card","lr-confirm-bar","lr-details","lr-empty","lr-entity-chip","lr-json-viewer","lr-live-region","lr-memory-panel","lr-path-strip","lr-provenance-panel","lr-scroller","lr-virtual-list"],"lr-mention-popover":["lr-mention-popover"],"lr-menu":["lr-menu","lr-menu-item"],"lr-menu-item":["lr-menu","lr-menu-item"],"lr-menu-label":["lr-menu-label"],"lr-menubar":["lr-menu","lr-menu-item","lr-menubar","lr-menubar-item"],"lr-menubar-item":["lr-menu","lr-menu-item","lr-menubar-item"],"lr-message-actions":["lr-chip","lr-copy-button","lr-icon-button","lr-message-actions","lr-message-feedback","lr-tooltip"],"lr-message-feedback":["lr-chip","lr-message-feedback"],"lr-message-parts":["lr-attachment-chip","lr-badge","lr-button","lr-card","lr-citation-badge","lr-copy-button","lr-icon-button","lr-json-viewer","lr-markdown","lr-media-card","lr-message-parts","lr-result-card","lr-result-field","lr-skeleton","lr-stat","lr-thinking-panel","lr-tool-call-block","lr-tool-call-chip","lr-tool-result-view","lr-tooltip","lr-virtual-list","lr-widget-renderer"],"lr-mind-map":["lr-mind-map","lr-virtual-list"],"lr-model-select":["lr-model-select"],"lr-model-settings-panel":["lr-model-select","lr-model-settings-panel","lr-slider"],"lr-model-viewer":["lr-model-viewer"],"lr-multi-split":["lr-multi-split"],"lr-mutation-observer":["lr-mutation-observer"],"lr-native-time-input":["lr-native-time-input"],"lr-navigation-menu":["lr-navigation-menu","lr-navigation-menu-item"],"lr-navigation-menu-item":["lr-navigation-menu-item"],"lr-neighbor-list":["lr-empty","lr-neighbor-list","lr-pagination","lr-virtual-list"],"lr-node-palette":["lr-node-palette"],"lr-notebook-viewer":["lr-code-block","lr-icon-button","lr-json-viewer","lr-markdown","lr-notebook-viewer","lr-skeleton","lr-virtual-list"],"lr-number-input":["lr-number-input"],"lr-option":["lr-option"],"lr-otp-input":["lr-otp-input"],"lr-page":["lr-page"],"lr-page-rail":["lr-file-icon","lr-page-rail","lr-skeleton","lr-virtual-list"],"lr-pagination":["lr-pagination"],"lr-pan-zoom":["lr-pan-zoom"],"lr-path-strip":["lr-path-strip","lr-scroller"],"lr-pdf-viewer":["lr-highlight-layer","lr-pdf-viewer","lr-virtual-list"],"lr-permission-grant":["lr-button","lr-permission-grant"],"lr-permission-rules":["lr-permission-rules"],"lr-phone-input":["lr-flag","lr-phone-input","lr-skeleton"],"lr-pie-chart":["lr-chart","lr-pie-chart","lr-skeleton"],"lr-polar-area-chart":["lr-chart","lr-polar-area-chart","lr-skeleton"],"lr-policy-summary":["lr-badge","lr-details","lr-empty","lr-policy-summary"],"lr-poll-status":["lr-live-region","lr-poll-status"],"lr-popover":["lr-popover"],"lr-popup":["lr-popup"],"lr-pptx-viewer":["lr-pptx-viewer"],"lr-progress-bar":["lr-progress-bar"],"lr-progress-ring":["lr-progress-ring"],"lr-prompt-input":["lr-attachment-chip","lr-attachment-trigger","lr-button","lr-chat-composer","lr-checkbox","lr-dropdown","lr-empty","lr-file-icon","lr-icon-button","lr-input","lr-mention-popover","lr-menu","lr-menu-item","lr-model-select","lr-prompt-input","lr-prompt-queue","lr-source-picker","lr-textarea","lr-voice-picker"],"lr-prompt-queue":["lr-button","lr-prompt-queue","lr-textarea"],"lr-prompt-studio":["lr-prompt-studio"],"lr-provenance-panel":["lr-button","lr-chip","lr-chunk-inspector","lr-community-card","lr-empty","lr-entity-chip","lr-path-strip","lr-provenance-panel","lr-scroller","lr-virtual-list"],"lr-push-to-talk":["lr-live-region","lr-push-to-talk"],"lr-qr-code":["lr-qr-code"],"lr-radar-chart":["lr-chart","lr-radar-chart","lr-skeleton"],"lr-radio":["lr-radio"],"lr-radio-button":["lr-radio-button"],"lr-radio-group":["lr-radio-group"],"lr-rag-answer":["lr-badge","lr-button","lr-citation-badge","lr-claim-evidence","lr-empty","lr-grounding-summary","lr-markdown","lr-rag-answer","lr-source-card","lr-source-list","lr-spinner","lr-stat"],"lr-rag-eval-dashboard":["lr-empty","lr-lite-chart","lr-live-region","lr-rag-eval-dashboard","lr-stat"],"lr-random-content":["lr-random-content"],"lr-rating":["lr-rating"],"lr-realtime-session":["lr-audio-visualizer","lr-badge","lr-live-region","lr-push-to-talk","lr-realtime-session","lr-transcript-feed"],"lr-relative-time":["lr-relative-time"],"lr-reorder-item":["lr-icon-button","lr-reorder-item"],"lr-reorder-list":["lr-icon-button","lr-live-region","lr-reorder-item","lr-reorder-list"],"lr-research-progress":["lr-empty","lr-research-progress"],"lr-resize-observer":["lr-resize-observer"],"lr-responsive-panel":["lr-responsive-panel"],"lr-result-card":["lr-result-card"],"lr-result-field":["lr-result-field"],"lr-retrieval-compare":["lr-empty","lr-retrieval-compare"],"lr-retrieval-results":["lr-checkbox","lr-chunk-inspector","lr-empty","lr-pagination","lr-retrieval-results","lr-spinner","lr-virtual-list"],"lr-retrieval-search":["lr-chip","lr-chip-group","lr-empty","lr-input","lr-retrieval-search","lr-segmented","lr-spinner"],"lr-retrieval-trace":["lr-chunk-inspector","lr-empty","lr-retrieval-trace","lr-span-waterfall","lr-virtual-list"],"lr-rubric-form":["lr-checkbox","lr-checkbox-group","lr-option","lr-rubric-form","lr-segmented","lr-select","lr-slider","lr-textarea"],"lr-scatter-chart":["lr-chart","lr-scatter-chart","lr-skeleton"],"lr-scroller":["lr-scroller"],"lr-segmented":["lr-segmented"],"lr-select":["lr-option","lr-select"],"lr-selection-toolbar":["lr-button","lr-selection-toolbar"],"lr-sequence-playback":["lr-sequence-playback"],"lr-sequence-strip":["lr-sequence-strip"],"lr-signature-pad":["lr-signature-pad"],"lr-skeleton":["lr-skeleton"],"lr-slider":["lr-slider"],"lr-source-card":["lr-source-card"],"lr-source-list":["lr-source-list"],"lr-source-picker":["lr-checkbox","lr-empty","lr-file-icon","lr-input","lr-source-picker"],"lr-span-waterfall":["lr-empty","lr-span-waterfall","lr-virtual-list"],"lr-sparkline":["lr-sparkline"],"lr-spinner":["lr-spinner"],"lr-split-panel":["lr-split-panel"],"lr-spreadsheet-viewer":["lr-spreadsheet-viewer","lr-tab","lr-tab-group","lr-tab-panel","lr-virtual-list"],"lr-stack-trace":["lr-stack-trace"],"lr-stat":["lr-stat"],"lr-stepper":["lr-stepper"],"lr-stream-status":["lr-live-region","lr-stream-status"],"lr-streaming-text":["lr-markdown","lr-streaming-text"],"lr-streaming-text-core":["lr-markdown-core","lr-streaming-text-core"],"lr-subagent-panel":["lr-badge","lr-empty","lr-subagent-panel"],"lr-suggestion-chips":["lr-scroller","lr-suggestion-chips"],"lr-svg-viewer":["lr-pan-zoom","lr-svg-viewer"],"lr-swatch-picker":["lr-swatch-picker"],"lr-switch":["lr-switch"],"lr-tab":["lr-tab"],"lr-tab-group":["lr-tab-group"],"lr-tab-panel":["lr-tab-panel"],"lr-table":["lr-empty","lr-pagination","lr-skeleton","lr-spinner","lr-table"],"lr-tag":["lr-tag"],"lr-task-list":["lr-live-region","lr-task-list","lr-virtual-list"],"lr-terminal":["lr-terminal","lr-virtual-list"],"lr-test-results":["lr-empty","lr-live-region","lr-pagination","lr-spinner","lr-test-results"],"lr-textarea":["lr-textarea"],"lr-thinking-panel":["lr-thinking-panel"],"lr-thread-list":["lr-conversation-item","lr-empty","lr-live-region","lr-pagination","lr-thread-list","lr-virtual-list"],"lr-time-input":["lr-time-input"],"lr-time-range":["lr-time-range"],"lr-time-zone-picker":["lr-combobox","lr-empty","lr-option","lr-select","lr-time-zone-picker"],"lr-timeline":["lr-relative-time","lr-timeline","lr-timeline-item"],"lr-timeline-item":["lr-relative-time","lr-timeline-item"],"lr-toast":["lr-toast","lr-toast-item"],"lr-toast-item":["lr-toast-item"],"lr-toggle":["lr-toggle"],"lr-toggle-group":["lr-toggle-group"],"lr-token-input":["lr-token-input"],"lr-tool-approval-dialog":["lr-button","lr-json-viewer","lr-tool-approval-dialog","lr-virtual-list"],"lr-tool-call-block":["lr-copy-button","lr-icon-button","lr-json-viewer","lr-skeleton","lr-tool-call-block","lr-tool-result-view","lr-tooltip","lr-virtual-list"],"lr-tool-call-chip":["lr-tool-call-chip"],"lr-tool-param-form":["lr-number-input","lr-option","lr-select","lr-tool-param-form"],"lr-tool-result-dialog":["lr-tool-result-dialog"],"lr-tool-result-view":["lr-copy-button","lr-icon-button","lr-json-viewer","lr-skeleton","lr-tool-result-view","lr-tooltip","lr-virtual-list"],"lr-tool-select-dialog":["lr-checkbox","lr-switch","lr-tool-select-dialog"],"lr-tool-timeline":["lr-button","lr-copy-button","lr-details","lr-empty","lr-icon-button","lr-json-viewer","lr-skeleton","lr-tool-approval-dialog","lr-tool-call-chip","lr-tool-result-view","lr-tool-timeline","lr-tooltip","lr-virtual-list"],"lr-tooltip":["lr-tooltip"],"lr-tour":["lr-tour"],"lr-trace-tree":["lr-empty","lr-live-region","lr-trace-tree","lr-virtual-list"],"lr-transcript-feed":["lr-transcript-feed"],"lr-tree":["lr-empty","lr-live-region","lr-tree","lr-tree-item","lr-virtual-list"],"lr-tree-item":["lr-tree-item"],"lr-typing-indicator":["lr-typing-indicator"],"lr-unit-picker":["lr-combobox","lr-empty","lr-option","lr-select","lr-unit-picker"],"lr-usage-badge":["lr-usage-badge"],"lr-video":["lr-icon","lr-video"],"lr-video-playlist":["lr-icon","lr-video","lr-video-playlist"],"lr-virtual-list":["lr-virtual-list"],"lr-visually-hidden":["lr-visually-hidden"],"lr-voice-picker":["lr-voice-picker"],"lr-widget":["lr-widget"],"lr-widget-renderer":["lr-badge","lr-button","lr-card","lr-markdown","lr-media-card","lr-result-card","lr-result-field","lr-stat","lr-widget-renderer"],"lr-word-cloud":["lr-word-cloud"],"lr-xml-viewer":["lr-virtual-list","lr-xml-viewer"],"lr-zoomable-frame":["lr-zoomable-frame"]});export{scopedDefinitionClosures};
1
+ const scopedDefinitionClosures=Object.freeze({"lr-accordion":["lr-accordion"],"lr-accordion-item":["lr-accordion-item"],"lr-activity-feed":["lr-activity-feed","lr-live-region","lr-virtual-list"],"lr-agent-eval-dashboard":["lr-agent-eval-dashboard","lr-badge","lr-lite-chart","lr-live-region","lr-stat"],"lr-agent-question":["lr-agent-question","lr-number-input","lr-option","lr-select","lr-tool-param-form"],"lr-agent-run":["lr-agent-run","lr-badge","lr-empty","lr-generation-metrics","lr-live-region","lr-task-list","lr-usage-badge","lr-virtual-list"],"lr-agent-trace":["lr-agent-trace","lr-empty","lr-graph-legend","lr-handoff-divider","lr-live-region","lr-trace-tree","lr-virtual-list"],"lr-agent-workspace":["lr-agent-run","lr-agent-workspace","lr-attachment-chip","lr-badge","lr-button","lr-card","lr-chat-composer","lr-chat-message","lr-chat-viewport","lr-checkbox","lr-chunk-inspector","lr-citation-badge","lr-claim-evidence","lr-context-inspector","lr-context-meter","lr-copy-button","lr-details","lr-empty","lr-export-button","lr-generation-metrics","lr-grounding-summary","lr-icon-button","lr-json-viewer","lr-live-region","lr-markdown","lr-media-card","lr-message-parts","lr-pagination","lr-result-card","lr-result-field","lr-retrieval-results","lr-skeleton","lr-spinner","lr-stat","lr-task-list","lr-thinking-panel","lr-tool-approval-dialog","lr-tool-call-block","lr-tool-call-chip","lr-tool-result-view","lr-tool-timeline","lr-tooltip","lr-usage-badge","lr-virtual-list","lr-widget-renderer"],"lr-alert":["lr-alert","lr-toast","lr-toast-item"],"lr-animated-image":["lr-animated-image"],"lr-animation":["lr-animation"],"lr-app-rail":["lr-app-rail","lr-app-rail-item"],"lr-app-rail-group":["lr-app-rail-group"],"lr-app-rail-item":["lr-app-rail-item"],"lr-approval-queue":["lr-approval-queue","lr-badge","lr-button","lr-json-viewer","lr-tool-approval-dialog","lr-virtual-list"],"lr-archive-viewer":["lr-archive-viewer","lr-virtual-list"],"lr-artifact-panel":["lr-artifact-panel","lr-live-region"],"lr-attachment-chip":["lr-attachment-chip"],"lr-attachment-trigger":["lr-attachment-trigger","lr-dropdown","lr-icon-button","lr-menu","lr-menu-item"],"lr-audio-visualizer":["lr-audio-visualizer"],"lr-av-player":["lr-av-player","lr-virtual-list"],"lr-avatar":["lr-avatar"],"lr-avatar-group":["lr-avatar-group"],"lr-background-runs":["lr-background-runs"],"lr-badge":["lr-badge"],"lr-bar-chart":["lr-bar-chart","lr-chart","lr-skeleton"],"lr-box-plot":["lr-box-plot","lr-skeleton"],"lr-branch-picker":["lr-branch-picker","lr-live-region"],"lr-breadcrumb":["lr-breadcrumb"],"lr-breadcrumb-item":["lr-breadcrumb-item"],"lr-browser-frame":["lr-browser-frame"],"lr-bubble-chart":["lr-bubble-chart","lr-chart","lr-skeleton"],"lr-budget-meter":["lr-budget-meter"],"lr-button":["lr-button"],"lr-button-group":["lr-button-group"],"lr-calendar":["lr-calendar"],"lr-calendar-viewer":["lr-calendar-viewer"],"lr-callout":["lr-callout","lr-icon-button"],"lr-card":["lr-card"],"lr-carousel":["lr-carousel"],"lr-carousel-item":["lr-carousel-item"],"lr-change-review":["lr-change-review","lr-diff-view"],"lr-chart":["lr-chart","lr-skeleton"],"lr-chart-3d":["lr-chart-3d"],"lr-chat-composer":["lr-chat-composer"],"lr-chat-message":["lr-chat-message"],"lr-chat-viewport":["lr-chat-viewport"],"lr-checkbox":["lr-checkbox"],"lr-checkbox-group":["lr-checkbox-group"],"lr-checkpoint":["lr-checkpoint"],"lr-chip":["lr-chip"],"lr-chip-group":["lr-chip-group"],"lr-chunk-inspector":["lr-chunk-inspector","lr-empty","lr-virtual-list"],"lr-citation-badge":["lr-citation-badge"],"lr-claim-evidence":["lr-badge","lr-citation-badge","lr-claim-evidence","lr-empty"],"lr-code-block":["lr-code-block","lr-icon-button","lr-skeleton"],"lr-code-block-core":["lr-code-block-core","lr-icon-button","lr-skeleton"],"lr-code-editor":["lr-code-editor"],"lr-color-picker":["lr-color-picker"],"lr-combobox":["lr-combobox","lr-empty","lr-option"],"lr-command-palette":["lr-command-palette"],"lr-commit-card":["lr-commit-card"],"lr-community-card":["lr-button","lr-chip","lr-community-card","lr-empty"],"lr-compare-panel":["lr-compare-panel","lr-live-region"],"lr-condition-builder":["lr-button","lr-combobox","lr-condition-builder","lr-date-input","lr-date-picker","lr-empty","lr-icon","lr-icon-button","lr-input","lr-option","lr-select"],"lr-confirm-bar":["lr-button","lr-confirm-bar","lr-details","lr-json-viewer","lr-live-region","lr-virtual-list"],"lr-connector-manager":["lr-button","lr-connector-manager"],"lr-contact-viewer":["lr-contact-viewer"],"lr-context-inspector":["lr-citation-badge","lr-context-inspector","lr-context-meter","lr-copy-button","lr-empty","lr-export-button","lr-icon-button","lr-tooltip"],"lr-context-menu":["lr-context-menu","lr-dropdown","lr-menu","lr-menu-item"],"lr-context-meter":["lr-context-meter"],"lr-control-group":["lr-control-group"],"lr-conversation-item":["lr-conversation-item"],"lr-copy-button":["lr-copy-button","lr-icon-button","lr-tooltip"],"lr-country-picker":["lr-combobox","lr-country-picker","lr-empty","lr-option","lr-select"],"lr-csv-viewer":["lr-csv-viewer","lr-virtual-list"],"lr-currency-picker":["lr-combobox","lr-currency-picker","lr-empty","lr-option","lr-select"],"lr-dashboard-grid":["lr-badge","lr-button","lr-card","lr-dashboard-grid","lr-empty","lr-markdown","lr-media-card","lr-result-card","lr-result-field","lr-stat","lr-widget","lr-widget-renderer"],"lr-data-grid":["lr-button","lr-data-grid","lr-dropdown","lr-dropdown-item","lr-empty","lr-menu","lr-menu-item"],"lr-dataset-viewer":["lr-dataset-viewer","lr-virtual-list"],"lr-date-input":["lr-date-input","lr-date-picker"],"lr-date-picker":["lr-date-picker"],"lr-details":["lr-details"],"lr-dialog":["lr-dialog","lr-icon-button"],"lr-diff-view":["lr-diff-view"],"lr-divider":["lr-divider"],"lr-dock-panel":["lr-dock-panel"],"lr-document-compare":["lr-diff-view","lr-document-compare","lr-document-preview","lr-pan-zoom"],"lr-document-library":["lr-checkbox","lr-chip","lr-chip-group","lr-combobox","lr-document-library","lr-empty","lr-file-icon","lr-input","lr-option","lr-pagination","lr-skeleton","lr-spinner","lr-table"],"lr-document-preview":["lr-document-preview","lr-pan-zoom"],"lr-document-viewer":["lr-dialog","lr-document-preview","lr-document-viewer","lr-icon-button","lr-pan-zoom"],"lr-docx-viewer":["lr-docx-viewer"],"lr-doughnut-chart":["lr-chart","lr-doughnut-chart","lr-skeleton"],"lr-drawer":["lr-drawer","lr-icon-button"],"lr-drilldown-panel":["lr-badge","lr-breadcrumb","lr-breadcrumb-item","lr-button","lr-chip","lr-document-preview","lr-drilldown-panel","lr-empty","lr-entity-card","lr-pan-zoom","lr-result-field","lr-source-card","lr-tab","lr-tab-group","lr-tab-panel"],"lr-drop-zone":["lr-drop-zone"],"lr-dropdown":["lr-dropdown","lr-menu","lr-menu-item"],"lr-dropdown-item":["lr-dropdown-item","lr-menu","lr-menu-item"],"lr-ebook-viewer":["lr-ebook-viewer"],"lr-email-viewer":["lr-email-viewer"],"lr-embedding-explorer":["lr-embedding-explorer"],"lr-emoji-picker":["lr-emoji-picker"],"lr-empty":["lr-empty"],"lr-entity-card":["lr-badge","lr-button","lr-chip","lr-empty","lr-entity-card","lr-result-field"],"lr-entity-chip":["lr-entity-chip"],"lr-entity-dossier":["lr-badge","lr-button","lr-chip","lr-chunk-inspector","lr-community-card","lr-empty","lr-entity-card","lr-entity-chip","lr-entity-dossier","lr-neighbor-list","lr-pagination","lr-path-strip","lr-provenance-panel","lr-result-field","lr-scroller","lr-stat","lr-tab","lr-tab-group","lr-tab-panel","lr-virtual-list"],"lr-env-list":["lr-empty","lr-env-list"],"lr-eval-dataset":["lr-chip","lr-chip-group","lr-empty","lr-eval-dataset","lr-export-button","lr-file-input","lr-input","lr-pagination","lr-skeleton","lr-spinner","lr-table"],"lr-eval-result":["lr-checkbox","lr-checkbox-group","lr-diff-view","lr-empty","lr-eval-result","lr-option","lr-pagination","lr-rubric-form","lr-segmented","lr-select","lr-skeleton","lr-slider","lr-spinner","lr-table","lr-textarea"],"lr-eval-run":["lr-badge","lr-button","lr-citation-badge","lr-claim-evidence","lr-code-block","lr-copy-button","lr-details","lr-empty","lr-eval-run","lr-grounding-summary","lr-icon-button","lr-json-viewer","lr-live-region","lr-markdown","lr-progress-bar","lr-skeleton","lr-stat","lr-tool-approval-dialog","lr-tool-call-chip","lr-tool-result-view","lr-tool-timeline","lr-tooltip","lr-virtual-list"],"lr-export-button":["lr-export-button"],"lr-file-icon":["lr-file-icon"],"lr-file-input":["lr-file-input"],"lr-file-tree":["lr-empty","lr-file-icon","lr-file-tree","lr-live-region","lr-tree","lr-tree-item","lr-virtual-list"],"lr-filter-bar":["lr-button","lr-chip","lr-chip-group","lr-combobox","lr-date-input","lr-date-picker","lr-dropdown","lr-dropdown-item","lr-empty","lr-filter-bar","lr-input","lr-menu","lr-menu-item","lr-option","lr-select","lr-spinner"],"lr-flag":["lr-flag","lr-skeleton"],"lr-flow-canvas":["lr-empty","lr-flow-canvas","lr-flow-node"],"lr-flow-controls":["lr-flow-controls"],"lr-flow-minimap":["lr-flow-minimap"],"lr-flow-node":["lr-flow-node"],"lr-flow-run-status":["lr-flow-run-status"],"lr-format-bytes":["lr-format-bytes"],"lr-format-date":["lr-format-date"],"lr-format-number":["lr-format-number"],"lr-funnel":["lr-funnel"],"lr-gauge":["lr-gauge"],"lr-generation-metrics":["lr-generation-metrics"],"lr-geojson-viewer":["lr-geojson-viewer","lr-json-viewer","lr-map","lr-skeleton","lr-virtual-list"],"lr-graph":["lr-graph","lr-pagination","lr-skeleton"],"lr-graph-legend":["lr-graph-legend"],"lr-graph-query-builder":["lr-chip","lr-chip-group","lr-graph-query-builder","lr-input","lr-option","lr-select"],"lr-grounding-summary":["lr-badge","lr-citation-badge","lr-claim-evidence","lr-empty","lr-grounding-summary","lr-stat"],"lr-handoff-divider":["lr-handoff-divider"],"lr-heatmap":["lr-heatmap"],"lr-highlight-layer":["lr-highlight-layer"],"lr-histogram":["lr-chart","lr-histogram","lr-skeleton"],"lr-html-viewer":["lr-html-viewer"],"lr-icon":["lr-icon"],"lr-icon-button":["lr-icon","lr-icon-button"],"lr-image-comparer":["lr-image-comparer"],"lr-image-viewer":["lr-image-viewer","lr-live-region","lr-pan-zoom"],"lr-include":["lr-include"],"lr-ingestion-queue":["lr-badge","lr-empty","lr-ingestion-queue","lr-pagination","lr-progress-bar","lr-virtual-list"],"lr-input":["lr-input"],"lr-intersection-observer":["lr-intersection-observer"],"lr-json-schema-viewer":["lr-badge","lr-empty","lr-json-schema-viewer"],"lr-json-viewer":["lr-json-viewer","lr-virtual-list"],"lr-kbd":["lr-kbd"],"lr-knowledge-base":["lr-badge","lr-button","lr-dropdown","lr-empty","lr-knowledge-base","lr-menu","lr-menu-item","lr-pagination","lr-skeleton","lr-spinner","lr-stat","lr-table"],"lr-knowledge-base-admin":["lr-badge","lr-button","lr-dropdown","lr-empty","lr-ingestion-queue","lr-knowledge-base","lr-knowledge-base-admin","lr-menu","lr-menu-item","lr-pagination","lr-progress-bar","lr-skeleton","lr-spinner","lr-stat","lr-table","lr-virtual-list"],"lr-knowledge-graph-explorer":["lr-badge","lr-button","lr-chip","lr-empty","lr-entity-card","lr-graph","lr-graph-legend","lr-input","lr-knowledge-graph-explorer","lr-neighbor-list","lr-pagination","lr-path-strip","lr-popover","lr-result-field","lr-scroller","lr-skeleton","lr-virtual-list"],"lr-known-date":["lr-known-date"],"lr-lightbox":["lr-lightbox","lr-pan-zoom"],"lr-line-chart":["lr-chart","lr-line-chart","lr-skeleton"],"lr-lite-chart":["lr-lite-chart","lr-live-region"],"lr-live-region":["lr-live-region"],"lr-locale-picker":["lr-flag","lr-locale-picker","lr-skeleton"],"lr-map":["lr-map","lr-skeleton"],"lr-map-anchor":["lr-map-anchor"],"lr-markdown":["lr-markdown"],"lr-markdown-core":["lr-markdown-core"],"lr-mcp-app":["lr-mcp-app"],"lr-media-card":["lr-media-card"],"lr-memory-panel":["lr-button","lr-chip","lr-chunk-inspector","lr-community-card","lr-confirm-bar","lr-details","lr-empty","lr-entity-chip","lr-json-viewer","lr-live-region","lr-memory-panel","lr-path-strip","lr-provenance-panel","lr-scroller","lr-virtual-list"],"lr-mention-popover":["lr-mention-popover"],"lr-menu":["lr-menu","lr-menu-item"],"lr-menu-item":["lr-menu","lr-menu-item"],"lr-menu-label":["lr-menu-label"],"lr-menubar":["lr-menu","lr-menu-item","lr-menubar","lr-menubar-item"],"lr-menubar-item":["lr-menu","lr-menu-item","lr-menubar-item"],"lr-message-actions":["lr-chip","lr-copy-button","lr-icon-button","lr-message-actions","lr-message-feedback","lr-tooltip"],"lr-message-feedback":["lr-chip","lr-message-feedback"],"lr-message-parts":["lr-attachment-chip","lr-badge","lr-button","lr-card","lr-citation-badge","lr-copy-button","lr-icon-button","lr-json-viewer","lr-markdown","lr-media-card","lr-message-parts","lr-result-card","lr-result-field","lr-skeleton","lr-stat","lr-thinking-panel","lr-tool-call-block","lr-tool-call-chip","lr-tool-result-view","lr-tooltip","lr-virtual-list","lr-widget-renderer"],"lr-mind-map":["lr-mind-map","lr-virtual-list"],"lr-model-select":["lr-model-select"],"lr-model-settings-panel":["lr-model-select","lr-model-settings-panel","lr-slider"],"lr-model-viewer":["lr-model-viewer"],"lr-multi-split":["lr-multi-split"],"lr-mutation-observer":["lr-mutation-observer"],"lr-native-time-input":["lr-native-time-input"],"lr-navigation-menu":["lr-navigation-menu","lr-navigation-menu-item"],"lr-navigation-menu-item":["lr-navigation-menu-item"],"lr-neighbor-list":["lr-empty","lr-neighbor-list","lr-pagination","lr-virtual-list"],"lr-node-palette":["lr-node-palette"],"lr-notebook-viewer":["lr-code-block","lr-icon-button","lr-json-viewer","lr-markdown","lr-notebook-viewer","lr-skeleton","lr-virtual-list"],"lr-number-input":["lr-number-input"],"lr-option":["lr-option"],"lr-otp-input":["lr-otp-input"],"lr-page":["lr-page"],"lr-page-rail":["lr-file-icon","lr-page-rail","lr-skeleton","lr-virtual-list"],"lr-pagination":["lr-pagination"],"lr-pan-zoom":["lr-pan-zoom"],"lr-path-strip":["lr-path-strip","lr-scroller"],"lr-pdf-viewer":["lr-highlight-layer","lr-pdf-viewer","lr-virtual-list"],"lr-permission-grant":["lr-button","lr-permission-grant"],"lr-permission-rules":["lr-permission-rules"],"lr-phone-input":["lr-flag","lr-phone-input","lr-skeleton"],"lr-pie-chart":["lr-chart","lr-pie-chart","lr-skeleton"],"lr-polar-area-chart":["lr-chart","lr-polar-area-chart","lr-skeleton"],"lr-policy-summary":["lr-badge","lr-details","lr-empty","lr-policy-summary"],"lr-poll-status":["lr-live-region","lr-poll-status"],"lr-popover":["lr-popover"],"lr-popup":["lr-popup"],"lr-pptx-viewer":["lr-pptx-viewer"],"lr-progress-bar":["lr-progress-bar"],"lr-progress-ring":["lr-progress-ring"],"lr-prompt-input":["lr-attachment-chip","lr-attachment-trigger","lr-button","lr-chat-composer","lr-checkbox","lr-dropdown","lr-empty","lr-file-icon","lr-icon-button","lr-input","lr-mention-popover","lr-menu","lr-menu-item","lr-model-select","lr-prompt-input","lr-prompt-queue","lr-source-picker","lr-textarea","lr-voice-picker"],"lr-prompt-queue":["lr-button","lr-prompt-queue","lr-textarea"],"lr-prompt-studio":["lr-prompt-studio"],"lr-provenance-panel":["lr-button","lr-chip","lr-chunk-inspector","lr-community-card","lr-empty","lr-entity-chip","lr-path-strip","lr-provenance-panel","lr-scroller","lr-virtual-list"],"lr-push-to-talk":["lr-live-region","lr-push-to-talk"],"lr-qr-code":["lr-qr-code"],"lr-radar-chart":["lr-chart","lr-radar-chart","lr-skeleton"],"lr-radio":["lr-radio"],"lr-radio-button":["lr-radio-button"],"lr-radio-group":["lr-radio-group"],"lr-rag-answer":["lr-badge","lr-button","lr-citation-badge","lr-claim-evidence","lr-empty","lr-grounding-summary","lr-markdown","lr-rag-answer","lr-source-card","lr-source-list","lr-spinner","lr-stat"],"lr-rag-eval-dashboard":["lr-empty","lr-lite-chart","lr-live-region","lr-rag-eval-dashboard","lr-stat"],"lr-random-content":["lr-random-content"],"lr-rating":["lr-rating"],"lr-realtime-session":["lr-audio-visualizer","lr-badge","lr-live-region","lr-push-to-talk","lr-realtime-session","lr-transcript-feed"],"lr-relative-time":["lr-relative-time"],"lr-reorder-item":["lr-icon-button","lr-reorder-item"],"lr-reorder-list":["lr-icon-button","lr-live-region","lr-reorder-item","lr-reorder-list"],"lr-research-progress":["lr-empty","lr-research-progress"],"lr-resize-observer":["lr-resize-observer"],"lr-responsive-panel":["lr-responsive-panel"],"lr-result-card":["lr-result-card"],"lr-result-field":["lr-result-field"],"lr-retrieval-compare":["lr-empty","lr-retrieval-compare"],"lr-retrieval-results":["lr-checkbox","lr-chunk-inspector","lr-empty","lr-pagination","lr-retrieval-results","lr-spinner","lr-virtual-list"],"lr-retrieval-search":["lr-chip","lr-chip-group","lr-empty","lr-input","lr-retrieval-search","lr-segmented","lr-spinner"],"lr-retrieval-trace":["lr-chunk-inspector","lr-empty","lr-retrieval-trace","lr-span-waterfall","lr-virtual-list"],"lr-rubric-form":["lr-checkbox","lr-checkbox-group","lr-option","lr-rubric-form","lr-segmented","lr-select","lr-slider","lr-textarea"],"lr-scatter-chart":["lr-chart","lr-scatter-chart","lr-skeleton"],"lr-scroller":["lr-scroller"],"lr-segmented":["lr-segmented"],"lr-select":["lr-option","lr-select"],"lr-selection-toolbar":["lr-button","lr-selection-toolbar"],"lr-sequence-playback":["lr-sequence-playback"],"lr-sequence-strip":["lr-sequence-strip"],"lr-signature-pad":["lr-signature-pad"],"lr-skeleton":["lr-skeleton"],"lr-slider":["lr-slider"],"lr-source-card":["lr-source-card"],"lr-source-list":["lr-source-list"],"lr-source-picker":["lr-checkbox","lr-empty","lr-file-icon","lr-input","lr-source-picker"],"lr-span-waterfall":["lr-empty","lr-span-waterfall","lr-virtual-list"],"lr-sparkline":["lr-sparkline"],"lr-spinner":["lr-spinner"],"lr-split-panel":["lr-split-panel"],"lr-spreadsheet-viewer":["lr-spreadsheet-viewer","lr-tab","lr-tab-group","lr-tab-panel","lr-virtual-list"],"lr-stack-trace":["lr-stack-trace"],"lr-stat":["lr-stat"],"lr-stepper":["lr-stepper"],"lr-stream-status":["lr-live-region","lr-stream-status"],"lr-streaming-text":["lr-markdown","lr-streaming-text"],"lr-streaming-text-core":["lr-markdown-core","lr-streaming-text-core"],"lr-subagent-panel":["lr-badge","lr-empty","lr-subagent-panel"],"lr-suggestion-chips":["lr-icon","lr-scroller","lr-suggestion-chips"],"lr-svg-viewer":["lr-pan-zoom","lr-svg-viewer"],"lr-swatch-picker":["lr-swatch-picker"],"lr-switch":["lr-switch"],"lr-tab":["lr-tab"],"lr-tab-group":["lr-tab-group"],"lr-tab-panel":["lr-tab-panel"],"lr-table":["lr-empty","lr-pagination","lr-skeleton","lr-spinner","lr-table"],"lr-tag":["lr-tag"],"lr-task-list":["lr-live-region","lr-task-list","lr-virtual-list"],"lr-terminal":["lr-terminal","lr-virtual-list"],"lr-test-results":["lr-empty","lr-live-region","lr-pagination","lr-spinner","lr-test-results"],"lr-textarea":["lr-textarea"],"lr-thinking-panel":["lr-thinking-panel"],"lr-thread-list":["lr-conversation-item","lr-empty","lr-live-region","lr-pagination","lr-thread-list","lr-virtual-list"],"lr-time-input":["lr-time-input"],"lr-time-range":["lr-time-range"],"lr-time-zone-picker":["lr-combobox","lr-empty","lr-option","lr-select","lr-time-zone-picker"],"lr-timeline":["lr-relative-time","lr-timeline","lr-timeline-item"],"lr-timeline-item":["lr-relative-time","lr-timeline-item"],"lr-toast":["lr-toast","lr-toast-item"],"lr-toast-item":["lr-toast-item"],"lr-toggle":["lr-toggle"],"lr-toggle-group":["lr-toggle-group"],"lr-token-input":["lr-token-input"],"lr-tool-approval-dialog":["lr-button","lr-json-viewer","lr-tool-approval-dialog","lr-virtual-list"],"lr-tool-call-block":["lr-copy-button","lr-icon-button","lr-json-viewer","lr-skeleton","lr-tool-call-block","lr-tool-result-view","lr-tooltip","lr-virtual-list"],"lr-tool-call-chip":["lr-tool-call-chip"],"lr-tool-param-form":["lr-number-input","lr-option","lr-select","lr-tool-param-form"],"lr-tool-result-dialog":["lr-tool-result-dialog"],"lr-tool-result-view":["lr-copy-button","lr-icon-button","lr-json-viewer","lr-skeleton","lr-tool-result-view","lr-tooltip","lr-virtual-list"],"lr-tool-select-dialog":["lr-checkbox","lr-switch","lr-tool-select-dialog"],"lr-tool-timeline":["lr-button","lr-copy-button","lr-details","lr-empty","lr-icon-button","lr-json-viewer","lr-skeleton","lr-tool-approval-dialog","lr-tool-call-chip","lr-tool-result-view","lr-tool-timeline","lr-tooltip","lr-virtual-list"],"lr-tooltip":["lr-tooltip"],"lr-tour":["lr-tour"],"lr-trace-tree":["lr-empty","lr-live-region","lr-trace-tree","lr-virtual-list"],"lr-transcript-feed":["lr-transcript-feed"],"lr-tree":["lr-empty","lr-live-region","lr-tree","lr-tree-item","lr-virtual-list"],"lr-tree-item":["lr-tree-item"],"lr-typing-indicator":["lr-typing-indicator"],"lr-unit-picker":["lr-combobox","lr-empty","lr-option","lr-select","lr-unit-picker"],"lr-usage-badge":["lr-usage-badge"],"lr-video":["lr-icon","lr-video"],"lr-video-playlist":["lr-icon","lr-video","lr-video-playlist"],"lr-virtual-list":["lr-virtual-list"],"lr-visually-hidden":["lr-visually-hidden"],"lr-voice-picker":["lr-voice-picker"],"lr-widget":["lr-widget"],"lr-widget-renderer":["lr-badge","lr-button","lr-card","lr-markdown","lr-media-card","lr-result-card","lr-result-field","lr-stat","lr-widget-renderer"],"lr-word-cloud":["lr-word-cloud"],"lr-xml-viewer":["lr-virtual-list","lr-xml-viewer"],"lr-zoomable-frame":["lr-zoomable-frame"]});export{scopedDefinitionClosures};
@@ -1 +1 @@
1
- import{isRtl}from"./rtl.js";const SCROLL_OVERFLOW_ATTRIBUTE="data-scroll-overflow",SCROLL_START_ATTRIBUTE="data-scroll-start",SCROLL_END_ATTRIBUTE="data-scroll-end",TOLERANCE_PX=1;class ScrollOverflowController{#observer;#observed;#ownerWindow;#scrollTarget;#onScroll=()=>this.measure();constructor(host,resolve,onResize){this.resolve=resolve,this.onResize=onResize,host.addController(this)}hostConnected(){this.sync()}hostUpdated(){this.sync()}sync(){const element=this.resolve(),ownerWindow=element?.ownerDocument.defaultView??void 0;if(element!==this.#observed||ownerWindow!==this.#ownerWindow){this.resetObservation(),this.#observed=element??void 0,this.#ownerWindow=ownerWindow,element&&(element.addEventListener("scroll",this.#onScroll,{passive:!0}),this.#scrollTarget=element);const ResizeObserverConstructor=ownerWindow?.ResizeObserver;if(element&&ResizeObserverConstructor){const observer=new ResizeObserverConstructor(()=>{this.#observer!==observer||this.#observed!==element||element.ownerDocument.defaultView!==ownerWindow||(this.measure(),this.onResize?.())});this.#observer=observer,observer.observe(element)}}this.measure()}hostDisconnected(){this.resetObservation()}resetObservation(){this.#observer?.disconnect(),this.#observer=void 0,this.#observed=void 0,this.#ownerWindow=void 0,this.#scrollTarget?.removeEventListener("scroll",this.#onScroll),this.#scrollTarget=void 0}measure(){const element=this.#observed;if(!element)return;const extent=Math.max(0,element.scrollWidth-element.clientWidth),overflows=extent>TOLERANCE_PX;if(element.toggleAttribute(SCROLL_OVERFLOW_ATTRIBUTE,overflows),!overflows){element.toggleAttribute(SCROLL_START_ATTRIBUTE,!1),element.toggleAttribute(SCROLL_END_ATTRIBUTE,!1);return}const raw=isRtl(element)?-element.scrollLeft:element.scrollLeft,position=Math.max(0,Math.min(extent,raw));element.toggleAttribute(SCROLL_START_ATTRIBUTE,position>TOLERANCE_PX),element.toggleAttribute(SCROLL_END_ATTRIBUTE,position<extent-TOLERANCE_PX)}observeExtra(elements){if(this.#observer)for(const element of elements)this.#observer.observe(element)}}function observeScrollOverflow(host,resolve,onResize){return new ScrollOverflowController(host,resolve,onResize)}export{SCROLL_END_ATTRIBUTE,SCROLL_OVERFLOW_ATTRIBUTE,SCROLL_START_ATTRIBUTE,ScrollOverflowController,observeScrollOverflow};
1
+ import{isRtl}from"./rtl.js";const SCROLL_OVERFLOW_ATTRIBUTE="data-scroll-overflow",SCROLL_START_ATTRIBUTE="data-scroll-start",SCROLL_END_ATTRIBUTE="data-scroll-end",TOLERANCE_PX=1;class ScrollOverflowController{#observer;#observed;#ownerWindow;#scrollTarget;#onScroll=()=>this.measure();constructor(host,resolve,onResize){this.resolve=resolve,this.onResize=onResize,host.addController(this)}hostConnected(){this.sync()}hostUpdated(){this.sync()}sync(){const resolved=this.resolve(),element=resolved?.isConnected?resolved:void 0,ownerWindow=element?.ownerDocument.defaultView??void 0;if(element!==this.#observed||ownerWindow!==this.#ownerWindow){this.resetObservation(),this.#observed=element??void 0,this.#ownerWindow=ownerWindow,element&&(element.addEventListener("scroll",this.#onScroll,{passive:!0}),this.#scrollTarget=element);const ResizeObserverConstructor=ownerWindow?.ResizeObserver;if(element&&ResizeObserverConstructor){const observer=new ResizeObserverConstructor(()=>{this.#observer!==observer||this.#observed!==element||element.ownerDocument.defaultView!==ownerWindow||(this.measure(),this.onResize?.())});this.#observer=observer,observer.observe(element)}}this.measure()}hostDisconnected(){this.resetObservation()}resetObservation(){this.#observer?.disconnect(),this.#observer=void 0,this.#observed=void 0,this.#ownerWindow=void 0,this.#scrollTarget?.removeEventListener("scroll",this.#onScroll),this.#scrollTarget=void 0}measure(){const element=this.#observed;if(!element)return;const extent=Math.max(0,element.scrollWidth-element.clientWidth),overflows=extent>TOLERANCE_PX;if(element.toggleAttribute(SCROLL_OVERFLOW_ATTRIBUTE,overflows),!overflows){element.toggleAttribute(SCROLL_START_ATTRIBUTE,!1),element.toggleAttribute(SCROLL_END_ATTRIBUTE,!1);return}const raw=isRtl(element)?-element.scrollLeft:element.scrollLeft,position=Math.max(0,Math.min(extent,raw));element.toggleAttribute(SCROLL_START_ATTRIBUTE,position>TOLERANCE_PX),element.toggleAttribute(SCROLL_END_ATTRIBUTE,position<extent-TOLERANCE_PX)}observeExtra(elements){if(this.#observer)for(const element of elements)this.#observer.observe(element)}}function observeScrollOverflow(host,resolve,onResize){return new ScrollOverflowController(host,resolve,onResize)}export{SCROLL_END_ATTRIBUTE,SCROLL_OVERFLOW_ATTRIBUTE,SCROLL_START_ATTRIBUTE,ScrollOverflowController,observeScrollOverflow};
@@ -0,0 +1 @@
1
+ import{SourceRequestController,sourceRevision}from"./source-request-controller.js";import{sourcePageScope}from"./source-page-scope.js";import{cursorCurrent,cursorField,cursorList,cursorText,cursorToken}from"./source-cursor-projection.js";const HISTORY_LIMIT=32,PAGE_TEXT_LIMIT=2e6;function snapshot(status="idle",rows=[],initial=!0,historyLength=0,next=null,truncated=!1){return Object.freeze({rows:Object.freeze(rows),initial,navigation:Object.freeze({status,canGoBack:status==="ready"&&historyLength>1,canGoForward:status==="ready"&&next!==null,atEnd:status==="ready"&&next===null,historyTruncated:truncated})})}class SourceCursorController{constructor(host,options){this.host=host,this.generation=0,this.value=snapshot(),this.history=[],this.nextToken=null,this.truncated=!1,this.scheduled=!1,this.options=Object.freeze({...options}),this.connected=host.isConnected,this.authority=new SourceRequestController(host,{channels:["page"]}),host.addController(this)}get state(){return this.value}bind(input){const previous=this.binding;if(input&&previous&&input.source===previous.source&&input.revision===previous.revision&&input.scope===previous.scope&&input.epoch===previous.epoch&&input.locale===previous.locale)return;const transaction=this.clear();if(!input||transaction!==this.generation)return;const current=()=>transaction===this.generation;try{const registration=sourcePageScope(this.host),subscription=this.scopeSubscription={},unsubscribe=registration?.onInvalidate(()=>{this.scopeSubscription===subscription&&this.invalidate()});if(!current()){unsubscribe?.();return}this.unsubscribeScope=unsubscribe;const{source,revision,scope,epoch,locale}=input;if(typeof source!="object"&&typeof source!="function"||source===null||typeof locale!="string"||!Number.isSafeInteger(epoch)||epoch<0)throw new TypeError("Invalid cursor binding");if(sourceRevision(revision),typeof revision=="string"&&revision.length>8192)throw new RangeError("Cursor revision limit");if(cursorText(scope,8192).length===0)throw new TypeError("Empty cursor scope");cursorCurrent(current);const queryPage=source.query;if(cursorCurrent(current),typeof queryPage!="function")throw new TypeError("Invalid cursor query");const accepted=Object.freeze({source,revision,scope,epoch,locale,queryPage});this.authority.setSource(source,revision),current()&&(this.binding=accepted)}catch{current()&&this.publish(snapshot("error"))}}invalidate(){this.clear()}fail(){this.clear()===this.generation&&this.publish(snapshot("error"))}request(query,limit){const binding=this.binding;return!binding||!this.usable()?Promise.resolve(!1):!Number.isSafeInteger(limit)||limit<1||limit>500?(this.fail(),Promise.resolve(!1)):(this.history=[],this.nextToken=null,this.truncated=!1,this.start(Object.freeze({binding,query,limit,cursor:null,history:Object.freeze([null]),truncated:!1,initial:!0})))}next(){if(!this.value.navigation.canGoForward||!this.last||this.nextToken===null)return Promise.resolve(!1);const history=[...this.history,this.nextToken],truncated=this.truncated||history.length>HISTORY_LIMIT;return history.length>HISTORY_LIMIT&&history.shift(),this.start(Object.freeze({...this.last,cursor:this.nextToken,history:Object.freeze(history),truncated,initial:!1}))}previous(){if(!this.value.navigation.canGoBack||!this.last)return Promise.resolve(!1);const history=this.history.slice(0,-1),cursor=history[history.length-1];return cursor===void 0?Promise.resolve(!1):this.start(Object.freeze({...this.last,cursor,history:Object.freeze(history),truncated:this.truncated,initial:cursor===null&&!this.truncated}))}retry(){return this.value.navigation.status==="error"&&this.last?this.start(this.last):Promise.resolve(!1)}start(intent){if(!this.usable()||this.binding!==intent.binding)return Promise.resolve(!1);const transaction=++this.generation;if(this.notification=void 0,this.stop(),transaction!==this.generation||this.binding!==intent.binding||!this.usable())return Promise.resolve(!1);this.last=intent,this.publish(snapshot("loading",[],intent.initial,0,null,this.truncated));let settle;const done=new Promise(resolve=>{settle=resolve});return this.currentJob={intent,settle},this.schedule(),done}clear(){const transaction=++this.generation;this.binding=void 0,this.last=void 0,this.history=[],this.nextToken=null,this.truncated=!1,this.notification=void 0,this.value=snapshot();const unsubscribe=this.unsubscribeScope;return this.unsubscribeScope=void 0,this.scopeSubscription=void 0,unsubscribe?.(),this.stop(),transaction!==this.generation||(this.authority.setSource(void 0,void 0),transaction===this.generation&&this.notify()),transaction}stop(){const previous=this.currentJob;this.currentJob=void 0,previous?.settle(!1),this.authority.invalidate("page")}schedule(){this.scheduled||(this.scheduled=!0,queueMicrotask(()=>{this.scheduled=!1,this.pump()}))}pump(){if(this.running||!this.currentJob)return;const job=this.currentJob,{intent}=job,binding=this.binding;if(!binding||binding!==intent.binding||!this.usable()){this.stop();return}this.running=job;const generation=this.generation,owner=this.host.ownerDocument,lease=this.authority.begin("page",binding.locale),scope=sourcePageScope(this.host),current=()=>this.currentJob===job&&this.generation===generation&&this.binding===binding&&this.usable()&&this.host.ownerDocument===owner&&lease?.isCurrent()===!0&&(!scope||scope.isCurrent());Promise.resolve().then(async()=>{if(!lease||!current())return!1;const release=scope?await scope.acquire(binding.source,"page",lease.context.signal):void 0;if(scope&&!release)return!1;try{if(!current())return!1;const request=Object.freeze({...lease.context,scope:binding.scope,query:intent.query,cursor:intent.cursor,limit:intent.limit}),raw=await Reflect.apply(binding.queryPage,binding.source,[request]);cursorCurrent(current);const rows=cursorList(cursorField(raw,"rows",current),intent.limit,current),next=cursorToken(cursorField(raw,"nextCursor",current));if(next!==null&&intent.history.includes(next))throw new TypeError("Cursor cycle");const accepted=[],keys=new Set;let textUnits=0;for(const row of rows){const key=cursorText(cursorField(row,"key",current),65536,!0);if(keys.has(key))throw new TypeError("Duplicate cursor key");keys.add(key);const projected=this.options.normalizeRecord(key,cursorField(row,"value",current),current);if(cursorCurrent(current),!Number.isSafeInteger(projected.textUnits)||projected.textUnits<0||projected.textUnits>65536)throw new RangeError("Cursor document text limit");if(textUnits+=key.length+projected.textUnits,textUnits>PAGE_TEXT_LIMIT)throw new RangeError("Cursor page text limit");accepted.push(Object.freeze({key,value:projected.value}))}return cursorCurrent(current),this.history=intent.history,this.nextToken=next,this.truncated=intent.truncated,this.publish(snapshot("ready",accepted,intent.initial,intent.history.length,next,intent.truncated)),!0}finally{release?.()}}).then(accepted=>{job.settle(current()&&accepted)}).catch(()=>{current()&&this.publish(snapshot("error",[],intent.initial,0,null,this.truncated)),job.settle(!1)}).finally(()=>{this.currentJob===job&&(this.currentJob=void 0),this.running===job&&(this.running=void 0),this.schedule()})}usable(){return this.connected&&this.host.isConnected}publish(value){this.value=value,this.notify()}notify(){if(this.notification)return;const token={},generation=this.generation,owner=this.host.ownerDocument;this.notification=token,queueMicrotask(()=>{this.notification===token&&(this.notification=void 0,generation===this.generation&&this.usable()&&this.host.ownerDocument===owner&&this.options.onChange())})}adopted(){this.invalidate()}hostConnected(){this.connected=!0}hostDisconnected(){this.connected=!1,this.invalidate()}}export{SourceCursorController};
@@ -0,0 +1 @@
1
+ function cursorCurrent(current){if(!current())throw new Error("Cursor operation revoked")}function cursorField(value,key,current,required=!0){if(cursorCurrent(current),typeof value!="object"&&typeof value!="function"||value===null)throw new TypeError("Invalid cursor object");const descriptor=Object.getOwnPropertyDescriptor(value,key);if(cursorCurrent(current),!descriptor){if(required)throw new TypeError("Missing cursor field");return}if(!("value"in descriptor))throw new TypeError("Accessor cursor field");return descriptor.value}function cursorList(value,maximum,current){if(cursorCurrent(current),!Array.isArray(value))throw new TypeError("Invalid cursor collection");const length=cursorField(value,"length",current);if(typeof length!="number"||!Number.isSafeInteger(length)||length<0||length>maximum)throw new RangeError("Cursor collection limit");const result=[];for(let index=0;index<length;index++)result.push(cursorField(value,String(index),current));return result}function cursorText(value,maximum,nonblank=!1){if(typeof value!="string"||value.length>maximum||nonblank&&value.trim().length===0)throw new TypeError("Invalid cursor text");return value}function cursorToken(value){if(value===null)return null;const token=cursorText(value,8192);if(token.length===0)throw new TypeError("Empty cursor token");return token}export{cursorCurrent,cursorField,cursorList,cursorText,cursorToken};
@@ -1 +1 @@
1
- const owners=new WeakMap,hosts=new WeakMap;function setSourcePageScope(host,owner){let scope=owners.get(owner);scope||(scope={sources:new WeakMap,waiting:new Map},owners.set(owner,scope));const previous=hosts.get(host);if(previous?.scope===scope&&scope.current===previous.ticket)return;if(previous&&previous.scope.current===previous.ticket){previous.scope.current=void 0;for(const pending of[...previous.scope.waiting.values()])pending.cancel()}const owned=scope,ticket={},registration={scope:owned,ticket,isCurrent:()=>owned.current===ticket,acquire(source,channel,signal){if(!registration.isCurrent()||signal.aborted)return Promise.resolve(void 0);let lanes=owned.sources.get(source);lanes||(lanes=new Map,owned.sources.set(source,lanes));let slot=lanes.get(channel);slot||(slot={},lanes.set(channel,slot));const physical=slot;return owned.waiting.get(channel)?.cancel(),new Promise(resolve=>{let done=!1;const clear=()=>{physical.waiting===pending&&(physical.waiting=void 0),owned.waiting.get(channel)===pending&&owned.waiting.delete(channel),signal.removeEventListener("abort",cancel)},cancel=()=>{done||(done=!0,clear(),resolve(void 0))},pending={cancel,grant:()=>{if(done)return;if(!registration.isCurrent()||signal.aborted){cancel();return}if(physical.held)return;done=!0,clear();const token=physical.held={};resolve(()=>{physical.held===token&&(physical.held=void 0,physical.waiting?.grant())})}};physical.waiting=pending,owned.waiting.set(channel,pending),signal.addEventListener("abort",cancel,{once:!0}),pending.grant()})}},obsolete=[...owned.waiting.values()];owned.current=ticket,hosts.set(host,registration);for(const pending of obsolete)pending.cancel()}function sourcePageScope(host){return hosts.get(host)}export{setSourcePageScope,sourcePageScope};
1
+ const owners=new WeakMap,hosts=new WeakMap;function setSourcePageScope(host,owner){let scope=owners.get(owner);scope||(scope={sources:new WeakMap,waiting:new Map},owners.set(owner,scope));const previous=hosts.get(host);if(previous?.scope===scope&&scope.current===previous.ticket)return;const retirements=new Set,obsolete=new Set;if(previous&&previous.scope.current===previous.ticket){previous.scope.current=void 0,previous.scope.retireCurrent&&retirements.add(previous.scope.retireCurrent),previous.scope.retireCurrent=void 0;for(const pending of previous.scope.waiting.values())obsolete.add(pending)}const owned=scope,ticket={},listeners=new Set,retire=()=>{const callbacks=[...listeners];listeners.clear();for(const callback of callbacks)try{callback()}catch{}},registration={scope:owned,ticket,isCurrent:()=>owned.current===ticket,onInvalidate(listener){return registration.isCurrent()?(listeners.add(listener),()=>{listeners.delete(listener)}):(listener(),()=>{})},acquire(source,channel,signal){if(!registration.isCurrent()||signal.aborted)return Promise.resolve(void 0);channel==="page"&&(owned.pageRequested=!0);let lanes=owned.sources.get(source);lanes||(lanes=new Map,owned.sources.set(source,lanes));let slot=lanes.get(channel);slot||(slot={},lanes.set(channel,slot));const physical=channel==="page"&&owned.sharedPage?owned.sharedPage:slot;return owned.waiting.get(channel)?.cancel(),new Promise(resolve=>{let done=!1;const clear=()=>{physical.waiting===pending&&(physical.waiting=void 0),owned.waiting.get(channel)===pending&&owned.waiting.delete(channel),signal.removeEventListener("abort",cancel)},cancel=()=>{done||(done=!0,clear(),resolve(void 0))},pending={cancel,grant:()=>{if(done)return;if(!registration.isCurrent()||signal.aborted){cancel();return}if(physical.held)return;done=!0,clear();const token=physical.held={};resolve(()=>{physical.held===token&&(physical.held=void 0,physical.waiting?.grant())})}};physical.waiting=pending,owned.waiting.set(channel,pending),signal.addEventListener("abort",cancel,{once:!0}),pending.grant()})}};owned.retireCurrent&&retirements.add(owned.retireCurrent);for(const pending of owned.waiting.values())obsolete.add(pending);owned.current=ticket,owned.retireCurrent=retire,hosts.set(host,registration);for(const pending of obsolete)pending.cancel();for(const retirePrevious of retirements)retirePrevious()}function sourcePageScope(host){return hosts.get(host)}function shareSourcePageQueries(host){const registration=hosts.get(host);if(!registration?.isCurrent())throw new TypeError("A current source page scope is required");if(!registration.scope.sharedPage){if(registration.scope.pageRequested)throw new RangeError("Shared page queries require early registration");registration.scope.sharedPage={}}}export{setSourcePageScope,shareSourcePageQueries,sourcePageScope};