@pstrikez/fluent-winui-theme 0.0.0-stage → 0.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 (120) hide show
  1. package/LICENSE +22 -0
  2. package/NOTICE.md +46 -0
  3. package/README.md +140 -2
  4. package/dist/base.css +9 -0
  5. package/dist/components/nav-selection-indicator.d.ts +7 -0
  6. package/dist/components/ui/back-navigation-button.d.ts +10 -0
  7. package/dist/components/ui/badge-hue.d.ts +21 -0
  8. package/dist/components/ui/chip.d.ts +11 -0
  9. package/dist/components/ui/choice-group.d.ts +25 -0
  10. package/dist/components/ui/code-block.d.ts +13 -0
  11. package/dist/components/ui/confirm-dialog.d.ts +16 -0
  12. package/dist/components/ui/copy-to-clipboard.d.ts +1 -0
  13. package/dist/components/ui/danger.d.ts +4 -0
  14. package/dist/components/ui/dashboard-page-header.d.ts +7 -0
  15. package/dist/components/ui/dialog-shell.d.ts +24 -0
  16. package/dist/components/ui/empty-state.d.ts +17 -0
  17. package/dist/components/ui/error-shell.css.d.ts +1 -0
  18. package/dist/components/ui/error-shell.d.ts +11 -0
  19. package/dist/components/ui/fluent-form-controls.d.ts +27 -0
  20. package/dist/components/ui/http-badge.d.ts +8 -0
  21. package/dist/components/ui/info-label.d.ts +3 -0
  22. package/dist/components/ui/layout.d.ts +9 -0
  23. package/dist/components/ui/loading-screen.css.d.ts +1 -0
  24. package/dist/components/ui/loading-screen.d.ts +6 -0
  25. package/dist/components/ui/masked-icon.d.ts +5 -0
  26. package/dist/components/ui/multiselect-combobox.d.ts +21 -0
  27. package/dist/components/ui/open-link-label.d.ts +4 -0
  28. package/dist/components/ui/outcome-message-bar.d.ts +9 -0
  29. package/dist/components/ui/outcome-toast.d.ts +14 -0
  30. package/dist/components/ui/panel.d.ts +12 -0
  31. package/dist/components/ui/prism.d.ts +30 -0
  32. package/dist/components/ui/progress-ring.d.ts +8 -0
  33. package/dist/components/ui/reorder-list.d.ts +55 -0
  34. package/dist/components/ui/resource-list.d.ts +33 -0
  35. package/dist/components/ui/route-link.d.ts +19 -0
  36. package/dist/components/ui/row-title.d.ts +7 -0
  37. package/dist/components/ui/scroll-area.d.ts +44 -0
  38. package/dist/components/ui/secret-input.d.ts +7 -0
  39. package/dist/components/ui/section-header.d.ts +11 -0
  40. package/dist/components/ui/settings-card.d.ts +36 -0
  41. package/dist/components/ui/status-badge.d.ts +8 -0
  42. package/dist/components/ui/switch-setting.d.ts +7 -0
  43. package/dist/components/ui/table-actions.d.ts +13 -0
  44. package/dist/components/ui/table-columns.d.ts +3 -0
  45. package/dist/components/ui/tooltip-icon-button.d.ts +17 -0
  46. package/dist/components/ui/truncation-tooltip.d.ts +27 -0
  47. package/dist/components/ui/use-copy-to-clipboard.d.ts +13 -0
  48. package/dist/components/ui/use-dialog-invocation.d.ts +11 -0
  49. package/dist/components/ui/use-discard-guard.d.ts +19 -0
  50. package/dist/document.css.d.ts +1 -0
  51. package/dist/fluent.d.ts +2 -0
  52. package/dist/font-stacks.d.ts +2 -0
  53. package/dist/fonts/LICENSE-Meslo-LG.txt +201 -0
  54. package/dist/fonts/meslo-lg-s-400-italic.generated.woff2 +0 -0
  55. package/dist/fonts/meslo-lg-s-400-normal.generated.woff2 +0 -0
  56. package/dist/fonts/meslo-lg-s-700-italic.generated.woff2 +0 -0
  57. package/dist/fonts/meslo-lg-s-700-normal.generated.woff2 +0 -0
  58. package/dist/i18n/translation.d.ts +49 -0
  59. package/dist/index.d.ts +60 -0
  60. package/dist/index.js +8945 -0
  61. package/dist/index.js.map +7 -0
  62. package/dist/lib/color.d.ts +9 -0
  63. package/dist/lib/legacy-css-color.d.ts +1 -0
  64. package/dist/lib/reduced-motion.d.ts +1 -0
  65. package/dist/lib/use-media-query.d.ts +2 -0
  66. package/dist/shell/app-shell.d.ts +30 -0
  67. package/dist/shell/gradient-background.css.d.ts +1 -0
  68. package/dist/shell/gradient-background.d.ts +2 -0
  69. package/dist/shell/navigation-pane.d.ts +42 -0
  70. package/dist/shell/navigation-progress.css.d.ts +1 -0
  71. package/dist/shell/navigation-progress.d.ts +3 -0
  72. package/dist/shell/page-frames.d.ts +24 -0
  73. package/dist/theme-mode.d.ts +17 -0
  74. package/dist/theme.d.ts +938 -0
  75. package/dist/winui/appearance.d.ts +11 -0
  76. package/dist/winui/controls/accordion.css.d.ts +1 -0
  77. package/dist/winui/controls/badge-tag.css.d.ts +1 -0
  78. package/dist/winui/controls/button.css.d.ts +1 -0
  79. package/dist/winui/controls/card.css.d.ts +1 -0
  80. package/dist/winui/controls/checkbox-surface.d.ts +25 -0
  81. package/dist/winui/controls/choice.css.d.ts +4 -0
  82. package/dist/winui/controls/color-picker.css.d.ts +1 -0
  83. package/dist/winui/controls/dialog.css.d.ts +1 -0
  84. package/dist/winui/controls/drawer.css.d.ts +1 -0
  85. package/dist/winui/controls/field.css.d.ts +3 -0
  86. package/dist/winui/controls/list.css.d.ts +1 -0
  87. package/dist/winui/controls/menu.css.d.ts +1 -0
  88. package/dist/winui/controls/message-bar.css.d.ts +1 -0
  89. package/dist/winui/controls/nav.css.d.ts +1 -0
  90. package/dist/winui/controls/popover.css.d.ts +1 -0
  91. package/dist/winui/controls/progress.css.d.ts +1 -0
  92. package/dist/winui/controls/reveal.d.ts +11 -0
  93. package/dist/winui/controls/scrollbar.css.d.ts +1 -0
  94. package/dist/winui/controls/select.css.d.ts +1 -0
  95. package/dist/winui/controls/selection-pill.d.ts +1 -0
  96. package/dist/winui/controls/selectors.d.ts +48 -0
  97. package/dist/winui/controls/severity.d.ts +24 -0
  98. package/dist/winui/controls/switch.css.d.ts +1 -0
  99. package/dist/winui/controls/table.css.d.ts +1 -0
  100. package/dist/winui/controls/tabs.css.d.ts +1 -0
  101. package/dist/winui/controls/text-input.css.d.ts +1 -0
  102. package/dist/winui/controls/text.css.d.ts +1 -0
  103. package/dist/winui/controls/toast.css.d.ts +1 -0
  104. package/dist/winui/controls/toolbar.css.d.ts +1 -0
  105. package/dist/winui/controls/tooltip.css.d.ts +1 -0
  106. package/dist/winui/focus-rect.css.d.ts +2 -0
  107. package/dist/winui/index.d.ts +1 -0
  108. package/dist/winui/motion.d.ts +29 -0
  109. package/dist/winui/page-transition.css.d.ts +2 -0
  110. package/dist/winui/presence.d.ts +3 -0
  111. package/dist/winui/progress-indeterminate.css.d.ts +1 -0
  112. package/dist/winui/reposition.d.ts +8 -0
  113. package/dist/winui/reset.css.d.ts +1 -0
  114. package/dist/winui/switch-drag.d.ts +2 -0
  115. package/dist/winui/theme.d.ts +3 -0
  116. package/dist/winui/toaster.d.ts +2 -0
  117. package/dist/winui/tokens.d.ts +1 -0
  118. package/dist/winui/wrap.d.ts +3 -0
  119. package/dist/winui.css +1 -0
  120. package/package.json +76 -4
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/prism.js", "../src/fluent.ts", "../src/winui/appearance.ts", "../src/winui/wrap.ts", "../src/winui/presence.ts", "../src/winui/motion.ts", "../src/winui/switch-drag.tsx", "../src/winui/toaster.tsx", "../src/winui/reposition.ts", "../src/font-stacks.ts", "../src/lib/legacy-css-color.ts", "../src/theme.ts", "../src/winui/theme.ts", "../src/winui/page-transition.css.ts", "../src/winui/progress-indeterminate.css.ts", "../src/components/nav-selection-indicator.tsx", "../src/lib/reduced-motion.ts", "../src/theme-mode.ts", "../src/components/ui/back-navigation-button.tsx", "../src/components/ui/route-link.tsx", "../src/lib/color.ts", "../src/components/ui/badge-hue.ts", "../src/components/ui/chip.tsx", "../src/components/ui/choice-group.tsx", "../src/components/ui/fluent-form-controls.tsx", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/support/cache.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/support/compatibility/isBrowser.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/support/utils/alias.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/support/compatibility/apis.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/support/utils/types.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/support/utils/animation.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/support/utils/array.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/support/utils/strings.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/support/utils/equal.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/support/utils/function.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/support/utils/object.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/support/utils/noop.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/support/utils/math.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/support/dom/attribute.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/support/dom/class.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/support/dom/traversal.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/support/dom/manipulation.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/trustedTypePolicy.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/support/dom/create.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/support/dom/style.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/support/dom/dimensions.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/support/dom/events.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/support/dom/scroll.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/support/dom/focus.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/support/eventListeners.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/plugins/plugins.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/plugins/optionsValidationPlugin/optionsValidationPlugin.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/classnames.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/plugins/sizeObserverPlugin/sizeObserverPlugin.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/setups/structureSetup/structureSetup.utils.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/plugins/scrollbarsHidingPlugin/scrollbarsHidingPlugin.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/plugins/clickScrollPlugin/clickScrollPlugin.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/options.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/nonce.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/environment.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/observers/domObserver.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/observers/sizeObserver.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/observers/trinsicObserver.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/setups/observersSetup/observersSetup.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/initialization.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/setups/scrollbarsSetup/scrollbarsSetup.elements.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/setups/scrollbarsSetup/scrollbarsSetup.events.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/setups/scrollbarsSetup/scrollbarsSetup.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/setups/structureSetup/structureSetup.elements.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/setups/structureSetup/updateSegments/trinsicUpdateSegment.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/setups/structureSetup/updateSegments/paddingUpdateSegment.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/setups/structureSetup/updateSegments/overflowUpdateSegment.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/setups/structureSetup/structureSetup.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/setups/setups.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/instances.ts", "../node_modules/.pnpm/overlayscrollbars@2.13.0_patch_hash=0989d8ab263bb64de03bfa5ce05a0492b7a0b2211ac83be29beaf137c31b2e22/node_modules/src/overlayscrollbars.ts", "../src/components/ui/scroll-area.tsx", "../src/i18n/translation.tsx", "../src/components/ui/code-block.tsx", "../src/components/ui/prism.ts", "../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-bash.js", "../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-json.js", "../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-markdown.js", "../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-powershell.js", "../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-toml.js", "../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-typescript.js", "../src/components/ui/use-copy-to-clipboard.ts", "../src/components/ui/copy-to-clipboard.ts", "../src/components/ui/dialog-shell.tsx", "../src/components/ui/outcome-message-bar.tsx", "../src/components/ui/confirm-dialog.tsx", "../src/components/ui/danger.ts", "../src/components/ui/layout.ts", "../src/components/ui/dashboard-page-header.tsx", "../src/components/ui/empty-state.tsx", "../src/components/ui/error-shell.tsx", "../src/components/ui/status-badge.tsx", "../src/components/ui/http-badge.tsx", "../src/components/ui/info-label.tsx", "../src/components/ui/loading-screen.tsx", "../src/components/ui/masked-icon.tsx", "../src/components/ui/multiselect-combobox.tsx", "../src/components/ui/open-link-label.tsx", "../src/components/ui/outcome-toast.tsx", "../src/components/ui/panel.tsx", "../src/components/ui/progress-ring.tsx", "../src/components/ui/reorder-list.tsx", "../src/components/ui/resource-list.tsx", "../src/components/ui/row-title.tsx", "../src/components/ui/secret-input.tsx", "../src/components/ui/section-header.tsx", "../src/components/ui/settings-card.tsx", "../src/components/ui/switch-setting.tsx", "../src/components/ui/table-actions.tsx", "../src/components/ui/table-columns.tsx", "../src/components/ui/tooltip-icon-button.tsx", "../src/components/ui/truncation-tooltip.tsx", "../src/components/ui/use-dialog-invocation.ts", "../src/components/ui/use-discard-guard.tsx", "../src/shell/app-shell.tsx", "../src/shell/page-frames.tsx", "../src/shell/gradient-background.tsx", "../src/shell/navigation-pane.tsx", "../src/shell/navigation-progress.tsx"],
4
+ "sourcesContent": ["\n/* **********************************************\n Begin prism-core.js\n********************************************** */\n\n/// <reference lib=\"WebWorker\"/>\n\nvar _self = (typeof window !== 'undefined')\n\t? window // if in browser\n\t: (\n\t\t(typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope)\n\t\t\t? self // if in worker\n\t\t\t: {} // if in node js\n\t);\n\n/**\n * Prism: Lightweight, robust, elegant syntax highlighting\n *\n * @license MIT <https://opensource.org/licenses/MIT>\n * @author Lea Verou <https://lea.verou.me>\n * @namespace\n * @public\n */\nvar Prism = (function (_self) {\n\n\t// Private helper vars\n\tvar lang = /(?:^|\\s)lang(?:uage)?-([\\w-]+)(?=\\s|$)/i;\n\tvar uniqueId = 0;\n\n\t// The grammar object for plaintext\n\tvar plainTextGrammar = {};\n\n\n\tvar _ = {\n\t\t/**\n\t\t * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the\n\t\t * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load\n\t\t * additional languages or plugins yourself.\n\t\t *\n\t\t * By setting this value to `true`, Prism will not automatically highlight all code elements on the page.\n\t\t *\n\t\t * You obviously have to change this value before the automatic highlighting started. To do this, you can add an\n\t\t * empty Prism object into the global scope before loading the Prism script like this:\n\t\t *\n\t\t * ```js\n\t\t * window.Prism = window.Prism || {};\n\t\t * Prism.manual = true;\n\t\t * // add a new <script> to load Prism's script\n\t\t * ```\n\t\t *\n\t\t * @default false\n\t\t * @type {boolean}\n\t\t * @memberof Prism\n\t\t * @public\n\t\t */\n\t\tmanual: _self.Prism && _self.Prism.manual,\n\t\t/**\n\t\t * By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses\n\t\t * `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your\n\t\t * own worker, you don't want it to do this.\n\t\t *\n\t\t * By setting this value to `true`, Prism will not add its own listeners to the worker.\n\t\t *\n\t\t * You obviously have to change this value before Prism executes. To do this, you can add an\n\t\t * empty Prism object into the global scope before loading the Prism script like this:\n\t\t *\n\t\t * ```js\n\t\t * window.Prism = window.Prism || {};\n\t\t * Prism.disableWorkerMessageHandler = true;\n\t\t * // Load Prism's script\n\t\t * ```\n\t\t *\n\t\t * @default false\n\t\t * @type {boolean}\n\t\t * @memberof Prism\n\t\t * @public\n\t\t */\n\t\tdisableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler,\n\n\t\t/**\n\t\t * A namespace for utility methods.\n\t\t *\n\t\t * All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may\n\t\t * change or disappear at any time.\n\t\t *\n\t\t * @namespace\n\t\t * @memberof Prism\n\t\t */\n\t\tutil: {\n\t\t\tencode: function encode(tokens) {\n\t\t\t\tif (tokens instanceof Token) {\n\t\t\t\t\treturn new Token(tokens.type, encode(tokens.content), tokens.alias);\n\t\t\t\t} else if (Array.isArray(tokens)) {\n\t\t\t\t\treturn tokens.map(encode);\n\t\t\t\t} else {\n\t\t\t\t\treturn tokens.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\\u00a0/g, ' ');\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Returns the name of the type of the given value.\n\t\t\t *\n\t\t\t * @param {any} o\n\t\t\t * @returns {string}\n\t\t\t * @example\n\t\t\t * type(null) === 'Null'\n\t\t\t * type(undefined) === 'Undefined'\n\t\t\t * type(123) === 'Number'\n\t\t\t * type('foo') === 'String'\n\t\t\t * type(true) === 'Boolean'\n\t\t\t * type([1, 2]) === 'Array'\n\t\t\t * type({}) === 'Object'\n\t\t\t * type(String) === 'Function'\n\t\t\t * type(/abc+/) === 'RegExp'\n\t\t\t */\n\t\t\ttype: function (o) {\n\t\t\t\treturn Object.prototype.toString.call(o).slice(8, -1);\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Returns a unique number for the given object. Later calls will still return the same number.\n\t\t\t *\n\t\t\t * @param {Object} obj\n\t\t\t * @returns {number}\n\t\t\t */\n\t\t\tobjId: function (obj) {\n\t\t\t\tif (!obj['__id']) {\n\t\t\t\t\tObject.defineProperty(obj, '__id', { value: ++uniqueId });\n\t\t\t\t}\n\t\t\t\treturn obj['__id'];\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Creates a deep clone of the given object.\n\t\t\t *\n\t\t\t * The main intended use of this function is to clone language definitions.\n\t\t\t *\n\t\t\t * @param {T} o\n\t\t\t * @param {Record<number, any>} [visited]\n\t\t\t * @returns {T}\n\t\t\t * @template T\n\t\t\t */\n\t\t\tclone: function deepClone(o, visited) {\n\t\t\t\tvisited = visited || {};\n\n\t\t\t\tvar clone; var id;\n\t\t\t\tswitch (_.util.type(o)) {\n\t\t\t\t\tcase 'Object':\n\t\t\t\t\t\tid = _.util.objId(o);\n\t\t\t\t\t\tif (visited[id]) {\n\t\t\t\t\t\t\treturn visited[id];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclone = /** @type {Record<string, any>} */ ({});\n\t\t\t\t\t\tvisited[id] = clone;\n\n\t\t\t\t\t\tfor (var key in o) {\n\t\t\t\t\t\t\tif (o.hasOwnProperty(key)) {\n\t\t\t\t\t\t\t\tclone[key] = deepClone(o[key], visited);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn /** @type {any} */ (clone);\n\n\t\t\t\t\tcase 'Array':\n\t\t\t\t\t\tid = _.util.objId(o);\n\t\t\t\t\t\tif (visited[id]) {\n\t\t\t\t\t\t\treturn visited[id];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclone = [];\n\t\t\t\t\t\tvisited[id] = clone;\n\n\t\t\t\t\t\t(/** @type {Array} */(/** @type {any} */(o))).forEach(function (v, i) {\n\t\t\t\t\t\t\tclone[i] = deepClone(v, visited);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn /** @type {any} */ (clone);\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn o;\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.\n\t\t\t *\n\t\t\t * If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.\n\t\t\t *\n\t\t\t * @param {Element} element\n\t\t\t * @returns {string}\n\t\t\t */\n\t\t\tgetLanguage: function (element) {\n\t\t\t\twhile (element) {\n\t\t\t\t\tvar m = lang.exec(element.className);\n\t\t\t\t\tif (m) {\n\t\t\t\t\t\treturn m[1].toLowerCase();\n\t\t\t\t\t}\n\t\t\t\t\telement = element.parentElement;\n\t\t\t\t}\n\t\t\t\treturn 'none';\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Sets the Prism `language-xxxx` class of the given element.\n\t\t\t *\n\t\t\t * @param {Element} element\n\t\t\t * @param {string} language\n\t\t\t * @returns {void}\n\t\t\t */\n\t\t\tsetLanguage: function (element, language) {\n\t\t\t\t// remove all `language-xxxx` classes\n\t\t\t\t// (this might leave behind a leading space)\n\t\t\t\telement.className = element.className.replace(RegExp(lang, 'gi'), '');\n\n\t\t\t\t// add the new `language-xxxx` class\n\t\t\t\t// (using `classList` will automatically clean up spaces for us)\n\t\t\t\telement.classList.add('language-' + language);\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Returns the script element that is currently executing.\n\t\t\t *\n\t\t\t * This does __not__ work for line script element.\n\t\t\t *\n\t\t\t * @returns {HTMLScriptElement | null}\n\t\t\t */\n\t\t\tcurrentScript: function () {\n\t\t\t\tif (typeof document === 'undefined') {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tif (document.currentScript && document.currentScript.tagName === 'SCRIPT' && 1 < 2 /* hack to trip TS' flow analysis */) {\n\t\t\t\t\treturn /** @type {any} */ (document.currentScript);\n\t\t\t\t}\n\n\t\t\t\t// IE11 workaround\n\t\t\t\t// we'll get the src of the current script by parsing IE11's error stack trace\n\t\t\t\t// this will not work for inline scripts\n\n\t\t\t\ttry {\n\t\t\t\t\tthrow new Error();\n\t\t\t\t} catch (err) {\n\t\t\t\t\t// Get file src url from stack. Specifically works with the format of stack traces in IE.\n\t\t\t\t\t// A stack will look like this:\n\t\t\t\t\t//\n\t\t\t\t\t// Error\n\t\t\t\t\t// at _.util.currentScript (http://localhost/components/prism-core.js:119:5)\n\t\t\t\t\t// at Global code (http://localhost/components/prism-core.js:606:1)\n\n\t\t\t\t\tvar src = (/at [^(\\r\\n]*\\((.*):[^:]+:[^:]+\\)$/i.exec(err.stack) || [])[1];\n\t\t\t\t\tif (src) {\n\t\t\t\t\t\tvar scripts = document.getElementsByTagName('script');\n\t\t\t\t\t\tfor (var i in scripts) {\n\t\t\t\t\t\t\tif (scripts[i].src == src) {\n\t\t\t\t\t\t\t\treturn scripts[i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Returns whether a given class is active for `element`.\n\t\t\t *\n\t\t\t * The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated\n\t\t\t * if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the\n\t\t\t * given class is just the given class with a `no-` prefix.\n\t\t\t *\n\t\t\t * Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is\n\t\t\t * closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its\n\t\t\t * ancestors have the given class or the negated version of it, then the default activation will be returned.\n\t\t\t *\n\t\t\t * In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated\n\t\t\t * version of it, the class is considered active.\n\t\t\t *\n\t\t\t * @param {Element} element\n\t\t\t * @param {string} className\n\t\t\t * @param {boolean} [defaultActivation=false]\n\t\t\t * @returns {boolean}\n\t\t\t */\n\t\t\tisActive: function (element, className, defaultActivation) {\n\t\t\t\tvar no = 'no-' + className;\n\n\t\t\t\twhile (element) {\n\t\t\t\t\tvar classList = element.classList;\n\t\t\t\t\tif (classList.contains(className)) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tif (classList.contains(no)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\telement = element.parentElement;\n\t\t\t\t}\n\t\t\t\treturn !!defaultActivation;\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * This namespace contains all currently loaded languages and the some helper functions to create and modify languages.\n\t\t *\n\t\t * @namespace\n\t\t * @memberof Prism\n\t\t * @public\n\t\t */\n\t\tlanguages: {\n\t\t\t/**\n\t\t\t * The grammar for plain, unformatted text.\n\t\t\t */\n\t\t\tplain: plainTextGrammar,\n\t\t\tplaintext: plainTextGrammar,\n\t\t\ttext: plainTextGrammar,\n\t\t\ttxt: plainTextGrammar,\n\n\t\t\t/**\n\t\t\t * Creates a deep copy of the language with the given id and appends the given tokens.\n\t\t\t *\n\t\t\t * If a token in `redef` also appears in the copied language, then the existing token in the copied language\n\t\t\t * will be overwritten at its original position.\n\t\t\t *\n\t\t\t * ## Best practices\n\t\t\t *\n\t\t\t * Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)\n\t\t\t * doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to\n\t\t\t * understand the language definition because, normally, the order of tokens matters in Prism grammars.\n\t\t\t *\n\t\t\t * Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.\n\t\t\t * Furthermore, all non-overwriting tokens should be placed after the overwriting ones.\n\t\t\t *\n\t\t\t * @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.\n\t\t\t * @param {Grammar} redef The new tokens to append.\n\t\t\t * @returns {Grammar} The new language created.\n\t\t\t * @public\n\t\t\t * @example\n\t\t\t * Prism.languages['css-with-colors'] = Prism.languages.extend('css', {\n\t\t\t * // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token\n\t\t\t * // at its original position\n\t\t\t * 'comment': { ... },\n\t\t\t * // CSS doesn't have a 'color' token, so this token will be appended\n\t\t\t * 'color': /\\b(?:red|green|blue)\\b/\n\t\t\t * });\n\t\t\t */\n\t\t\textend: function (id, redef) {\n\t\t\t\tvar lang = _.util.clone(_.languages[id]);\n\n\t\t\t\tfor (var key in redef) {\n\t\t\t\t\tlang[key] = redef[key];\n\t\t\t\t}\n\n\t\t\t\treturn lang;\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Inserts tokens _before_ another token in a language definition or any other grammar.\n\t\t\t *\n\t\t\t * ## Usage\n\t\t\t *\n\t\t\t * This helper method makes it easy to modify existing languages. For example, the CSS language definition\n\t\t\t * not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded\n\t\t\t * in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the\n\t\t\t * appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do\n\t\t\t * this:\n\t\t\t *\n\t\t\t * ```js\n\t\t\t * Prism.languages.markup.style = {\n\t\t\t * // token\n\t\t\t * };\n\t\t\t * ```\n\t\t\t *\n\t\t\t * then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens\n\t\t\t * before existing tokens. For the CSS example above, you would use it like this:\n\t\t\t *\n\t\t\t * ```js\n\t\t\t * Prism.languages.insertBefore('markup', 'cdata', {\n\t\t\t * 'style': {\n\t\t\t * // token\n\t\t\t * }\n\t\t\t * });\n\t\t\t * ```\n\t\t\t *\n\t\t\t * ## Special cases\n\t\t\t *\n\t\t\t * If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar\n\t\t\t * will be ignored.\n\t\t\t *\n\t\t\t * This behavior can be used to insert tokens after `before`:\n\t\t\t *\n\t\t\t * ```js\n\t\t\t * Prism.languages.insertBefore('markup', 'comment', {\n\t\t\t * 'comment': Prism.languages.markup.comment,\n\t\t\t * // tokens after 'comment'\n\t\t\t * });\n\t\t\t * ```\n\t\t\t *\n\t\t\t * ## Limitations\n\t\t\t *\n\t\t\t * The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object\n\t\t\t * properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave\n\t\t\t * differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily\n\t\t\t * deleting properties which is necessary to insert at arbitrary positions.\n\t\t\t *\n\t\t\t * To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.\n\t\t\t * Instead, it will create a new object and replace all references to the target object with the new one. This\n\t\t\t * can be done without temporarily deleting properties, so the iteration order is well-defined.\n\t\t\t *\n\t\t\t * However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if\n\t\t\t * you hold the target object in a variable, then the value of the variable will not change.\n\t\t\t *\n\t\t\t * ```js\n\t\t\t * var oldMarkup = Prism.languages.markup;\n\t\t\t * var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });\n\t\t\t *\n\t\t\t * assert(oldMarkup !== Prism.languages.markup);\n\t\t\t * assert(newMarkup === Prism.languages.markup);\n\t\t\t * ```\n\t\t\t *\n\t\t\t * @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the\n\t\t\t * object to be modified.\n\t\t\t * @param {string} before The key to insert before.\n\t\t\t * @param {Grammar} insert An object containing the key-value pairs to be inserted.\n\t\t\t * @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the\n\t\t\t * object to be modified.\n\t\t\t *\n\t\t\t * Defaults to `Prism.languages`.\n\t\t\t * @returns {Grammar} The new grammar object.\n\t\t\t * @public\n\t\t\t */\n\t\t\tinsertBefore: function (inside, before, insert, root) {\n\t\t\t\troot = root || /** @type {any} */ (_.languages);\n\t\t\t\tvar grammar = root[inside];\n\t\t\t\t/** @type {Grammar} */\n\t\t\t\tvar ret = {};\n\n\t\t\t\tfor (var token in grammar) {\n\t\t\t\t\tif (grammar.hasOwnProperty(token)) {\n\n\t\t\t\t\t\tif (token == before) {\n\t\t\t\t\t\t\tfor (var newToken in insert) {\n\t\t\t\t\t\t\t\tif (insert.hasOwnProperty(newToken)) {\n\t\t\t\t\t\t\t\t\tret[newToken] = insert[newToken];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Do not insert token which also occur in insert. See #1525\n\t\t\t\t\t\tif (!insert.hasOwnProperty(token)) {\n\t\t\t\t\t\t\tret[token] = grammar[token];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar old = root[inside];\n\t\t\t\troot[inside] = ret;\n\n\t\t\t\t// Update references in other language definitions\n\t\t\t\t_.languages.DFS(_.languages, function (key, value) {\n\t\t\t\t\tif (value === old && key != inside) {\n\t\t\t\t\t\tthis[key] = ret;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn ret;\n\t\t\t},\n\n\t\t\t// Traverse a language definition with Depth First Search\n\t\t\tDFS: function DFS(o, callback, type, visited) {\n\t\t\t\tvisited = visited || {};\n\n\t\t\t\tvar objId = _.util.objId;\n\n\t\t\t\tfor (var i in o) {\n\t\t\t\t\tif (o.hasOwnProperty(i)) {\n\t\t\t\t\t\tcallback.call(o, i, o[i], type || i);\n\n\t\t\t\t\t\tvar property = o[i];\n\t\t\t\t\t\tvar propertyType = _.util.type(property);\n\n\t\t\t\t\t\tif (propertyType === 'Object' && !visited[objId(property)]) {\n\t\t\t\t\t\t\tvisited[objId(property)] = true;\n\t\t\t\t\t\t\tDFS(property, callback, null, visited);\n\t\t\t\t\t\t} else if (propertyType === 'Array' && !visited[objId(property)]) {\n\t\t\t\t\t\t\tvisited[objId(property)] = true;\n\t\t\t\t\t\t\tDFS(property, callback, i, visited);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tplugins: {},\n\n\t\t/**\n\t\t * This is the most high-level function in Prism\u2019s API.\n\t\t * It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on\n\t\t * each one of them.\n\t\t *\n\t\t * This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.\n\t\t *\n\t\t * @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.\n\t\t * @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.\n\t\t * @memberof Prism\n\t\t * @public\n\t\t */\n\t\thighlightAll: function (async, callback) {\n\t\t\t_.highlightAllUnder(document, async, callback);\n\t\t},\n\n\t\t/**\n\t\t * Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls\n\t\t * {@link Prism.highlightElement} on each one of them.\n\t\t *\n\t\t * The following hooks will be run:\n\t\t * 1. `before-highlightall`\n\t\t * 2. `before-all-elements-highlight`\n\t\t * 3. All hooks of {@link Prism.highlightElement} for each element.\n\t\t *\n\t\t * @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.\n\t\t * @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.\n\t\t * @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.\n\t\t * @memberof Prism\n\t\t * @public\n\t\t */\n\t\thighlightAllUnder: function (container, async, callback) {\n\t\t\tvar env = {\n\t\t\t\tcallback: callback,\n\t\t\t\tcontainer: container,\n\t\t\t\tselector: 'code[class*=\"language-\"], [class*=\"language-\"] code, code[class*=\"lang-\"], [class*=\"lang-\"] code'\n\t\t\t};\n\n\t\t\t_.hooks.run('before-highlightall', env);\n\n\t\t\tenv.elements = Array.prototype.slice.apply(env.container.querySelectorAll(env.selector));\n\n\t\t\t_.hooks.run('before-all-elements-highlight', env);\n\n\t\t\tfor (var i = 0, element; (element = env.elements[i++]);) {\n\t\t\t\t_.highlightElement(element, async === true, env.callback);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Highlights the code inside a single element.\n\t\t *\n\t\t * The following hooks will be run:\n\t\t * 1. `before-sanity-check`\n\t\t * 2. `before-highlight`\n\t\t * 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.\n\t\t * 4. `before-insert`\n\t\t * 5. `after-highlight`\n\t\t * 6. `complete`\n\t\t *\n\t\t * Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for\n\t\t * the element's language.\n\t\t *\n\t\t * @param {Element} element The element containing the code.\n\t\t * It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.\n\t\t * @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers\n\t\t * to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is\n\t\t * [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).\n\t\t *\n\t\t * Note: All language definitions required to highlight the code must be included in the main `prism.js` file for\n\t\t * asynchronous highlighting to work. You can build your own bundle on the\n\t\t * [Download page](https://prismjs.com/download.html).\n\t\t * @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.\n\t\t * Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.\n\t\t * @memberof Prism\n\t\t * @public\n\t\t */\n\t\thighlightElement: function (element, async, callback) {\n\t\t\t// Find language\n\t\t\tvar language = _.util.getLanguage(element);\n\t\t\tvar grammar = _.languages[language];\n\n\t\t\t// Set language on the element, if not present\n\t\t\t_.util.setLanguage(element, language);\n\n\t\t\t// Set language on the parent, for styling\n\t\t\tvar parent = element.parentElement;\n\t\t\tif (parent && parent.nodeName.toLowerCase() === 'pre') {\n\t\t\t\t_.util.setLanguage(parent, language);\n\t\t\t}\n\n\t\t\tvar code = element.textContent;\n\n\t\t\tvar env = {\n\t\t\t\telement: element,\n\t\t\t\tlanguage: language,\n\t\t\t\tgrammar: grammar,\n\t\t\t\tcode: code\n\t\t\t};\n\n\t\t\tfunction insertHighlightedCode(highlightedCode) {\n\t\t\t\tenv.highlightedCode = highlightedCode;\n\n\t\t\t\t_.hooks.run('before-insert', env);\n\n\t\t\t\tenv.element.innerHTML = env.highlightedCode;\n\n\t\t\t\t_.hooks.run('after-highlight', env);\n\t\t\t\t_.hooks.run('complete', env);\n\t\t\t\tcallback && callback.call(env.element);\n\t\t\t}\n\n\t\t\t_.hooks.run('before-sanity-check', env);\n\n\t\t\t// plugins may change/add the parent/element\n\t\t\tparent = env.element.parentElement;\n\t\t\tif (parent && parent.nodeName.toLowerCase() === 'pre' && !parent.hasAttribute('tabindex')) {\n\t\t\t\tparent.setAttribute('tabindex', '0');\n\t\t\t}\n\n\t\t\tif (!env.code) {\n\t\t\t\t_.hooks.run('complete', env);\n\t\t\t\tcallback && callback.call(env.element);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t_.hooks.run('before-highlight', env);\n\n\t\t\tif (!env.grammar) {\n\t\t\t\tinsertHighlightedCode(_.util.encode(env.code));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (async && _self.Worker) {\n\t\t\t\tvar worker = new Worker(_.filename);\n\n\t\t\t\tworker.onmessage = function (evt) {\n\t\t\t\t\tinsertHighlightedCode(evt.data);\n\t\t\t\t};\n\n\t\t\t\tworker.postMessage(JSON.stringify({\n\t\t\t\t\tlanguage: env.language,\n\t\t\t\t\tcode: env.code,\n\t\t\t\t\timmediateClose: true\n\t\t\t\t}));\n\t\t\t} else {\n\t\t\t\tinsertHighlightedCode(_.highlight(env.code, env.grammar, env.language));\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Low-level function, only use if you know what you\u2019re doing. It accepts a string of text as input\n\t\t * and the language definitions to use, and returns a string with the HTML produced.\n\t\t *\n\t\t * The following hooks will be run:\n\t\t * 1. `before-tokenize`\n\t\t * 2. `after-tokenize`\n\t\t * 3. `wrap`: On each {@link Token}.\n\t\t *\n\t\t * @param {string} text A string with the code to be highlighted.\n\t\t * @param {Grammar} grammar An object containing the tokens to use.\n\t\t *\n\t\t * Usually a language definition like `Prism.languages.markup`.\n\t\t * @param {string} language The name of the language definition passed to `grammar`.\n\t\t * @returns {string} The highlighted HTML.\n\t\t * @memberof Prism\n\t\t * @public\n\t\t * @example\n\t\t * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');\n\t\t */\n\t\thighlight: function (text, grammar, language) {\n\t\t\tvar env = {\n\t\t\t\tcode: text,\n\t\t\t\tgrammar: grammar,\n\t\t\t\tlanguage: language\n\t\t\t};\n\t\t\t_.hooks.run('before-tokenize', env);\n\t\t\tif (!env.grammar) {\n\t\t\t\tthrow new Error('The language \"' + env.language + '\" has no grammar.');\n\t\t\t}\n\t\t\tenv.tokens = _.tokenize(env.code, env.grammar);\n\t\t\t_.hooks.run('after-tokenize', env);\n\t\t\treturn Token.stringify(_.util.encode(env.tokens), env.language);\n\t\t},\n\n\t\t/**\n\t\t * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input\n\t\t * and the language definitions to use, and returns an array with the tokenized code.\n\t\t *\n\t\t * When the language definition includes nested tokens, the function is called recursively on each of these tokens.\n\t\t *\n\t\t * This method could be useful in other contexts as well, as a very crude parser.\n\t\t *\n\t\t * @param {string} text A string with the code to be highlighted.\n\t\t * @param {Grammar} grammar An object containing the tokens to use.\n\t\t *\n\t\t * Usually a language definition like `Prism.languages.markup`.\n\t\t * @returns {TokenStream} An array of strings and tokens, a token stream.\n\t\t * @memberof Prism\n\t\t * @public\n\t\t * @example\n\t\t * let code = `var foo = 0;`;\n\t\t * let tokens = Prism.tokenize(code, Prism.languages.javascript);\n\t\t * tokens.forEach(token => {\n\t\t * if (token instanceof Prism.Token && token.type === 'number') {\n\t\t * console.log(`Found numeric literal: ${token.content}`);\n\t\t * }\n\t\t * });\n\t\t */\n\t\ttokenize: function (text, grammar) {\n\t\t\tvar rest = grammar.rest;\n\t\t\tif (rest) {\n\t\t\t\tfor (var token in rest) {\n\t\t\t\t\tgrammar[token] = rest[token];\n\t\t\t\t}\n\n\t\t\t\tdelete grammar.rest;\n\t\t\t}\n\n\t\t\tvar tokenList = new LinkedList();\n\t\t\taddAfter(tokenList, tokenList.head, text);\n\n\t\t\tmatchGrammar(text, tokenList, grammar, tokenList.head, 0);\n\n\t\t\treturn toArray(tokenList);\n\t\t},\n\n\t\t/**\n\t\t * @namespace\n\t\t * @memberof Prism\n\t\t * @public\n\t\t */\n\t\thooks: {\n\t\t\tall: {},\n\n\t\t\t/**\n\t\t\t * Adds the given callback to the list of callbacks for the given hook.\n\t\t\t *\n\t\t\t * The callback will be invoked when the hook it is registered for is run.\n\t\t\t * Hooks are usually directly run by a highlight function but you can also run hooks yourself.\n\t\t\t *\n\t\t\t * One callback function can be registered to multiple hooks and the same hook multiple times.\n\t\t\t *\n\t\t\t * @param {string} name The name of the hook.\n\t\t\t * @param {HookCallback} callback The callback function which is given environment variables.\n\t\t\t * @public\n\t\t\t */\n\t\t\tadd: function (name, callback) {\n\t\t\t\tvar hooks = _.hooks.all;\n\n\t\t\t\thooks[name] = hooks[name] || [];\n\n\t\t\t\thooks[name].push(callback);\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Runs a hook invoking all registered callbacks with the given environment variables.\n\t\t\t *\n\t\t\t * Callbacks will be invoked synchronously and in the order in which they were registered.\n\t\t\t *\n\t\t\t * @param {string} name The name of the hook.\n\t\t\t * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.\n\t\t\t * @public\n\t\t\t */\n\t\t\trun: function (name, env) {\n\t\t\t\tvar callbacks = _.hooks.all[name];\n\n\t\t\t\tif (!callbacks || !callbacks.length) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfor (var i = 0, callback; (callback = callbacks[i++]);) {\n\t\t\t\t\tcallback(env);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tToken: Token\n\t};\n\t_self.Prism = _;\n\n\n\t// Typescript note:\n\t// The following can be used to import the Token type in JSDoc:\n\t//\n\t// @typedef {InstanceType<import(\"./prism-core\")[\"Token\"]>} Token\n\n\t/**\n\t * Creates a new token.\n\t *\n\t * @param {string} type See {@link Token#type type}\n\t * @param {string | TokenStream} content See {@link Token#content content}\n\t * @param {string|string[]} [alias] The alias(es) of the token.\n\t * @param {string} [matchedStr=\"\"] A copy of the full string this token was created from.\n\t * @class\n\t * @global\n\t * @public\n\t */\n\tfunction Token(type, content, alias, matchedStr) {\n\t\t/**\n\t\t * The type of the token.\n\t\t *\n\t\t * This is usually the key of a pattern in a {@link Grammar}.\n\t\t *\n\t\t * @type {string}\n\t\t * @see GrammarToken\n\t\t * @public\n\t\t */\n\t\tthis.type = type;\n\t\t/**\n\t\t * The strings or tokens contained by this token.\n\t\t *\n\t\t * This will be a token stream if the pattern matched also defined an `inside` grammar.\n\t\t *\n\t\t * @type {string | TokenStream}\n\t\t * @public\n\t\t */\n\t\tthis.content = content;\n\t\t/**\n\t\t * The alias(es) of the token.\n\t\t *\n\t\t * @type {string|string[]}\n\t\t * @see GrammarToken\n\t\t * @public\n\t\t */\n\t\tthis.alias = alias;\n\t\t// Copy of the full string this token was created from\n\t\tthis.length = (matchedStr || '').length | 0;\n\t}\n\n\t/**\n\t * A token stream is an array of strings and {@link Token Token} objects.\n\t *\n\t * Token streams have to fulfill a few properties that are assumed by most functions (mostly internal ones) that process\n\t * them.\n\t *\n\t * 1. No adjacent strings.\n\t * 2. No empty strings.\n\t *\n\t * The only exception here is the token stream that only contains the empty string and nothing else.\n\t *\n\t * @typedef {Array<string | Token>} TokenStream\n\t * @global\n\t * @public\n\t */\n\n\t/**\n\t * Converts the given token or token stream to an HTML representation.\n\t *\n\t * The following hooks will be run:\n\t * 1. `wrap`: On each {@link Token}.\n\t *\n\t * @param {string | Token | TokenStream} o The token or token stream to be converted.\n\t * @param {string} language The name of current language.\n\t * @returns {string} The HTML representation of the token or token stream.\n\t * @memberof Token\n\t * @static\n\t */\n\tToken.stringify = function stringify(o, language) {\n\t\tif (typeof o == 'string') {\n\t\t\treturn o;\n\t\t}\n\t\tif (Array.isArray(o)) {\n\t\t\tvar s = '';\n\t\t\to.forEach(function (e) {\n\t\t\t\ts += stringify(e, language);\n\t\t\t});\n\t\t\treturn s;\n\t\t}\n\n\t\tvar env = {\n\t\t\ttype: o.type,\n\t\t\tcontent: stringify(o.content, language),\n\t\t\ttag: 'span',\n\t\t\tclasses: ['token', o.type],\n\t\t\tattributes: {},\n\t\t\tlanguage: language\n\t\t};\n\n\t\tvar aliases = o.alias;\n\t\tif (aliases) {\n\t\t\tif (Array.isArray(aliases)) {\n\t\t\t\tArray.prototype.push.apply(env.classes, aliases);\n\t\t\t} else {\n\t\t\t\tenv.classes.push(aliases);\n\t\t\t}\n\t\t}\n\n\t\t_.hooks.run('wrap', env);\n\n\t\tvar attributes = '';\n\t\tfor (var name in env.attributes) {\n\t\t\tattributes += ' ' + name + '=\"' + (env.attributes[name] || '').replace(/\"/g, '&quot;') + '\"';\n\t\t}\n\n\t\treturn '<' + env.tag + ' class=\"' + env.classes.join(' ') + '\"' + attributes + '>' + env.content + '</' + env.tag + '>';\n\t};\n\n\t/**\n\t * @param {RegExp} pattern\n\t * @param {number} pos\n\t * @param {string} text\n\t * @param {boolean} lookbehind\n\t * @returns {RegExpExecArray | null}\n\t */\n\tfunction matchPattern(pattern, pos, text, lookbehind) {\n\t\tpattern.lastIndex = pos;\n\t\tvar match = pattern.exec(text);\n\t\tif (match && lookbehind && match[1]) {\n\t\t\t// change the match to remove the text matched by the Prism lookbehind group\n\t\t\tvar lookbehindLength = match[1].length;\n\t\t\tmatch.index += lookbehindLength;\n\t\t\tmatch[0] = match[0].slice(lookbehindLength);\n\t\t}\n\t\treturn match;\n\t}\n\n\t/**\n\t * @param {string} text\n\t * @param {LinkedList<string | Token>} tokenList\n\t * @param {any} grammar\n\t * @param {LinkedListNode<string | Token>} startNode\n\t * @param {number} startPos\n\t * @param {RematchOptions} [rematch]\n\t * @returns {void}\n\t * @private\n\t *\n\t * @typedef RematchOptions\n\t * @property {string} cause\n\t * @property {number} reach\n\t */\n\tfunction matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) {\n\t\tfor (var token in grammar) {\n\t\t\tif (!grammar.hasOwnProperty(token) || !grammar[token]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar patterns = grammar[token];\n\t\t\tpatterns = Array.isArray(patterns) ? patterns : [patterns];\n\n\t\t\tfor (var j = 0; j < patterns.length; ++j) {\n\t\t\t\tif (rematch && rematch.cause == token + ',' + j) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar patternObj = patterns[j];\n\t\t\t\tvar inside = patternObj.inside;\n\t\t\t\tvar lookbehind = !!patternObj.lookbehind;\n\t\t\t\tvar greedy = !!patternObj.greedy;\n\t\t\t\tvar alias = patternObj.alias;\n\n\t\t\t\tif (greedy && !patternObj.pattern.global) {\n\t\t\t\t\t// Without the global flag, lastIndex won't work\n\t\t\t\t\tvar flags = patternObj.pattern.toString().match(/[imsuy]*$/)[0];\n\t\t\t\t\tpatternObj.pattern = RegExp(patternObj.pattern.source, flags + 'g');\n\t\t\t\t}\n\n\t\t\t\t/** @type {RegExp} */\n\t\t\t\tvar pattern = patternObj.pattern || patternObj;\n\n\t\t\t\tfor ( // iterate the token list and keep track of the current token/string position\n\t\t\t\t\tvar currentNode = startNode.next, pos = startPos;\n\t\t\t\t\tcurrentNode !== tokenList.tail;\n\t\t\t\t\tpos += currentNode.value.length, currentNode = currentNode.next\n\t\t\t\t) {\n\n\t\t\t\t\tif (rematch && pos >= rematch.reach) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar str = currentNode.value;\n\n\t\t\t\t\tif (tokenList.length > text.length) {\n\t\t\t\t\t\t// Something went terribly wrong, ABORT, ABORT!\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (str instanceof Token) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar removeCount = 1; // this is the to parameter of removeBetween\n\t\t\t\t\tvar match;\n\n\t\t\t\t\tif (greedy) {\n\t\t\t\t\t\tmatch = matchPattern(pattern, pos, text, lookbehind);\n\t\t\t\t\t\tif (!match || match.index >= text.length) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar from = match.index;\n\t\t\t\t\t\tvar to = match.index + match[0].length;\n\t\t\t\t\t\tvar p = pos;\n\n\t\t\t\t\t\t// find the node that contains the match\n\t\t\t\t\t\tp += currentNode.value.length;\n\t\t\t\t\t\twhile (from >= p) {\n\t\t\t\t\t\t\tcurrentNode = currentNode.next;\n\t\t\t\t\t\t\tp += currentNode.value.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// adjust pos (and p)\n\t\t\t\t\t\tp -= currentNode.value.length;\n\t\t\t\t\t\tpos = p;\n\n\t\t\t\t\t\t// the current node is a Token, then the match starts inside another Token, which is invalid\n\t\t\t\t\t\tif (currentNode.value instanceof Token) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// find the last node which is affected by this match\n\t\t\t\t\t\tfor (\n\t\t\t\t\t\t\tvar k = currentNode;\n\t\t\t\t\t\t\tk !== tokenList.tail && (p < to || typeof k.value === 'string');\n\t\t\t\t\t\t\tk = k.next\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tremoveCount++;\n\t\t\t\t\t\t\tp += k.value.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tremoveCount--;\n\n\t\t\t\t\t\t// replace with the new match\n\t\t\t\t\t\tstr = text.slice(pos, p);\n\t\t\t\t\t\tmatch.index -= pos;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmatch = matchPattern(pattern, 0, str, lookbehind);\n\t\t\t\t\t\tif (!match) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// eslint-disable-next-line no-redeclare\n\t\t\t\t\tvar from = match.index;\n\t\t\t\t\tvar matchStr = match[0];\n\t\t\t\t\tvar before = str.slice(0, from);\n\t\t\t\t\tvar after = str.slice(from + matchStr.length);\n\n\t\t\t\t\tvar reach = pos + str.length;\n\t\t\t\t\tif (rematch && reach > rematch.reach) {\n\t\t\t\t\t\trematch.reach = reach;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar removeFrom = currentNode.prev;\n\n\t\t\t\t\tif (before) {\n\t\t\t\t\t\tremoveFrom = addAfter(tokenList, removeFrom, before);\n\t\t\t\t\t\tpos += before.length;\n\t\t\t\t\t}\n\n\t\t\t\t\tremoveRange(tokenList, removeFrom, removeCount);\n\n\t\t\t\t\tvar wrapped = new Token(token, inside ? _.tokenize(matchStr, inside) : matchStr, alias, matchStr);\n\t\t\t\t\tcurrentNode = addAfter(tokenList, removeFrom, wrapped);\n\n\t\t\t\t\tif (after) {\n\t\t\t\t\t\taddAfter(tokenList, currentNode, after);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (removeCount > 1) {\n\t\t\t\t\t\t// at least one Token object was removed, so we have to do some rematching\n\t\t\t\t\t\t// this can only happen if the current pattern is greedy\n\n\t\t\t\t\t\t/** @type {RematchOptions} */\n\t\t\t\t\t\tvar nestedRematch = {\n\t\t\t\t\t\t\tcause: token + ',' + j,\n\t\t\t\t\t\t\treach: reach\n\t\t\t\t\t\t};\n\t\t\t\t\t\tmatchGrammar(text, tokenList, grammar, currentNode.prev, pos, nestedRematch);\n\n\t\t\t\t\t\t// the reach might have been extended because of the rematching\n\t\t\t\t\t\tif (rematch && nestedRematch.reach > rematch.reach) {\n\t\t\t\t\t\t\trematch.reach = nestedRematch.reach;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @typedef LinkedListNode\n\t * @property {T} value\n\t * @property {LinkedListNode<T> | null} prev The previous node.\n\t * @property {LinkedListNode<T> | null} next The next node.\n\t * @template T\n\t * @private\n\t */\n\n\t/**\n\t * @template T\n\t * @private\n\t */\n\tfunction LinkedList() {\n\t\t/** @type {LinkedListNode<T>} */\n\t\tvar head = { value: null, prev: null, next: null };\n\t\t/** @type {LinkedListNode<T>} */\n\t\tvar tail = { value: null, prev: head, next: null };\n\t\thead.next = tail;\n\n\t\t/** @type {LinkedListNode<T>} */\n\t\tthis.head = head;\n\t\t/** @type {LinkedListNode<T>} */\n\t\tthis.tail = tail;\n\t\tthis.length = 0;\n\t}\n\n\t/**\n\t * Adds a new node with the given value to the list.\n\t *\n\t * @param {LinkedList<T>} list\n\t * @param {LinkedListNode<T>} node\n\t * @param {T} value\n\t * @returns {LinkedListNode<T>} The added node.\n\t * @template T\n\t */\n\tfunction addAfter(list, node, value) {\n\t\t// assumes that node != list.tail && values.length >= 0\n\t\tvar next = node.next;\n\n\t\tvar newNode = { value: value, prev: node, next: next };\n\t\tnode.next = newNode;\n\t\tnext.prev = newNode;\n\t\tlist.length++;\n\n\t\treturn newNode;\n\t}\n\t/**\n\t * Removes `count` nodes after the given node. The given node will not be removed.\n\t *\n\t * @param {LinkedList<T>} list\n\t * @param {LinkedListNode<T>} node\n\t * @param {number} count\n\t * @template T\n\t */\n\tfunction removeRange(list, node, count) {\n\t\tvar next = node.next;\n\t\tfor (var i = 0; i < count && next !== list.tail; i++) {\n\t\t\tnext = next.next;\n\t\t}\n\t\tnode.next = next;\n\t\tnext.prev = node;\n\t\tlist.length -= i;\n\t}\n\t/**\n\t * @param {LinkedList<T>} list\n\t * @returns {T[]}\n\t * @template T\n\t */\n\tfunction toArray(list) {\n\t\tvar array = [];\n\t\tvar node = list.head.next;\n\t\twhile (node !== list.tail) {\n\t\t\tarray.push(node.value);\n\t\t\tnode = node.next;\n\t\t}\n\t\treturn array;\n\t}\n\n\n\tif (!_self.document) {\n\t\tif (!_self.addEventListener) {\n\t\t\t// in Node.js\n\t\t\treturn _;\n\t\t}\n\n\t\tif (!_.disableWorkerMessageHandler) {\n\t\t\t// In worker\n\t\t\t_self.addEventListener('message', function (evt) {\n\t\t\t\tvar message = JSON.parse(evt.data);\n\t\t\t\tvar lang = message.language;\n\t\t\t\tvar code = message.code;\n\t\t\t\tvar immediateClose = message.immediateClose;\n\n\t\t\t\t_self.postMessage(_.highlight(code, _.languages[lang], lang));\n\t\t\t\tif (immediateClose) {\n\t\t\t\t\t_self.close();\n\t\t\t\t}\n\t\t\t}, false);\n\t\t}\n\n\t\treturn _;\n\t}\n\n\t// Get current script and highlight\n\tvar script = _.util.currentScript();\n\n\tif (script) {\n\t\t_.filename = script.src;\n\n\t\tif (script.hasAttribute('data-manual')) {\n\t\t\t_.manual = true;\n\t\t}\n\t}\n\n\tfunction highlightAutomaticallyCallback() {\n\t\tif (!_.manual) {\n\t\t\t_.highlightAll();\n\t\t}\n\t}\n\n\tif (!_.manual) {\n\t\t// If the document state is \"loading\", then we'll use DOMContentLoaded.\n\t\t// If the document state is \"interactive\" and the prism.js script is deferred, then we'll also use the\n\t\t// DOMContentLoaded event because there might be some plugins or languages which have also been deferred and they\n\t\t// might take longer one animation frame to execute which can create a race condition where only some plugins have\n\t\t// been loaded when Prism.highlightAll() is executed, depending on how fast resources are loaded.\n\t\t// See https://github.com/PrismJS/prism/issues/2102\n\t\tvar readyState = document.readyState;\n\t\tif (readyState === 'loading' || readyState === 'interactive' && script && script.defer) {\n\t\t\tdocument.addEventListener('DOMContentLoaded', highlightAutomaticallyCallback);\n\t\t} else {\n\t\t\tif (window.requestAnimationFrame) {\n\t\t\t\twindow.requestAnimationFrame(highlightAutomaticallyCallback);\n\t\t\t} else {\n\t\t\t\twindow.setTimeout(highlightAutomaticallyCallback, 16);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn _;\n\n}(_self));\n\nif (typeof module !== 'undefined' && module.exports) {\n\tmodule.exports = Prism;\n}\n\n// hack for components to work correctly in node.js\nif (typeof global !== 'undefined') {\n\tglobal.Prism = Prism;\n}\n\n// some additional documentation/types\n\n/**\n * The expansion of a simple `RegExp` literal to support additional properties.\n *\n * @typedef GrammarToken\n * @property {RegExp} pattern The regular expression of the token.\n * @property {boolean} [lookbehind=false] If `true`, then the first capturing group of `pattern` will (effectively)\n * behave as a lookbehind group meaning that the captured text will not be part of the matched text of the new token.\n * @property {boolean} [greedy=false] Whether the token is greedy.\n * @property {string|string[]} [alias] An optional alias or list of aliases.\n * @property {Grammar} [inside] The nested grammar of this token.\n *\n * The `inside` grammar will be used to tokenize the text value of each token of this kind.\n *\n * This can be used to make nested and even recursive language definitions.\n *\n * Note: This can cause infinite recursion. Be careful when you embed different languages or even the same language into\n * each another.\n * @global\n * @public\n */\n\n/**\n * @typedef Grammar\n * @type {Object<string, RegExp | GrammarToken | Array<RegExp | GrammarToken>>}\n * @property {Grammar} [rest] An optional grammar object that will be appended to this grammar.\n * @global\n * @public\n */\n\n/**\n * A function which will invoked after an element was successfully highlighted.\n *\n * @callback HighlightCallback\n * @param {Element} element The element successfully highlighted.\n * @returns {void}\n * @global\n * @public\n */\n\n/**\n * @callback HookCallback\n * @param {Object<string, any>} env The environment variables of the hook.\n * @returns {void}\n * @global\n * @public\n */\n\n\n/* **********************************************\n Begin prism-markup.js\n********************************************** */\n\nPrism.languages.markup = {\n\t'comment': {\n\t\tpattern: /<!--(?:(?!<!--)[\\s\\S])*?-->/,\n\t\tgreedy: true\n\t},\n\t'prolog': {\n\t\tpattern: /<\\?[\\s\\S]+?\\?>/,\n\t\tgreedy: true\n\t},\n\t'doctype': {\n\t\t// https://www.w3.org/TR/xml/#NT-doctypedecl\n\t\tpattern: /<!DOCTYPE(?:[^>\"'[\\]]|\"[^\"]*\"|'[^']*')+(?:\\[(?:[^<\"'\\]]|\"[^\"]*\"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\\]\\s*)?>/i,\n\t\tgreedy: true,\n\t\tinside: {\n\t\t\t'internal-subset': {\n\t\t\t\tpattern: /(^[^\\[]*\\[)[\\s\\S]+(?=\\]>$)/,\n\t\t\t\tlookbehind: true,\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: null // see below\n\t\t\t},\n\t\t\t'string': {\n\t\t\t\tpattern: /\"[^\"]*\"|'[^']*'/,\n\t\t\t\tgreedy: true\n\t\t\t},\n\t\t\t'punctuation': /^<!|>$|[[\\]]/,\n\t\t\t'doctype-tag': /^DOCTYPE/i,\n\t\t\t'name': /[^\\s<>'\"]+/\n\t\t}\n\t},\n\t'cdata': {\n\t\tpattern: /<!\\[CDATA\\[[\\s\\S]*?\\]\\]>/i,\n\t\tgreedy: true\n\t},\n\t'tag': {\n\t\tpattern: /<\\/?(?!\\d)[^\\s>\\/=$<%]+(?:\\s(?:\\s*[^\\s>\\/=]+(?:\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+(?=[\\s>]))|(?=[\\s/>])))+)?\\s*\\/?>/,\n\t\tgreedy: true,\n\t\tinside: {\n\t\t\t'tag': {\n\t\t\t\tpattern: /^<\\/?[^\\s>\\/]+/,\n\t\t\t\tinside: {\n\t\t\t\t\t'punctuation': /^<\\/?/,\n\t\t\t\t\t'namespace': /^[^\\s>\\/:]+:/\n\t\t\t\t}\n\t\t\t},\n\t\t\t'special-attr': [],\n\t\t\t'attr-value': {\n\t\t\t\tpattern: /=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+)/,\n\t\t\t\tinside: {\n\t\t\t\t\t'punctuation': [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpattern: /^=/,\n\t\t\t\t\t\t\talias: 'attr-equals'\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpattern: /^(\\s*)[\"']|[\"']$/,\n\t\t\t\t\t\t\tlookbehind: true\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t},\n\t\t\t'punctuation': /\\/?>/,\n\t\t\t'attr-name': {\n\t\t\t\tpattern: /[^\\s>\\/]+/,\n\t\t\t\tinside: {\n\t\t\t\t\t'namespace': /^[^\\s>\\/:]+:/\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t},\n\t'entity': [\n\t\t{\n\t\t\tpattern: /&[\\da-z]{1,8};/i,\n\t\t\talias: 'named-entity'\n\t\t},\n\t\t/&#x?[\\da-f]{1,8};/i\n\t]\n};\n\nPrism.languages.markup['tag'].inside['attr-value'].inside['entity'] =\n\tPrism.languages.markup['entity'];\nPrism.languages.markup['doctype'].inside['internal-subset'].inside = Prism.languages.markup;\n\n// Plugin to make entity title show the real entity, idea by Roman Komarov\nPrism.hooks.add('wrap', function (env) {\n\n\tif (env.type === 'entity') {\n\t\tenv.attributes['title'] = env.content.replace(/&amp;/, '&');\n\t}\n});\n\nObject.defineProperty(Prism.languages.markup.tag, 'addInlined', {\n\t/**\n\t * Adds an inlined language to markup.\n\t *\n\t * An example of an inlined language is CSS with `<style>` tags.\n\t *\n\t * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as\n\t * case insensitive.\n\t * @param {string} lang The language key.\n\t * @example\n\t * addInlined('style', 'css');\n\t */\n\tvalue: function addInlined(tagName, lang) {\n\t\tvar includedCdataInside = {};\n\t\tincludedCdataInside['language-' + lang] = {\n\t\t\tpattern: /(^<!\\[CDATA\\[)[\\s\\S]+?(?=\\]\\]>$)/i,\n\t\t\tlookbehind: true,\n\t\t\tinside: Prism.languages[lang]\n\t\t};\n\t\tincludedCdataInside['cdata'] = /^<!\\[CDATA\\[|\\]\\]>$/i;\n\n\t\tvar inside = {\n\t\t\t'included-cdata': {\n\t\t\t\tpattern: /<!\\[CDATA\\[[\\s\\S]*?\\]\\]>/i,\n\t\t\t\tinside: includedCdataInside\n\t\t\t}\n\t\t};\n\t\tinside['language-' + lang] = {\n\t\t\tpattern: /[\\s\\S]+/,\n\t\t\tinside: Prism.languages[lang]\n\t\t};\n\n\t\tvar def = {};\n\t\tdef[tagName] = {\n\t\t\tpattern: RegExp(/(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)/.source.replace(/__/g, function () { return tagName; }), 'i'),\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true,\n\t\t\tinside: inside\n\t\t};\n\n\t\tPrism.languages.insertBefore('markup', 'cdata', def);\n\t}\n});\nObject.defineProperty(Prism.languages.markup.tag, 'addAttribute', {\n\t/**\n\t * Adds an pattern to highlight languages embedded in HTML attributes.\n\t *\n\t * An example of an inlined language is CSS with `style` attributes.\n\t *\n\t * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as\n\t * case insensitive.\n\t * @param {string} lang The language key.\n\t * @example\n\t * addAttribute('style', 'css');\n\t */\n\tvalue: function (attrName, lang) {\n\t\tPrism.languages.markup.tag.inside['special-attr'].push({\n\t\t\tpattern: RegExp(\n\t\t\t\t/(^|[\"'\\s])/.source + '(?:' + attrName + ')' + /\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+(?=[\\s>]))/.source,\n\t\t\t\t'i'\n\t\t\t),\n\t\t\tlookbehind: true,\n\t\t\tinside: {\n\t\t\t\t'attr-name': /^[^\\s=]+/,\n\t\t\t\t'attr-value': {\n\t\t\t\t\tpattern: /=[\\s\\S]+/,\n\t\t\t\t\tinside: {\n\t\t\t\t\t\t'value': {\n\t\t\t\t\t\t\tpattern: /(^=\\s*([\"']|(?![\"'])))\\S[\\s\\S]*(?=\\2$)/,\n\t\t\t\t\t\t\tlookbehind: true,\n\t\t\t\t\t\t\talias: [lang, 'language-' + lang],\n\t\t\t\t\t\t\tinside: Prism.languages[lang]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'punctuation': [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tpattern: /^=/,\n\t\t\t\t\t\t\t\talias: 'attr-equals'\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t/\"|'/\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n});\n\nPrism.languages.html = Prism.languages.markup;\nPrism.languages.mathml = Prism.languages.markup;\nPrism.languages.svg = Prism.languages.markup;\n\nPrism.languages.xml = Prism.languages.extend('markup', {});\nPrism.languages.ssml = Prism.languages.xml;\nPrism.languages.atom = Prism.languages.xml;\nPrism.languages.rss = Prism.languages.xml;\n\n\n/* **********************************************\n Begin prism-css.js\n********************************************** */\n\n(function (Prism) {\n\n\tvar string = /(?:\"(?:\\\\(?:\\r\\n|[\\s\\S])|[^\"\\\\\\r\\n])*\"|'(?:\\\\(?:\\r\\n|[\\s\\S])|[^'\\\\\\r\\n])*')/;\n\n\tPrism.languages.css = {\n\t\t'comment': /\\/\\*[\\s\\S]*?\\*\\//,\n\t\t'atrule': {\n\t\t\tpattern: RegExp('@[\\\\w-](?:' + /[^;{\\s\"']|\\s+(?!\\s)/.source + '|' + string.source + ')*?' + /(?:;|(?=\\s*\\{))/.source),\n\t\t\tinside: {\n\t\t\t\t'rule': /^@[\\w-]+/,\n\t\t\t\t'selector-function-argument': {\n\t\t\t\t\tpattern: /(\\bselector\\s*\\(\\s*(?![\\s)]))(?:[^()\\s]|\\s+(?![\\s)])|\\((?:[^()]|\\([^()]*\\))*\\))+(?=\\s*\\))/,\n\t\t\t\t\tlookbehind: true,\n\t\t\t\t\talias: 'selector'\n\t\t\t\t},\n\t\t\t\t'keyword': {\n\t\t\t\t\tpattern: /(^|[^\\w-])(?:and|not|only|or)(?![\\w-])/,\n\t\t\t\t\tlookbehind: true\n\t\t\t\t}\n\t\t\t\t// See rest below\n\t\t\t}\n\t\t},\n\t\t'url': {\n\t\t\t// https://drafts.csswg.org/css-values-3/#urls\n\t\t\tpattern: RegExp('\\\\burl\\\\((?:' + string.source + '|' + /(?:[^\\\\\\r\\n()\"']|\\\\[\\s\\S])*/.source + ')\\\\)', 'i'),\n\t\t\tgreedy: true,\n\t\t\tinside: {\n\t\t\t\t'function': /^url/i,\n\t\t\t\t'punctuation': /^\\(|\\)$/,\n\t\t\t\t'string': {\n\t\t\t\t\tpattern: RegExp('^' + string.source + '$'),\n\t\t\t\t\talias: 'url'\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t'selector': {\n\t\t\tpattern: RegExp('(^|[{}\\\\s])[^{}\\\\s](?:[^{};\"\\'\\\\s]|\\\\s+(?![\\\\s{])|' + string.source + ')*(?=\\\\s*\\\\{)'),\n\t\t\tlookbehind: true\n\t\t},\n\t\t'string': {\n\t\t\tpattern: string,\n\t\t\tgreedy: true\n\t\t},\n\t\t'property': {\n\t\t\tpattern: /(^|[^-\\w\\xA0-\\uFFFF])(?!\\s)[-_a-z\\xA0-\\uFFFF](?:(?!\\s)[-\\w\\xA0-\\uFFFF])*(?=\\s*:)/i,\n\t\t\tlookbehind: true\n\t\t},\n\t\t'important': /!important\\b/i,\n\t\t'function': {\n\t\t\tpattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\\()/i,\n\t\t\tlookbehind: true\n\t\t},\n\t\t'punctuation': /[(){};:,]/\n\t};\n\n\tPrism.languages.css['atrule'].inside.rest = Prism.languages.css;\n\n\tvar markup = Prism.languages.markup;\n\tif (markup) {\n\t\tmarkup.tag.addInlined('style', 'css');\n\t\tmarkup.tag.addAttribute('style', 'css');\n\t}\n\n}(Prism));\n\n\n/* **********************************************\n Begin prism-clike.js\n********************************************** */\n\nPrism.languages.clike = {\n\t'comment': [\n\t\t{\n\t\t\tpattern: /(^|[^\\\\])\\/\\*[\\s\\S]*?(?:\\*\\/|$)/,\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true\n\t\t},\n\t\t{\n\t\t\tpattern: /(^|[^\\\\:])\\/\\/.*/,\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true\n\t\t}\n\t],\n\t'string': {\n\t\tpattern: /([\"'])(?:\\\\(?:\\r\\n|[\\s\\S])|(?!\\1)[^\\\\\\r\\n])*\\1/,\n\t\tgreedy: true\n\t},\n\t'class-name': {\n\t\tpattern: /(\\b(?:class|extends|implements|instanceof|interface|new|trait)\\s+|\\bcatch\\s+\\()[\\w.\\\\]+/i,\n\t\tlookbehind: true,\n\t\tinside: {\n\t\t\t'punctuation': /[.\\\\]/\n\t\t}\n\t},\n\t'keyword': /\\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\\b/,\n\t'boolean': /\\b(?:false|true)\\b/,\n\t'function': /\\b\\w+(?=\\()/,\n\t'number': /\\b0x[\\da-f]+\\b|(?:\\b\\d+(?:\\.\\d*)?|\\B\\.\\d+)(?:e[+-]?\\d+)?/i,\n\t'operator': /[<>]=?|[!=]=?=?|--?|\\+\\+?|&&?|\\|\\|?|[?*/~^%]/,\n\t'punctuation': /[{}[\\];(),.:]/\n};\n\n\n/* **********************************************\n Begin prism-javascript.js\n********************************************** */\n\nPrism.languages.javascript = Prism.languages.extend('clike', {\n\t'class-name': [\n\t\tPrism.languages.clike['class-name'],\n\t\t{\n\t\t\tpattern: /(^|[^$\\w\\xA0-\\uFFFF])(?!\\s)[_$A-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*(?=\\.(?:constructor|prototype))/,\n\t\t\tlookbehind: true\n\t\t}\n\t],\n\t'keyword': [\n\t\t{\n\t\t\tpattern: /((?:^|\\})\\s*)catch\\b/,\n\t\t\tlookbehind: true\n\t\t},\n\t\t{\n\t\t\tpattern: /(^|[^.]|\\.\\.\\.\\s*)\\b(?:as|assert(?=\\s*\\{)|async(?=\\s*(?:function\\b|\\(|[$\\w\\xA0-\\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\\s*(?:\\{|$))|for|from(?=\\s*(?:['\"]|$))|function|(?:get|set)(?=\\s*(?:[#\\[$\\w\\xA0-\\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\\b/,\n\t\t\tlookbehind: true\n\t\t},\n\t],\n\t// Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)\n\t'function': /#?(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*(?=\\s*(?:\\.\\s*(?:apply|bind|call)\\s*)?\\()/,\n\t'number': {\n\t\tpattern: RegExp(\n\t\t\t/(^|[^\\w$])/.source +\n\t\t\t'(?:' +\n\t\t\t(\n\t\t\t\t// constant\n\t\t\t\t/NaN|Infinity/.source +\n\t\t\t\t'|' +\n\t\t\t\t// binary integer\n\t\t\t\t/0[bB][01]+(?:_[01]+)*n?/.source +\n\t\t\t\t'|' +\n\t\t\t\t// octal integer\n\t\t\t\t/0[oO][0-7]+(?:_[0-7]+)*n?/.source +\n\t\t\t\t'|' +\n\t\t\t\t// hexadecimal integer\n\t\t\t\t/0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?/.source +\n\t\t\t\t'|' +\n\t\t\t\t// decimal bigint\n\t\t\t\t/\\d+(?:_\\d+)*n/.source +\n\t\t\t\t'|' +\n\t\t\t\t// decimal number (integer or float) but no bigint\n\t\t\t\t/(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?/.source\n\t\t\t) +\n\t\t\t')' +\n\t\t\t/(?![\\w$])/.source\n\t\t),\n\t\tlookbehind: true\n\t},\n\t'operator': /--|\\+\\+|\\*\\*=?|=>|&&=?|\\|\\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\\.{3}|\\?\\?=?|\\?\\.?|[~:]/\n});\n\nPrism.languages.javascript['class-name'][0].pattern = /(\\b(?:class|extends|implements|instanceof|interface|new)\\s+)[\\w.\\\\]+/;\n\nPrism.languages.insertBefore('javascript', 'keyword', {\n\t'regex': {\n\t\tpattern: RegExp(\n\t\t\t// lookbehind\n\t\t\t// eslint-disable-next-line regexp/no-dupe-characters-character-class\n\t\t\t/((?:^|[^$\\w\\xA0-\\uFFFF.\"'\\])\\s]|\\b(?:return|yield))\\s*)/.source +\n\t\t\t// Regex pattern:\n\t\t\t// There are 2 regex patterns here. The RegExp set notation proposal added support for nested character\n\t\t\t// classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible\n\t\t\t// with the only syntax, so we have to define 2 different regex patterns.\n\t\t\t/\\//.source +\n\t\t\t'(?:' +\n\t\t\t/(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}/.source +\n\t\t\t'|' +\n\t\t\t// `v` flag syntax. This supports 3 levels of nested character classes.\n\t\t\t/(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source +\n\t\t\t')' +\n\t\t\t// lookahead\n\t\t\t/(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))/.source\n\t\t),\n\t\tlookbehind: true,\n\t\tgreedy: true,\n\t\tinside: {\n\t\t\t'regex-source': {\n\t\t\t\tpattern: /^(\\/)[\\s\\S]+(?=\\/[a-z]*$)/,\n\t\t\t\tlookbehind: true,\n\t\t\t\talias: 'language-regex',\n\t\t\t\tinside: Prism.languages.regex\n\t\t\t},\n\t\t\t'regex-delimiter': /^\\/|\\/$/,\n\t\t\t'regex-flags': /^[a-z]+$/,\n\t\t}\n\t},\n\t// This must be declared before keyword because we use \"function\" inside the look-forward\n\t'function-variable': {\n\t\tpattern: /#?(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*(?=\\s*[=:]\\s*(?:async\\s*)?(?:\\bfunction\\b|(?:\\((?:[^()]|\\([^()]*\\))*\\)|(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*)\\s*=>))/,\n\t\talias: 'function'\n\t},\n\t'parameter': [\n\t\t{\n\t\t\tpattern: /(function(?:\\s+(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*)?\\s*\\(\\s*)(?!\\s)(?:[^()\\s]|\\s+(?![\\s)])|\\([^()]*\\))+(?=\\s*\\))/,\n\t\t\tlookbehind: true,\n\t\t\tinside: Prism.languages.javascript\n\t\t},\n\t\t{\n\t\t\tpattern: /(^|[^$\\w\\xA0-\\uFFFF])(?!\\s)[_$a-z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*(?=\\s*=>)/i,\n\t\t\tlookbehind: true,\n\t\t\tinside: Prism.languages.javascript\n\t\t},\n\t\t{\n\t\t\tpattern: /(\\(\\s*)(?!\\s)(?:[^()\\s]|\\s+(?![\\s)])|\\([^()]*\\))+(?=\\s*\\)\\s*=>)/,\n\t\t\tlookbehind: true,\n\t\t\tinside: Prism.languages.javascript\n\t\t},\n\t\t{\n\t\t\tpattern: /((?:\\b|\\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\\w\\xA0-\\uFFFF]))(?:(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*\\s*)\\(\\s*|\\]\\s*\\(\\s*)(?!\\s)(?:[^()\\s]|\\s+(?![\\s)])|\\([^()]*\\))+(?=\\s*\\)\\s*\\{)/,\n\t\t\tlookbehind: true,\n\t\t\tinside: Prism.languages.javascript\n\t\t}\n\t],\n\t'constant': /\\b[A-Z](?:[A-Z_]|\\dx?)*\\b/\n});\n\nPrism.languages.insertBefore('javascript', 'string', {\n\t'hashbang': {\n\t\tpattern: /^#!.*/,\n\t\tgreedy: true,\n\t\talias: 'comment'\n\t},\n\t'template-string': {\n\t\tpattern: /`(?:\\\\[\\s\\S]|\\$\\{(?:[^{}]|\\{(?:[^{}]|\\{[^}]*\\})*\\})+\\}|(?!\\$\\{)[^\\\\`])*`/,\n\t\tgreedy: true,\n\t\tinside: {\n\t\t\t'template-punctuation': {\n\t\t\t\tpattern: /^`|`$/,\n\t\t\t\talias: 'string'\n\t\t\t},\n\t\t\t'interpolation': {\n\t\t\t\tpattern: /((?:^|[^\\\\])(?:\\\\{2})*)\\$\\{(?:[^{}]|\\{(?:[^{}]|\\{[^}]*\\})*\\})+\\}/,\n\t\t\t\tlookbehind: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'interpolation-punctuation': {\n\t\t\t\t\t\tpattern: /^\\$\\{|\\}$/,\n\t\t\t\t\t\talias: 'punctuation'\n\t\t\t\t\t},\n\t\t\t\t\trest: Prism.languages.javascript\n\t\t\t\t}\n\t\t\t},\n\t\t\t'string': /[\\s\\S]+/\n\t\t}\n\t},\n\t'string-property': {\n\t\tpattern: /((?:^|[,{])[ \\t]*)([\"'])(?:\\\\(?:\\r\\n|[\\s\\S])|(?!\\2)[^\\\\\\r\\n])*\\2(?=\\s*:)/m,\n\t\tlookbehind: true,\n\t\tgreedy: true,\n\t\talias: 'property'\n\t}\n});\n\nPrism.languages.insertBefore('javascript', 'operator', {\n\t'literal-property': {\n\t\tpattern: /((?:^|[,{])[ \\t]*)(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*(?=\\s*:)/m,\n\t\tlookbehind: true,\n\t\talias: 'property'\n\t},\n});\n\nif (Prism.languages.markup) {\n\tPrism.languages.markup.tag.addInlined('script', 'javascript');\n\n\t// add attribute support for all DOM events.\n\t// https://developer.mozilla.org/en-US/docs/Web/Events#Standard_events\n\tPrism.languages.markup.tag.addAttribute(\n\t\t/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,\n\t\t'javascript'\n\t);\n}\n\nPrism.languages.js = Prism.languages.javascript;\n\n\n/* **********************************************\n Begin prism-file-highlight.js\n********************************************** */\n\n(function () {\n\n\tif (typeof Prism === 'undefined' || typeof document === 'undefined') {\n\t\treturn;\n\t}\n\n\t// https://developer.mozilla.org/en-US/docs/Web/API/Element/matches#Polyfill\n\tif (!Element.prototype.matches) {\n\t\tElement.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\n\t}\n\n\tvar LOADING_MESSAGE = 'Loading\u2026';\n\tvar FAILURE_MESSAGE = function (status, message) {\n\t\treturn '\u2716 Error ' + status + ' while fetching file: ' + message;\n\t};\n\tvar FAILURE_EMPTY_MESSAGE = '\u2716 Error: File does not exist or is empty';\n\n\tvar EXTENSIONS = {\n\t\t'js': 'javascript',\n\t\t'py': 'python',\n\t\t'rb': 'ruby',\n\t\t'ps1': 'powershell',\n\t\t'psm1': 'powershell',\n\t\t'sh': 'bash',\n\t\t'bat': 'batch',\n\t\t'h': 'c',\n\t\t'tex': 'latex'\n\t};\n\n\tvar STATUS_ATTR = 'data-src-status';\n\tvar STATUS_LOADING = 'loading';\n\tvar STATUS_LOADED = 'loaded';\n\tvar STATUS_FAILED = 'failed';\n\n\tvar SELECTOR = 'pre[data-src]:not([' + STATUS_ATTR + '=\"' + STATUS_LOADED + '\"])'\n\t\t+ ':not([' + STATUS_ATTR + '=\"' + STATUS_LOADING + '\"])';\n\n\t/**\n\t * Loads the given file.\n\t *\n\t * @param {string} src The URL or path of the source file to load.\n\t * @param {(result: string) => void} success\n\t * @param {(reason: string) => void} error\n\t */\n\tfunction loadFile(src, success, error) {\n\t\tvar xhr = new XMLHttpRequest();\n\t\txhr.open('GET', src, true);\n\t\txhr.onreadystatechange = function () {\n\t\t\tif (xhr.readyState == 4) {\n\t\t\t\tif (xhr.status < 400 && xhr.responseText) {\n\t\t\t\t\tsuccess(xhr.responseText);\n\t\t\t\t} else {\n\t\t\t\t\tif (xhr.status >= 400) {\n\t\t\t\t\t\terror(FAILURE_MESSAGE(xhr.status, xhr.statusText));\n\t\t\t\t\t} else {\n\t\t\t\t\t\terror(FAILURE_EMPTY_MESSAGE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\txhr.send(null);\n\t}\n\n\t/**\n\t * Parses the given range.\n\t *\n\t * This returns a range with inclusive ends.\n\t *\n\t * @param {string | null | undefined} range\n\t * @returns {[number, number | undefined] | undefined}\n\t */\n\tfunction parseRange(range) {\n\t\tvar m = /^\\s*(\\d+)\\s*(?:(,)\\s*(?:(\\d+)\\s*)?)?$/.exec(range || '');\n\t\tif (m) {\n\t\t\tvar start = Number(m[1]);\n\t\t\tvar comma = m[2];\n\t\t\tvar end = m[3];\n\n\t\t\tif (!comma) {\n\t\t\t\treturn [start, start];\n\t\t\t}\n\t\t\tif (!end) {\n\t\t\t\treturn [start, undefined];\n\t\t\t}\n\t\t\treturn [start, Number(end)];\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tPrism.hooks.add('before-highlightall', function (env) {\n\t\tenv.selector += ', ' + SELECTOR;\n\t});\n\n\tPrism.hooks.add('before-sanity-check', function (env) {\n\t\tvar pre = /** @type {HTMLPreElement} */ (env.element);\n\t\tif (pre.matches(SELECTOR)) {\n\t\t\tenv.code = ''; // fast-path the whole thing and go to complete\n\n\t\t\tpre.setAttribute(STATUS_ATTR, STATUS_LOADING); // mark as loading\n\n\t\t\t// add code element with loading message\n\t\t\tvar code = pre.appendChild(document.createElement('CODE'));\n\t\t\tcode.textContent = LOADING_MESSAGE;\n\n\t\t\tvar src = pre.getAttribute('data-src');\n\n\t\t\tvar language = env.language;\n\t\t\tif (language === 'none') {\n\t\t\t\t// the language might be 'none' because there is no language set;\n\t\t\t\t// in this case, we want to use the extension as the language\n\t\t\t\tvar extension = (/\\.(\\w+)$/.exec(src) || [, 'none'])[1];\n\t\t\t\tlanguage = EXTENSIONS[extension] || extension;\n\t\t\t}\n\n\t\t\t// set language classes\n\t\t\tPrism.util.setLanguage(code, language);\n\t\t\tPrism.util.setLanguage(pre, language);\n\n\t\t\t// preload the language\n\t\t\tvar autoloader = Prism.plugins.autoloader;\n\t\t\tif (autoloader) {\n\t\t\t\tautoloader.loadLanguages(language);\n\t\t\t}\n\n\t\t\t// load file\n\t\t\tloadFile(\n\t\t\t\tsrc,\n\t\t\t\tfunction (text) {\n\t\t\t\t\t// mark as loaded\n\t\t\t\t\tpre.setAttribute(STATUS_ATTR, STATUS_LOADED);\n\n\t\t\t\t\t// handle data-range\n\t\t\t\t\tvar range = parseRange(pre.getAttribute('data-range'));\n\t\t\t\t\tif (range) {\n\t\t\t\t\t\tvar lines = text.split(/\\r\\n?|\\n/g);\n\n\t\t\t\t\t\t// the range is one-based and inclusive on both ends\n\t\t\t\t\t\tvar start = range[0];\n\t\t\t\t\t\tvar end = range[1] == null ? lines.length : range[1];\n\n\t\t\t\t\t\tif (start < 0) { start += lines.length; }\n\t\t\t\t\t\tstart = Math.max(0, Math.min(start - 1, lines.length));\n\t\t\t\t\t\tif (end < 0) { end += lines.length; }\n\t\t\t\t\t\tend = Math.max(0, Math.min(end, lines.length));\n\n\t\t\t\t\t\ttext = lines.slice(start, end).join('\\n');\n\n\t\t\t\t\t\t// add data-start for line numbers\n\t\t\t\t\t\tif (!pre.hasAttribute('data-start')) {\n\t\t\t\t\t\t\tpre.setAttribute('data-start', String(start + 1));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// highlight code\n\t\t\t\t\tcode.textContent = text;\n\t\t\t\t\tPrism.highlightElement(code);\n\t\t\t\t},\n\t\t\t\tfunction (error) {\n\t\t\t\t\t// mark as failed\n\t\t\t\t\tpre.setAttribute(STATUS_ATTR, STATUS_FAILED);\n\n\t\t\t\t\tcode.textContent = error;\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t});\n\n\tPrism.plugins.fileHighlight = {\n\t\t/**\n\t\t * Executes the File Highlight plugin for all matching `pre` elements under the given container.\n\t\t *\n\t\t * Note: Elements which are already loaded or currently loading will not be touched by this method.\n\t\t *\n\t\t * @param {ParentNode} [container=document]\n\t\t */\n\t\thighlight: function highlight(container) {\n\t\t\tvar elements = (container || document).querySelectorAll(SELECTOR);\n\n\t\t\tfor (var i = 0, element; (element = elements[i++]);) {\n\t\t\t\tPrism.highlightElement(element);\n\t\t\t}\n\t\t}\n\t};\n\n\tvar logged = false;\n\t/** @deprecated Use `Prism.plugins.fileHighlight.highlight` instead. */\n\tPrism.fileHighlight = function () {\n\t\tif (!logged) {\n\t\t\tconsole.warn('Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead.');\n\t\t\tlogged = true;\n\t\t}\n\t\tPrism.plugins.fileHighlight.highlight.apply(this, arguments);\n\t};\n\n}());\n", "// A host that renders on the server must keep the whole Fluent family out of\n// SSR externalization (Vite: `ssr.noExternal: [/^@fluentui\\//, /^@griffel\\//,\n// /^tabster(?:$|\\/)/]`), so every consumer of this module sees the ESM\n// namespace rather than one of Fluent's CommonJS entrypoints. The guard is what turns a regression in that\n// wiring into a crash here instead of an undefined component deep in a tree.\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-components/package.json#L89-L102\nimport * as fluentNamespace from '@fluentui/react-components';\n\nimport { withWinuiAppearance } from './winui/appearance';\nimport { withWinuiMotion } from './winui/presence';\nimport { withWinuiDrag } from './winui/switch-drag';\nimport { withWinuiToaster } from './winui/toaster';\nimport type { FluentComponents } from './winui/wrap';\n\nif (!(fluentNamespace as Partial<FluentComponents>).FluentProvider) {\n throw new Error('@fluentui/react-components exposes no component surface.');\n}\n\n// The package's only value import of `@fluentui/react-components`, so it is the\n// one place the appearance stamping, motion substitution, toaster replacement and\n// Switch drag gesture reach every instance. `react-components` re-exports only\n// the toast's component layer, so the state and hook layers the toaster is\n// rebuilt from are imported from `@fluentui/react-toast` in ./winui/toaster,\n// which is the package's only value import of that package. A host renders\n// `fluentComponents.*` rather than importing Fluent components directly, or the\n// WinUI behaviour does not reach them.\nexport const fluentComponents = withWinuiToaster(withWinuiDrag(\n withWinuiMotion(withWinuiAppearance(fluentNamespace)),\n));\n", "// Fluent v9 resolves `appearance` into hashed Griffel atoms and keeps it off the\n// DOM, so no CSS selector can name a variant. These wrappers put the resolved\n// value back as `data-winui-*` for `winui/controls/*.css.ts` to address, and\n// swap the artwork Fluent picks where WinUI picks another.\nimport { CheckmarkCircleFilled, ChevronDown12Regular, DismissCircleFilled, ErrorCircleFilled, InfoFilled } from '@fluentui/react-icons';\nimport * as React from 'react';\n\nimport { wrapFluent } from './wrap';\nimport type { FluentComponents, PropCarrier } from './wrap';\n\nexport const winuiAppearanceAttribute = 'data-winui-appearance';\nexport const winuiIntentAttribute = 'data-winui-intent';\nconst winuiSizeAttribute = 'data-winui-size';\nconst winuiSeverityMarkAttribute = 'data-winui-severity-mark';\nexport const winuiCheckedAttribute = 'data-winui-checked';\n\nexport type SeverityIntent = 'error' | 'warning' | 'success' | 'info';\ninterface IntentCarrier { intent?: SeverityIntent; icon?: unknown }\ntype CheckedState = boolean | 'mixed';\ninterface CheckedCarrier {\n checked?: CheckedState;\n defaultChecked?: CheckedState;\n onChange?: (ev: React.ChangeEvent<HTMLInputElement>, data: { checked: CheckedState }) => void;\n}\n\n// Every InfoBar severity is a circle in WinUI, where Fluent reaches for a\n// diamond and a triangle in two of the four places \u2014 a different pair per\n// control, so the map is stated once and every severity-carrying control is\n// routed through it.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/InfoBar/InfoBar_themeresources.xaml#L70-L74\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/InfoBar/InfoBar.xaml#L107-L110\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-message-bar/library/src/components/MessageBar/getIntentIcon.tsx#L7-L19\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-toast/library/src/components/ToastTitle/useToastTitle.ts#L47-L60\nconst severityIcons: Record<SeverityIntent, React.ComponentType> = {\n error: DismissCircleFilled,\n warning: ErrorCircleFilled,\n success: CheckmarkCircleFilled,\n info: InfoFilled,\n};\n\n// The mark is stamped as well as filled in. Only the standard mark is a\n// silhouette with the symbol as negative space, so only it may take the disc\n// ./controls/severity.ts paints behind the slot; a caller's own artwork would\n// wear the disc in front of the card.\nexport const severityMark = (intent: SeverityIntent) => ({\n children: React.createElement(severityIcons[intent]),\n [winuiSeverityMarkAttribute]: '',\n});\n\n// A tri-state check box carries its mixed state only as the input's\n// `indeterminate` property, which Fluent assigns from a layout effect keyed on\n// that state. The browser clears the property on user activation, and the\n// effect does not re-run while the state stays mixed, so `:indeterminate` is\n// gone for good on a box held at mixed while Fluent keeps painting mixed. The\n// resolved tri-state is stamped instead, and ./controls/choice.css.ts reads\n// the stamp rather than the property.\n//\n// Fluent's own resolution is mirrored here: the prop wins where it is given,\n// otherwise the last value its onChange reported, seeded from defaultChecked.\n// https://html.spec.whatwg.org/multipage/input.html#the-input-element:legacy-pre-activation-behavior\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-checkbox/library/src/components/Checkbox/useCheckbox.tsx#L163-L169\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-checkbox/library/src/components/Checkbox/useCheckbox.tsx#L93-L97\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-checkbox/library/src/components/Checkbox/useCheckbox.tsx#L152-L156\nconst useCheckedProps = (props: CheckedCarrier) => {\n const [uncontrolled, setUncontrolled] = React.useState<CheckedState>(props.defaultChecked ?? false);\n const checked = props.checked ?? uncontrolled;\n\n return {\n ...props,\n [winuiCheckedAttribute]: String(checked),\n onChange: (ev: React.ChangeEvent<HTMLInputElement>, data: { checked: CheckedState }) => {\n setUncontrolled(data.checked);\n props.onChange?.(ev, data);\n },\n };\n};\n\n// Where the root is not the primary slot, `getPartitionedNativeProps` forwards a\n// top-level `data-*` to the inner `<input>`/`<textarea>`/`<select>` instead of\n// the `.fui-*` root, so those name `root` and get stamped twice. SplitButton's\n// root is a plain `<div>` whose `.fui-Button` children are unreachable otherwise.\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-utilities/src/utils/getNativeElementProps.ts#L86-L118\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-button/library/src/components/SplitButton/useSplitButton.ts#L32-L57\nconst rootIsPrimary: readonly string[] = [];\nconst rootAndPrimary = ['root'] as const;\nconst splitButtonSlots = ['primaryActionButton', 'menuButton'] as const;\n\n// Each fallback below is Fluent's own default for that component, read from its\n// state hook \u2014 they do not agree, so none may be assumed. The Toolbar buttons\n// delegate a base hook carrying no default and name `subtle` themselves.\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-button/library/src/components/Button/useButton.ts#L20\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-button/library/src/components/ToggleButton/useToggleButton.ts#L19\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-button/library/src/components/CompoundButton/useCompoundButton.ts#L21\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-button/library/src/components/MenuButton/useMenuButton.tsx#L64\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-button/library/src/components/SplitButton/useSplitButton.ts#L17\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-toolbar/library/src/components/ToolbarButton/useToolbarButton.ts#L22\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-toolbar/library/src/components/ToolbarToggleButton/useToolbarToggleButton.ts#L24\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-toolbar/library/src/components/ToolbarRadioButton/useToolbarRadioButton.ts#L25\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-link/library/src/components/Link/useLink.ts#L20\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-combobox/library/src/components/Dropdown/useDropdown.tsx#L165\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-combobox/library/src/components/Combobox/useCombobox.tsx#L216\n//\n// Input, Textarea and Select spell their default as\n// `overrides.inputDefaultAppearance ?? 'outline'`, whose context\n// `react-components` does not re-export \u2014 so `outline` is what this app resolves.\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-input/library/src/components/Input/useInput.ts#L21\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-textarea/library/src/components/Textarea/useTextarea.ts#L21\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-select/library/src/components/Select/useSelect.tsx#L21\n//\n// Card defaults to `filled`; its companions declare no appearance and stay\n// unwrapped. TableRow defaults to `none`, and its selected appearances are a\n// second, independent selection signal beside aria-selected.\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-card/library/src/components/Card/useCard.ts#L54\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-table/library/src/components/TableRow/useTableRow.ts#L21\n//\n// A Tab reads its appearance from TabList's context and never carries it\n// itself, so the strip is what gets stamped and the tab rules select through\n// it.\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-tabs/library/src/components/TabList/useTabList.tsx#L20\nexport const withWinuiAppearance = (components: FluentComponents): FluentComponents => {\n // Only a props object can take one more prop by merging; Fluent's own\n // normalization folds the other shorthand forms into `{ children: value }`.\n // `null` is left alone \u2014 merging into it would render a suppressed slot back.\n // https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-utilities/src/compose/slot.ts#L82-L93\n const resolveSlotProps = components.slot.resolveShorthand as (value: unknown) => PropCarrier | undefined;\n\n const stamp = <Component>(\n component: Component,\n axis: { prop: string; attribute: string; fallback: string; slots?: readonly string[] },\n ): Component => wrapFluent(component, (props: PropCarrier) => {\n const mark = { [axis.attribute]: props[axis.prop] ?? axis.fallback };\n const stampedSlotProps = Object.fromEntries(\n (axis.slots ?? [])\n .filter(name => props[name] !== null)\n .map(name => [name, { ...resolveSlotProps(props[name]), ...mark }]),\n );\n\n return { ...props, ...mark, ...stampedSlotProps };\n });\n\n const appearance = (fallback: string, slots?: readonly string[]) =>\n ({ prop: 'appearance', attribute: winuiAppearanceAttribute, fallback, slots });\n const size = (fallback: string, slots?: readonly string[]) =>\n ({ prop: 'size', attribute: winuiSizeAttribute, fallback, slots });\n\n // The table builds the selection cell's check box out of Fluent's own\n // Checkbox rather than the wrapped one above, so the stamp reaches it through\n // that slot -- through the same resolution, so a cell that leaves `checked`\n // to the box cannot be stamped with a state the box has since left. Fluent\n // merges the slot over its own `defaultProps: { checked: props.checked }`, so\n // a slot that states its own `checked` outranks the cell's; the stamp reads\n // the same order rather than overwriting it. The slot is left alone where the\n // cell draws a radio or suppresses the box, because a slot object of our\n // making would render a box the cell had not asked for.\n // https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-table/library/src/components/TableSelectionCell/useTableSelectionCell.ts#L20-L36\n const stampSelectionCellCheckedState = <Component>(component: Component): Component =>\n wrapFluent(component, (props: PropCarrier) => {\n const drawsCheckbox = (props.type ?? 'checkbox') === 'checkbox' && props.checkboxIndicator !== null;\n const slotProps = resolveSlotProps(props.checkboxIndicator);\n const checkboxIndicator = useCheckedProps({\n ...slotProps,\n checked: (slotProps?.checked ?? props.checked) as CheckedState | undefined,\n });\n\n return { ...props, ...(drawsCheckbox ? { checkboxIndicator } : {}) };\n });\n\n // The intent is stamped alongside because Fluent settles it in JavaScript.\n // https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-message-bar/library/src/components/MessageBar/useMessageBar.ts#L22\n const stampIntent = <Component>(component: Component): Component => wrapFluent(component, (props: IntentCarrier) => {\n const intent = props.intent ?? 'info';\n return {\n ...props,\n [winuiIntentAttribute]: intent,\n icon: props.icon === undefined ? severityMark(intent) : props.icon,\n };\n });\n\n // WinUI ends the header row with the chevron, points it down when collapsed,\n // and states 12 for the glyph where Fluent leads with it, points it right, and\n // hands 20px artwork to a 12px box. Fluent only rotates a chevron it supplies\n // itself, so with ours the turn belongs to ./controls/accordion.css.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/Expander/Expander_themeresources.xaml#L82-L85\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/Expander/Expander_themeresources.xaml#L280-L281\n // https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-accordion/library/src/components/AccordionHeader/useAccordionHeader.tsx#L42-L50\n const winuiChevron = <Component>(component: Component): Component => wrapFluent(component, (props: PropCarrier) => ({\n expandIconPosition: 'end',\n ...props,\n expandIcon: props.expandIcon === undefined ? { children: React.createElement(ChevronDown12Regular) } : props.expandIcon,\n }));\n\n // The map covers Fluent's whole appearance-carrying surface, not just the\n // subset the dashboard renders today, so a later component arrives stamped.\n return {\n ...components,\n AccordionHeader: winuiChevron(components.AccordionHeader),\n MessageBar: stampIntent(components.MessageBar),\n Button: stamp(components.Button, appearance('secondary', rootIsPrimary)),\n ToggleButton: stamp(components.ToggleButton, appearance('secondary', rootIsPrimary)),\n CompoundButton: stamp(components.CompoundButton, appearance('secondary', rootIsPrimary)),\n MenuButton: stamp(components.MenuButton, appearance('secondary', rootIsPrimary)),\n SplitButton: stamp(components.SplitButton, appearance('secondary', splitButtonSlots)),\n ToolbarButton: stamp(components.ToolbarButton, appearance('subtle', rootIsPrimary)),\n ToolbarToggleButton: stamp(components.ToolbarToggleButton, appearance('subtle', rootIsPrimary)),\n ToolbarRadioButton: stamp(components.ToolbarRadioButton, appearance('subtle', rootIsPrimary)),\n Link: stamp(components.Link, appearance('default', rootIsPrimary)),\n Input: stamp(components.Input, appearance('outline', rootAndPrimary)),\n Textarea: stamp(components.Textarea, appearance('outline', rootAndPrimary)),\n Select: stamp(components.Select, appearance('outline', rootAndPrimary)),\n Combobox: stamp(components.Combobox, appearance('outline', rootAndPrimary)),\n Dropdown: stamp(components.Dropdown, appearance('outline', rootAndPrimary)),\n Card: stamp(components.Card, appearance('filled', rootIsPrimary)),\n TableRow: stamp(components.TableRow, appearance('none', rootIsPrimary)),\n TabList: stamp(components.TabList, appearance('transparent', rootIsPrimary)),\n Checkbox: wrapFluent(components.Checkbox, useCheckedProps),\n TableSelectionCell: stampSelectionCellCheckedState(components.TableSelectionCell),\n Switch: stamp(components.Switch, size('medium', rootAndPrimary)),\n };\n};\n", "// Every substitution this layer makes is the same shape: take a Fluent\n// component, rewrite the props on their way in, and hand back something the\n// original's type still describes. Fluent exports its components as opaque\n// function types rather than element types, so a wrapper costs one cast inward\n// and one outward; both live here so no wrapper restates them.\n//\n// The ref rides in the props, which is what React hands a function component\n// and what Fluent's own forwardRef components read on the way out, so a mapper\n// that spreads its props forwards the ref by doing nothing.\n// https://github.com/facebook/react/blob/v19.2.0/packages/react-reconciler/src/ReactChildFiber.js#L287-L294\nimport * as React from 'react';\n\nexport type FluentComponents = typeof import('@fluentui/react-components');\n\nexport type PropCarrier = Record<string, unknown>;\n\nexport const wrapFluent = <Component, Props extends object = PropCarrier>(\n component: Component,\n mapProps: (props: Props) => object,\n): Component => {\n const elementType = component as React.ElementType;\n\n const wrapped = (props: Props) => React.createElement(elementType, mapProps(props));\n\n return Object.assign(wrapped, {\n displayName: (component as { displayName?: string }).displayName,\n }) as Component;\n};\n", "// Every motion Fluent runs from JavaScript, restated as WinUI states it. A\n// component that animates takes its motion from a slot, so the slot is the one\n// seam this file writes through: a presence component where WinUI states its own\n// keyframes, motion parameters where Fluent's own component keeps the shape, and\n// nothing at all where a stylesheet takes the motion over. Fluent's motion slot\n// forbids `as`, so a presence component reaches it through the slot's render\n// function rather than by being named.\n// https://github.com/microsoft/fluentui/blob/6dee27b023a2d989f032b4adacb2135d336a67fb/packages/react-components/react-motion/library/src/slots/presenceMotionSlot.tsx#L13-L19\nimport * as React from 'react';\n\nimport {\n CHEVRON_TURN_EASING,\n CHEVRON_TURN_MS,\n COLLAPSE_ANIMATION_MS,\n CONTROL_FASTER_ANIMATION_MS,\n CONTROL_FAST_ANIMATION_MS,\n CONTROL_FAST_OUT_SLOW_IN_EASING,\n CONTROL_NORMAL_ANIMATION_MS,\n EXPAND_ANIMATION_MS,\n PANE_SLIDE_EASING,\n PANE_SLIDE_MS,\n PANE_SLIDE_OUT_MS,\n POPUP_FADE_DELAY_MS,\n POPUP_FADE_MS,\n POPUP_HIDE_MS,\n POPUP_SLIDE_EASING,\n POPUP_SLIDE_MS,\n POP_IN_OFFSET_PX,\n} from './motion';\nimport { wrapFluent } from './wrap';\nimport type { FluentComponents, PropCarrier } from './wrap';\n\ninterface MotionSlotProps { children?: unknown }\n\n// One rule for every motion slot this layer fills: ours is the base, a caller's\n// object is merged over it -- onMotionFinish above all -- and a caller's null\n// suppresses the slot rather than being merged into, which is how a caller\n// switches the motion off entirely.\nconst resolveMotionSlot = (ours: PropCarrier | null, stated: PropCarrier | null | undefined) => {\n if (stated === undefined) return ours;\n if (stated === null) return null;\n return { ...ours, ...stated };\n};\n\nconst motionSlot = <Component>(component: Component, slot: string, ours: PropCarrier | null): Component =>\n wrapFluent(component, (props: PropCarrier) => ({\n ...props,\n [slot]: resolveMotionSlot(ours, props[slot] as PropCarrier | null | undefined),\n }));\n\n// Filled in both directions: several opacity legs finish well before the\n// transform they accompany, and their final value has to hold until the whole\n// motion ends.\nconst fadeIn = { keyframes: [{ opacity: 0 }, { opacity: 1 }], duration: CONTROL_FASTER_ANIMATION_MS, easing: 'linear', fill: 'both' as const };\nconst fadeOut = { keyframes: [{ opacity: 1 }, { opacity: 0 }], duration: CONTROL_FASTER_ANIMATION_MS, easing: 'linear', fill: 'both' as const };\n\n// Fluent parameterises a drawer's motion by its edge and the reading direction,\n// and keeps the drawer's own extent in a custom property, which is what the\n// closed offset is measured in.\n// https://github.com/microsoft/fluentui/blob/6dee27b023a2d989f032b4adacb2135d336a67fb/packages/react-components/react-drawer/library/src/shared/drawerMotions.ts#L9-L11\n// https://github.com/microsoft/fluentui/blob/6dee27b023a2d989f032b4adacb2135d336a67fb/packages/react-components/react-drawer/library/src/shared/useDrawerBaseStyles.styles.ts#L11-L13\ntype DrawerMotionParams = {\n dir: 'ltr' | 'rtl';\n position: 'start' | 'end' | 'bottom';\n};\n\nconst DRAWER_SIZE_VAR = '--fui-Drawer--size';\n\n// https://github.com/microsoft/fluentui/blob/6dee27b023a2d989f032b4adacb2135d336a67fb/packages/react-components/react-drawer/library/src/shared/drawerMotions.ts#L24-L46\nconst closedDrawerTransform = ({ dir, position }: DrawerMotionParams): string => (position === 'bottom'\n ? `translate3d(0, var(${DRAWER_SIZE_VAR}), 0)`\n : `translate3d(calc(var(${DRAWER_SIZE_VAR}) * ${(position === 'start') === (dir === 'ltr') ? -1 : 1}), 0, 0)`);\n\n// A toast is a floating surface with no edge to be clipped by, which is what the\n// popup family is for: the arrival travels while a much shorter fade catches up,\n// and the departure is that fade alone, with nothing to move a dismissed card\n// across the stack it is leaving. The offset is stated on the horizontal because\n// that is where the platform's own default puts it.\nexport const createToastPresence = (components: FluentComponents) => components.createPresenceComponent({\n enter: [\n {\n keyframes: [{ transform: `translateX(${POP_IN_OFFSET_PX}px)` }, { transform: 'none' }],\n duration: POPUP_SLIDE_MS,\n easing: POPUP_SLIDE_EASING,\n },\n { keyframes: [{ opacity: 0 }, { opacity: 1 }], duration: POPUP_FADE_MS, delay: POPUP_FADE_DELAY_MS, easing: 'linear', fill: 'both' },\n ],\n exit: { keyframes: [{ opacity: 1 }, { opacity: 0 }], duration: POPUP_HIDE_MS, easing: 'linear', fill: 'both' },\n});\n\nexport const withWinuiMotion = (components: FluentComponents): FluentComponents => {\n // ContentDialog settles down from 1.05 rather than growing in from below 1,\n // and its fade is a separate, much shorter animation, so the surface is fully\n // opaque while it is still moving; Fluent's own motion disagrees on both.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/ContentDialog_themeresources.xaml#L97-L113\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/ContentDialog_themeresources.xaml#L74-L94\n const DialogSurfaceMotion = components.createPresenceComponent({\n enter: [\n {\n keyframes: [{ scale: 1.05 }, { scale: 1 }],\n duration: CONTROL_NORMAL_ANIMATION_MS,\n easing: CONTROL_FAST_OUT_SLOW_IN_EASING,\n },\n fadeIn,\n ],\n exit: [\n {\n keyframes: [{ scale: 1 }, { scale: 1.05 }],\n duration: CONTROL_FAST_ANIMATION_MS,\n easing: CONTROL_FAST_OUT_SLOW_IN_EASING,\n },\n fadeOut,\n ],\n });\n\n // ContentDialog gives the scale to the dialog's own background element and\n // the opacity to LayoutRoot, which is what the dim rides, so the backdrop\n // never moves. Fluent's default here is FadeRelaxed at durationGentle, 250ms.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/ContentDialog_themeresources.xaml#L82-L93\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/ContentDialog_themeresources.xaml#L101-L112\n // https://github.com/microsoft/fluentui/blob/6dee27b023a2d989f032b4adacb2135d336a67fb/packages/react-components/react-dialog/library/src/components/DialogBackdropMotion.ts#L1-L3\n // https://github.com/microsoft/fluentui/blob/6dee27b023a2d989f032b4adacb2135d336a67fb/packages/react-components/react-motion-components-preview/library/src/components/Fade/Fade.ts#L46\n // https://github.com/microsoft/fluentui/blob/6dee27b023a2d989f032b4adacb2135d336a67fb/packages/react-components/react-motion/library/src/motions/motionTokens.ts#L9\n const DialogBackdropMotion = components.createPresenceComponent({\n enter: fadeIn,\n exit: fadeOut,\n });\n\n // MenuFlyout's close, and only its close: the open is a CSS animation in\n // ./controls/menu.css, because its direction comes from the placement\n // attribute and that attribute is written after this factory has already run.\n // The close needs a presence component to hold the surface mounted while it\n // runs, since Fluent mounts a menu with `unmountOnExit`. WinUI's close carries\n // no transform -- the clip keyframes it registers hold one constant value at\n // both ends, pinning an interrupted open rather than animating.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/543310634592831f8f2638301ece05d2d2dbea39/src/dxaml/xcp/dxaml/lib/MenuPopupThemeTransition_Partial.h#L24-L25\n const MenuSurfaceMotion = components.createPresenceComponent({\n enter: [],\n exit: fadeOut,\n });\n\n // A drawer is SplitView's overlaying pane, which only travels: WinUI puts no\n // opacity and no shadow key frame on the pane itself, and NavigationView's\n // depth comes from a separate ShadowCaster element on the same spline, which\n // this layer does not transcribe -- see the tooltip note in ./tokens.ts for\n // how far WinUI depth is carried here. Fluent instead fades the surface in\n // and ramps shadow64 alongside the slide over a size-dependent duration, and\n // since it is the only shadow the drawer has, dropping the term leaves the\n // open surface flat.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/NavigationView/NavigationView.xaml#L96-L107\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/SplitView/SplitView_themeresources.xaml#L185-L190\n // https://github.com/microsoft/fluentui/blob/6dee27b023a2d989f032b4adacb2135d336a67fb/packages/react-components/react-drawer/library/src/shared/drawerMotions.ts#L14-L19\n // https://github.com/microsoft/fluentui/blob/6dee27b023a2d989f032b4adacb2135d336a67fb/packages/react-components/react-drawer/library/src/shared/drawerMotions.ts#L85-L116\n // https://github.com/microsoft/fluentui/blob/6dee27b023a2d989f032b4adacb2135d336a67fb/packages/react-components/react-drawer/library/src/components/OverlayDrawer/useOverlayDrawerStyles.styles.ts#L20-L26\n const DrawerSurfaceMotion = components.createPresenceComponent<DrawerMotionParams>(params => {\n const closed = { transform: closedDrawerTransform(params) };\n const open = { transform: 'translate3d(0, 0, 0)' };\n\n return {\n enter: { keyframes: [closed, open], duration: PANE_SLIDE_MS, easing: PANE_SLIDE_EASING },\n exit: { keyframes: [open, closed], duration: PANE_SLIDE_OUT_MS, easing: PANE_SLIDE_EASING },\n };\n });\n\n // A nav category's chevron is the same AnimatedIcon as the Expander's, so it\n // turns on the same timing rather than Fluent's Rotate variant at\n // durationFast on curveEasyEase. The angles are Fluent's, and only the\n // rotation is animated -- the WinUI icon keeps its opacity throughout, which\n // is what Fluent's own `animateOpacity: false` already expresses.\n // https://github.com/microsoft/fluentui/blob/6dee27b023a2d989f032b4adacb2135d336a67fb/packages/react-components/react-nav/library/src/components/NavCategoryItem/useNavCategoryItem.tsx#L18-L24\n const chevronCollapsed = { rotate: '0deg' };\n const chevronExpanded = { rotate: '180deg' };\n const ChevronTurnMotion = components.createPresenceComponent({\n enter: { keyframes: [chevronCollapsed, chevronExpanded], duration: CHEVRON_TURN_MS, easing: CHEVRON_TURN_EASING },\n exit: { keyframes: [chevronExpanded, chevronCollapsed], duration: CHEVRON_TURN_MS, easing: CHEVRON_TURN_EASING },\n });\n\n const runMotion = <Component>(component: Component, slot: string, Motion: React.ElementType): Component =>\n motionSlot(component, slot, {\n children: (_: unknown, motionProps: MotionSlotProps) => React.createElement(Motion, motionProps),\n });\n\n // WinUI's Expander slides its content region open and never touches its\n // opacity: all four expand storyboards animate ExpanderContent's Visibility\n // and TranslateY alone, and the template carries no opacity animation at all.\n // Fluent's Collapse fades the panel with the height, which takes the card's\n // own fill and stroke transparent mid-animation, so the fade atom is switched\n // off.\n //\n // The size animation then runs on the pair of durations those storyboards\n // state, 333ms opening and 167ms closing, read from ./motion so this and the\n // SettingsExpander cannot drift apart. What travels is the panel's own size\n // rather than the clipped translate WinUI animates -- the SettingsExpander's\n // simplification too -- and on that geometry both directions take the opening\n // KeySpline; nothing sources the substitution for the close, which upstream\n // states as cubic-bezier(1, 1, 0, 1).\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/Expander/Expander.xaml#L33-L90\n // https://github.com/microsoft/fluentui/blob/6dee27b023a2d989f032b4adacb2135d336a67fb/packages/react-components/react-accordion/library/src/components/AccordionPanel/useAccordionPanel.ts#L42-L48\n // https://github.com/microsoft/fluentui/blob/6dee27b023a2d989f032b4adacb2135d336a67fb/packages/react-components/react-motion-components-preview/library/src/components/Collapse/Collapse.ts#L30-L48\n const panelCollapse = {\n animateOpacity: false,\n duration: EXPAND_ANIMATION_MS,\n exitDuration: COLLAPSE_ANIMATION_MS,\n easing: CONTROL_FAST_OUT_SLOW_IN_EASING,\n exitEasing: CONTROL_FAST_OUT_SLOW_IN_EASING,\n };\n\n return {\n ...components,\n AccordionPanel: motionSlot(components.AccordionPanel, 'collapseMotion', panelCollapse),\n Dialog: runMotion(components.Dialog, 'surfaceMotion', DialogSurfaceMotion),\n DialogSurface: runMotion(components.DialogSurface, 'backdropMotion', DialogBackdropMotion),\n Menu: runMotion(components.Menu, 'surfaceMotion', MenuSurfaceMotion),\n NavCategoryItem: runMotion(components.NavCategoryItem, 'expandIconMotion', ChevronTurnMotion),\n OverlayDrawer: runMotion(components.OverlayDrawer, 'surfaceMotion', DrawerSurfaceMotion),\n // Fluent runs the indeterminate ProgressBar from the Web Animations API\n // rather than a stylesheet -- one 33 per cent segment sweeping across in 3s,\n // or a full-width opacity pulse under a reduced-motion preference -- so no\n // rule can retime or reshape it. Its motion slot is documented as nullable,\n // and emptying it here is what hands the state to\n // ./progress-indeterminate.css, whose transcription of WinUI's own\n // storyboard is the only shape this control has.\n // https://github.com/microsoft/fluentui/blob/6dee27b023a2d989f032b4adacb2135d336a67fb/packages/react-components/react-progress/library/src/components/ProgressBar/progressBarMotions.ts#L8-L23\n // https://github.com/microsoft/fluentui/blob/6dee27b023a2d989f032b4adacb2135d336a67fb/packages/react-components/react-progress/library/src/components/ProgressBar/ProgressBar.types.ts#L13-L16\n ProgressBar: motionSlot(components.ProgressBar, 'indeterminateMotion', null),\n };\n};\n", "// The WinUI 3 motion vocabulary, as values: a Web Animations keyframe takes a\n// number and will not resolve a `var()`, so the numbers live here and\n// ./tokens.ts interpolates them into custom properties for the CSS form.\n\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L602-L606\nexport const CONTROL_NORMAL_ANIMATION_MS = 250;\nexport const CONTROL_FAST_ANIMATION_MS = 167;\nexport const CONTROL_FASTER_ANIMATION_MS = 83;\nexport const CONTROL_FAST_OUT_SLOW_IN_EASING = 'cubic-bezier(0, 0, 0, 1)';\n\n// SplitView's overlaying pane, which is the pane NavigationView opens over its\n// content. Its transition translates the pane and the pane's clip, with no\n// opacity and no shadow key frame riding along, and it leaves faster than it\n// arrives on the one spline both directions share.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/SplitView/SplitView_themeresources.xaml#L63-L70\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/SplitView/SplitView_themeresources.xaml#L185-L190\nexport const PANE_SLIDE_MS = 350;\nexport const PANE_SLIDE_OUT_MS = 120;\nexport const PANE_SLIDE_EASING = 'cubic-bezier(0.1, 0.9, 0.2, 1)';\n\n// Expander's own open and close, which are neither the control durations above\n// nor symmetric with each other.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/Expander/Expander.xaml#L33-L90\nexport const EXPAND_ANIMATION_MS = 333;\nexport const COLLAPSE_ANIMATION_MS = 167;\n\n// The expand chevron of Expander and of NavigationViewItem is one and the same\n// AnimatedIcon, so both turn on the timing baked into its generated visual\n// source: a 260-frame composition lasting c_durationTicks of 100ns, in which\n// the segments that turn -- NormalOffToNormalOn and NormalOnToNormalOff --\n// each spend ten frames rotating, on the one spline they share.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/Expander/Expander_themeresources.xaml#L280-L282\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/NavigationView/NavigationView_themeresources.xaml#L617-L619\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/AnimatedIcon/AnimatedVisuals/AnimatedChevronUpDownSmallVisualSource.cpp#L104\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/AnimatedIcon/AnimatedVisuals/AnimatedChevronUpDownSmallVisualSource.cpp#L350-L353\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/AnimatedIcon/AnimatedVisuals/AnimatedChevronUpDownSmallVisualSource.cpp#L423-L440\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/AnimatedIcon/AnimatedVisuals/AnimatedChevronUpDownSmallVisualSource.cpp#L781\nconst CHEVRON_VISUAL_MS = 43333333 / 10000;\nconst CHEVRON_VISUAL_FRAMES = 260;\nconst CHEVRON_TURN_FRAMES = 10;\n\nexport const CHEVRON_TURN_MS = Math.round((CHEVRON_VISUAL_MS * CHEVRON_TURN_FRAMES) / CHEVRON_VISUAL_FRAMES);\nexport const CHEVRON_TURN_EASING = 'cubic-bezier(0.167, 0.167, 0, 1)';\n\n// RepositionThemeAnimation. Its timing lives in the PVL table of the OS visual\n// style (TAS_REPOSITION / TA_REPOSITION_TARGET) and appears in no source file;\n// these are decoded from aero.msstyles, byte-identical across the Windows 8.1,\n// 10 21H2 and 11 styles, and corroborated by WinJS and by\n// SwipeHintThemeAnimation, which cannot reach PVL and hardcodes them.\n// https://github.com/winjs/winjs/blob/b9e0b33f76c57caac941c9b1885bf69443320b1c/src/js/WinJS/Animations.js#L349-L367\n// https://github.com/microsoft/microsoft-ui-xaml/blob/543310634592831f8f2638301ece05d2d2dbea39/src/dxaml/xcp/dxaml/lib/SwipeHintThemeAnimation_Partial.h#L18-L32\nexport const REPOSITION_ANIMATION_MS = 367;\nexport const REPOSITION_EASING = 'cubic-bezier(0.1, 0.9, 0.2, 1)';\n\n// The delay a list charges its survivors when something leaves it, so the\n// departing item gets a head start before the gap closes. WinJS writes it as a\n// condition on the deleted set, so an arrival, which perturbs the same\n// survivors, pays nothing -- which is the whole rule, not just the number.\n//\n// Spliced: we take the delay from that animation and not its durations. Its\n// survivors travel for 400ms and its leavers shrink on a bezier of their own,\n// where ours reposition on TAS_REPOSITION above and leave on POPUP_HIDE_MS\n// below.\n// https://github.com/winjs/winjs/blob/b9e0b33f76c57caac941c9b1885bf69443320b1c/src/js/WinJS/Animations.js#L447-L456\nexport const REPOSITION_DELETE_DELAY_MS = 60;\n\n// PopInThemeAnimation and PopOutThemeAnimation, the transition XAML gives a\n// surface that floats free of any edge -- a Flyout, and here a toast. Their\n// timing lives in the PVL table (TAS_SHOWPOPUP / TAS_HIDEPOPUP) on the same\n// route REPOSITION_ANIMATION_MS above documents, and WinJS is the corroborating\n// transcription: showPopup travels on one spline while a much shorter opacity\n// leg, delayed by its own duration, catches up.\n//\n// The exit carries no transform. PopOutThemeAnimation pins both its start and\n// its destination offset to the origin, makes no call to read either back, and\n// exposes no offset property at all; hidePopup is correspondingly a single\n// opacity object rather than the array showPopup passes, and its signature takes\n// no offset.\n//\n// The offset is the platform's own knob rather than a derived extent: PopIn\n// reads FromHorizontalOffset and FromVerticalOffset and feeds them in as the\n// start point, and the defaults make an unset PopIn a purely horizontal 40px\n// travel -- FromHorizontalOffset is answered from a named constant, while\n// FromVerticalOffset appears nowhere in that switch and falls through to the\n// Double default of zero. The omission is deliberate: the same switch answers\n// the vertical of PopupThemeTransition with 40 and of EntranceThemeTransition\n// with 28.\n// https://github.com/winjs/winjs/blob/b9e0b33f76c57caac941c9b1885bf69443320b1c/src/js/WinJS/Animations.js#L1164-L1181\n// https://github.com/winjs/winjs/blob/b9e0b33f76c57caac941c9b1885bf69443320b1c/src/js/WinJS/Animations.js#L1203-L1211\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/dxaml/xcp/dxaml/lib/ThemeAnimations.cpp#L101-L127\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/dxaml/xcp/dxaml/lib/ThemeAnimations.cpp#L129-L148\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/dxaml/xcp/components/DependencyObject/DependencyProperty.cpp#L83\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/dxaml/xcp/components/DependencyObject/DependencyProperty.cpp#L537-L539\nexport const POPUP_SLIDE_MS = 367;\nexport const POP_IN_OFFSET_PX = 40;\nexport const POPUP_FADE_MS = 83;\nexport const POPUP_FADE_DELAY_MS = 83;\nexport const POPUP_HIDE_MS = 83;\n\n// Its own constant despite matching REPOSITION_EASING and PAGE_ENTER_EASING, for\n// the reason stated at the latter: separate declarations with separate owners.\nexport const POPUP_SLIDE_EASING = 'cubic-bezier(0.1, 0.9, 0.2, 1)';\n\n// Selection indicator timing, shared by every control that has one. Offset and\n// scale run the full duration while the transform origin flips at the snap on a\n// single-frame step, which is what keeps the indicator from overshooting.\n// Composition attaches an easing to the keyframe it interpolates *into* where\n// CSS attaches it to the keyframe it interpolates *from*, so both curves sit one\n// keyframe earlier at their use than they read in the source.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/NavigationView/NavigationView.cpp#L2176-L2233\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/NavigationView/NavigationView.cpp#L1990-L1993\nexport const INDICATOR_DURATION_MS = 600;\nexport const INDICATOR_POSITION_SNAP = 0.333;\nexport const INDICATOR_STRETCH_EASING = 'cubic-bezier(0.9, 0.1, 1, 0.2)';\nexport const INDICATOR_SETTLE_EASING = 'cubic-bezier(0.1, 0.9, 0.2, 1)';\n\n// EntranceNavigationTransitionInfo. Strictly sequential rather than a\n// cross-fade: the outgoing frame fades over PAGE_LEAVE_MS and the incoming frame\n// is held at zero for exactly that long, then appears whole on a pair of\n// DISCRETE opacity key frames, so only its travel animates. PAGE_ENTER_EASING\n// stays its own constant despite matching REPOSITION_EASING, because they are\n// separate declarations with separate owners.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/dxaml/phone/lib/ThemeTransitions.cpp#L3179-L3186\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/dxaml/phone/lib/ThemeTransitions.cpp#L3194-L3206\nexport const PAGE_LEAVE_MS = 150;\nexport const PAGE_ENTER_MS = 300;\nexport const PAGE_ENTER_OFFSET_PX = 140;\nexport const PAGE_LEAVE_EASING = 'cubic-bezier(0.7, 0, 1, 0.5)';\nexport const PAGE_ENTER_EASING = 'cubic-bezier(0.1, 0.9, 0.2, 1)';\n", "// Drag support for the Switch, which Fluent does not have and WinUI's\n// ToggleSwitch does. XAML puts a transparent Thumb over the whole control and\n// listens to its DragStarted / DragDelta / DragCompleted; there is no\n// manipulation and no inertia, so the whole gesture is reproducible from\n// pointer events.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/dxaml/xcp/dxaml/lib/ToggleSwitch_Partial.cpp#L245-L250\n//\n// The knob follows the pointer 1:1 and is clamped only where it is written, not\n// where it is accumulated, so a drag that overshoots the end and comes back\n// leaves the decision reading from the unclamped total. That is why the offset\n// below is kept raw and clamped at paint time.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/dxaml/xcp/dxaml/lib/ToggleSwitch_Partial.cpp#L452-L458\nimport * as React from 'react';\n\nimport { CONTROL_FASTER_ANIMATION_MS } from './motion';\nimport type { FluentComponents, PropCarrier } from './wrap';\n\ntype SwitchProps = React.ComponentProps<FluentComponents['Switch']>;\n\nconst DRAG_X = '--winui-switch-drag-x';\nconst DRAGGING = 'data-winui-switch-dragging';\nconst SETTLING = 'data-winui-switch-settling';\n\n// XAML defers \"was that a tap or a drag\" to the OS gesture recognizer, whose\n// slop is not expressed anywhere in the corpus, and the web has no equivalent:\n// a click follows every pointer sequence that starts and ends on the same\n// element, however far it travelled. This stands in for that recognizer -- below\n// it the gesture is a tap and the click toggles, above it the click is\n// suppressed so a drag that wanders out and returns leaves the switch alone.\nconst TAP_SLOP_PX = 4;\n\ninterface Gesture {\n pointerId: number;\n root: HTMLElement;\n input: HTMLInputElement;\n /** Accumulated raw, and clamped only when painted. */\n offset: number;\n travel: number;\n lastClientX: number;\n originClientX: number;\n excursion: number;\n /** XAML's m_wasDragged, whose threshold is literally a non-zero delta. */\n moved: boolean;\n /** Toward the track's on end, which RTL puts on the left. */\n sign: 1 | -1;\n}\n\nconst paint = (gesture: Gesture) => {\n const clamped = Math.min(Math.max(gesture.offset, 0), gesture.travel);\n gesture.root.style.setProperty(DRAG_X, `${clamped * gesture.sign}px`);\n};\n\nexport const withWinuiDrag = (components: FluentComponents): FluentComponents => {\n const FluentSwitch = components.Switch;\n const { indicator: indicatorClass, input: inputClass } = components.switchClassNames;\n const resolveSlotProps = components.slot.resolveShorthand as (value: unknown) => PropCarrier | undefined;\n\n const DraggableSwitch = React.forwardRef<HTMLInputElement, SwitchProps>(({ root, ...props }, ref) => {\n const gestureRef = React.useRef<Gesture | null>(null);\n const suppressClickRef = React.useRef(false);\n const settleTimerRef = React.useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n\n React.useEffect(() => () => clearTimeout(settleTimerRef.current), []);\n\n // Every step below writes the DOM rather than React state, because the\n // ordering is load-bearing: the settling flag has to be in effect before the\n // checkbox flips, or the cross-fade it selects starts on the old duration,\n // and the drag position has to leave in the same style recalculation that\n // re-enables the travel transition, or the knob jumps instead of settling.\n //\n // The toggle is always issued here rather than left to the browser, because\n // capturing the pointer redirects the click that follows to the capture\n // target -- the root -- where it no longer reaches the checkbox at all.\n const end = (gesture: Gesture, toggle: boolean, fromDrag: boolean) => {\n gestureRef.current = null;\n gesture.root.removeAttribute(DRAGGING);\n gesture.root.style.removeProperty(DRAG_X);\n if (toggle) {\n if (fromDrag) {\n // Committing out of a drag fades both ways, where the click path's\n // off direction is instant.\n gesture.root.setAttribute(SETTLING, '');\n clearTimeout(settleTimerRef.current);\n settleTimerRef.current = setTimeout(() => gesture.root.removeAttribute(SETTLING), CONTROL_FASTER_ANIMATION_MS);\n }\n gesture.input.click();\n }\n // Set after our own click, which would otherwise suppress itself.\n suppressClickRef.current = true;\n };\n\n const onPointerDown = (event: React.PointerEvent<HTMLDivElement>) => {\n suppressClickRef.current = false;\n if (!event.isPrimary || event.button !== 0) return;\n const element = event.currentTarget;\n const input = element.querySelector<HTMLInputElement>(`.${inputClass}`);\n const indicator = element.querySelector<HTMLElement>(`.${indicatorClass}`);\n // Fluent renders both unconditionally, so their absence is not a switch\n // that cannot be dragged: it is the control this layer targets no longer\n // being there, which the quiet return below would hide.\n if (!input || !indicator) throw new Error('The Switch drag gesture found no input or indicator under the switch root.');\n if (input.disabled || input.getAttribute('aria-disabled') === 'true') return;\n if (element.getAttribute('aria-readonly') === 'true') return;\n\n // XAML's range is knob-bounds width minus knob width; Fluent's knob cell is\n // half the track at every size, so half the indicator is the same number.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/dxaml/xcp/dxaml/lib/ToggleSwitch_Partial.cpp#L936-L952\n const travel = indicator.offsetWidth / 2;\n const gesture: Gesture = {\n excursion: 0,\n input,\n lastClientX: event.clientX,\n moved: false,\n offset: input.checked ? travel : 0,\n originClientX: event.clientX,\n pointerId: event.pointerId,\n root: element,\n sign: getComputedStyle(element).direction === 'rtl' ? -1 : 1,\n travel,\n };\n gestureRef.current = gesture;\n element.setPointerCapture(event.pointerId);\n // Dragging is entered with no movement at all: Thumb raises DragStarted from\n // OnPointerPressed.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/dxaml/xcp/dxaml/lib/ToggleSwitch_Partial.cpp#L806-L816\n element.setAttribute(DRAGGING, '');\n paint(gesture);\n };\n\n const onPointerMove = (event: React.PointerEvent<HTMLDivElement>) => {\n const gesture = gestureRef.current;\n if (!gesture || event.pointerId !== gesture.pointerId) return;\n const delta = (event.clientX - gesture.lastClientX) * gesture.sign;\n // Ignoring vertical movement is what leaves a vertical swipe to the scroller.\n if (delta === 0) return;\n gesture.lastClientX = event.clientX;\n gesture.excursion = Math.max(gesture.excursion, Math.abs(event.clientX - gesture.originClientX));\n gesture.moved = true;\n gesture.offset += delta;\n paint(gesture);\n };\n\n const onPointerUp = (event: React.PointerEvent<HTMLDivElement>) => {\n const gesture = gestureRef.current;\n if (!gesture || event.pointerId !== gesture.pointerId) return;\n // Midpoint decides, inclusive both ways, with no velocity or direction term.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/dxaml/xcp/dxaml/lib/ToggleSwitch_Partial.cpp#L592-L605\n const midpoint = gesture.travel / 2;\n const crossed = gesture.input.checked ? gesture.offset <= midpoint : gesture.offset >= midpoint;\n const committed = gesture.moved && crossed;\n end(gesture, committed || gesture.excursion <= TAP_SLOP_PX, committed);\n };\n\n const abandon = (event: React.PointerEvent<HTMLDivElement>) => {\n const gesture = gestureRef.current;\n if (!gesture || event.pointerId !== gesture.pointerId) return;\n end(gesture, false, false);\n };\n\n const onClickCapture = (event: React.MouseEvent<HTMLDivElement>) => {\n // Synthesised clicks -- keyboard space, and the toggle issued above -- carry a\n // zero detail where a pointer's click counts from one.\n if (!suppressClickRef.current || event.detail === 0) return;\n suppressClickRef.current = false;\n // stopPropagation alone would still leave the checkbox its default action.\n event.preventDefault();\n event.stopPropagation();\n };\n\n return (\n <FluentSwitch\n {...props}\n ref={ref}\n root={{\n ...resolveSlotProps(root),\n onClickCapture,\n onLostPointerCapture: abandon,\n onPointerCancel: abandon,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n }}\n />\n );\n });\n\n DraggableSwitch.displayName = 'Switch';\n\n return { ...components, Switch: DraggableSwitch as FluentComponents['Switch'] };\n};\n", "// Toast presentation, on Fluent's toast controller. `@fluentui/react-toast`\n// splits into a state layer, a hook layer and a render layer and exports all\n// three; only the container's own render function is closed, and all it does is\n// name the presence component. Everything below re-states that render function\n// and the shell around it, so the toast keeps Fluent's dispatch, queue, timeout,\n// focus restoration and update semantics while the surface, the motion and the\n// countdown are ours. The card and the title are wrapped here too, because the\n// context carrying a toast's intent is exported by this package alone.\n//\n// This is the package's only value import of `@fluentui/react-toast`. The runtime\n// bindings still arrive as an argument, so ../fluent.ts stays the one place a\n// Fluent component surface is resolved and wrapped.\nimport {\n ToastContainerContextProvider,\n toastContainerClassNames,\n toasterClassNames,\n useToastAnnounce,\n useToastContainerContext,\n useToastContainerContextValues_unstable,\n useToastContainer_unstable,\n useToaster,\n} from '@fluentui/react-toast';\nimport type {\n ToastAnnounce,\n ToastAnnounceOptions,\n ToastContainerProps,\n ToastData,\n ToastOffset,\n ToastPosition,\n ToasterProps,\n} from '@fluentui/react-toast';\nimport * as React from 'react';\n\nimport { severityMark, winuiIntentAttribute } from './appearance';\nimport { createToastPresence } from './presence';\nimport { createReposition } from './reposition';\nimport { wrapFluent } from './wrap';\nimport type { FluentComponents, PropCarrier } from './wrap';\n\ntype Politeness = ToastAnnounceOptions['politeness'];\n\n// The stack slot, which is what a reposition moves: the card travels inside it,\n// so a card that is entering and a stack that is closing a gap never write the\n// same element's transform.\nconst STACK_ITEM_CLASS = 'winui-toast-slot';\n\n// Long enough for a screen reader to register that the region changed. Fluent's\n// own live region holds each message for the same span.\n// https://github.com/microsoft/fluentui/blob/6dee27b023a2d989f032b4adacb2135d336a67fb/packages/react-components/react-toast/library/src/components/AriaLive/useAriaLive.ts#L7-L8\nconst MESSAGE_HOLD_MS = 500;\n\ninterface LiveMessage {\n message: string;\n order: number;\n politeness: Politeness;\n}\n\n// Assertive ahead of polite, and within a politeness the oldest first. Dispatch\n// order is counted rather than timed, because several toasts can be dispatched\n// in one synchronous block and share a clock reading.\nconst byUrgency = (a: LiveMessage, b: LiveMessage) => {\n if (a.politeness === b.politeness) return a.order - b.order;\n return a.politeness === 'assertive' ? -1 : 1;\n};\n\n/**\n * The toaster's live regions.\n *\n * Both regions are mounted for the lifetime of the toaster and start empty: a\n * live region that is inserted already carrying text announces nothing, because\n * assistive technology reports changes to a region it was already observing.\n * Writing is therefore always a text change inside a region that has been there\n * all along, and it is deferred by a frame so the change lands in a paint of its\n * own rather than in the same one that mounted the toast.\n */\nconst AriaLive = ({ announceRef }: { announceRef: React.RefObject<ToastAnnounce> }) => {\n const [current, setCurrent] = React.useState<LiveMessage>();\n const currentRef = React.useRef<LiveMessage>(undefined);\n const queue = React.useRef<LiveMessage[]>([]);\n const dispatched = React.useRef(0);\n const frame = React.useRef(0);\n\n const pump = React.useCallback(() => {\n if (frame.current) return;\n frame.current = requestAnimationFrame(() => {\n frame.current = 0;\n const next = queue.current.shift();\n // Written here rather than from the effect below: `announce` reads this\n // to decide whether the pump is idle, and between this callback and the\n // commit it schedules there is a window in which an effect can announce.\n // A mirror written only on commit still holds the message just retired,\n // so the announcement would be queued behind a pump nothing restarts.\n currentRef.current = next;\n setCurrent(next);\n });\n }, []);\n\n React.useEffect(() => () => cancelAnimationFrame(frame.current), []);\n\n React.useEffect(() => {\n if (!current) return;\n const timer = setTimeout(pump, MESSAGE_HOLD_MS);\n return () => clearTimeout(timer);\n }, [current, pump]);\n\n React.useImperativeHandle(announceRef, () => (message, { politeness }) => {\n if (message === currentRef.current?.message) return;\n queue.current.push({ message, order: dispatched.current++, politeness });\n queue.current.sort(byUrgency);\n if (!currentRef.current) pump();\n }, [pump]);\n\n return <>\n <div aria-live=\"assertive\" className=\"sr-only\">{current?.politeness === 'assertive' ? current.message : undefined}</div>\n <div aria-live=\"polite\" className=\"sr-only\">{current?.politeness === 'polite' ? current.message : undefined}</div>\n </>;\n};\n\ninterface CountdownProps {\n onTimeout: () => void;\n running: boolean;\n timeout: number;\n}\n\n// The remaining time, as the bar WinUI would draw it. It is Fluent's timer slot\n// rather than a second mechanism beside it: one CSS animation whose duration is\n// the timeout and whose end event is what closes the toast, so pausing the\n// animation pauses the toast, exactly, and resuming carries on from where it\n// stopped instead of restarting. A negative timeout is Fluent's own sentinel for\n// a toast that never expires, and it draws no bar for one.\n// https://github.com/microsoft/fluentui/blob/6dee27b023a2d989f032b4adacb2135d336a67fb/packages/react-components/react-toast/library/src/components/Timer/Timer.tsx#L23-L25\nconst Countdown = ({ onTimeout, running, timeout }: CountdownProps) => (timeout < 0 ? null : <span\n className={toastContainerClassNames.timer}\n data-timer-status={running ? 'running' : 'paused'}\n onAnimationEnd={onTimeout}\n style={{ animationDuration: `${timeout}ms`, animationPlayState: running ? 'running' : 'paused' }}\n/>);\n\nconst createToastContainer = (components: FluentComponents) => {\n const ToastPresence = createToastPresence(components);\n\n const WinuiToastContainer = (props: ToastContainerProps) => {\n const state = useToastContainer_unstable(props, null);\n const contextValues = useToastContainerContextValues_unstable(state);\n const { children, ...root } = state.root;\n const { onTimeout, running, timeout } = state.timer;\n\n // The slot is transparent to the accessibility tree so that the stack's list\n // role still sees its items as its own children.\n //\n // A toast held behind the toaster's limit is rendered here too, with\n // `visible` false, and `unmountOnExit` is what keeps it out of the document\n // until a slot frees: a presence component that stays mounted runs the exit\n // motion on it immediately, and the finish of that motion is Fluent's own\n // signal to drop the toast from the queue for good.\n // https://github.com/microsoft/fluentui/blob/6dee27b023a2d989f032b4adacb2135d336a67fb/packages/react-components/react-toast/library/src/state/vanilla/createToaster.ts#L161-L165\n // https://github.com/microsoft/fluentui/blob/6dee27b023a2d989f032b4adacb2135d336a67fb/packages/react-components/react-toast/library/src/state/vanilla/createToaster.ts#L123-L141\n // https://github.com/microsoft/fluentui/blob/6dee27b023a2d989f032b4adacb2135d336a67fb/packages/react-components/react-toast/library/src/components/ToastContainer/useToastContainer.ts#L131-L134\n return <ToastContainerContextProvider value={contextValues.toast}>\n <div className={STACK_ITEM_CLASS} role=\"presentation\">\n <ToastPresence appear onMotionFinish={state.onMotionFinish} unmountOnExit visible={state.visible}>\n <div {...root} className={[toastContainerClassNames.root, root.className].filter(Boolean).join(' ')}>\n {children}\n <Countdown key={state.updateId} onTimeout={onTimeout} running={running} timeout={timeout} />\n </div>\n </ToastPresence>\n </div>\n </ToastContainerContextProvider>;\n };\n\n return WinuiToastContainer;\n};\n\n// Every position a toast can be dispatched to, in one fixed order so that the\n// stacks keep their document order as they come and go. Fluent publishes the\n// same list, but only from a barrel its package exports does not reach; the\n// element type is exported, so the set is checked rather than asserted.\nconst STACK_POSITIONS: readonly ToastPosition[] = [\n 'bottom',\n 'bottom-start',\n 'bottom-end',\n 'top-start',\n 'top-end',\n 'top',\n];\n\ninterface StackInset {\n horizontal?: number;\n vertical?: number;\n}\n\n// A caller states its offset either once for every position or per position, and\n// the two shapes are not discriminable: every property of the uniform one is\n// optional, so the presence of a key cannot rule it out of the other branch.\nconst insetFor = (offset: ToastOffset | undefined, position: ToastPosition): StackInset => {\n if (!offset) return {};\n if ('horizontal' in offset || 'vertical' in offset) return offset;\n return (offset as Partial<Record<ToastPosition, StackInset>>)[position] ?? {};\n};\n\n// Where a stack sits in the viewport. This is Fluent's own computation, out of\n// reach for the same reason, restated with its axes, its flip on reading\n// direction and its default insets unchanged -- those insets are Fluent's\n// numbers, kept for the reason the stack's width and gap are.\n// https://github.com/microsoft/fluentui/blob/6dee27b023a2d989f032b4adacb2135d336a67fb/packages/react-components/react-toast/library/src/state/vanilla/getPositionStyles.ts#L19-L21\nconst stackPlacement = (\n position: ToastPosition,\n dir: 'ltr' | 'rtl',\n offset: ToastOffset | undefined,\n): React.CSSProperties => {\n const centred = position === 'top' || position === 'bottom';\n const { horizontal = centred ? 0 : 20, vertical = 16 } = insetFor(offset, position);\n const block = position.startsWith('top') ? { top: vertical } : { bottom: vertical };\n\n if (centred) return { ...block, left: `calc(50% + ${horizontal}px)`, transform: 'translateX(-50%)' };\n\n return { ...block, ...(position.endsWith('start') === (dir === 'ltr') ? { left: horizontal } : { right: horizontal }) };\n};\n\nconst isNode = (value: EventTarget | null): value is Node => value instanceof Node;\n\n// What is left of the toaster's props once its options are taken out: the props\n// of the div each position stack renders. Fluent maps its root slot onto every\n// one of those stacks in the same way.\ntype StackRootProps = Omit<ToasterProps, keyof ToasterOptionProps>;\n\ntype ToasterOptionProps = Pick<\n ToasterProps,\n | 'announce'\n | 'inline'\n | 'limit'\n | 'mountNode'\n | 'offset'\n | 'pauseOnHover'\n | 'pauseOnWindowBlur'\n | 'position'\n | 'priority'\n | 'shortcuts'\n | 'timeout'\n | 'toasterId'\n>;\n\n// The card and the title read their intent from the container context this file\n// already installs, which is the one place a toast's intent is in scope: the\n// dispatched content is rendered inside it, and an update carries a new intent\n// through it without the content being rewritten. `info` is what the container\n// resolves an absent intent to, and an InfoBar without a severity is\n// Informational too.\n// https://github.com/microsoft/fluentui/blob/6dee27b023a2d989f032b4adacb2135d336a67fb/packages/react-components/react-toast/library/src/contexts/toastContainerContext.tsx#L13-L24\n// https://github.com/microsoft/fluentui/blob/6dee27b023a2d989f032b4adacb2135d336a67fb/packages/react-components/react-toast/library/src/components/ToastContainer/useToastContainer.ts#L44\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/InfoBar/InfoBar.xaml#L15\nconst useToastIntent = () => useToastContainerContext().intent ?? 'info';\n\nconst useCardIntentProps = (props: PropCarrier) => ({ ...props, [winuiIntentAttribute]: useToastIntent() });\n\n// WinUI paints the severity on the card and always shows its glyph, so an\n// explicit media slot is the only thing that displaces the mark.\nconst useTitleSeverityProps = (props: { media?: unknown }) => {\n const intent = useToastIntent();\n return { ...props, media: props.media === undefined ? severityMark(intent) : props.media };\n};\n\nexport const withWinuiToaster = (components: FluentComponents): FluentComponents => {\n const { Portal, useFluent, useFocusableGroup } = components;\n const ToastContainer = createToastContainer(components);\n\n interface StackProps {\n announce: ToastAnnounce;\n closeAllToasts: () => void;\n dir: 'ltr' | 'rtl';\n inline: boolean;\n isToastVisible: (toastId: string) => boolean;\n offset: ToasterProps['offset'];\n pauseAllToasts: () => void;\n playAllToasts: () => void;\n position: ToastPosition;\n rootProps: StackRootProps;\n toasts: ToastData[];\n tryRestoreFocus: () => void;\n }\n\n const ToastStack = ({\n announce,\n closeAllToasts,\n dir,\n inline,\n isToastVisible,\n offset,\n pauseAllToasts,\n playAllToasts,\n position,\n rootProps,\n toasts,\n tryRestoreFocus,\n }: StackProps) => {\n const { announceToast, toasterRef } = useToastAnnounce(announce);\n const focusableGroupAttribute = useFocusableGroup({\n tabBehavior: 'limited-trap-focus',\n ignoreDefaultKeydown: { Escape: true },\n });\n const element = React.useRef<HTMLDivElement>(null);\n const [reposition] = React.useState(createReposition);\n\n const ref = React.useCallback((node: HTMLDivElement | null) => {\n element.current = node;\n toasterRef(node);\n }, [toasterRef]);\n\n React.useLayoutEffect(() => {\n const node = element.current;\n if (!node) return;\n reposition([...node.querySelectorAll<HTMLElement>(`.${STACK_ITEM_CLASS}`)]);\n });\n\n // Fluent's own traversal between stacked toasts is internal and unexported,\n // so it is restated: the arrows step through the containers in document\n // order and wrap at both ends, and the whole stack holds while focus is\n // anywhere inside it, which is what stops a toast expiring under a reader.\n const onKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n closeAllToasts();\n }\n\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n const containers = [...event.currentTarget.querySelectorAll<HTMLElement>(`.${toastContainerClassNames.root}`)];\n const focused = containers.findIndex(container => isNode(event.target) && container.contains(event.target));\n if (focused >= 0) {\n const step = event.key === 'ArrowDown' ? 1 : -1;\n containers[(focused + step + containers.length) % containers.length].focus();\n }\n }\n\n rootProps.onKeyDown?.(event);\n };\n\n const { className, style, ...rest } = rootProps;\n\n return <div\n {...rest}\n className={[toasterClassNames.root, className].filter(Boolean).join(' ')}\n data-toaster-position={position}\n onBlur={event => { if (!isNode(event.relatedTarget) || !event.currentTarget.contains(event.relatedTarget)) playAllToasts(); }}\n onFocus={event => { if (!isNode(event.relatedTarget) || !event.currentTarget.contains(event.relatedTarget)) pauseAllToasts(); }}\n onKeyDown={onKeyDown}\n ref={ref}\n role=\"list\"\n style={{ position: inline ? 'absolute' : 'fixed', ...stackPlacement(position, dir, offset), ...style }}\n {...focusableGroupAttribute}\n >\n {toasts.map(toast => <ToastContainer\n {...toast}\n announce={announceToast}\n intent={toast.intent}\n key={toast.toastId}\n tryRestoreFocus={tryRestoreFocus}\n visible={isToastVisible(toast.toastId)}\n >{toast.content as React.ReactNode}</ToastContainer>)}\n </div>;\n };\n\n const WinuiToaster = (props: ToasterProps) => {\n const {\n announce: announceProp,\n inline = false,\n limit,\n mountNode,\n offset,\n pauseOnHover,\n pauseOnWindowBlur,\n position,\n priority,\n shortcuts,\n timeout,\n toasterId,\n ...rootProps\n } = props;\n const announceRef = React.useRef<ToastAnnounce>(() => undefined);\n const announce = React.useCallback<ToastAnnounce>(\n (message, announceOptions) => announceRef.current(message, announceOptions),\n [],\n );\n const { dir } = useFluent();\n const {\n closeAllToasts,\n isToastVisible,\n pauseAllToasts,\n playAllToasts,\n toastsToRender,\n tryRestoreFocus,\n } = useToaster({ limit, pauseOnHover, pauseOnWindowBlur, position, priority, shortcuts, timeout, toasterId });\n\n const stacks = STACK_POSITIONS.filter(stackPosition => toastsToRender.has(stackPosition)).map(stackPosition => <ToastStack\n announce={announceProp ?? announce}\n closeAllToasts={closeAllToasts}\n dir={dir}\n inline={inline}\n isToastVisible={isToastVisible}\n key={stackPosition}\n offset={offset}\n pauseAllToasts={pauseAllToasts}\n playAllToasts={playAllToasts}\n position={stackPosition}\n rootProps={rootProps}\n toasts={toastsToRender.get(stackPosition) ?? []}\n tryRestoreFocus={tryRestoreFocus}\n />);\n\n return <>\n {announceProp ? null : <AriaLive announceRef={announceRef} />}\n {inline ? stacks : <Portal mountNode={mountNode}>{stacks}</Portal>}\n </>;\n };\n\n WinuiToaster.displayName = 'Toaster';\n\n return {\n ...components,\n Toast: wrapFluent(components.Toast, useCardIntentProps),\n Toaster: WinuiToaster,\n ToastTitle: wrapFluent(components.ToastTitle, useTitleSeverityProps),\n };\n};\n", "// RepositionThemeAnimation, for elements that neither arrive nor leave. A\n// presence component cannot carry it: presence is about a thing being there or\n// not, and these are there throughout -- what changed is where the ones around\n// them are. So the motion is measured rather than declared, from the layout the\n// browser has already committed to the layout it is about to show.\n//\n// Offsets are read with offsetTop rather than a bounding rect, because a rect\n// includes the transform an unfinished reposition is still applying and would\n// feed its own output back in as the next measurement.\nimport { REPOSITION_ANIMATION_MS, REPOSITION_DELETE_DELAY_MS, REPOSITION_EASING } from './motion';\n\n/**\n * Tracks one stack of elements across layout changes.\n *\n * Call the returned function from a layout effect with the stack in document\n * order, on every render: it is the comparison against the previous call that\n * detects a move, so a call that finds nothing changed is not a wasted one.\n */\nexport const createReposition = () => {\n const offsets = new Map<HTMLElement, number>();\n const running = new Map<HTMLElement, Animation>();\n\n return (elements: readonly HTMLElement[]) => {\n const present = new Set(elements);\n const moved: [HTMLElement, number][] = [];\n\n for (const element of elements) {\n const before = offsets.get(element);\n const after = element.offsetTop;\n offsets.set(element, after);\n if (before !== undefined && before !== after) moved.push([element, before - after]);\n }\n\n let departed = false;\n for (const element of offsets.keys()) {\n if (present.has(element)) continue;\n offsets.delete(element);\n running.delete(element);\n departed = true;\n }\n\n for (const [element, delta] of moved) {\n running.get(element)?.cancel();\n running.set(element, element.animate(\n [{ transform: `translateY(${delta}px)` }, { transform: 'none' }],\n {\n delay: departed ? REPOSITION_DELETE_DELAY_MS : 0,\n duration: REPOSITION_ANIMATION_MS,\n easing: REPOSITION_EASING,\n // The delayed form holds its first key frame through the delay. Without\n // it the survivors would snap into the gap and then slide back out of it.\n fill: 'backwards',\n },\n ));\n }\n };\n};\n", "// Held apart from ./theme.ts so build-time ./document.css.ts can spend them without loading @fluentui/react-components.\nexport const baseFontStack = \"'Segoe UI Variable Web', 'Segoe UI Variable Text', 'Segoe UI Variable Display', 'Segoe UI Variable Small', 'Segoe UI', system-ui, sans-serif\";\n\nexport const monospaceStack = \"'Meslo LG S Web', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace\";\n", "const alphaHexToRgba = (hex: string): string => {\n const digits = hex.slice(1);\n const expanded = digits.length === 4\n ? [...digits].map(digit => digit.repeat(2)).join('')\n : digits;\n const channels = expanded.match(/../g)?.map(channel => Number.parseInt(channel, 16));\n if (channels?.length !== 4) throw new TypeError(`Invalid alpha hex color: ${hex}`);\n const [red, green, blue, alpha] = channels;\n return `rgba(${red}, ${green}, ${blue}, ${Number((alpha! / 255).toFixed(6))})`;\n};\n\nconst legacyFunction = (source: string, name: string, channels: string, alpha?: string): string => {\n const components = channels.trim().split(/\\s+/u);\n if (components.length !== 3) return source;\n const legacyName = alpha === undefined ? name.slice(0, 3) : `${name.slice(0, 3)}a`;\n const legacyAlpha = alpha?.trim().endsWith('%')\n ? String(Number.parseFloat(alpha) / 100)\n : alpha?.trim();\n return `${legacyName}(${[...components, ...(legacyAlpha === undefined ? [] : [legacyAlpha])].join(', ')})`;\n};\n\nexport const toLegacyCssColor = (source: string): string => source\n .replace(/(?<![\\da-f])#(?:[\\da-f]{8}|[\\da-f]{4})(?![\\da-f])/giu, alphaHexToRgba)\n .replace(/\\b(rgb|rgba|hsl|hsla)\\(\\s*([^,()]+?)(?:\\s*\\/\\s*([^()]+?))?\\s*\\)/giu, legacyFunction);\n", "import { fluentComponents } from './fluent';\nimport { baseFontStack, monospaceStack } from './font-stacks';\n\nconst { webDarkTheme, webLightTheme } = fluentComponents;\n\n// One step of Fluent's ramp is ours: 600 drops from 24px to 22px, on Fluent's\n// unchanged 32px leading. WinUI's ramp steps from Subtitle 20 straight to Title\n// 28, so neither value transcribes anything and the 22 is ours. Every other step\n// is Fluent's own: 12/14/20 already are WinUI's Caption, Body and Subtitle.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/TextBlock_themeresources.xaml#L3-L9\nconst fontOverrides = {\n fontFamilyBase: baseFontStack,\n fontFamilyMonospace: monospaceStack,\n fontSizeBase600: '22px',\n} as const;\n\nexport const baseLightTheme = { ...webLightTheme, ...fontOverrides };\nexport const baseDarkTheme = { ...webDarkTheme, ...fontOverrides };\n", "import type { Theme } from '@fluentui/react-components';\n\nimport { toLegacyCssColor } from '../lib/legacy-css-color';\nimport { baseDarkTheme, baseLightTheme } from '../theme';\n\n// Shared and status colors have no one-to-one WinUI counterpart and are spent\n// per control in ./controls/*.css.ts instead.\n//\n// One table serves both themes only because the host picks its Fluent theme\n// from the same resolved scheme the `--winui-*` dictionaries in ./tokens.ts\n// switch on: `prefers-color-scheme`, overridable by `data-fwt-theme` on the\n// document element (../theme-mode.ts, scripts/color-scheme.ts).\nconst palette = {\n // WinUI's SolidBackgroundFill ramp is ordered by role, not by lightness, so it\n // maps onto Fluent's ramp by role rather than by step number.\n colorNeutralBackground1: 'var(--winui-solid-background-fill-quarternary)',\n colorNeutralBackground1Hover: 'var(--winui-control-fill-secondary)',\n colorNeutralBackground1Pressed: 'var(--winui-control-fill-tertiary)',\n colorNeutralBackground2: 'var(--winui-solid-background-fill-tertiary)',\n colorNeutralBackground3: 'var(--winui-solid-background-fill-base)',\n colorNeutralBackground4: 'var(--winui-solid-background-fill-secondary)',\n colorNeutralBackground5: 'var(--winui-solid-background-fill-base-alt)',\n colorSubtleBackground: 'var(--winui-subtle-fill-transparent)',\n colorSubtleBackgroundHover: 'var(--winui-subtle-fill-secondary)',\n colorSubtleBackgroundPressed: 'var(--winui-subtle-fill-tertiary)',\n colorSubtleBackgroundSelected: 'var(--winui-subtle-fill-secondary)',\n\n // Every modal surface Fluent dims behind reads one overlay token, and WinUI\n // states one smoke for all of them and the same value in both schemes, where\n // Fluent's darkens with the theme.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/ContentDialog_themeresources.xaml#L7\n colorBackgroundOverlay: 'var(--winui-smoke-fill-default)',\n\n // ControlElevationBorderBrush is a gradient and a Fluent token carries one\n // stop, so all three states resolve to its dominant Default stop; the edge\n // highlight is drawn from --winui-control-elevation-border-color instead.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Button_themeresources.xaml#L38-L40\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Button_themeresources.xaml#L136-L138\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L186-L191\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L382-L390\n colorNeutralStroke1: 'var(--winui-control-stroke-default)',\n colorNeutralStroke1Hover: 'var(--winui-control-stroke-default)',\n colorNeutralStroke1Pressed: 'var(--winui-control-stroke-default)',\n colorNeutralStroke2: 'var(--winui-card-stroke-default)',\n colorNeutralStroke3: 'var(--winui-divider-stroke-default)',\n colorNeutralStrokeAccessible: 'var(--winui-control-strong-stroke-default)',\n colorNeutralStrokeDisabled: 'var(--winui-control-strong-stroke-disabled)',\n\n // A neutral foreground and its Hover/Pressed/Selected siblings resolve to one\n // WinUI brush: ListViewItem states TextFillColorPrimaryBrush for every pointer\n // and selection state, and a control whose own template does move the\n // foreground says so in ./controls/*.css.ts. Fluent's stock steps are a\n // separate grey ramp, so leaving a sibling unmapped is what lets a control\n // repaint under the pointer with a colour the layer never chose.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/ListViewItem_themeresources.xaml#L23-L28\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/ListViewItem_themeresources.xaml#L175-L180\n colorNeutralForeground1: 'var(--winui-text-fill-primary)',\n colorNeutralForeground1Hover: 'var(--winui-text-fill-primary)',\n colorNeutralForeground1Pressed: 'var(--winui-text-fill-primary)',\n colorNeutralForeground1Selected: 'var(--winui-text-fill-primary)',\n colorNeutralForeground2: 'var(--winui-text-fill-secondary)',\n colorNeutralForeground2Hover: 'var(--winui-text-fill-secondary)',\n colorNeutralForeground2Pressed: 'var(--winui-text-fill-secondary)',\n colorNeutralForeground2Selected: 'var(--winui-text-fill-secondary)',\n colorNeutralForeground3: 'var(--winui-text-fill-tertiary)',\n colorNeutralForeground3Hover: 'var(--winui-text-fill-tertiary)',\n colorNeutralForeground3Pressed: 'var(--winui-text-fill-tertiary)',\n colorNeutralForeground3Selected: 'var(--winui-text-fill-tertiary)',\n\n // Fluent's least prominent neutral is what every field paints a placeholder\n // with, and a WinUI placeholder is the secondary text fill. The two other\n // consumers are the colour picker's thumb ring and its empty swatch, and\n // ./controls/color-picker.css.ts states a stroke for both.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/TextBox_themeresources.xaml#L35\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/ComboBox/ComboBox_themeresources.xaml#L48\n colorNeutralForeground4: 'var(--winui-text-fill-secondary)',\n colorNeutralForegroundDisabled: 'var(--winui-text-fill-disabled)',\n colorNeutralForegroundInverted: 'var(--winui-text-fill-inverse)',\n colorNeutralForegroundOnBrand: 'var(--winui-text-on-accent-fill-primary)',\n\n // WinUI has one accent ramp -- AccentFillColor Default, Secondary and\n // Tertiary, the same base at 100%, 90% and 80% -- and no tinted-accent\n // surface at all: an accent-intent control is a solid accent fill under an\n // on-accent label. Fluent's two brand background ramps therefore land on the\n // same three fills, and the foreground that pairs with the tinted one lands\n // on the on-accent text beside colorNeutralForegroundOnBrand above. The brand\n // and compound-brand strokes walk the same three fills: they are the stroke a\n // Fluent control draws when it is checked, selected or focused, which is the\n // accent brush in every WinUI template that states one. Leaving any of these\n // ramps unmapped is what let a chip, a badge, a tab chip and the colour\n // picker's swatch grid wear Fluent blue beside WinUI accent, and let a dark\n // filled badge pair black on-accent text with Fluent's dark brand fill.\n //\n // The second ramp is the wash rather than the fill, so it lands on the derived\n // accent tint in ../tokens.ts and not on the accent fills: mapping it onto\n // those turns a tinted badge into a solid pill, and leaving it unmapped keeps\n // Microsoft blue beside the accent the operator picked. Stroke2 is that\n // surface's own outline, so it takes the tint's heavier step rather than an\n // on-accent stroke, which would be painting a stroke meant for accent-filled\n // ground onto a nearly-neutral one.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L36-L38\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Button_themeresources.xaml#L103-L105\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/ToggleButton_themeresources.xaml#L11-L13\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/SplitButton/SplitButton_themeresources.xaml#L9-L11\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/SplitButton/SplitButton_themeresources.xaml#L17\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/SplitButton/SplitButton_themeresources.xaml#L32\n colorBrandBackground: 'var(--winui-accent-fill-default)',\n colorBrandBackgroundHover: 'var(--winui-accent-fill-secondary)',\n colorBrandBackgroundPressed: 'var(--winui-accent-fill-tertiary)',\n colorBrandBackgroundSelected: 'var(--winui-accent-fill-default)',\n colorBrandBackground2: 'var(--winui-accent-tint-fill-default)',\n colorBrandBackground2Hover: 'var(--winui-accent-tint-fill-secondary)',\n colorBrandBackground2Pressed: 'var(--winui-accent-tint-fill-tertiary)',\n colorBrandForeground2: 'var(--winui-accent-text-fill-primary)',\n colorBrandStroke1: 'var(--winui-accent-fill-default)',\n colorBrandStroke2: 'var(--winui-accent-tint-stroke)',\n colorCompoundBrandStroke: 'var(--winui-accent-fill-default)',\n colorCompoundBrandStrokeHover: 'var(--winui-accent-fill-secondary)',\n colorCompoundBrandStrokePressed: 'var(--winui-accent-fill-tertiary)',\n\n // WinUI's focus visual is two concentric strokes, and Fluent spends one token\n // per stroke in the same roles, so the pair is stated here rather than at each\n // focusable control. A control whose Fluent ring needs the strokes swapped or\n // repositioned still says that locally.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L54-L55\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L258-L259\n colorStrokeFocus1: 'var(--winui-focus-stroke-inner)',\n colorStrokeFocus2: 'var(--winui-focus-stroke-outer)',\n} as const satisfies Partial<Theme>;\n\n// Fluent's small step keeps its own 2px: WinUI declares no shared radius below\n// ControlCornerRadius's 4, and the smaller values it does declare are keyed to\n// named parts of a single control, so they belong to the sheets drawing them.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/CornerRadius_themeresources.xaml#L13-L15\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/ComboBox/ComboBox_themeresources.xaml#L345-L346\nconst radii = {\n borderRadiusMedium: 'var(--winui-control-corner-radius)',\n borderRadiusLarge: 'var(--winui-overlay-corner-radius)',\n borderRadiusXLarge: 'var(--winui-overlay-corner-radius)',\n} as const satisfies Partial<Theme>;\n\n// WinUI draws no drop shadow on inline surfaces, so the ambient elevations are\n// zeroed and only the overlay depths (16, 28, 64) are left alone.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Button_themeresources.xaml#L30-L41\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/TabView/TabView_themeresources.xaml#L265\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/NavigationView/NavigationView_themeresources.xaml#L207\n//\n// A transparent layer rather than `none`: Fluent builds focus rings as a shadow\n// list whose first layer is the elevation, and `none` is only valid as a whole\n// box-shadow, so it invalidates the list and drops the focus ring entirely.\nconst shadows = {\n shadow2: '0 0 rgba(0, 0, 0, 0)',\n shadow2Brand: '0 0 rgba(0, 0, 0, 0)',\n shadow4: '0 0 rgba(0, 0, 0, 0)',\n shadow4Brand: '0 0 rgba(0, 0, 0, 0)',\n shadow8: '0 0 rgba(0, 0, 0, 0)',\n shadow8Brand: '0 0 rgba(0, 0, 0, 0)',\n} as const satisfies Partial<Theme>;\n\nconst legacyTheme = (theme: Theme): Theme => Object.fromEntries(\n Object.entries(theme).map(([token, value]) => [token, typeof value === 'string' ? toLegacyCssColor(value) : value]),\n) as unknown as Theme;\n\nexport const winuiLightTheme: Theme = legacyTheme({\n ...baseLightTheme,\n ...palette,\n ...radii,\n ...shadows,\n});\n\nexport const winuiDarkTheme: Theme = legacyTheme({\n ...baseDarkTheme,\n ...palette,\n ...radii,\n ...shadows,\n});\n", "// The page transition, drawn as WinUI 3's EntranceNavigationTransitionInfo,\n// over the leaving and arriving frames that ../../routes/dashboard.tsx stacks\n// in one grid cell. The View Transition API would snapshot the outgoing page\n// instead and make those frames unnecessary; they are here so the transition\n// does not depend on its availability.\n\n// The leg that owns how long the outgoing frame stays mounted: it is dropped\n// when this animation ends, so ../components/page-frames.tsx recognises it by\n// name off the animation event.\nexport const PAGE_LEAVE_ANIMATION = 'fwt-page-leave';\n\nexport const pageTransitionCss = `\n /* The legs are strictly sequential, so the entering animation fills forwards:\n a delayed animation's default fill leaves the element at its own resting\n style, overlapping the two pages for the length of the delay. Incoming\n opacity is two discrete key frames that never interpolate, as in the\n source. */\n .fwt-page-leaving {\n animation: ${PAGE_LEAVE_ANIMATION} var(--winui-page-leave-duration)\n var(--winui-page-leave-easing) forwards;\n pointer-events: none;\n }\n .fwt-page-entering {\n animation: fwt-page-enter var(--winui-page-enter-duration)\n var(--winui-page-enter-easing) var(--winui-page-leave-duration) forwards;\n opacity: 0;\n }\n @keyframes ${PAGE_LEAVE_ANIMATION} { to { opacity: 0; } }\n @keyframes fwt-page-enter {\n from { opacity: 1; translate: 0 var(--winui-page-enter-offset); }\n to { opacity: 1; translate: none; }\n }\n\n /* Only the resting position is stated here; ../../routes/dashboard.tsx starts\n the reload entrance on the element, because a CSS animation takes its start\n time from the frame its style was recalculated in rather than the frame it\n is first painted in -- this frame is recalculated mid-hydration, so 84ms of\n its 300 had already run by the time it reached the screen. That script also\n adds this class, so nothing holds the frame down unless the thing that\n lifts it already exists, and the animation's forwards fill outranks this\n declaration afterwards. */\n .fwt-page-entrance {\n translate: 0 var(--winui-page-enter-offset);\n }\n\n /* Both legs are clamped rather than dropped so the pair still runs in order\n and still fires; the reload entrance is skipped instead, because script\n starts it and script can ask. Arriving from below is motion animation by\n WCAG's definition, which turns on perceived position.\n https://github.com/w3c/wcag/blob/900ea026b967bc306a2cdbe0c586330a508d6759/guidelines/terms/21/motion-animation.html#L3-L4 */\n @media (prefers-reduced-motion: reduce) {\n .fwt-page-leaving { animation-duration: 0.01ms; }\n .fwt-page-entering {\n animation-delay: 0.01ms;\n animation-duration: 0.01ms;\n }\n }\n`;\n", "// The Indeterminate visual state of WinUI 3's ProgressBar, as the pair of\n// travelling indicators every surface that shows one has to draw: two\n// left-aligned rectangles sized 40 and 60 per cent of the track, on one 2s loop\n// that repeats forever, the second held at its start until 0.75s. Each\n// indicator's travel is expressed in its own width, which is what\n// UpdateWidthBasedTemplateSettings computes from those two fractions.\n//\n// The caller supplies the two selectors and paints them; only the geometry and\n// the timing are stated here, so the one storyboard cannot drift between the\n// controls that run it.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/ProgressBar/ProgressBar.xaml#L94-L112\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/ProgressBar/ProgressBar.xaml#L164-L172\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/ProgressBar/ProgressBar.cpp#L208-L231\nconst LOOP_MS = 2000;\nconst FIRST_TRAVEL_MS = 1500;\nconst SECOND_HOLD_MS = 750;\n\nconst FIRST_WIDTH_PERCENT = 40;\nconst SECOND_WIDTH_PERCENT = 60;\n\nconst FIRST_START_PERCENT = -100;\nconst FIRST_END_PERCENT = 300;\nconst SECOND_START_PERCENT = -150;\nconst SECOND_END_PERCENT = 166;\n\n// The KeySpline both travels share. XAML hangs a spline on the frame it\n// interpolates into and CSS hangs a timing function on the frame it\n// interpolates out of, so it sits one keyframe earlier here than it reads\n// there.\nconst TRAVEL_EASING = 'cubic-bezier(0.4, 0, 0.6, 1)';\n\nconst keyTime = (ms: number) => `${(ms / LOOP_MS) * 100}%`;\n\nexport const progressIndeterminateCss = (first: string, second: string) => `\n${first},\n${second} {\n animation-duration: ${LOOP_MS}ms;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n}\n\n${first} {\n animation-name: winui-progress-indeterminate;\n width: ${FIRST_WIDTH_PERCENT}%;\n}\n\n${second} {\n animation-name: winui-progress-indeterminate-2;\n width: ${SECOND_WIDTH_PERCENT}%;\n}\n\n@keyframes winui-progress-indeterminate {\n 0% {\n animation-timing-function: ${TRAVEL_EASING};\n transform: translateX(${FIRST_START_PERCENT}%);\n }\n ${keyTime(FIRST_TRAVEL_MS)} { transform: translateX(${FIRST_END_PERCENT}%); }\n 100% { transform: translateX(${FIRST_END_PERCENT}%); }\n}\n\n@keyframes winui-progress-indeterminate-2 {\n 0% { transform: translateX(${SECOND_START_PERCENT}%); }\n ${keyTime(SECOND_HOLD_MS)} {\n animation-timing-function: ${TRAVEL_EASING};\n transform: translateX(${SECOND_START_PERCENT}%);\n }\n 100% { transform: translateX(${SECOND_END_PERCENT}%); }\n}\n`;\n", "import { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport type { RefObject } from 'react';\n\nimport { prefersReducedMotion } from '../lib/reduced-motion';\nimport { INDICATOR_DURATION_MS, INDICATOR_POSITION_SNAP, INDICATOR_SETTLE_EASING, INDICATOR_STRETCH_EASING } from '../winui/motion';\n\n// WinUI's NavigationView does not move one indicator between items. It keeps a\n// separate indicator per item and, on a selection change, plays a matched pair\n// of composition animations. Both halves run the same offset, scale and anchor\n// keyframes over the same 600ms, each against its own item, so the pair draws\n// one rectangle twice; the only thing the outgoing half adds is an opacity that\n// holds through the first third and falls away over the rest. Within a single\n// list the two are superimposed and the opaque incoming half covers the fading\n// outgoing one, which is why one element reproduces them there.\n//\n// The drawer is two lists, though -- a scrolling body and a pinned footer --\n// and each indicator is clipped to its own item, so neither half can draw where\n// the other one is. Each list plays its half on its own item over the same\n// 600ms, starting together. The list losing the selection stretches toward the\n// list taking it, settles back to its resting length and fades away across that\n// settle. The list taking it holds its bar invisible for as long as the offset\n// leg would have it drawn in the other list, then shows it at the snap already\n// extended toward where the selection came from and lets it contract. Within\n// one list superimposition is what hides the outgoing half; across two it is\n// the fade.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/NavigationView/NavigationView.cpp#L2176-L2233\n//\n// The offset, the scale and the anchor change are three animations on nested\n// elements, because they carry different easings and only a nested element can\n// give two transforms their own timing. The anchor change is a transform and\n// not a transform-origin: a transform-origin animation cannot run on the\n// compositor, so it advances only when the main thread does, while the two\n// transforms advance without it -- and the instant all three are written to\n// step at is the snap, which is where a route commit lands. Measured with the\n// main thread held across the snap, the bar was drawn anchored at the edge it\n// was leaving for as long as the main thread was behind, off by its own inset,\n// in both engines. So the track steps the offset and clips the bar to the item,\n// and a nested element carries the mirror of that step: zero through the first\n// third, the offset the track has just given up at the snap, and back to zero\n// over the settle. The two steps cancel frame for frame, which holds the bar at\n// the edge it has reached without its origin moving, and leaves every leg of\n// the move a composited transform.\n\n// The bar's width and corner radius are stated outright. Its length is not:\n// WinUI states a fixed 16px against a 36px item, and the operator asked that\n// this indicator be derived from the row height by a formula that hardcodes\n// nothing and reproduces the stock length at the stock row height. A quarter\n// inset at each end is that formula, and 20px is the length he pinned for this\n// sidebar. A margin percentage resolves against the containing block's\n// inline size rather than its block size, so the inset is computed from the\n// item box this component has already measured.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/NavigationView/NavigationView_themeresources.xaml#L217\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/NavigationView/NavigationView_themeresources.xaml#L220-L222\nconst INDICATOR_INSET_RATIO = 0.25;\nconst INDICATOR_WIDTH = 3;\nconst INDICATOR_RADIUS = 2;\n\ninterface Geometry { top: number; left: number; width: number; height: number }\n\nconst geometryOf = (container: HTMLElement, item: HTMLElement): Geometry => {\n const containerBox = container.getBoundingClientRect();\n const itemBox = item.getBoundingClientRect();\n return {\n // The clip box is the item, so the pill can stretch without ever painting\n // outside the fill the item already occupies, and so the inset that gives\n // the pill its length is measured against the item's own box.\n top: itemBox.top - containerBox.top + container.scrollTop,\n left: itemBox.left - containerBox.left + container.scrollLeft,\n width: itemBox.width,\n height: itemBox.height,\n };\n};\n\nexport function NavSelectionIndicator({\n containerRef,\n inset,\n otherListIs,\n selectedValue,\n}: {\n containerRef: RefObject<HTMLElement | null>;\n inset: number;\n // Where the other list sits. Fixed per instance, and only read when the\n // selection arrives from there.\n otherListIs: 'above' | 'below';\n selectedValue: string;\n}) {\n const trackRef = useRef<HTMLDivElement>(null);\n const anchorRef = useRef<HTMLDivElement>(null);\n const barRef = useRef<HTMLDivElement>(null);\n const previousRef = useRef<Geometry | null>(null);\n const ranFor = useRef<string | undefined>(undefined);\n const handedOver = useRef(false);\n const [geometry, setGeometry] = useState<Geometry | null>(null);\n\n useLayoutEffect(() => {\n // A bar with no position in this list to travel from was either handed over\n // by the other list or is the first one this list has drawn, and only the\n // hand-over animates. So the question is whether the selection MOVED,\n // rather than whether this list held it before -- which is also true on a\n // fresh load, where nobody handed anything over and WinUI plays nothing for\n // an initial selection. Running again on the same selection is not a move\n // either, which is what a StrictMode double pass is.\n //\n // Every commit records the selection it saw, whether or not this list holds\n // it. A list only ever takes a hand-over on a commit that did not find it\n // holding the selection before -- so recording only the selections a list\n // holds is recording exactly the commits that cannot ask the question. The\n // footer holds one item and would never have recorded anything else.\n handedOver.current = ranFor.current !== undefined && ranFor.current !== selectedValue;\n ranFor.current = selectedValue;\n const container = containerRef.current;\n const item = container?.querySelector<HTMLElement>(`[data-nav-value=\"${CSS.escape(selectedValue)}\"]`);\n // A bar that has to leave is not cleared here; the effect below plays it\n // out first.\n if (!container || !item) return;\n setGeometry(geometryOf(container, item));\n }, [containerRef, selectedValue]);\n\n // Leaving for the other list, which is WinUI's outgoing half on this list's\n // own item. Its offset leg is the one that cannot be taken literally: it\n // carries the bar to an item in the other list, and this bar is clipped to\n // the item it sits in. So the stretch reaches by the item's own length, the\n // clip takes the rest, and the settle brings the bar back to its resting\n // length in the item it is leaving rather than in the one it cannot reach.\n useEffect(() => {\n const container = containerRef.current;\n if (!geometry || container?.querySelector(`[data-nav-value=\"${CSS.escape(selectedValue)}\"]`)) return;\n const bar = barRef.current;\n if (!bar) return;\n const drop = () => {\n previousRef.current = null;\n setGeometry(null);\n };\n // Nothing to wait out when nothing is playing.\n if (prefersReducedMotion()) {\n drop();\n return;\n }\n bar.style.transformOrigin = otherListIs === 'below' ? 'top' : 'bottom';\n // The bar goes when the animation says so, not when a timer of the same\n // length does: the timer starts at the call and the animation starts at the\n // next frame, so the frames a timer cuts off are the ones the fade ends on.\n const leave = bar.animate([\n { opacity: 1, transform: 'scaleY(1)', easing: INDICATOR_STRETCH_EASING },\n { opacity: 1, transform: `scaleY(${geometry.height / bar.offsetHeight + 1})`, offset: INDICATOR_POSITION_SNAP, easing: INDICATOR_SETTLE_EASING },\n { opacity: 0, transform: 'scaleY(1)' },\n ], { duration: INDICATOR_DURATION_MS, fill: 'forwards' });\n leave.addEventListener('finish', drop);\n return () => leave.cancel();\n }, [containerRef, geometry, otherListIs, selectedValue]);\n\n // The item can move without the selection changing -- a group appearing above\n // it, the drawer resizing, the list scrolling under a sticky footer. Tracking\n // the container keeps the pill on its item, and writing the new position as\n // the previous one too means the move is taken without animating, since\n // nothing was selected.\n //\n // The selected item is found through the attribute Fluent already marks it\n // with, so this subscription depends on nothing that a selection changes and\n // outlives one. Re-subscribing would re-observe, and re-observing fires the\n // callback at once -- overwriting the position the pill is supposed to travel\n // from, a frame before it travels.\n useEffect(() => {\n const container = containerRef.current;\n if (!container) return;\n const observer = new ResizeObserver(() => {\n const item = container.querySelector<HTMLElement>('[data-nav-value][aria-current=\"page\"]');\n if (!item) return;\n const next = geometryOf(container, item);\n previousRef.current = next;\n setGeometry(next);\n });\n observer.observe(container);\n return () => observer.disconnect();\n }, [containerRef]);\n\n useEffect(() => {\n const track = trackRef.current;\n const anchor = anchorRef.current;\n const bar = barRef.current;\n const previous = previousRef.current;\n previousRef.current = geometry;\n if (!track || !anchor || !bar || !geometry) return;\n if (prefersReducedMotion()) return;\n if (!previous && !handedOver.current) return;\n\n // Taking the hand-over: there is no position in this list to travel from,\n // so the reach is the item's own length toward where the selection came\n // from.\n const distance = previous\n ? geometry.top - previous.top\n : (otherListIs === 'below' ? geometry.height : -geometry.height);\n if (distance === 0) return;\n\n // The indicator stretches far enough to span the gap it is crossing, then\n // settles back to its own height.\n // Every stretch is a multiple of the bar's own length. That length is the\n // room the item leaves it, which the layout has already worked out, so it\n // is read back off the bar rather than recomputed from the inset.\n const peak = Math.abs(distance) / bar.offsetHeight + 1;\n // The bar grows out of what it is leaving, so it is anchored at the edge\n // facing there -- and stays anchored there for the whole move. What changes\n // is the offset underneath it.\n bar.style.transformOrigin = distance > 0 ? 'top' : 'bottom';\n\n if (!previous) {\n bar.animate([\n { opacity: 0, transform: 'scaleY(1)', easing: 'steps(1, end)' },\n { opacity: 1, transform: `scaleY(${peak})`, offset: INDICATOR_POSITION_SNAP, easing: INDICATOR_SETTLE_EASING },\n { opacity: 1, transform: 'scaleY(1)' },\n ], { duration: INDICATOR_DURATION_MS });\n return;\n }\n\n const travelled = `translateY(${previous.top - geometry.top}px)`;\n track.animate([\n { transform: travelled, easing: 'steps(1, end)' },\n { transform: 'translateY(0px)', offset: INDICATOR_POSITION_SNAP },\n { transform: 'translateY(0px)' },\n ], { duration: INDICATOR_DURATION_MS });\n\n anchor.animate([\n { transform: 'translateY(0px)', easing: 'steps(1, end)' },\n { transform: travelled, offset: INDICATOR_POSITION_SNAP, easing: INDICATOR_SETTLE_EASING },\n { transform: 'translateY(0px)' },\n ], { duration: INDICATOR_DURATION_MS });\n\n bar.animate([\n { transform: 'scaleY(1)', easing: INDICATOR_STRETCH_EASING },\n { transform: `scaleY(${peak})`, offset: INDICATOR_POSITION_SNAP, easing: INDICATOR_SETTLE_EASING },\n { transform: 'scaleY(1)' },\n ], { duration: INDICATOR_DURATION_MS });\n }, [geometry, otherListIs]);\n\n if (!geometry) return null;\n\n return <div\n aria-hidden\n ref={trackRef}\n style={{\n display: 'flex',\n // The clip box is the item itself, corners included. WinUI cuts the\n // indicator against the item's rounded rect, and over the three pixels the\n // bar occupies that boundary is a curve rather than a straight edge, so a\n // box only as wide as the bar cannot stand in for it however it is\n // rounded -- it would round its own corners instead of following the\n // item's.\n borderRadius: 'var(--borderRadiusMedium)',\n height: geometry.height,\n left: geometry.left,\n overflow: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n top: geometry.top,\n width: geometry.width,\n }}\n >\n <div ref={anchorRef} style={{ display: 'flex' }}>\n <div\n ref={barRef}\n style={{\n backgroundColor: 'var(--winui-accent-fill-default)',\n borderRadius: INDICATOR_RADIUS,\n marginBlock: geometry.height * INDICATOR_INSET_RATIO,\n marginInlineStart: inset,\n width: INDICATOR_WIDTH,\n }}\n />\n </div>\n </div>;\n}\n", "export const prefersReducedMotion = (): boolean =>\n window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n", "import type { Theme } from '@fluentui/react-components';\nimport { useEffect, useSyncExternalStore } from 'react';\n\nimport { winuiDarkTheme, winuiLightTheme } from './winui/theme';\n\n// Floway follows the system colour scheme and nothing else. The stylesheets in\n// this package keep that default and add an explicit override: the build turns\n// every `prefers-color-scheme: dark` block into one that yields to\n// `data-fwt-theme=\"light\"` on the document element, plus a copy that applies\n// under `data-fwt-theme=\"dark\"` whatever the system says. See\n// scripts/color-scheme.ts.\nexport type ThemeMode = 'system' | 'light' | 'dark';\nexport type ResolvedThemeMode = 'light' | 'dark';\n\nexport const THEME_MODE_ATTRIBUTE = 'data-fwt-theme';\n\nconst DARK_SCHEME_QUERY = '(prefers-color-scheme: dark)';\n\nconst subscribeToSystemScheme = (onChange: () => void) => {\n const query = window.matchMedia(DARK_SCHEME_QUERY);\n query.addEventListener('change', onChange);\n return () => query.removeEventListener('change', onChange);\n};\n\nconst systemPrefersDark = () => window.matchMedia(DARK_SCHEME_QUERY).matches;\n\n/** The scheme the stylesheets resolve to for a mode, given the system preference. */\nexport const resolveThemeMode = (mode: ThemeMode, prefersDark: boolean): ResolvedThemeMode =>\n mode === 'system' ? (prefersDark ? 'dark' : 'light') : mode;\n\n/** Stamps `mode` on `root` so the stylesheets follow it; `system` removes the override. */\nexport const applyThemeMode = (mode: ThemeMode, root: HTMLElement = document.documentElement): void => {\n if (mode === 'system') root.removeAttribute(THEME_MODE_ATTRIBUTE);\n else root.setAttribute(THEME_MODE_ATTRIBUTE, mode);\n};\n\n/**\n * Applies `mode` to the document and returns the matching Fluent theme for\n * `FluentProvider`. The token stylesheet and the Fluent theme must agree, so the\n * provider's theme is derived from the same resolved scheme the CSS uses.\n */\nexport const useWinuiTheme = (mode: ThemeMode = 'system'): { theme: Theme; resolved: ResolvedThemeMode } => {\n const prefersDark = useSyncExternalStore(subscribeToSystemScheme, systemPrefersDark, () => false);\n useEffect(() => applyThemeMode(mode), [mode]);\n const resolved = resolveThemeMode(mode, prefersDark);\n return { theme: resolved === 'dark' ? winuiDarkTheme : winuiLightTheme, resolved };\n};\n", "import { ArrowLeftRegular } from '@fluentui/react-icons';\nimport type { MouseEvent, ReactNode } from 'react';\n\nimport { useRouteAddress } from './route-link';\nimport { fluentComponents } from '../../fluent';\n\nconst { Button, makeStyles } = fluentComponents;\n\n// NavigationBackButtonNormalStyle has SubtleButtonStyle's state table, which the\n// layer restyles `subtle` onto; `transparent` carries no fill in any state.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/NavigationView/NavigationBackButton.xaml#L4-L5\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/NavigationView/NavigationBackButton.xaml#L23-L48\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/NavigationView/NavigationBackButton_themeresources.xaml#L5-L8\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/NavigationView/NavigationView_themeresources.xaml#L63-L68\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/NavigationView/NavigationView_themeresources.xaml#L129-L134\n\n// A WinUI back button takes one brush for glyph and label, where Fluent's subtle\n// appearance tints the icon slot toward the brand and leaves the label behind.\n// Redefining the two tokens that slot reads, rather than restating the slot, needs\n// no selector outranking Fluent's own and leaves its forced-colours rules in force.\nconst useStyles = makeStyles({\n root: {\n '--colorNeutralForeground2BrandHover': 'var(--winui-text-fill-primary)',\n '--colorNeutralForeground2BrandPressed': 'var(--winui-text-fill-secondary)',\n },\n});\n\n// `to` is for a destination that remains useful beside the current view, while\n// `onClick` moves within one editing session. The former gives middle and\n// modified clicks a real address; Fluent's anchor root keeps Enter and Space\n// through react-aria's button props.\n// https://github.com/microsoft/fluentui/blob/6dee27b023a2d989f032b4adacb2135d336a67fb/packages/react-components/react-aria/library/src/button/useARIAButtonProps.ts#L84-L120\nexport function BackNavigationButton(props: { children: ReactNode } & (\n | { onClick: () => void; to?: never }\n | { onClick?: never; to: string }\n)) {\n return props.to === undefined\n ? <BackButton onClick={props.onClick}>{props.children}</BackButton>\n : <AddressedBackButton to={props.to}>{props.children}</AddressedBackButton>;\n}\n\nfunction AddressedBackButton({ children, to }: { children: ReactNode; to: string }) {\n const address = useRouteAddress(to);\n return <BackButton {...address}>{children}</BackButton>;\n}\n\nfunction BackButton({ children, href, onClick }: { children: ReactNode; href?: string; onClick?: (event: MouseEvent<HTMLElement>) => void }) {\n const styles = useStyles();\n const shared = { appearance: 'subtle', className: styles.root, icon: <ArrowLeftRegular />, onClick } as const;\n return href === undefined\n ? <Button {...shared}>{children}</Button>\n : <Button {...shared} as=\"a\" href={href}>{children}</Button>;\n}\n", "import { createContext, useContext } from 'react';\nimport type { MouseEvent, PropsWithChildren, ReactNode } from 'react';\n\nimport { fluentComponents } from '../../fluent';\n\nconst { Link } = fluentComponents;\n\n// Floway's version of this module binds react-router's useHref and\n// useLinkClickHandler. Components imported unchanged from Floway reach routing\n// through `useRouteAddress` only, so this module keeps that signature and lets\n// the host supply its router through `WinuiRouterProvider`; without one, an\n// address is a plain link the browser follows.\n// https://github.com/Menci/Floway/blob/fee9533cc3ed5cba8028e53e53ca13d2e64d91af/apps/web/src/components/ui/route-link.tsx\n\nexport interface WinuiRouter {\n /** Navigates within the application, e.g. react-router's `useNavigate()` result. */\n navigate: (to: string) => void;\n /** Maps a route to the href an anchor carries. Defaults to the route itself. */\n href?: (to: string) => string;\n}\n\nconst RouterContext = createContext<WinuiRouter | null>(null);\n\nexport function WinuiRouterProvider({ router, children }: PropsWithChildren<{ router: WinuiRouter }>) {\n return <RouterContext.Provider value={router}>{children}</RouterContext.Provider>;\n}\n\nexport interface RouteAddress {\n href: string;\n onClick: (event: MouseEvent<HTMLElement>) => void;\n}\n\n// The address a control carries so that every click the browser handles itself\n// -- middle, modified, and \"open in new tab\" from the context menu -- lands on\n// a real anchor and opens a second tab. Only the plain left click is taken\n// here, and only when the host routes in-app or the caller owns the transition.\nexport function useRouteAddress(to: string, onActivate?: () => void): RouteAddress {\n const router = useContext(RouterContext);\n const href = router?.href?.(to) ?? to;\n return {\n href,\n onClick: event => {\n const activate = onActivate ?? (router === null ? undefined : () => router.navigate(to));\n if (activate === undefined) return;\n if (event.defaultPrevented || event.button !== 0 || event.metaKey || event.altKey || event.ctrlKey || event.shiftKey) return;\n event.preventDefault();\n activate();\n },\n };\n}\n\n// A link to another route, spelled as the Fluent Link the WinUI layer paints.\nexport function RouteLink({ children, to }: { children?: ReactNode; to: string }) {\n const address = useRouteAddress(to);\n return <Link {...address}>{children}</Link>;\n}\n", "import {\n blend,\n convertHsvToRgb,\n convertRgbToHsv,\n convertRgbToLrgb,\n formatHex,\n modeRgb,\n parseHex,\n serializeRgb,\n useMode as registerMode,\n wcagContrast,\n} from 'culori/fn';\n\nregisterMode(modeRgb);\n\nconst parseHexColor = (hex: string) => {\n const rgb = parseHex(hex);\n if (!rgb) throw new TypeError(`Not a hex colour: ${hex}`);\n return rgb;\n};\n\nconst linearRgb = (rgb: ReturnType<typeof parseHexColor>) => convertRgbToLrgb(rgb);\n\nexport const alphaColor = (hex: string, opacity: number): string => {\n const rgb = parseHexColor(hex);\n const serialized = serializeRgb({ ...rgb, alpha: (rgb.alpha ?? 1) * opacity });\n if (serialized === undefined) throw new TypeError(`Could not serialize hex colour: ${hex}`);\n return serialized;\n};\n\nexport const blendHex = (hex: string, alpha: number, backdrop: string): string => {\n const parsed = parseHexColor(hex);\n const foreground = { ...parsed, alpha: (parsed.alpha ?? 1) * alpha };\n const mixed = blend([parseHexColor(backdrop), foreground], 'normal', 'rgb');\n if (mixed.alpha === undefined) throw new TypeError('Culori blend returned no alpha');\n if (mixed.alpha < 1) throw new TypeError('Hex blending requires an opaque backdrop');\n return formatHex(mixed).toUpperCase();\n};\n\n// WCAG 2.2 requires at least 4.5:1 contrast for normal text.\n// https://www.w3.org/TR/WCAG22/#contrast-minimum\nconst TEXT_CONTRAST_FLOOR = 4.5;\nconst BLACK = parseHexColor('#000000');\nconst WHITE = parseHexColor('#FFFFFF');\n\n/**\n * The nearest tone of `hex` that reads as text on `surface`. Hue is held fixed\n * because it carries the upstream's identity; value moves first because it costs\n * the least recognition, and saturation gives way only where value alone cannot\n * reach the floor.\n */\nexport const readableTone = (hex: string, surface: string): string => {\n const rgb = parseHexColor(hex);\n const surfaceRgb = parseHexColor(surface);\n if (surfaceRgb.alpha !== undefined && surfaceRgb.alpha < 1) {\n throw new TypeError('Readable tone requires an opaque surface');\n }\n const surfaceLinear = linearRgb(surfaceRgb);\n const paintedRgb = blend([surfaceRgb, rgb], 'normal', 'rgb') as ReturnType<typeof parseHexColor>;\n if (wcagContrast(linearRgb(paintedRgb), surfaceLinear) >= TEXT_CONTRAST_FLOOR) return hex;\n\n const opaqueHex = formatHex(rgb).toUpperCase();\n if (wcagContrast(linearRgb(parseHexColor(opaqueHex)), surfaceLinear) >= TEXT_CONTRAST_FLOOR) return opaqueHex;\n\n const { h, s, v } = convertRgbToHsv(rgb);\n // Which extreme actually clears the floor, not whether the surface is light:\n // between luminance 0.183 and 0.5 white misses the floor while black clears\n // it, so a lightness test would search the direction that cannot arrive.\n const darken = wcagContrast(linearRgb(BLACK), surfaceLinear) > wcagContrast(linearRgb(WHITE), surfaceLinear);\n const STEPS = 100;\n\n for (let saturation = s; saturation >= 0; saturation -= 0.1) {\n // Luminance is monotonic along the chosen HSV value direction, so this\n // finds the same first rung as a linear walk of all 100.\n let first = 1;\n let last = STEPS;\n let readable: string | undefined;\n while (first <= last) {\n const step = Math.floor((first + last) / 2);\n const value = darken ? v * (1 - step / STEPS) : v + (1 - v) * (step / STEPS);\n const candidate = convertHsvToRgb({ h, s: saturation, v: value });\n const candidateHex = formatHex(candidate).toUpperCase();\n if (wcagContrast(linearRgb(parseHexColor(candidateHex)), surfaceLinear) >= TEXT_CONTRAST_FLOOR) {\n readable = candidateHex;\n last = step - 1;\n } else {\n first = step + 1;\n }\n }\n if (readable) return readable;\n }\n // Reachable: the saturation ladder stops short of zero unless the saturation is\n // a multiple of a tenth. The extreme always clears -- a surface's ratios against\n // black and white multiply to exactly 21, so the larger is never below 4.58.\n return formatHex(darken ? BLACK : WHITE).toUpperCase();\n};\n", "import type { CSSProperties } from 'react';\n\nimport { fluentComponents } from '../../fluent';\nimport { alphaColor, blendHex, readableTone } from '../../lib/color';\n\nconst { makeStyles } = fluentComponents;\n\n/** A hue that reads the same in both schemes, or one stated per scheme. */\nexport type BadgeHue = string | { light: string; dark: string };\n\n// The hardest end of each scheme's badge-surface range: in light the selected\n// request row (Fluent brand 160); in dark a card washed by\n// SubtleFillColorSecondary (rgba(255, 255, 255, 0.058824) over #373737).\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L26\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L56\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L71\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L230\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/tokens/src/global/brandColors.ts#L5-L19\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/tokens/src/alias/lightColor.ts#L138\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/tokens/src/alias/darkColor.ts#L132\nconst HARDEST_BADGE_SURFACE = { light: '#EBF3FC', dark: '#434343' } as const;\nconst BADGE_FILL_ALPHA = 0.1;\nconst BADGE_STROKE_ALPHA = 0.35;\n\n// The three painted properties stay on the element's own style attribute,\n// which is what outranks Fluent's chip styles and the WinUI layer's\n// doubled-class rules; only the scheme choice can live in a class.\nconst useStyles = makeStyles({\n scheme: {\n '--fwt-badge-fill': 'var(--fwt-badge-fill-light)',\n '--fwt-chip-stroke': 'var(--fwt-badge-stroke-light)',\n '--fwt-badge-label': 'var(--fwt-badge-label-light)',\n '@media (prefers-color-scheme: dark)': {\n '--fwt-badge-fill': 'var(--fwt-badge-fill-dark)',\n '--fwt-chip-stroke': 'var(--fwt-badge-stroke-dark)',\n '--fwt-badge-label': 'var(--fwt-badge-label-dark)',\n },\n },\n});\n\n/**\n * A badge painted in an arbitrary hue. The label is resolved against the fill\n * rather than the surface under it, because the wash moves the reading by enough\n * to change the answer. Fill and stroke are fractions of the hue, so they\n * composite over whatever is beneath and follow that surface's pointer and\n * selection states on their own.\n *\n * A hue may differ by scheme -- WinUI states its own success, caution and\n * critical colours twice, because a colour that carries a meaning against white\n * is not the one that carries it against black.\n */\nexport const useBadgeHue = (hue: BadgeHue): { className: string; style: CSSProperties } => {\n const styles = useStyles();\n const pair = typeof hue === 'string' ? { light: hue, dark: hue } : hue;\n const fill = { light: alphaColor(pair.light, BADGE_FILL_ALPHA), dark: alphaColor(pair.dark, BADGE_FILL_ALPHA) };\n const label = (own: string, surface: string) => readableTone(own, blendHex(own, BADGE_FILL_ALPHA, surface));\n\n return {\n className: styles.scheme,\n style: {\n '--fwt-badge-fill-light': fill.light,\n '--fwt-badge-fill-dark': fill.dark,\n '--fwt-badge-stroke-light': alphaColor(pair.light, BADGE_STROKE_ALPHA),\n '--fwt-badge-stroke-dark': alphaColor(pair.dark, BADGE_STROKE_ALPHA),\n '--fwt-badge-label-light': label(pair.light, HARDEST_BADGE_SURFACE.light),\n '--fwt-badge-label-dark': label(pair.dark, HARDEST_BADGE_SURFACE.dark),\n backgroundColor: 'var(--fwt-badge-fill)',\n borderColor: 'var(--fwt-chip-stroke)',\n color: 'var(--fwt-badge-label)',\n } as CSSProperties,\n };\n};\n", "import type { ComponentProps, CSSProperties, ReactElement, ReactNode, Ref } from 'react';\n\nimport { fluentComponents } from '../../fluent';\n\nconst { Tag, makeStyles, mergeClasses } = fluentComponents;\n\nconst useStyles = makeStyles({\n // Fluent sizes the chip to its content, so a long label carries the chip\n // past the column that holds it.\n root: { maxWidth: '100%' },\n // Fluent pads the primary text for a secondary line the chip never has; drop\n // the padding but leave the text spanning both grid rows, since confining it\n // to the primary row rides it higher still. `overflow: hidden` also drops the\n // grid item's automatic minimum size, without which the text never shrinks\n // below its content width and the ellipsis has nothing to stand for.\n // https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-tags/library/src/components/Tag/useTagStyles.styles.ts#L320-L323\n // https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-tags/library/src/components/Tag/useTagStyles.styles.ts#L337-L341\n text: {\n paddingBottom: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n },\n});\n\n// Fluent clones a Tooltip's trigger element, so any prop Chip drops -- the\n// ref, the pointer and focus handlers, the aria attribute tying the two\n// together -- leaves the tooltip with nothing to open on.\ntype ChipTriggerProps = Omit<\n ComponentProps<typeof Tag>,\n | 'appearance' | 'children' | 'className' | 'disabled' | 'dismissIcon' | 'dismissible' | 'icon'\n | 'media' | 'primaryText' | 'secondaryText' | 'selected' | 'shape' | 'size' | 'style' | 'value'\n>;\n\n// Fluent's `small` is the 24px step, which every badge in the dashboard stands\n// on -- `StatusBadge` reaches the same height through Badge's `large`.\nexport function Chip({ children, className, icon, style, textRef, ...trigger }: {\n children: ReactNode;\n className?: string;\n icon?: ReactElement;\n style?: CSSProperties;\n // The text slot is the box that clips, so it is the one a caller has to\n // reach to measure what the chip shows.\n textRef?: Ref<HTMLSpanElement>;\n} & ChipTriggerProps) {\n const styles = useStyles();\n\n return (\n <Tag\n appearance=\"outline\"\n shape=\"circular\"\n size=\"small\"\n className={mergeClasses(styles.root, className)}\n icon={icon}\n primaryText={{ className: styles.text, ref: textRef }}\n style={style}\n {...trigger}\n >\n {children}\n </Tag>\n );\n}\n", "import { useId, type KeyboardEvent } from 'react';\n\nimport { refuseToggle } from './fluent-form-controls';\nimport { useRouteAddress } from './route-link';\nimport { fluentComponents } from '../../fluent';\n\nconst { makeStyles, tokens } = fluentComponents;\n\n// A row of mutually exclusive choices, shaped after WinUI's SelectorBar: track,\n// item borders and every item background including the selected one are\n// transparent, selection is carried by a 3px accent pill under the chosen item,\n// and the states live in the foreground, stepping *down* the text ramp on\n// pointer.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/SelectorBar/SelectorBar_themeresources.xaml\nconst useStyles = makeStyles({\n // The items sit flush: SelectorBar's horizontal StackLayout states no spacing,\n // so each item's 12px of side padding is the whole distance between one label\n // and the next. SelectorBarItemSpacing, 8, is the icon-to-text gap and these\n // items carry no icon; SelectorBarPadding, 0,4, is not taken either, as those\n // eight vertical pixels would stand outside the shared control-row height.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/SelectorBar/SelectorBar.xaml#L14\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/SelectorBar/SelectorBar.xaml#L29-L36\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/SelectorBar/SelectorBar.xaml#L174-L178\n root: {\n alignItems: 'center',\n display: 'flex',\n flexWrap: 'nowrap',\n maxWidth: '100%',\n width: 'fit-content',\n },\n // Seven above and below a 20px line is 34, the height every control row in\n // this dashboard is set to. That is ours, not WinUI's: WinUI pads the item\n // 12,10,12,7 and hangs the pill in a row of its own beneath, which stands the\n // control clear of the inputs and dropdowns it shares a form row with. On the\n // uniform row the pill finds its 3px inside the item's own bottom padding.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/SelectorBar/SelectorBar_themeresources.xaml#L26-L32\n item: {\n alignItems: 'center',\n // Stated for the addressed item, whose anchor would otherwise take the\n // user-agent link colour and underline.\n color: 'inherit',\n textDecorationLine: 'none',\n // ControlCornerRadius, the radius SelectorBarItem states for itself; every\n // fill it can carry is transparent, so only the focus ring below reads it.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/SelectorBar/SelectorBar.xaml#L53\n borderRadius: tokens.borderRadiusMedium,\n cursor: 'pointer',\n display: 'inline-flex',\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n padding: '7px 12px',\n position: 'relative',\n whiteSpace: 'nowrap',\n // Pressed steps on to tertiary only while the item is unselected, because\n // SelectedPressed re-states the pointer-over fill rather than the pressed\n // one. The two pressed rules are an exclusive pair so neither has to outrank\n // the other, and the selected one is spelled out rather than left to the\n // hover rule: a radio is also pressed by the keyboard, with no pointer over\n // it.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/SelectorBar/SelectorBar.xaml#L70-L96\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/SelectorBar/SelectorBar.xaml#L116-L149\n '&:not([data-disabled]):hover': { color: 'var(--winui-text-fill-secondary)' },\n '&:not([data-disabled]):not([data-checked]):active': {\n color: 'var(--winui-text-fill-tertiary)',\n },\n '&[data-checked]:not([data-disabled]):active': {\n color: 'var(--winui-text-fill-secondary)',\n },\n // The system focus visual: a 2px FocusStrokeColorOuter ring with a 1px\n // FocusStrokeColorInner ring inside it, held two pixels clear of the item by\n // FocusVisualMargin -2. The negative margin grows the focus rectangle, which\n // puts the outer stroke exactly where an outline at offset zero sits and\n // leaves the inner stroke the first pixel within.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/SelectorBar/SelectorBar_themeresources.xaml#L34\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L472-L473\n // https://github.com/microsoft/microsoft-ui-xaml/blob/543310634592831f8f2638301ece05d2d2dbea39/src/dxaml/xcp/components/FocusRect/FocusRectManager.cpp#L173-L174\n '&:has(input:focus-visible)': {\n boxShadow: 'inset 0 0 0 1px var(--winui-focus-stroke-inner)',\n outline: '2px solid var(--winui-focus-stroke-outer)',\n outlineOffset: '0',\n },\n // The addressed item is the focusable element itself, where the field's is\n // the radio inside it.\n '&:focus-visible': {\n boxShadow: 'inset 0 0 0 1px var(--winui-focus-stroke-inner)',\n outline: '2px solid var(--winui-focus-stroke-outer)',\n outlineOffset: '0',\n },\n '&[data-disabled]': {\n color: 'var(--winui-text-fill-disabled)',\n cursor: 'not-allowed',\n },\n // PART_SelectionVisual: a 4px by 3px accent rectangle centred at the bottom\n // of every item, held at zero opacity until its item is the chosen one.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/SelectorBar/SelectorBar.xaml#L200-L214\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/SelectorBar/SelectorBar_themeresources.xaml#L96-L104\n '&::after': {\n backgroundColor: 'var(--winui-accent-fill-default)',\n // Stated per corner because Griffel splits the `border-radius` shorthand\n // on whitespace and would not survive its `/`.\n borderBottomLeftRadius: '0.5px 1px',\n borderBottomRightRadius: '0.5px 1px',\n borderTopLeftRadius: '0.5px 1px',\n borderTopRightRadius: '0.5px 1px',\n bottom: '0',\n content: '\"\"',\n height: '3px',\n left: 'calc(50% - 2px)',\n opacity: 0,\n pointerEvents: 'none',\n position: 'absolute',\n width: '4px',\n },\n // Selecting scales the pill to four times its width about its centre, over\n // ComboBoxItemScaleAnimationDuration on the template's own KeySpline.\n // Deselecting states no storyboard at all, so the pill snaps away: the\n // timing sits on the rule becoming active, and the resting rule states none.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/SelectorBar/SelectorBar.xaml#L97-L114\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/SelectorBar/SelectorBar.xaml#L69\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/ComboBox/ComboBox_themeresources.xaml#L330\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/ComboBox/ComboBox_themeresources.xaml#L349-L357\n '&[data-checked]::after': {\n opacity: 1,\n transform: 'scaleX(4)',\n transitionDuration: '167ms',\n transitionProperty: 'opacity, transform',\n transitionTimingFunction: 'cubic-bezier(0, 0, 0, 1)',\n '@media (prefers-reduced-motion: reduce)': { transitionDuration: '0.01ms' },\n },\n // WinUI's Disabled state replaces only the pill's fill, so a disabled item\n // that is also the chosen one still shows the mark, in the disabled accent.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/SelectorBar/SelectorBar.xaml#L164-L166\n '&[data-disabled]::after': { backgroundColor: 'var(--winui-accent-fill-disabled)' },\n // Without these the forced palette would repaint the pill on the canvas,\n // erasing the only mark the selection has, and flatten the pointer ramp onto\n // CanvasText where WinUI greys it. Each rule restates the selector it\n // overrides, because a media query carries no specificity of its own.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/SelectorBar/SelectorBar_themeresources.xaml#L36-L49\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L456\n '@media (forced-colors: active)': {\n '&::after': { backgroundColor: 'Highlight', forcedColorAdjust: 'none' },\n '&:not([data-disabled]):hover': { color: 'GrayText' },\n '&:not([data-disabled]):not([data-checked]):active': { color: 'GrayText' },\n '&[data-checked]:not([data-disabled]):active': { color: 'GrayText' },\n '&[data-disabled]': { color: 'GrayText' },\n '&[data-disabled]::after': { backgroundColor: 'Canvas' },\n },\n },\n input: {\n height: '1px',\n inset: 0,\n opacity: 0,\n position: 'absolute',\n width: '1px',\n },\n});\n\nexport interface ChoiceGroupItem {\n value: string;\n label: string;\n disabled?: boolean;\n /**\n * Where this choice's view lives, for a group that picks between views of\n * data rather than between the values of a form field. The choice becomes an\n * anchor and can be opened in a second tab, which is the whole point of\n * addressing it: a range beside another range is a comparison.\n */\n to?: string;\n}\n\nexport function ChoiceGroup({\n ariaLabel,\n disabled = false,\n items,\n onChange,\n readOnly,\n value,\n}: {\n ariaLabel: string;\n disabled?: boolean;\n items: ChoiceGroupItem[];\n onChange: (value: string) => void;\n /**\n * The choice is shown but is not this operator's to make -- as distinct from\n * disabled, which says the choice is not available at all. It keeps its own\n * appearance and pointer states, takes focus, and refuses the selection.\n */\n readOnly?: boolean;\n value: string;\n}) {\n const styles = useStyles();\n const name = useId();\n const selectedIndex = items.findIndex(item => item.value === value);\n // An addressed group is a row of anchors, so the single tab stop and the\n // arrow keys that a native radiogroup gives for free are restated here.\n // Arrowing selects as well as moves, which is what a radio does.\n // https://www.w3.org/WAI/ARIA/apg/patterns/radio/\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n const step = event.key === 'ArrowRight' || event.key === 'ArrowDown' ? 1\n : event.key === 'ArrowLeft' || event.key === 'ArrowUp' ? -1 : 0;\n if (step === 0) return;\n if (disabled) {\n event.preventDefault();\n return;\n }\n const choices = [...event.currentTarget.querySelectorAll<HTMLAnchorElement>('[role=\"radio\"]:not([aria-disabled=\"true\"])')];\n if (choices.length === 0) return;\n event.preventDefault();\n const next = choices[(choices.indexOf(event.target as HTMLAnchorElement) + step + choices.length) % choices.length];\n next.focus();\n next.click();\n };\n\n return <div aria-label={ariaLabel} aria-readonly={readOnly === true ? true : undefined} className={styles.root} onKeyDown={handleKeyDown} role=\"radiogroup\">\n {items.map((item, index) => {\n const itemDisabled = disabled || item.disabled === true;\n return item.to === undefined\n ? <label\n className={styles.item}\n data-checked={value === item.value ? '' : undefined}\n data-disabled={itemDisabled ? '' : undefined}\n key={item.value}\n >\n <input\n checked={value === item.value}\n className={styles.input}\n disabled={itemDisabled}\n name={name}\n onChange={readOnly === true ? undefined : () => onChange(item.value)}\n onClick={readOnly === true ? refuseToggle : undefined}\n type=\"radio\"\n value={item.value}\n />\n <span>{item.label}</span>\n </label>\n : <AddressedChoice\n checked={value === item.value}\n className={styles.item}\n disabled={itemDisabled}\n item={item}\n key={item.value}\n onChange={onChange}\n to={item.to}\n tabIndex={(selectedIndex === -1 ? index === 0 : value === item.value) ? 0 : -1}\n />;\n })}\n </div>;\n}\n\nfunction AddressedChoice({ checked, className, disabled, item, onChange, tabIndex, to }: {\n checked: boolean;\n className: string;\n disabled: boolean;\n item: ChoiceGroupItem;\n onChange: (value: string) => void;\n tabIndex: number;\n to: string;\n}) {\n // The page owns the transition, holding the view in state and writing the URL\n // after it, so the address only has to say where the view lives.\n const address = useRouteAddress(to, () => onChange(item.value));\n return <a\n href={disabled ? undefined : address.href}\n onClick={disabled ? event => event.preventDefault() : address.onClick}\n aria-checked={checked}\n aria-disabled={disabled ? true : undefined}\n className={className}\n data-checked={checked ? '' : undefined}\n data-disabled={disabled ? '' : undefined}\n // An anchor answers Enter on its own; Space is the radio's key and has to\n // be given back, and its default is the page scroll.\n onKeyDown={event => {\n if (event.key !== ' ') return;\n event.preventDefault();\n if (!disabled) event.currentTarget.click();\n }}\n role=\"radio\"\n tabIndex={disabled ? -1 : tabIndex}\n >\n <span>{item.label}</span>\n </a>;\n}\n", "import type { CheckboxProps, ComboboxProps, DropdownProps, ListboxProps, SwitchProps, TextareaProps } from '@fluentui/react-components';\nimport { ChevronDown12Regular } from '@fluentui/react-icons';\nimport { Children, createElement, forwardRef } from 'react';\nimport type { ComponentProps, ElementType, ForwardRefExoticComponent, MouseEvent, ReactNode, Ref, RefAttributes } from 'react';\n\nimport { useScrollAreaHost } from './scroll-area';\nimport { fluentComponents } from '../../fluent';\nimport { useTranslation } from '../../i18n/translation';\n\nconst {\n Checkbox: FluentCheckbox,\n Combobox: FluentCombobox,\n Dropdown: FluentDropdown,\n Input: FluentInput,\n Option,\n Switch: FluentSwitch,\n Textarea: FluentTextarea,\n mergeClasses,\n useMergedRefs,\n} = fluentComponents;\n\n// Read-only, as distinct from disabled: the setting is available, this operator\n// just does not set it. Fluent offers it only on a text field, so every control\n// here stays enabled and keeps its own appearance, states `aria-readonly`, and\n// refuses the change at the source.\ninterface ReadOnlyProp {\n readOnly?: boolean;\n}\n\n// The caller's own slot spreads first and the refusal lands on top of it, so a\n// slot carrying the same key cannot leave the control editable while the root\n// still states aria-readonly. A slot given in Fluent's shorthand form -- an\n// element or a string -- has no props to keep.\nconst slotProps = <T,>(slot: T) => (typeof slot === 'object' && slot !== null ? slot : {});\n\n// Fluent's minimum width and the wrapped input's own `min-width: auto` form an\n// intrinsic floor that propagates up through every auto-sized grid track above\n// the control, so a field in a fluid column can push its layout wider than the\n// container. Zeroing both lets the column decide.\nconst MIN_WIDTH_CLASS = '!min-w-[0px] [&_input]:!min-w-[0px]';\n\n// A select is only as wide as the value it currently shows, so clearing Fluent's\n// 250px leaves nothing under it. The floor is WinUI's own ComboBoxThemeMinWidth,\n// stated as a token in ../../winui/tokens.ts, and the variable raises it where a\n// column of selects has to line up. Carried by a variable rather than a second\n// class, so a caller sets a value instead of racing the `!important` this one\n// needs to clear Fluent's.\nconst SELECT_MIN_WIDTH_CLASS = '!min-w-[var(--fwt-select-min-width,var(--winui-combo-box-min-width))] [&_input]:!min-w-[0px]';\n\n// Fluent flips the popup to whichever side has room for its natural height, so\n// a long list ends up beside the field rather than under it. Restricting the\n// fallbacks to the opposite edge keeps the list attached, and `autoSize` trims\n// it to the space that edge has instead of moving it.\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-positioning/library/src/types.ts#L244-L264\nexport const LISTBOX_POSITIONING = {\n position: 'below',\n align: 'start',\n autoSize: 'height',\n fallbackPositions: ['above'],\n overflowBoundaryPadding: 8,\n} satisfies NonNullable<ComponentProps<typeof FluentCombobox>['positioning']>;\n\n// The 12px cut rather than Fluent's default 20px artwork scaled down: that\n// stroke is one unit in a twenty-unit box, so at 12px no pixel reaches full\n// strength -- measured, the darkest came out 145 where a solid glyph on that\n// fill reaches 97.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/ComboBox/ComboBox_themeresources.xaml#L582-L586\nconst EXPAND_ICON = <ChevronDown12Regular />;\n\ntype ListboxRenderFunction = (\n ListboxComponent: ElementType<ListboxProps>,\n listboxProps: Omit<ListboxProps, 'as'>,\n) => ReactNode;\ntype ListboxRenderPropsWithRef = Omit<ListboxProps, 'as'> & {\n ref?: Ref<HTMLDivElement>;\n};\n\nfunction ScrollableListbox({\n ListboxComponent,\n emptyMessage,\n freeform,\n listboxProps,\n}: {\n emptyMessage: string | undefined;\n freeform: boolean;\n ListboxComponent: ElementType<ListboxProps>;\n listboxProps: Omit<ListboxProps, 'as'>;\n}) {\n const { hostProps, viewportRef, viewportStyle } = useScrollAreaHost({ axes: 'vertical', noTabIndex: true });\n const {\n children,\n className,\n ref: fluentRef,\n ...rootProps\n } = listboxProps as ListboxRenderPropsWithRef;\n const { t } = useTranslation();\n const mergedRef = useMergedRefs(fluentRef, hostProps.ref);\n\n return createElement(\n ListboxComponent as ElementType,\n {\n ...rootProps,\n ...hostProps,\n className: mergeClasses(className, hostProps.className, 'fwt-combobox-listbox'),\n ref: mergedRef,\n },\n // JSX rather than createElement, so the ref is a ref to the compiler and not\n // an ordinary prop it has to assume is read in render.\n <div className=\"fwt-combobox-listbox-viewport\" ref={viewportRef} style={viewportStyle}>\n {/* Fluent opens the popup whether or not there is anything in it, so an\n empty list would arrive as a bordered seam a few pixels tall. Filling\n it is not an ARIA obligation, despite appearances: 1.3 renamed the\n section to Allowed Accessibility Child Roles and dropped the existence\n requirement, 1.2's MUST applied only while loading, and axe files an\n empty listbox as review-only. The row must be an option: axe escalates\n a bare text node inside a listbox from review to a hard violation.\n Fluent ships this shape itself in useComboboxFilter's\n noOptionsMessage; this is that row with the one correction its version\n needs, the `disabled` prop rather than `aria-disabled` -- Fluent's\n useOption reads props.disabled, so aria-disabled alone leaves the row\n selectable and eligible to become the active descendant.\n https://w3c.github.io/aria/#mustContain */}\n <div className=\"fwt-combobox-listbox-content\">\n {Children.toArray(children).length === 0\n ? <Option disabled value=\"\">{emptyMessage ?? t(freeform ? 'common.noSuggestions' : 'common.noOptions')}</Option>\n : children}\n </div>\n </div>,\n );\n}\n\n// MUI and Ant Design suppress the message outright on a free-text field, taking\n// an empty suggestion list for a non-failure. A row stating there is nothing to\n// suggest announces no failure either, and keeps the control from changing shape.\nconst listboxRenderer = (freeform: boolean, emptyMessage: string | undefined): ListboxRenderFunction =>\n (ListboxComponent, listboxProps) => (\n <ScrollableListbox ListboxComponent={ListboxComponent} emptyMessage={emptyMessage} freeform={freeform} listboxProps={listboxProps} />\n );\n\n// Fluent writes the control's measured width straight onto the list, truncating\n// every option longer than a narrow control. `listWidth=\"content\"` keeps the\n// measurement as a floor and lets the list grow past it, which is only usable\n// together with an `align: 'end'` positioning -- the list has to hang off the\n// trailing edge and open away from it, or it would grow off the page.\nconst CONTENT_WIDTH_LISTBOX_CLASS = '!w-max !min-w-[var(--fui-match-target-size)] !max-w-[calc(100vw-16px)]';\n\nconst listboxFor = (listWidth: 'target' | 'content' | undefined, freeform: boolean, emptyMessage: string | undefined) => ({\n children: listboxRenderer(freeform, emptyMessage),\n ...(listWidth === 'content' ? { className: CONTENT_WIDTH_LISTBOX_CLASS } : {}),\n});\n\ninterface ListWidthProp {\n listWidth?: 'target' | 'content';\n}\n\n// A caller that filters its own options says here what it wants the empty\n// result to read as, instead of adding a row of its own beside this one.\ninterface EmptyMessageProp {\n emptyMessage?: string;\n}\n\nexport const Input = forwardRef<HTMLInputElement, ComponentProps<typeof FluentInput>>(\n ({ className, ...props }, ref) => (\n <FluentInput {...props} className={mergeClasses(className, MIN_WIDTH_CLASS)} ref={ref} />\n ),\n) as typeof FluentInput;\n\n// WinUI carries one ComboBox style and no variant beside it, so Fluent's\n// underline, filled-darker and filled-lighter fills have nothing to be faithful\n// to and ../../winui/controls/select.css.ts restyles none of them. Withholding\n// the prop leaves Fluent's own outline default as the only thing either control\n// can render.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/ComboBox/ComboBox_themeresources.xaml#L358-L359\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-combobox/library/src/components/Combobox/useCombobox.tsx#L216\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-combobox/library/src/components/Dropdown/useDropdown.tsx#L165\n// Local adaptation (UPSTREAM.md): the export types below name Fluent's public\n// prop types so the emitted declarations reference no internal package.\nexport const Combobox: ForwardRefExoticComponent<Omit<ComboboxProps, 'appearance' | 'listbox'> & ListWidthProp & EmptyMessageProp & ReadOnlyProp & RefAttributes<HTMLInputElement>> = forwardRef<HTMLInputElement, Omit<ComponentProps<typeof FluentCombobox>, 'appearance' | 'listbox'> & ListWidthProp & EmptyMessageProp & ReadOnlyProp>(\n ({ className, emptyMessage, expandIcon, listWidth, onOptionSelect, positioning, readOnly, ...props }, ref) => (\n <FluentCombobox\n {...props}\n aria-readonly={readOnly === true ? true : undefined}\n expandIcon={expandIcon === undefined ? EXPAND_ICON : expandIcon}\n input={{ ...slotProps(props.input), readOnly }}\n onOptionSelect={readOnly === true ? undefined : onOptionSelect}\n positioning={positioning ?? LISTBOX_POSITIONING}\n listbox={listboxFor(listWidth, props.freeform === true, emptyMessage)}\n className={mergeClasses(className, SELECT_MIN_WIDTH_CLASS)}\n ref={ref}\n />\n ),\n);\n\nexport const Dropdown: ForwardRefExoticComponent<Omit<DropdownProps, 'appearance' | 'listbox'> & ListWidthProp & EmptyMessageProp & ReadOnlyProp & RefAttributes<HTMLButtonElement>> = forwardRef<HTMLButtonElement, Omit<ComponentProps<typeof FluentDropdown>, 'appearance' | 'listbox'> & ListWidthProp & EmptyMessageProp & ReadOnlyProp>(\n ({ className, emptyMessage, expandIcon, listWidth, onOptionSelect, positioning, readOnly, ...props }, ref) => (\n <FluentDropdown\n {...props}\n aria-readonly={readOnly === true ? true : undefined}\n expandIcon={expandIcon === undefined ? EXPAND_ICON : expandIcon}\n onOptionSelect={readOnly === true ? undefined : onOptionSelect}\n positioning={positioning ?? LISTBOX_POSITIONING}\n listbox={listboxFor(listWidth, false, emptyMessage)}\n className={mergeClasses(className, SELECT_MIN_WIDTH_CLASS)}\n ref={ref}\n />\n ),\n);\n\n// A checkbox, a switch and a radio are all native inputs on which HTML accepts\n// `readonly` and does nothing with it. Cancelling the click refuses the change,\n// since that is the default action of a click on such an input.\nexport const refuseToggle = (event: MouseEvent<HTMLInputElement>) => event.preventDefault();\n\n// `size` and `shape` are omitted because WinUI states one check box and only\n// one: a single CheckBoxSize, a single glyph measure, a square corner, and no\n// round counterpart anywhere in the control. The layer already held both of\n// Fluent's sizes to that one box, so `size` changed nothing a caller could see\n// except to pick a different glyph asset, whose ink is a different width once\n// it is squeezed into the one slot; a circular box has nothing to transcribe\n// at all.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/CheckBox_themeresources.xaml#L270-L271\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/CheckBox_themeresources.xaml#L294\nexport const Checkbox: ForwardRefExoticComponent<Omit<CheckboxProps, 'shape' | 'size'> & ReadOnlyProp & RefAttributes<HTMLInputElement>> = forwardRef<HTMLInputElement, Omit<ComponentProps<typeof FluentCheckbox>, 'shape' | 'size'> & ReadOnlyProp>(\n ({ input, onChange, readOnly, ...props }, ref) => (\n <FluentCheckbox\n {...props}\n aria-readonly={readOnly === true ? true : undefined}\n input={{ ...slotProps(input), ...(readOnly === true ? { onClick: refuseToggle } : {}) }}\n onChange={readOnly === true ? undefined : onChange}\n ref={ref}\n />\n ),\n);\n\nexport const Switch: ForwardRefExoticComponent<SwitchProps & ReadOnlyProp & RefAttributes<HTMLInputElement>> = forwardRef<HTMLInputElement, ComponentProps<typeof FluentSwitch> & ReadOnlyProp>(\n ({ input, onChange, readOnly, ...props }, ref) => (\n <FluentSwitch\n {...props}\n aria-readonly={readOnly === true ? true : undefined}\n input={{ ...slotProps(input), ...(readOnly === true ? { onClick: refuseToggle } : {}) }}\n onChange={readOnly === true ? undefined : onChange}\n ref={ref}\n />\n ),\n);\n\n// WinUI's multi-line TextBox is a fixed box: the template is the single-line\n// one, and nothing in it offers a drag handle. Withholding the prop leaves\n// Fluent's own `none` default, and ../../winui/controls/text-input.css.ts takes\n// back the bottom padding Fluent reserves for the grip. A caller sizes the box\n// with rows.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/TextBox_themeresources.xaml#L336-L337\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-textarea/library/src/components/Textarea/useTextareaStyles.styles.ts#L204-L217\nexport const Textarea: ForwardRefExoticComponent<Omit<TextareaProps, 'resize'> & RefAttributes<HTMLTextAreaElement>> = forwardRef<HTMLTextAreaElement, Omit<ComponentProps<typeof FluentTextarea>, 'resize'>>(\n ({ className, ...props }, ref) => (\n <FluentTextarea {...props} className={mergeClasses(className, MIN_WIDTH_CLASS)} ref={ref} />\n ),\n);\n", "export interface CacheOptions<Value> {\r\n // initial value of _value.\r\n _initialValue: Value;\r\n // Custom comparison function if shallow compare isn't enough. Returns true if nothing changed.\r\n _equal?: EqualCachePropFunction<Value>;\r\n // If true always updates _value and _previous, otherwise they update only when they changed.\r\n _alwaysUpdateValues?: boolean;\r\n}\r\n\r\nexport type CacheValues<T> = [value: T, changed: boolean, previous?: T];\r\n\r\nexport type EqualCachePropFunction<Value> = (currentVal: Value, newVal: Value) => boolean;\r\n\r\nexport type CacheUpdater<Value> = (current: Value, previous?: Value) => Value;\r\n\r\nexport type UpdateCacheContextual<Value> = (newValue: Value, force?: boolean) => CacheValues<Value>;\r\n\r\nexport type UpdateCache<Value> = (force?: boolean) => CacheValues<Value>;\r\n\r\nexport type GetCurrentCache<Value> = (force?: boolean) => CacheValues<Value>;\r\n\r\nexport type Cache<Value> = [UpdateCache<Value>, GetCurrentCache<Value>];\r\n\r\nexport type CacheContextual<Value> = [UpdateCacheContextual<Value>, GetCurrentCache<Value>];\r\n\r\ntype CreateCache = {\r\n <Value>(options: CacheOptions<Value>): CacheContextual<Value>;\r\n <Value>(options: CacheOptions<Value>, update: CacheUpdater<Value>): Cache<Value>;\r\n <Value>(\r\n options: CacheOptions<Value>,\r\n update?: CacheUpdater<Value>\r\n ): CacheContextual<Value> | Cache<Value>;\r\n};\r\n\r\nexport const createCache: CreateCache = <Value>(\r\n options: CacheOptions<Value>,\r\n update?: CacheUpdater<Value>\r\n): CacheContextual<Value> | Cache<Value> => {\r\n const { _initialValue, _equal, _alwaysUpdateValues } = options;\r\n let _value: Value = _initialValue;\r\n let _previous: Value | undefined;\r\n\r\n const cacheUpdateContextual: UpdateCacheContextual<Value> = (newValue, force?) => {\r\n const curr = _value;\r\n\r\n const newVal = newValue;\r\n const changed = force || (_equal ? !_equal(curr, newVal) : curr !== newVal);\r\n\r\n if (changed || _alwaysUpdateValues) {\r\n _value = newVal;\r\n _previous = curr;\r\n }\r\n\r\n return [_value, changed, _previous];\r\n };\r\n const cacheUpdateIsolated: UpdateCache<Value> = (force?) =>\r\n cacheUpdateContextual(update!(_value, _previous), force);\r\n\r\n const getCurrentCache: GetCurrentCache<Value> = (force?: boolean) => [\r\n _value,\r\n !!force, // changed\r\n _previous,\r\n ];\r\n\r\n return [update ? cacheUpdateIsolated : cacheUpdateContextual, getCurrentCache] as\r\n | CacheContextual<Value>\r\n | Cache<Value>;\r\n};\r\n", "export const isBrowser =\r\n // deno has the global `window` defined\r\n typeof window !== 'undefined' &&\r\n // make sure HTML element is available\r\n typeof HTMLElement !== 'undefined' &&\r\n // make sure document is defined\r\n !!window.document;\r\n", "import { isBrowser } from '../compatibility/isBrowser';\r\n\r\nexport const wnd = (isBrowser ? window : {}) as typeof window;\r\nexport const mathMax = Math.max;\r\nexport const mathMin = Math.min;\r\nexport const mathRound = Math.round;\r\nexport const mathFloor = Math.floor;\r\nexport const mathCeil = Math.ceil;\r\nexport const mathAbs = Math.abs;\r\nexport const mathSign = Math.sign;\r\nexport const cAF = wnd.cancelAnimationFrame;\r\nexport const rAF = wnd.requestAnimationFrame;\r\nexport const setT = wnd.setTimeout;\r\nexport const clearT = wnd.clearTimeout;\r\n", "import { wnd } from '../utils/alias';\r\n\r\nconst getApi = <T>(name: string) =>\r\n (typeof wnd[name as keyof typeof wnd] !== 'undefined'\r\n ? wnd[name as keyof typeof wnd]\r\n : undefined) as T;\r\n\r\nexport const MutationObserverConstructor = getApi<typeof MutationObserver>('MutationObserver');\r\nexport const IntersectionObserverConstructor =\r\n getApi<typeof IntersectionObserver>('IntersectionObserver');\r\nexport const ResizeObserverConstructor = getApi<typeof ResizeObserver>('ResizeObserver');\r\nexport const scrollT = getApi<new (constructor: unknown) => AnimationTimeline>('ScrollTimeline');\r\n", "/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport type { PlainObject } from '../../typings';\r\n\r\nexport const isUndefined = (obj: any): obj is undefined => obj === undefined;\r\n\r\nexport const isNull = (obj: any): obj is null => obj === null;\r\n\r\nexport const type = (obj: any): string =>\r\n isUndefined(obj) || isNull(obj)\r\n ? `${obj}`\r\n : Object.prototype.toString\r\n .call(obj)\r\n .replace(/^\\[object (.+)\\]$/, '$1')\r\n .toLowerCase();\r\n\r\nexport const isNumber = (obj: any): obj is number => typeof obj === 'number';\r\n\r\nexport const isString = (obj: any): obj is string => typeof obj === 'string';\r\n\r\nexport const isBoolean = (obj: any): obj is boolean => typeof obj === 'boolean';\r\n\r\nexport const isFunction = (obj: any): obj is (...args: any[]) => any => typeof obj === 'function';\r\n\r\nexport const isArray = <T = any>(obj: any): obj is Array<T> => Array.isArray(obj);\r\n\r\nexport const isObject = (obj: any): obj is object =>\r\n typeof obj === 'object' && !isArray(obj) && !isNull(obj);\r\n\r\n/**\r\n * Returns true if the given object is array like, false otherwise.\r\n * @param obj The Object\r\n */\r\nexport const isArrayLike = <T extends PlainObject = any>(obj: any): obj is ArrayLike<T> => {\r\n const length = !!obj && obj.length;\r\n const lengthCorrectFormat = isNumber(length) && length > -1 && length % 1 == 0;\r\n\r\n return isArray(obj) || (!isFunction(obj) && lengthCorrectFormat)\r\n ? length > 0 && isObject(obj)\r\n ? length - 1 in obj\r\n : true\r\n : false;\r\n};\r\n\r\n/**\r\n * Returns true if the given object is a \"plain\" (e.g. { key: value }) object, false otherwise.\r\n * @param obj The Object.\r\n */\r\nexport const isPlainObject = <T = any>(obj: any): obj is PlainObject<T> =>\r\n !!obj && obj.constructor === Object;\r\n\r\n/**\r\n * Checks whether the given object is a HTMLElement.\r\n * @param obj The object which shall be checked.\r\n */\r\nexport const isHTMLElement = (obj: any): obj is HTMLElement => obj instanceof HTMLElement;\r\n\r\n/**\r\n * Checks whether the given object is a Element.\r\n * @param obj The object which shall be checked.\r\n */\r\nexport const isElement = (obj: any): obj is Element => obj instanceof Element;\r\n", "import { mathMax, rAF, cAF } from './alias';\r\nimport { isFunction } from './types';\r\n\r\n/**\r\n * percent: current percent (0 - 1),\r\n * time: current time (duration * percent),\r\n * min: start value\r\n * max: end value\r\n * duration: duration in ms\r\n */\r\nexport type EasingFn = (\r\n percent: number,\r\n time: number,\r\n min: number,\r\n max: number,\r\n duration: number\r\n) => number;\r\n\r\nconst animationCurrentTime = () => performance.now();\r\n\r\nexport const animateNumber = (\r\n from: number,\r\n to: number,\r\n duration: number,\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onFrame: (progress: number, percent: number, completed: boolean) => any,\r\n easing?: EasingFn | false\r\n): ((complete?: boolean) => void) => {\r\n let animationFrameId = 0;\r\n const timeStart = animationCurrentTime();\r\n const finalDuration = mathMax(0, duration);\r\n const frame = (complete?: boolean) => {\r\n const timeNow = animationCurrentTime();\r\n const timeElapsed = timeNow - timeStart;\r\n const stopAnimation = timeElapsed >= finalDuration;\r\n const percent = complete\r\n ? 1\r\n : 1 - (mathMax(0, timeStart + finalDuration - timeNow) / finalDuration || 0);\r\n const progress =\r\n (to - from) *\r\n (isFunction(easing)\r\n ? easing(percent, percent * finalDuration, 0, 1, finalDuration)\r\n : percent) +\r\n from;\r\n const animationCompleted = stopAnimation || percent === 1;\r\n\r\n if (onFrame) {\r\n onFrame(progress, percent, animationCompleted);\r\n }\r\n\r\n animationFrameId = animationCompleted ? 0 : rAF!(() => frame());\r\n };\r\n frame();\r\n return (complete) => {\r\n cAF!(animationFrameId);\r\n if (complete) {\r\n frame(complete);\r\n }\r\n };\r\n};\r\n", "/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport type { PlainObject } from '../../typings';\r\nimport { isArray, isArrayLike, isString } from './types';\r\n\r\ntype RunEachItem = ((...args: any) => any | any[]) | false | null | undefined;\r\n\r\nexport function each<T extends Array<unknown> | ReadonlyArray<unknown>>(\r\n array: T,\r\n callback: (\r\n value: T extends Array<infer V> | ReadonlyArray<infer V> ? V : never,\r\n index: number,\r\n source: T\r\n ) => boolean | unknown\r\n): T;\r\nexport function each<T extends ArrayLike<unknown>>(\r\n arrayLikeObject: T,\r\n callback: (\r\n value: T extends ArrayLike<infer V> ? V : never,\r\n index: number,\r\n source: T\r\n ) => boolean | unknown\r\n): T;\r\nexport function each<T extends PlainObject>(\r\n obj: T,\r\n callback: (value: any, key: string, source: T) => boolean | unknown\r\n): T;\r\nexport function each(\r\n source: Array<unknown> | ArrayLike<unknown> | ReadonlyArray<unknown> | PlainObject,\r\n callback: (value: any, indexOrKey: any, source: any) => boolean | unknown\r\n): Array<unknown> | ArrayLike<unknown> | ReadonlyArray<unknown> | Set<unknown> | PlainObject {\r\n if (isArrayLike(source)) {\r\n for (let i = 0; i < source.length; i++) {\r\n if (callback(source[i], i, source) === false) {\r\n break;\r\n }\r\n }\r\n } else if (source) {\r\n // cant use support func keys here due to circular dep\r\n each(Object.keys(source), (key) => callback(source[key], key, source));\r\n }\r\n return source;\r\n}\r\n\r\n/**\r\n * Returns true when the passed item is in the passed array and false otherwise.\r\n * @param arr The array.\r\n * @param item The item.\r\n * @returns Whether the item is in the array.\r\n */\r\nexport const inArray = <T = any>(arr: T[] | readonly T[], item: T): boolean =>\r\n arr.indexOf(item) >= 0;\r\n\r\n/**\r\n * Concats two arrays and returns an new array without modifying any of the passed arrays.\r\n * @param a Array A.\r\n * @param b Array B.\r\n * @returns A new array which has the entries of both arrays.\r\n */\r\nexport const concat = <T>(a: T[] | ReadonlyArray<T>, b: T[] | ReadonlyArray<T>): T[] => a.concat(b);\r\n\r\n/**\r\n * Pushesh all given items into the given array and returns it.\r\n * @param array The array the items shall be pushed into.\r\n * @param items The items which shall be pushed into the array.\r\n */\r\nexport const push = <T>(array: T[], items: T | ArrayLike<T>, arrayIsSingleItem?: boolean): T[] => {\r\n if (!arrayIsSingleItem && !isString(items) && isArrayLike(items)) {\r\n Array.prototype.push.apply(array, items as T[]);\r\n } else {\r\n array.push(items as T);\r\n }\r\n return array;\r\n};\r\n\r\n/**\r\n * Creates a shallow-copied Array instance from an array-like or iterable object.\r\n * @param arr The object from which the array instance shall be created.\r\n */\r\nexport const from = <T = any>(arr?: ArrayLike<T> | Set<T>) => Array.from(arr || []);\r\n\r\n/**\r\n * Creates an array if the passed value is not an array, or returns the value if it is.\r\n * If the passed value is an array like structure and not a string it will be converted into an array.\r\n * @param value The value.\r\n * @returns An array which represents the passed value(s).\r\n */\r\nexport const createOrKeepArray = <T>(value: T | T[] | ArrayLike<T>): T[] => {\r\n if (isArray(value)) {\r\n return value;\r\n }\r\n return !isString(value) && isArrayLike(value) ? from(value) : [value];\r\n};\r\n\r\n/**\r\n * Check whether the passed array is empty.\r\n * @param array The array which shall be checked.\r\n */\r\nexport const isEmptyArray = (array: any[] | null | undefined): boolean => !!array && !array.length;\r\n\r\n/**\r\n * Deduplicates all items of the array.\r\n * @param array The array to be deduplicated.\r\n * @returns The deduplicated array.\r\n */\r\nexport const deduplicateArray = <T extends any[]>(array: T): T => from(new Set(array)) as T;\r\n\r\n/**\r\n * Calls all functions in the passed array/set of functions.\r\n * @param arr The array filled with function which shall be called.\r\n * @param args The args with which each function is called.\r\n * @param keep True when the Set / array should not be cleared afterwards, false otherwise.\r\n */\r\nexport const runEachAndClear = (arr: RunEachItem[], args?: any[], keep?: boolean): void => {\r\n // eslint-disable-next-line prefer-spread\r\n const runFn = (fn: RunEachItem) => (fn ? fn.apply(undefined, args || []) : true); // return true when fn is falsy to not break the loop\r\n each(arr, runFn);\r\n if (!keep) {\r\n (arr as any[]).length = 0;\r\n }\r\n};\r\n", "export const strPaddingTop = 'paddingTop';\r\nexport const strPaddingRight = 'paddingRight';\r\nexport const strPaddingLeft = 'paddingLeft';\r\nexport const strPaddingBottom = 'paddingBottom';\r\nexport const strMarginLeft = 'marginLeft';\r\nexport const strMarginRight = 'marginRight';\r\nexport const strMarginBottom = 'marginBottom';\r\nexport const strOverflowX = 'overflowX';\r\nexport const strOverflowY = 'overflowY';\r\nexport const strWidth = 'width';\r\nexport const strHeight = 'height';\r\nexport const strVisible = 'visible';\r\nexport const strHidden = 'hidden';\r\nexport const strScroll = 'scroll';\r\n\r\nexport const capitalizeFirstLetter = (str: string | number | false | null | undefined): string => {\r\n const finalStr = String(str || '');\r\n return finalStr ? finalStr[0].toUpperCase() + finalStr.slice(1) : '';\r\n};\r\n", "import type { WH } from '../dom/dimensions';\r\nimport type { XY } from '../dom/offset';\r\nimport type { TRBL } from '../dom/style';\r\nimport type { PlainObject } from '../../typings';\r\nimport { each } from './array';\r\nimport { mathRound } from './alias';\r\nimport { strHeight, strWidth } from './strings';\r\n\r\n/**\r\n * Compares two objects and returns true if all values of the passed prop names are identical, false otherwise or if one of the two object is falsy.\r\n * @param a Object a.\r\n * @param b Object b.\r\n * @param props The props which shall be compared.\r\n */\r\nexport const equal = <T extends PlainObject>(\r\n a: T | undefined,\r\n b: T | undefined,\r\n props: Array<keyof T> | ReadonlyArray<keyof T>,\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n propMutation?: ((value: any) => any) | null | false\r\n): boolean => {\r\n if (a && b) {\r\n let result = true;\r\n each(props, (prop) => {\r\n const compareA = propMutation ? propMutation(a[prop]) : a[prop];\r\n const compareB = propMutation ? propMutation(b[prop]) : b[prop];\r\n if (compareA !== compareB) {\r\n result = false;\r\n }\r\n });\r\n return result;\r\n }\r\n return false;\r\n};\r\n\r\n/**\r\n * Compares object a with object b and returns true if both have the same property values, false otherwise.\r\n * Also returns false if one of the objects is undefined or null.\r\n * @param a Object a.\r\n * @param b Object b.\r\n */\r\nexport const equalWH = <T>(a?: Partial<WH<T>>, b?: Partial<WH<T>>) =>\r\n equal<Partial<WH<T>>>(a, b, ['w', 'h']);\r\n\r\n/**\r\n * Compares object a with object b and returns true if both have the same property values, false otherwise.\r\n * Also returns false if one of the objects is undefined or null.\r\n * @param a Object a.\r\n * @param b Object b.\r\n */\r\nexport const equalXY = <T>(a?: Partial<XY<T>>, b?: Partial<XY<T>>) =>\r\n equal<Partial<XY<T>>>(a, b, ['x', 'y']);\r\n\r\n/**\r\n * Compares object a with object b and returns true if both have the same property values, false otherwise.\r\n * Also returns false if one of the objects is undefined or null.\r\n * @param a Object a.\r\n * @param b Object b.\r\n */\r\nexport const equalTRBL = (a?: TRBL, b?: TRBL) => equal<TRBL>(a, b, ['t', 'r', 'b', 'l']);\r\n\r\n/**\r\n * Compares two DOM Rects for their equality of their width and height properties\r\n * Also returns false if one of the DOM Rects is undefined or null.\r\n * @param a DOM Rect a.\r\n * @param b DOM Rect b.\r\n * @param round Whether the values should be rounded.\r\n */\r\nexport const equalBCRWH = (a?: DOMRect, b?: DOMRect, round?: boolean) =>\r\n equal<DOMRect>(a, b, [strWidth, strHeight], round && ((value) => mathRound(value)));\r\n", "/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport { isNumber, isFunction } from './types';\r\nimport { from } from './array';\r\nimport { rAF, cAF, setT, clearT } from './alias';\r\n\r\ntype DebouncerFn = (task: () => void) => () => void;\r\n\r\nexport type DebounceTiming = { _debouncer: DebouncerFn } | number | false | null | undefined;\r\nexport type DebounceLeading = boolean | null | undefined;\r\n\r\nexport interface DebounceOptions<FunctionToDebounce extends (...args: any) => any> {\r\n /**\r\n * The timing for debouncing. If false, null or undefined, no debounce is applied.\r\n */\r\n _debounceTiming?: DebounceTiming | (() => DebounceTiming);\r\n /**\r\n * The timing which determines when the debounced will be called even when the debounce timing did not call it yet.\r\n */\r\n _maxDebounceTiming?: DebounceTiming | (() => DebounceTiming);\r\n /**\r\n * Defines the calling on the leading edge of the timeout.\r\n */\r\n _leading?: DebounceLeading | (() => DebounceLeading);\r\n /**\r\n * Function which merges parameters for each canceled debounce.\r\n * If parameters can't be merged the function will return null, otherwise it returns the merged parameters.\r\n */\r\n _mergeParams?: (\r\n prev: Parameters<FunctionToDebounce>,\r\n curr: Parameters<FunctionToDebounce>\r\n ) => Parameters<FunctionToDebounce> | false | null | undefined;\r\n}\r\n\r\nexport interface Debounced<FunctionToDebounce extends (...args: any) => any> {\r\n (...args: Parameters<FunctionToDebounce>): ReturnType<FunctionToDebounce>;\r\n _flush(): void;\r\n}\r\n\r\nexport const bind = <A extends any[], B extends any[], R>(\r\n fn: (...args: [...A, ...B]) => R,\r\n ...args: A\r\n): ((...args: B) => R) => fn.bind(0, ...args);\r\n\r\n/**\r\n * Creates a timeout and cleartimeout tuple. The timeout function always clears the previously created timeout before it runs.\r\n * @param timeout The timeout in ms. If no timeout (or 0) is passed requestAnimationFrame is used instead of setTimeout.\r\n * @returns A tuple with the timeout function as the first value and the clearTimeout function as the second value.\r\n */\r\nexport const selfClearTimeout = (timeout?: number | (() => number)) => {\r\n let id: number;\r\n const setTFn = timeout ? setT : rAF!;\r\n const clearTFn = timeout ? clearT : cAF!;\r\n return [\r\n (callback: () => any) => {\r\n clearTFn(id);\r\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\r\n // @ts-ignore\r\n id = setTFn(() => callback(), isFunction(timeout) ? timeout() : timeout);\r\n },\r\n () => clearTFn(id),\r\n ] as [timeout: (callback: () => any) => void, clear: () => void];\r\n};\r\n\r\nconst getDebouncer = (\r\n debounceTiming: DebounceTiming | (() => DebounceTiming)\r\n): DebouncerFn | false | null | undefined | void => {\r\n const debounceTimingResult = isFunction(debounceTiming) ? debounceTiming() : debounceTiming;\r\n if (isNumber(debounceTimingResult)) {\r\n const schedule = debounceTimingResult ? setT! : rAF!;\r\n const clear = debounceTimingResult ? clearT : cAF;\r\n return (task) => {\r\n const timeoutId = schedule!(\r\n () => task(),\r\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\r\n // @ts-ignore\r\n debounceTimingResult\r\n );\r\n return () => {\r\n clear!(timeoutId);\r\n };\r\n };\r\n }\r\n\r\n return debounceTimingResult && debounceTimingResult._debouncer;\r\n};\r\n\r\n/**\r\n * Debounces the given function either with a timeout or a animation frame.\r\n * @param functionToDebounce The function which shall be debounced.\r\n * @param options Options for debouncing.\r\n */\r\nexport const debounce = <FunctionToDebounce extends (...args: any) => any>(\r\n functionToDebounce: FunctionToDebounce,\r\n options?: DebounceOptions<FunctionToDebounce>\r\n): Debounced<FunctionToDebounce> => {\r\n const {\r\n _debounceTiming: _timeout,\r\n _maxDebounceTiming: _maxDelay,\r\n _leading,\r\n _mergeParams,\r\n } = options || {};\r\n let cancelMaxTimeoutDebouncer: (() => void) | undefined;\r\n let cancelTimeoutDebounder: (() => void) | undefined;\r\n let prevArguments: Parameters<FunctionToDebounce> | null | undefined;\r\n let leadingInvoked: boolean | undefined;\r\n\r\n const invokeFunctionToDebounce = function (args: Parameters<FunctionToDebounce>) {\r\n if (cancelTimeoutDebounder) {\r\n cancelTimeoutDebounder();\r\n }\r\n if (cancelMaxTimeoutDebouncer) {\r\n cancelMaxTimeoutDebouncer();\r\n }\r\n\r\n leadingInvoked = cancelTimeoutDebounder = cancelMaxTimeoutDebouncer = prevArguments = undefined;\r\n // eslint-disable-next-line\r\n // @ts-ignore\r\n functionToDebounce.apply(this, args);\r\n };\r\n\r\n const mergeParms = (\r\n curr: Parameters<FunctionToDebounce>\r\n ): Parameters<FunctionToDebounce> | false | null | undefined =>\r\n _mergeParams && prevArguments ? _mergeParams(prevArguments, curr) : curr;\r\n\r\n const flush = () => {\r\n /* istanbul ignore next */\r\n if (cancelTimeoutDebounder && prevArguments) {\r\n invokeFunctionToDebounce(mergeParms(prevArguments) || prevArguments);\r\n }\r\n };\r\n\r\n const debouncedFn = function () {\r\n // eslint-disable-next-line prefer-rest-params\r\n const args: Parameters<FunctionToDebounce> = from(arguments) as Parameters<FunctionToDebounce>;\r\n const timeoutDebouncer = getDebouncer(_timeout);\r\n\r\n if (timeoutDebouncer) {\r\n const leading = typeof _leading === 'function' ? _leading() : _leading;\r\n const maxDelayDebouncer = getDebouncer(_maxDelay);\r\n const mergeParamsResult = mergeParms(args);\r\n const invokedArgs = mergeParamsResult || args;\r\n const boundInvoke = invokeFunctionToDebounce.bind(0, invokedArgs);\r\n\r\n if (cancelTimeoutDebounder) {\r\n cancelTimeoutDebounder();\r\n }\r\n\r\n if (leading && !leadingInvoked) {\r\n boundInvoke();\r\n leadingInvoked = true;\r\n cancelTimeoutDebounder = timeoutDebouncer(() => (leadingInvoked = undefined));\r\n } else {\r\n cancelTimeoutDebounder = timeoutDebouncer(boundInvoke);\r\n\r\n if (maxDelayDebouncer && !cancelMaxTimeoutDebouncer) {\r\n cancelMaxTimeoutDebouncer = maxDelayDebouncer(flush);\r\n }\r\n }\r\n\r\n prevArguments = invokedArgs;\r\n } else {\r\n invokeFunctionToDebounce(args);\r\n }\r\n };\r\n debouncedFn._flush = flush;\r\n\r\n return debouncedFn as Debounced<FunctionToDebounce>;\r\n};\r\n", "/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport type { PlainObject } from '../../typings';\r\nimport { isArray, isFunction, isPlainObject, isNull } from './types';\r\nimport { each } from './array';\r\n\r\n/**\r\n * Determines whether the passed object has a property with the passed name.\r\n * @param obj The object.\r\n * @param prop The name of the property.\r\n */\r\nexport const hasOwnProperty = (obj: any, prop: string | number | symbol): boolean =>\r\n Object.prototype.hasOwnProperty.call(obj, prop);\r\n\r\n/**\r\n * Returns the names of the enumerable string properties and methods of an object.\r\n * @param obj The object of which the properties shall be returned.\r\n */\r\nexport const keys = (obj: any): Array<string> => (obj ? Object.keys(obj) : []);\r\n\r\ntype AssignDeep = {\r\n <T, U>(target: T, object1: U): T & U;\r\n <T, U, V>(target: T, object1: U, object2: V): T & U & V;\r\n <T, U, V, W>(target: T, object1: U, object2: V, object3: W): T & U & V & W;\r\n <T, U, V, W, X>(target: T, object1: U, object2: V, object3: W, object4: X): T & U & V & W & X;\r\n <T, U, V, W, X, Y>(\r\n target: T,\r\n object1: U,\r\n object2: V,\r\n object3: W,\r\n object4: X,\r\n object5: Y\r\n ): T & U & V & W & X & Y;\r\n <T, U, V, W, X, Y, Z>(\r\n target: T,\r\n object1?: U,\r\n object2?: V,\r\n object3?: W,\r\n object4?: X,\r\n object5?: Y,\r\n object6?: Z\r\n ): T & U & V & W & X & Y & Z;\r\n};\r\n\r\n// https://github.com/jquery/jquery/blob/master/src/core.js#L116\r\nexport const assignDeep: AssignDeep = <T, U, V, W, X, Y, Z>(\r\n target: T,\r\n object1?: U,\r\n object2?: V,\r\n object3?: W,\r\n object4?: X,\r\n object5?: Y,\r\n object6?: Z\r\n): T & U & V & W & X & Y & Z => {\r\n const sources: Array<any> = [object1, object2, object3, object4, object5, object6];\r\n\r\n // Handle case when target is a string or something (possible in deep copy)\r\n if ((typeof target !== 'object' || isNull(target)) && !isFunction(target)) {\r\n target = {} as T;\r\n }\r\n\r\n each(sources, (source) => {\r\n // Extend the base object\r\n each(source, (_, key) => {\r\n const copy: any = source[key];\r\n\r\n // Prevent Object.prototype pollution\r\n // Prevent never-ending loop\r\n if (target === copy) {\r\n return true;\r\n }\r\n\r\n const copyIsArray = isArray(copy);\r\n\r\n // Recurse if we're merging plain objects or arrays\r\n if (copy && isPlainObject(copy)) {\r\n const src = target[key as keyof T];\r\n let clone: any = src;\r\n\r\n // Ensure proper type for the source value\r\n if (copyIsArray && !isArray(src)) {\r\n clone = [];\r\n } else if (!copyIsArray && !isPlainObject(src)) {\r\n clone = {};\r\n }\r\n\r\n // Never move original objects, clone them\r\n target[key as keyof T] = assignDeep(clone, copy) as any;\r\n } else {\r\n target[key as keyof T] = copyIsArray ? copy.slice() : copy;\r\n }\r\n });\r\n });\r\n\r\n // Return the modified object\r\n return target as any;\r\n};\r\n\r\nexport const removeUndefinedProperties = <T extends PlainObject>(target: T, deep?: boolean): T =>\r\n each(assignDeep({}, target), (value, key, copy) => {\r\n if (value === undefined) {\r\n delete copy[key];\r\n } else if (deep && value && isPlainObject(value)) {\r\n copy[key as keyof typeof copy] = removeUndefinedProperties(value, deep) as any;\r\n }\r\n });\r\n\r\n/**\r\n * Returns true if the given object is empty, false otherwise.\r\n * @param obj The Object.\r\n */\r\nexport const isEmptyObject = (obj: any): boolean => !keys(obj).length;\r\n", "export const noop = () => {};\r\n", "import { mathMax, mathMin } from './alias';\r\n\r\n/**\r\n * Caps the passed number between the `min` and `max` bounds.\r\n * @param min The min bound.\r\n * @param max The max bound.\r\n * @param number The number to be capped.\r\n * @returns The capped number between min and max.\r\n */\r\nexport const capNumber = (min: number, max: number, number: number) =>\r\n mathMax(min, mathMin(max, number));\r\n", "import type { HTMLElementTarget } from './types';\r\nimport { bind, deduplicateArray, each, from, isArray } from '../utils';\r\n\r\nexport type AttributeElementTarget = HTMLElementTarget | Element;\r\n\r\nexport type DomTokens = string | string[] | false | null | undefined | void;\r\n\r\nexport const getDomTokensArray = (tokens: DomTokens) =>\r\n deduplicateArray((isArray(tokens) ? tokens : (tokens || '').split(' ')).filter((token) => token));\r\n\r\n/**\r\n * Gets a attribute with the given attribute of the given element.\r\n * @param elm The element of which the attribute shall be get.\r\n * @param attrName The attribute name which shall be get.\r\n * @returns The attribute value or `null` when the attribute is not set or `false` if the element is undefined.\r\n */\r\nexport const getAttr = (elm: AttributeElementTarget, attrName: string) =>\r\n elm && elm.getAttribute(attrName);\r\n\r\n/**\r\n * Returns whether the given attribute exists on the given element.\r\n * @param elm The element.\r\n * @param attrName The attribute.\r\n * @returns A Truthy value indicates a present attrubte.\r\n */\r\nexport const hasAttr = (elm: AttributeElementTarget, attrName: string) =>\r\n elm && elm.hasAttribute(attrName);\r\n\r\n/**\r\n * Sets the given attributes to the given element.\r\n * @param elm The element of which the attributes shall be removed.\r\n * @param attrName The attribute names separated by a space.\r\n */\r\nexport const setAttrs = (\r\n elm: AttributeElementTarget,\r\n attrNames: string | string[],\r\n value: string | number | false | null | undefined\r\n) => {\r\n each(getDomTokensArray(attrNames), (attrName) => {\r\n if (elm) {\r\n elm.setAttribute(attrName, String(value || ''));\r\n }\r\n });\r\n};\r\n\r\n/**\r\n * Removes the given attributes from the given element.\r\n * @param elm The element of which the attribute shall be removed.\r\n * @param attrName The attribute names separated by a space.\r\n */\r\nexport const removeAttrs = (elm: AttributeElementTarget, attrNames: string | string[]): void => {\r\n each(getDomTokensArray(attrNames), (attrName) => elm && elm.removeAttribute(attrName));\r\n};\r\n\r\nexport const domTokenListAttr = (elm: AttributeElementTarget, attrName: string) => {\r\n const initialArr = getDomTokensArray(getAttr(elm, attrName));\r\n const setElmAttr = bind(setAttrs, elm, attrName);\r\n const domTokenListOperation = (operationTokens: DomTokens, operation: 'add' | 'delete') => {\r\n const initialArrSet = new Set(initialArr);\r\n each(getDomTokensArray(operationTokens), (token) => {\r\n initialArrSet[operation](token);\r\n });\r\n return from(initialArrSet).join(' ');\r\n };\r\n\r\n return {\r\n _remove: (removeTokens: DomTokens) => setElmAttr(domTokenListOperation(removeTokens, 'delete')),\r\n _add: (addTokens: DomTokens) => setElmAttr(domTokenListOperation(addTokens, 'add')),\r\n _has: (hasTokens: DomTokens) => {\r\n const tokenSet = getDomTokensArray(hasTokens);\r\n return tokenSet.reduce(\r\n (boolean, token) => boolean && initialArr.includes(token),\r\n tokenSet.length > 0\r\n );\r\n },\r\n };\r\n};\r\n\r\n/**\r\n * Treats the given attribute like the \"class\" attribute and removes the given value from it.\r\n * @param elm The element.\r\n * @param attrName The attributeName to which the value shall be removed.\r\n * @param value The value which shall be removed.\r\n */\r\nexport const removeAttrClass = (\r\n elm: AttributeElementTarget,\r\n attrName: string,\r\n value: DomTokens\r\n): (() => void) => {\r\n domTokenListAttr(elm, attrName)._remove(value);\r\n return bind(addAttrClass, elm, attrName, value);\r\n};\r\n\r\n/**\r\n * Treats the given attribute like the \"class\" attribute and adds value to it.\r\n * @param elm The element.\r\n * @param attrName The attributeName to which the value shall be added.\r\n * @param value The value which shall be added.\r\n */\r\nexport const addAttrClass = (\r\n elm: AttributeElementTarget,\r\n attrName: string,\r\n value: DomTokens\r\n): (() => void) => {\r\n domTokenListAttr(elm, attrName)._add(value);\r\n return bind(removeAttrClass, elm, attrName, value);\r\n};\r\n\r\nexport const addRemoveAttrClass = (\r\n elm: AttributeElementTarget,\r\n attrName: string,\r\n value: DomTokens,\r\n add?: boolean\r\n) => (add ? addAttrClass : removeAttrClass)(elm, attrName, value);\r\n\r\n/**\r\n * Treats the given attribute like the \"class\" attribute and checks if the given value is in it.\r\n * @param elm The element.\r\n * @param attrName The attributeName from which the content shall be checked.\r\n * @param value The value.\r\n * @returns True if the given attribute has the value in it, false otherwise.\r\n */\r\nexport const hasAttrClass = (\r\n elm: AttributeElementTarget,\r\n attrName: string,\r\n value: DomTokens\r\n): boolean => domTokenListAttr(elm, attrName)._has(value);\r\n", "import type { AttributeElementTarget, DomTokens } from './attribute';\r\nimport { each, from } from '../utils/array';\r\nimport { bind } from '../utils/function';\r\nimport { domTokenListAttr } from './attribute';\r\n\r\nconst createDomTokenListClass = (elm: AttributeElementTarget) => domTokenListAttr(elm, 'class');\r\n\r\n/**\r\n * Check whether the given element has the given class name(s).\r\n * @param elm The element.\r\n * @param className The class name(s).\r\n */\r\nexport const hasClass = (elm: AttributeElementTarget, className: DomTokens): boolean =>\r\n createDomTokenListClass(elm)._has(className);\r\n\r\n/**\r\n * Removes the given class name(s) from the given element.\r\n * @param elm The element.\r\n * @param className The class name(s) which shall be removed. (separated by spaces)\r\n */\r\nexport const removeClass = (elm: AttributeElementTarget, className: DomTokens): void => {\r\n createDomTokenListClass(elm)._remove(className);\r\n};\r\n\r\n/**\r\n * Adds the given class name(s) to the given element.\r\n * @param elm The element.\r\n * @param className The class name(s) which shall be added. (separated by spaces)\r\n * @returns A function which removes the added class name(s).\r\n */\r\nexport const addClass = (elm: AttributeElementTarget, className: DomTokens): (() => void) => {\r\n createDomTokenListClass(elm)._add(className);\r\n return bind(removeClass, elm, className);\r\n};\r\n\r\n/**\r\n * Takes two className strings, compares them and returns the difference as array.\r\n * @param classNameA ClassName A.\r\n * @param classNameB ClassName B.\r\n */\r\nexport const diffClass = (\r\n classNameA: string | false | null | undefined,\r\n classNameB: string | false | null | undefined\r\n) => {\r\n const set = new Set<string>(classNameA ? classNameA.split(' ') : []);\r\n\r\n each(classNameB ? classNameB.split(' ') : [], (className) => {\r\n set[set.has(className) ? 'delete' : 'add'](className);\r\n });\r\n\r\n return from(set);\r\n};\r\n", "import type { NodeElementTarget } from './types';\r\nimport { isElement } from '../utils/types';\r\nimport { push, from } from '../utils/array';\r\n\r\n/**\r\n * Find all elements with the passed selector, outgoing (and including) the passed element or the document if no element was provided.\r\n * @param selector The selector which has to be searched by.\r\n * @param elm The element from which the search shall be outgoing.\r\n */\r\nexport const find = (selector: string, elm?: NodeElementTarget): Element[] => {\r\n const rootElm = elm ? isElement(elm) && elm : document;\r\n return rootElm ? from(rootElm.querySelectorAll(selector)) : [];\r\n};\r\n\r\n/**\r\n * Find the first element with the passed selector, outgoing (and including) the passed element or the document if no element was provided.\r\n * @param selector The selector which has to be searched by.\r\n * @param elm The element from which the search shall be outgoing.\r\n */\r\nexport const findFirst = (selector: string, elm?: NodeElementTarget): NodeElementTarget => {\r\n const rootElm = elm ? isElement(elm) && elm : document;\r\n return rootElm && rootElm.querySelector(selector);\r\n};\r\n\r\n/**\r\n * Determines whether the passed element is matching with the passed selector.\r\n * @param elm The element which has to be compared with the passed selector.\r\n * @param selector The selector which has to be compared with the passed element. Additional selectors: ':visible' and ':hidden'.\r\n */\r\nexport const is = (elm: NodeElementTarget, selector: string): boolean =>\r\n isElement(elm) && elm.matches(selector);\r\n\r\nexport const isBodyElement = (elm: NodeElementTarget) => is(elm, 'body'); // don't do targetElement === ownerDocument.body in case initialization happens in memory\r\n\r\n/**\r\n * Returns the children (no text-nodes or comments) of the passed element which are matching the passed selector. An empty array is returned if the passed element is null.\r\n * @param elm The element of which the children shall be returned.\r\n * @param selector The selector which must match with the children elements.\r\n */\r\nexport const children = (elm: NodeElementTarget, selector?: string): ReadonlyArray<Element> => {\r\n const childs: Array<Element> = [];\r\n\r\n return isElement(elm)\r\n ? push(\r\n childs,\r\n from(elm.children).filter((child) => (selector ? is(child, selector) : child))\r\n )\r\n : childs;\r\n};\r\n\r\n/**\r\n * Returns the childNodes (incl. text-nodes or comments etc.) of the passed element. An empty array is returned if the passed element is null.\r\n * @param elm The element of which the childNodes shall be returned.\r\n */\r\nexport const contents = (elm: NodeElementTarget): ReadonlyArray<ChildNode> =>\r\n elm ? from(elm.childNodes) : [];\r\n\r\n/**\r\n * Returns the parent element of the passed element, or null if the passed element is null.\r\n * @param elm The element of which the parent element shall be returned.\r\n */\r\nexport const parent = (elm: NodeElementTarget): NodeElementTarget => elm && elm.parentElement;\r\n\r\n/**\r\n * Returns the closest element to the passed element which matches the given selector.\r\n * @param elm The element.\r\n * @param selector The selector.\r\n * @returns The closest element to the passed element which matches the given selector.\r\n */\r\nexport const closest = (elm: NodeElementTarget, selector: string): NodeElementTarget =>\r\n isElement(elm) && elm.closest(selector);\r\n\r\n/**\r\n * Gets the focused element of the passed or default document.\r\n * @returns The focused element of the passed document.\r\n */\r\nexport const getFocusedElement = (doc?: Document) => (doc || document).activeElement;\r\n\r\n/**\r\n * Determines whether the given element lies between two selectors in the DOM.\r\n * @param elm The element.\r\n * @param highBoundarySelector The high boundary selector.\r\n * @param deepBoundarySelector The deep boundary selector.\r\n */\r\nexport const liesBetween = (\r\n elm: NodeElementTarget,\r\n highBoundarySelector: string,\r\n deepBoundarySelector: string\r\n): boolean => {\r\n const closestHighBoundaryElm = closest(elm, highBoundarySelector);\r\n const closestDeepBoundaryElm = elm && findFirst(deepBoundarySelector, closestHighBoundaryElm);\r\n const deepBoundaryIsValid =\r\n closest(closestDeepBoundaryElm, highBoundarySelector) === closestHighBoundaryElm;\r\n\r\n return closestHighBoundaryElm && closestDeepBoundaryElm\r\n ? closestHighBoundaryElm === elm ||\r\n closestDeepBoundaryElm === elm ||\r\n (deepBoundaryIsValid &&\r\n closest(closest(elm, deepBoundarySelector), highBoundarySelector) !==\r\n closestHighBoundaryElm)\r\n : false;\r\n};\r\n", "import type { NodeElementTarget, NodeElementTargetCollection } from './types';\r\nimport { createOrKeepArray, each } from '../utils/array';\r\nimport { parent } from './traversal';\r\nimport { bind } from '../utils';\r\n\r\n/**\r\n * Removes the given Nodes from their parent.\r\n * @param nodes The Nodes which shall be removed.\r\n */\r\nexport const removeElements = (nodes: NodeElementTargetCollection): void => {\r\n each(createOrKeepArray(nodes), (node) => {\r\n const parentElm = parent(node);\r\n if (node && parentElm) {\r\n parentElm.removeChild(node);\r\n }\r\n });\r\n};\r\n\r\n/**\r\n * Appends the given children at the end of the given Node.\r\n * @param node The Node to which the children shall be appended.\r\n * @param children The Nodes which shall be appended.\r\n * @returns A function which removes the inserted nodes.\r\n */\r\nexport const appendChildren = (node: NodeElementTarget, children: NodeElementTargetCollection) =>\r\n bind(\r\n removeElements,\r\n node &&\r\n children &&\r\n each(createOrKeepArray(children), (child) => {\r\n if (child) {\r\n node.appendChild(child);\r\n }\r\n })\r\n );\r\n", "// at the time of implementation TypeScript doesn't offer any TrustedTypes typescript definitions\r\n// https://github.com/microsoft/TypeScript/issues/30024\r\nlet trustedTypePolicy: unknown | undefined;\r\n\r\nexport const getTrustedTypePolicy = () => trustedTypePolicy;\r\nexport const setTrustedTypePolicy = (newTrustedTypePolicy: unknown | undefined) => {\r\n trustedTypePolicy = newTrustedTypePolicy;\r\n};\r\n", "import { each } from '../utils/array';\r\nimport { setAttrs } from './attribute';\r\nimport { contents } from './traversal';\r\nimport { removeElements } from './manipulation';\r\nimport { getTrustedTypePolicy } from '../../trustedTypePolicy';\r\n\r\n/**\r\n * Creates a div DOM node.\r\n */\r\nexport const createDiv = (classNames?: string): HTMLDivElement => {\r\n const div = document.createElement('div');\r\n setAttrs(div, 'class', classNames);\r\n return div;\r\n};\r\n\r\n/**\r\n * Creates DOM nodes modeled after the passed html string and returns the root dom nodes as a array.\r\n * @param html The html string after which the DOM nodes shall be created.\r\n */\r\nexport const createDOM = (html: string): ReadonlyArray<Node> => {\r\n const createdDiv = createDiv();\r\n const trustedTypesPolicy = getTrustedTypePolicy();\r\n const trimmedHtml = html.trim();\r\n createdDiv.innerHTML = trustedTypesPolicy\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (trustedTypesPolicy as any).createHTML(trimmedHtml)\r\n : trimmedHtml;\r\n\r\n return each(contents(createdDiv), (elm) => removeElements(elm));\r\n};\r\n", "import type { PlainObject, StyleObject, StyleObjectKey, StyleObjectValue } from '../../typings';\r\nimport type { XY } from './offset';\r\nimport type { HTMLElementTarget } from './types';\r\nimport { wnd } from '../utils/alias';\r\nimport { each, from } from '../utils/array';\r\nimport { isString, isNumber, isObject, isNull, isBoolean } from '../utils/types';\r\n\r\nexport interface TRBL {\r\n t: number;\r\n r: number;\r\n b: number;\r\n l: number;\r\n}\r\n\r\nconst getCSSVal = (computedStyle: CSSStyleDeclaration, prop: StyleObjectKey): string =>\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n computedStyle.getPropertyValue(prop) || computedStyle[prop as any] || '';\r\n\r\nconst validFiniteNumber = (number: number) => {\r\n const notNaN = number || 0;\r\n return isFinite(notNaN) ? notNaN : 0;\r\n};\r\n\r\nconst parseToZeroOrNumber = (value?: string): number => validFiniteNumber(parseFloat(value || ''));\r\n\r\nexport const roundCssNumber = (value: number) => Math.round(value * 10000) / 10000;\r\n\r\nexport const ratioToCssPercent = (ratio: number) =>\r\n `${roundCssNumber(validFiniteNumber(ratio) * 100)}%`;\r\n\r\nexport const numberToCssPx = (number: number) => `${roundCssNumber(validFiniteNumber(number))}px`;\r\n\r\nexport function setStyles(\r\n elm: HTMLElementTarget,\r\n styles: StyleObject | false | null | undefined\r\n): void {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\r\n elm &&\r\n styles &&\r\n each(styles, (rawValue: StyleObjectValue, name) => {\r\n try {\r\n const elmStyle = elm.style;\r\n const value =\r\n isNull(rawValue) || isBoolean(rawValue)\r\n ? ''\r\n : isNumber(rawValue)\r\n ? numberToCssPx(rawValue)\r\n : rawValue;\r\n\r\n if (name.indexOf('--') === 0) {\r\n elmStyle.setProperty(name, value);\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n elmStyle[name as any] = value;\r\n }\r\n // eslint-disable-next-line no-empty\r\n } catch {}\r\n });\r\n}\r\n\r\nexport function getStyles(\r\n elm: HTMLElementTarget,\r\n styles: Array<StyleObjectKey> | ReadonlyArray<StyleObjectKey>,\r\n pseudoElm?: string | null | undefined\r\n): Partial<Record<StyleObjectKey, string>>;\r\nexport function getStyles(\r\n elm: HTMLElementTarget,\r\n styles: StyleObjectKey,\r\n pseudoElm?: string | null | undefined\r\n): string;\r\nexport function getStyles(\r\n elm: HTMLElementTarget,\r\n styles: Array<StyleObjectKey> | ReadonlyArray<StyleObjectKey> | StyleObjectKey,\r\n pseudoElm?: string | null | undefined\r\n): Partial<Record<StyleObjectKey, string>> | string {\r\n const getSingleStyle = isString(styles);\r\n let getStylesResult: string | PlainObject = getSingleStyle ? '' : {};\r\n\r\n if (elm) {\r\n const computedStyle = wnd.getComputedStyle(elm, pseudoElm) || elm.style;\r\n getStylesResult = getSingleStyle\r\n ? getCSSVal(computedStyle, styles)\r\n : from(styles).reduce((result, key) => {\r\n result[key] = getCSSVal(computedStyle, key);\r\n return result;\r\n }, getStylesResult as PlainObject);\r\n }\r\n return getStylesResult;\r\n}\r\n\r\n/**\r\n * Returns the top right bottom left values of the passed css property.\r\n * @param elm The element of which the values shall be returned.\r\n * @param propertyPrefix The css property prefix. (e.g. \"border\")\r\n * @param propertySuffix The css property suffix. (e.g. \"width\")\r\n */\r\nexport const topRightBottomLeft = (\r\n elm?: HTMLElementTarget,\r\n propertyPrefix?: string,\r\n propertySuffix?: string\r\n): TRBL => {\r\n const finalPrefix = propertyPrefix ? `${propertyPrefix}-` : '';\r\n const finalSuffix = propertySuffix ? `-${propertySuffix}` : '';\r\n const top = `${finalPrefix}top${finalSuffix}` as StyleObjectKey;\r\n const right = `${finalPrefix}right${finalSuffix}` as StyleObjectKey;\r\n const bottom = `${finalPrefix}bottom${finalSuffix}` as StyleObjectKey;\r\n const left = `${finalPrefix}left${finalSuffix}` as StyleObjectKey;\r\n const result = getStyles(elm, [top, right, bottom, left]);\r\n return {\r\n t: parseToZeroOrNumber(result[top]),\r\n r: parseToZeroOrNumber(result[right]),\r\n b: parseToZeroOrNumber(result[bottom]),\r\n l: parseToZeroOrNumber(result[left]),\r\n };\r\n};\r\n\r\nexport const getTrasformTranslateValue = (\r\n value: string | number | XY<string | number>,\r\n isHorizontal?: boolean\r\n) =>\r\n `translate${\r\n isObject(value) ? `(${value.x},${value.y})` : `${isHorizontal ? 'X' : 'Y'}(${value})`\r\n }`;\r\n", "import type { HTMLElementTarget } from './types';\r\nimport { getStyles } from './style';\r\nimport { mathRound, wnd } from '../utils/alias';\r\nimport { bind } from '../utils/function';\r\nimport { strHeight, strWidth } from '../utils/strings';\r\n\r\nexport interface WH<T = number> {\r\n w: T;\r\n h: T;\r\n}\r\n\r\nconst elementHasDimensions = (elm: HTMLElement): boolean =>\r\n !!(elm.offsetWidth || elm.offsetHeight || elm.getClientRects().length);\r\nconst zeroObj: WH = {\r\n w: 0,\r\n h: 0,\r\n};\r\n\r\nconst getElmWidthHeightProperty = <E extends HTMLElement | Window>(\r\n property: E extends HTMLElement ? 'client' | 'offset' | 'scroll' : 'inner',\r\n elm: E | false | null | undefined\r\n): Readonly<WH> =>\r\n elm\r\n ? {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n w: (elm as any)[`${property}Width`],\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n h: (elm as any)[`${property}Height`],\r\n }\r\n : zeroObj;\r\n\r\n/**\r\n * Returns the window inner- width and height.\r\n */\r\nexport const getWindowSize = (customWnd?: Window): Readonly<WH> =>\r\n getElmWidthHeightProperty('inner', customWnd || wnd);\r\n\r\n/**\r\n * Returns the scroll- width and height of the passed element. If the element is null the width and height values are 0.\r\n * @param elm The element of which the scroll- width and height shall be returned.\r\n */\r\nexport const getOffsetSize = bind(getElmWidthHeightProperty<HTMLElement>, 'offset') satisfies (\r\n elm: HTMLElementTarget\r\n) => Readonly<WH>;\r\n\r\n/**\r\n * Returns the client- width and height of the passed element. If the element is null the width and height values are 0.\r\n * @param elm The element of which the client- width and height shall be returned.\r\n */\r\nexport const getClientSize = bind(getElmWidthHeightProperty<HTMLElement>, 'client') satisfies (\r\n elm: HTMLElementTarget\r\n) => Readonly<WH>;\r\n\r\n/**\r\n * Returns the client- width and height of the passed element. If the element is null the width and height values are 0.\r\n * @param elm The element of which the client- width and height shall be returned.\r\n */\r\nexport const getScrollSize = bind(getElmWidthHeightProperty<HTMLElement>, 'scroll') satisfies (\r\n elm: HTMLElementTarget\r\n) => Readonly<WH>;\r\n\r\n/**\r\n * Returns the fractional- width and height of the passed element. If the element is null the width and height values are 0.\r\n * @param elm The element of which the fractional- width and height shall be returned.\r\n */\r\nexport const getFractionalSize = (elm: HTMLElementTarget): Readonly<WH> => {\r\n const cssWidth = parseFloat(getStyles(elm, strWidth)) || 0;\r\n const cssHeight = parseFloat(getStyles(elm, strHeight)) || 0;\r\n return {\r\n w: cssWidth - mathRound(cssWidth),\r\n h: cssHeight - mathRound(cssHeight),\r\n };\r\n};\r\n\r\n/**\r\n * Returns the BoundingClientRect of the passed element.\r\n * @param elm The element of which the BoundingClientRect shall be returned.\r\n */\r\nexport const getBoundingClientRect = (elm: HTMLElement): DOMRect => elm.getBoundingClientRect();\r\n\r\n/**\r\n * Determines whether the passed element has any dimensions.\r\n * @param elm The element.\r\n */\r\nexport const hasDimensions = (elm: HTMLElementTarget): boolean =>\r\n !!elm && elementHasDimensions(elm);\r\n\r\n/**\r\n * Determines whether the passed DOM Rect has any dimensions.\r\n */\r\nexport const domRectHasDimensions = (rect?: DOMRectReadOnly | false | null) =>\r\n !!(rect && (rect[strHeight] || rect[strWidth]));\r\n\r\n/**\r\n * Determines whether current DOM Rect has appeared according the the previous dom rect..\r\n * @param currContentRect The current DOM Rect.\r\n * @param prevContentRect The previous DOM Rect.\r\n * @returns Whether the dom rect appeared.\r\n */\r\nexport const domRectAppeared = (\r\n currContentRect: DOMRectReadOnly | false | null | undefined,\r\n prevContentRect: DOMRectReadOnly | false | null | undefined\r\n) => {\r\n const rectHasDimensions = domRectHasDimensions(currContentRect);\r\n const rectHadDimensions = domRectHasDimensions(prevContentRect);\r\n return !rectHadDimensions && rectHasDimensions;\r\n};\r\n", "/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport type { DomTokens } from './attribute';\r\nimport { each, runEachAndClear } from '../utils/array';\r\nimport { bind } from '../utils/function';\r\nimport { keys } from '../utils';\r\nimport { getDomTokensArray } from './attribute';\r\n\r\nexport interface EventListenerOptions {\r\n _capture?: boolean;\r\n _passive?: boolean;\r\n _once?: boolean;\r\n}\r\n\r\nexport type EventListenerTarget = EventTarget | false | null | undefined;\r\n\r\nexport type EventListenerMap = {\r\n [eventNames: string]: ((event: any) => any) | false | null | undefined;\r\n};\r\n\r\n/**\r\n * Removes the passed event listener for the passed event names with the passed options.\r\n * @param target The element from which the listener shall be removed.\r\n * @param eventNames The eventsnames for which the listener shall be removed.\r\n * @param listener The listener which shall be removed.\r\n * @param capture The options of the removed listener.\r\n */\r\nexport const removeEventListener = <T extends Event = Event>(\r\n target: EventListenerTarget,\r\n eventNames: DomTokens,\r\n listener: (event: T) => any,\r\n capture?: boolean\r\n): void => {\r\n each(getDomTokensArray(eventNames), (eventName) => {\r\n if (target) {\r\n target.removeEventListener(eventName, listener as EventListener, capture);\r\n }\r\n });\r\n};\r\n\r\n/**\r\n * Adds the passed event listener for the passed event names with the passed options.\r\n * @param target The element to which the listener shall be added.\r\n * @param eventNames The eventsnames for which the listener shall be called.\r\n * @param listener The listener which is called on the eventnames.\r\n * @param options The options of the added listener.\r\n */\r\nexport const addEventListener = <T extends Event = Event>(\r\n target: EventListenerTarget,\r\n eventNames: DomTokens,\r\n listener: ((event: T) => any) | false | null | undefined,\r\n options?: EventListenerOptions\r\n): (() => void) => {\r\n const passive = (options && options._passive) ?? true;\r\n const capture = (options && options._capture) || false;\r\n const once = (options && options._once) || false;\r\n const nativeOptions: AddEventListenerOptions = {\r\n passive,\r\n capture,\r\n };\r\n\r\n return bind(\r\n runEachAndClear,\r\n getDomTokensArray(eventNames).map((eventName) => {\r\n const finalListener = (\r\n once\r\n ? (evt: T) => {\r\n removeEventListener(target, eventName, finalListener, capture);\r\n if (listener) {\r\n listener(evt);\r\n }\r\n }\r\n : listener\r\n ) as EventListener;\r\n\r\n if (target) {\r\n target.addEventListener(eventName, finalListener, nativeOptions);\r\n }\r\n\r\n return bind(removeEventListener, target, eventName, finalListener, capture);\r\n })\r\n );\r\n};\r\n\r\n/**\r\n * Adds the passed event listeners for the passed event names with the passed options.\r\n * @param target The element to which the listener shall be added.\r\n * @param eventListenerMap A map which descirbes the event names and event listeners to be added.\r\n * @param options The options of the added listeners.\r\n */\r\nexport const addEventListeners = (\r\n target: EventListenerTarget,\r\n eventListenerMap: EventListenerMap,\r\n options?: EventListenerOptions\r\n): (() => void) =>\r\n bind(\r\n runEachAndClear,\r\n keys(eventListenerMap).map((eventNames) =>\r\n addEventListener(target, eventNames, eventListenerMap[eventNames], options)\r\n )\r\n );\r\n\r\n/**\r\n * Shorthand for the stopPropagation event Method.\r\n * @param evt The event of which the stopPropagation method shall be called.\r\n */\r\nexport const stopPropagation = (evt: Event): void => evt.stopPropagation();\r\n\r\n/**\r\n * Shorthand for the preventDefault event Method.\r\n * @param evt The event of which the preventDefault method shall be called.\r\n */\r\nexport const preventDefault = (evt: Event): void => evt.preventDefault();\r\n\r\n/**\r\n * Shorthand for the stopPropagation and preventDefault event Method.\r\n * @param evt The event of which the stopPropagation and preventDefault methods shall be called.\r\n */\r\nexport const stopAndPrevent = (evt: Event): void =>\r\n (stopPropagation(evt) as undefined) || (preventDefault(evt) as undefined);\r\n", "import type { XY } from './offset';\r\nimport type { WH } from './dimensions';\r\nimport { capNumber, isNumber, mathAbs, mathSign } from '../utils';\r\n\r\nexport interface ScrollCoordinates {\r\n /** The start (origin) scroll coordinates for each axis. */\r\n _start: XY<number>;\r\n /** The end scroll coordinates for each axis. */\r\n _end: XY<number>;\r\n}\r\n\r\n/**\r\n * Scroll the passed element to the passed position.\r\n * @param elm The element to be scrolled.\r\n * @param position The scroll position.\r\n */\r\nexport const scrollElementTo = (\r\n elm: HTMLElement,\r\n position: Partial<XY<number | false | null | undefined>> | number | false | null | undefined\r\n): void => {\r\n const { x, y } = isNumber(position) ? { x: position, y: position } : position || {};\r\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\r\n isNumber(x) && (elm.scrollLeft = x);\r\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\r\n isNumber(y) && (elm.scrollTop = y);\r\n};\r\n\r\n/**\r\n * Scroll the passed element to the passed position.\r\n * @param elm The element to be scrolled.\r\n * @param position The scroll position.\r\n */\r\nexport const getElementScroll = (elm: HTMLElement): Readonly<XY> => ({\r\n x: elm.scrollLeft,\r\n y: elm.scrollTop,\r\n});\r\n\r\n/**\r\n * Scroll Coordinates which are 0.\r\n */\r\nexport const getZeroScrollCoordinates = (): ScrollCoordinates => ({\r\n _start: { x: 0, y: 0 },\r\n _end: { x: 0, y: 0 },\r\n});\r\n\r\n/**\r\n * Sanatizes raw scroll coordinates.\r\n * The passed `overflowAmount` is used as the \"max\" value for each axis if the sign of the raw max value is not `0`.\r\n * Makes sure that each axis has `0` either in the start or end coordinates.\r\n * @param rawScrollCoordinates The raw scroll coordinates.\r\n * @param overflowAmount The overflow amount.\r\n * @returns\r\n */\r\nexport const sanitizeScrollCoordinates = (\r\n rawScrollCoordinates: ScrollCoordinates,\r\n overflowAmount: WH<number>\r\n) => {\r\n const { _start, _end } = rawScrollCoordinates;\r\n const { w, h } = overflowAmount;\r\n const sanitizeAxis = (start: number, end: number, amount: number) => {\r\n let newStart = mathSign(start) * amount;\r\n let newEnd = mathSign(end) * amount;\r\n\r\n if (newStart === newEnd) {\r\n const startAbs = mathAbs(start);\r\n const endAbs = mathAbs(end);\r\n\r\n newEnd = startAbs > endAbs ? 0 : newEnd;\r\n newStart = startAbs < endAbs ? 0 : newStart;\r\n }\r\n\r\n // in doubt set start to 0\r\n newStart = newStart === newEnd ? 0 : newStart;\r\n\r\n return [newStart + 0, newEnd + 0] as const; // \"+ 0\" prevents \"-0\" to be in the result\r\n };\r\n\r\n const [startX, endX] = sanitizeAxis(_start.x, _end.x, w);\r\n const [startY, endY] = sanitizeAxis(_start.y, _end.y, h);\r\n\r\n return {\r\n _start: {\r\n x: startX,\r\n y: startY,\r\n },\r\n _end: {\r\n x: endX,\r\n y: endY,\r\n },\r\n };\r\n};\r\n\r\n/**\r\n * Returns whether the passed scroll coordinates represent the browsers default scroll direction.\r\n * For the default scroll direction the following must be true:\r\n * 1. Start value is `0`.\r\n * 2. End value <= Start value.\r\n * @param scrollCoordinates The scroll coordinates.\r\n */\r\nexport const isDefaultDirectionScrollCoordinates = ({\r\n _start,\r\n _end,\r\n}: ScrollCoordinates): XY<boolean> => {\r\n const getAxis = (start: number, end: number) => start === 0 && start <= end;\r\n\r\n return {\r\n x: getAxis(_start.x, _end.x),\r\n y: getAxis(_start.y, _end.y),\r\n };\r\n};\r\n\r\n/**\r\n * Gets the current scroll percent between 0..1 for each axis.\r\n * @param scrollCoordinates The scroll coordinates.\r\n * @param currentScroll The current scroll position of the element.\r\n */\r\nexport const getScrollCoordinatesPercent = (\r\n { _start, _end }: ScrollCoordinates,\r\n currentScroll: XY<number>\r\n) => {\r\n const getAxis = (start: number, end: number, current: number) =>\r\n capNumber(0, 1, (start - current) / (start - end) || 0);\r\n\r\n return {\r\n x: getAxis(_start.x, _end.x, currentScroll.x),\r\n y: getAxis(_start.y, _end.y, currentScroll.y),\r\n };\r\n};\r\n\r\n/**\r\n * Gets the scroll position of the given percent.\r\n * @param scrollCoordinates The scroll coordinates.\r\n * @param percent The percentage of the scroll.\r\n */\r\nexport const getScrollCoordinatesPosition = (\r\n { _start, _end }: ScrollCoordinates,\r\n percent: XY<number>\r\n) => {\r\n const getAxis = (start: number, end: number, p: number) => start + (end - start) * p;\r\n\r\n return {\r\n x: getAxis(_start.x, _end.x, percent.x),\r\n y: getAxis(_start.y, _end.y, percent.y),\r\n };\r\n};\r\n", "import type { NodeElementTarget } from './types';\r\n// import { getAttr, removeAttrs, setAttrs } from './attribute';\r\n\r\nexport const focusElement = (element: NodeElementTarget /*, forceTabIndex?: boolean*/) => {\r\n if (element && (element as HTMLElement).focus) {\r\n // const tabIndexStr = 'tabindex';\r\n // const originalTabIndex = getAttr(element as HTMLElement, tabIndexStr);\r\n // if (forceTabIndex) {\r\n // setAttrs(element as HTMLElement, tabIndexStr, '-1');\r\n // }\r\n\r\n (element as HTMLElement).focus({\r\n preventScroll: true,\r\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\r\n // @ts-ignore\r\n focusVisible: false,\r\n });\r\n\r\n // if (forceTabIndex) {\r\n // if (originalTabIndex) {\r\n // setAttrs(element as HTMLElement, tabIndexStr, originalTabIndex);\r\n // } else {\r\n // removeAttrs(element as HTMLElement, tabIndexStr);\r\n // }\r\n // }\r\n }\r\n};\r\n", "/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport { isBoolean, isFunction, isString } from './utils/types';\r\nimport { keys } from './utils/object';\r\nimport { each, push, from, isEmptyArray, runEachAndClear, createOrKeepArray } from './utils/array';\r\nimport { bind } from './utils/function';\r\n\r\nexport type EventListener<EventArgs extends Record<string, any[]>, N extends keyof EventArgs> = (\r\n ...args: EventArgs[N]\r\n) => void;\r\n\r\nexport type EventListeners<EventArgs extends Record<string, any[]>> = {\r\n [K in keyof EventArgs]?: EventListener<EventArgs, K> | EventListener<EventArgs, K>[] | null;\r\n};\r\n\r\nexport type RemoveEvent<EventArgs extends Record<string, any[]>> = {\r\n <N extends keyof EventArgs>(name?: N, listener?: EventListener<EventArgs, N>): void;\r\n <N extends keyof EventArgs>(name?: N, listener?: EventListener<EventArgs, N>[]): void;\r\n <N extends keyof EventArgs>(\r\n name?: N,\r\n listener?: EventListener<EventArgs, N> | EventListener<EventArgs, N>[]\r\n ): void;\r\n};\r\n\r\nexport type AddEvent<EventArgs extends Record<string, any[]>> = {\r\n (eventListeners: EventListeners<EventArgs>, pure?: boolean): () => void;\r\n <N extends keyof EventArgs>(name: N, listener: EventListener<EventArgs, N>): () => void;\r\n <N extends keyof EventArgs>(name: N, listener: EventListener<EventArgs, N>[]): () => void;\r\n <N extends keyof EventArgs>(\r\n nameOrEventListeners: N | EventListeners<EventArgs>,\r\n listener?: EventListener<EventArgs, N> | EventListener<EventArgs, N>[] | boolean\r\n ): () => void;\r\n};\r\n\r\nexport type TriggerEvent<EventArgs extends Record<string, any[]>> = {\r\n <N extends keyof EventArgs>(name: N, args: EventArgs[N]): void;\r\n};\r\n\r\nexport type EventListenerHub<EventArgs extends Record<string, any[]>> = [\r\n AddEvent<EventArgs>,\r\n RemoveEvent<EventArgs>,\r\n TriggerEvent<EventArgs>,\r\n];\r\n\r\nconst manageListener = <EventArgs extends Record<string, any[]>, N extends keyof EventArgs>(\r\n callback: (listener?: EventListener<EventArgs, N>) => void,\r\n listener?: EventListener<EventArgs, N> | EventListener<EventArgs, N>[]\r\n) => {\r\n each(createOrKeepArray(listener), callback);\r\n};\r\n\r\nexport const createEventListenerHub = <EventArgs extends Record<string, any[]>>(\r\n initialEventListeners?: EventListeners<EventArgs>\r\n): EventListenerHub<EventArgs> => {\r\n const events = new Map<keyof EventArgs, Set<EventListener<EventArgs, keyof EventArgs>>>();\r\n\r\n const removeEvent: RemoveEvent<EventArgs> = (name, listener) => {\r\n if (name) {\r\n const eventSet = events.get(name);\r\n manageListener((currListener) => {\r\n if (eventSet) {\r\n eventSet[currListener ? 'delete' : 'clear'](currListener! as any);\r\n }\r\n }, listener);\r\n } else {\r\n events.forEach((eventSet) => {\r\n eventSet.clear();\r\n });\r\n events.clear();\r\n }\r\n };\r\n\r\n const addEvent: AddEvent<EventArgs> = (\r\n nameOrEventListeners: keyof EventArgs | EventListeners<EventArgs>,\r\n listenerOrPure?:\r\n | EventListener<EventArgs, keyof EventArgs>\r\n | EventListener<EventArgs, keyof EventArgs>[]\r\n | boolean\r\n ) => {\r\n if (isString(nameOrEventListeners)) {\r\n const eventSet = events.get(nameOrEventListeners) || new Set();\r\n events.set(nameOrEventListeners, eventSet);\r\n\r\n manageListener(\r\n (currListener) => {\r\n if (isFunction(currListener)) {\r\n eventSet.add(currListener);\r\n }\r\n },\r\n listenerOrPure as Exclude<typeof listenerOrPure, boolean>\r\n );\r\n\r\n return bind(\r\n removeEvent,\r\n nameOrEventListeners,\r\n listenerOrPure as Exclude<typeof listenerOrPure, boolean>\r\n );\r\n }\r\n if (isBoolean(listenerOrPure) && listenerOrPure) {\r\n removeEvent();\r\n }\r\n\r\n const eventListenerKeys = keys(nameOrEventListeners) as (keyof EventListeners<EventArgs>)[];\r\n const offFns: (() => void)[] = [];\r\n each(eventListenerKeys, (key) => {\r\n const eventListener = (nameOrEventListeners as EventListeners<EventArgs>)[key];\r\n if (eventListener) {\r\n push(offFns, addEvent(key, eventListener));\r\n }\r\n });\r\n\r\n return bind(runEachAndClear, offFns);\r\n };\r\n\r\n const triggerEvent: TriggerEvent<EventArgs> = (name, args) => {\r\n each(from(events.get(name)), (event) => {\r\n if (args && !isEmptyArray(args)) {\r\n (event as (...eventArgs: EventArgs[keyof EventArgs]) => void).apply(0, args);\r\n } else {\r\n (event as () => void)();\r\n }\r\n });\r\n };\r\n\r\n addEvent(initialEventListeners || {});\r\n\r\n return [addEvent, removeEvent, triggerEvent];\r\n};\r\n", "/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport type { OverlayScrollbars, OverlayScrollbarsStatic } from '../overlayscrollbars';\r\nimport type { EventListener, EventListenerArgs, EventListeners } from '../eventListeners';\r\nimport { each, keys } from '../support';\r\n\r\nexport type PluginModuleInstance = Record<string | number | symbol, any>;\r\n\r\nexport type InstancePluginEvent = {\r\n /**\r\n * Adds event listeners to the instance.\r\n * @param eventListeners An object which contains the added listeners.\r\n * @returns Returns a function which removes the added listeners.\r\n */\r\n (eventListeners: EventListeners): () => void;\r\n /**\r\n * Adds a single event listener to the instance.\r\n * @param name The name of the event.\r\n * @param listener The listener which is invoked on that event.\r\n * @returns Returns a function which removes the added listeners.\r\n */\r\n <N extends keyof EventListenerArgs>(name: N, listener: EventListener<N>): () => void;\r\n /**\r\n * Adds multiple event listeners to the instance.\r\n * @param name The name of the event.\r\n * @param listener The listeners which are invoked on that event.\r\n * @returns Returns a function which removes the added listeners.\r\n */\r\n <N extends keyof EventListenerArgs>(name: N, listener: EventListener<N>[]): () => void;\r\n};\r\n\r\n/**\r\n * Describes a OverlayScrollbars plugin module.\r\n * Plugin modules must be side-effect free and deterministic. (same input produces same output)\r\n */\r\nexport type PluginModule<\r\n S extends PluginModuleInstance | void = PluginModuleInstance | void,\r\n I extends PluginModuleInstance | void = PluginModuleInstance | void,\r\n> = (S extends PluginModuleInstance\r\n ? {\r\n /**\r\n * Creates a plugin which is bound to the static object.\r\n * The function will be called once with the static object as soon as the plugin is registered.\r\n * The plugin can add new methods or fields to the passed static object.\r\n * @param osStatic The static object the plugin is bound to.\r\n * @returns The plugins instance object or a falsy value if the plugin doesn't need any instance object.\r\n */\r\n static: (osStatic: OverlayScrollbarsStatic) => S | void;\r\n }\r\n : object) &\r\n (I extends PluginModuleInstance\r\n ? {\r\n /**\r\n * Creates a A plugin which is bound to an instance.\r\n * The function will be called each time a new instance is created.\r\n * The plugin can add new methods or fields to the passed instance object.\r\n * @param osInstance The instance object the plugin is bound to.\r\n * @param event A function which adds events to the instance which can't be removed from outside the plugin. (instance events added with the `on` function can be removed with the optional `pure` parameter)\r\n * @param osStatic The static object the plugin is bound to.\r\n * @returns The plugins instance object or a falsy value if the plugin doesn't need any instance object.\r\n */\r\n instance: (\r\n osInstance: OverlayScrollbars,\r\n event: InstancePluginEvent,\r\n osStatic: OverlayScrollbarsStatic\r\n ) => I | void;\r\n }\r\n : object);\r\n\r\n/**\r\n * Describes a OverlayScrollbar plugin.\r\n */\r\nexport type Plugin<\r\n Name extends string = string,\r\n S extends PluginModuleInstance | void = PluginModuleInstance | void,\r\n I extends PluginModuleInstance | void = PluginModuleInstance | void,\r\n> = {\r\n /** The field is the plugins name. Plugin names must be globally unique, please choose wisely. */\r\n [pluginName in Name]: PluginModule<S, I>;\r\n};\r\n\r\n/**\r\n * Describes a OverlayScrollbar plugin which has only a static module.\r\n */\r\nexport type StaticPlugin<\r\n Name extends string = string,\r\n T extends PluginModuleInstance = PluginModuleInstance,\r\n> = Plugin<Name, T, void>;\r\n\r\n/**\r\n * Describes a OverlayScrollbar plugin which has only a instance module.\r\n */\r\nexport type InstancePlugin<\r\n Name extends string = string,\r\n T extends PluginModuleInstance = PluginModuleInstance,\r\n> = Plugin<Name, void, T>;\r\n\r\n/**\r\n * Infers the type of the static modules instance of the passed plugin.\r\n */\r\nexport type InferStaticPluginModuleInstance<T extends StaticPlugin> =\r\n T extends StaticPlugin<infer Name>\r\n ? T[Name]['static'] extends (...args: any[]) => any\r\n ? ReturnType<T[Name]['static']>\r\n : void\r\n : void;\r\n\r\n/**\r\n * Infers the type of the instance modules instance of the passed plugin.\r\n */\r\nexport type InferInstancePluginModuleInstance<T extends InstancePlugin> =\r\n T extends InstancePlugin<infer Name>\r\n ? T[Name]['instance'] extends (...args: any[]) => any\r\n ? ReturnType<T[Name]['instance']>\r\n : void\r\n : void;\r\n\r\n/** All registered plugin modules. */\r\nexport const pluginModules: Record<string, PluginModule> = {};\r\n\r\n/** All static plugin module instances. */\r\nexport const staticPluginModuleInstances: Record<string, PluginModuleInstance | void> = {};\r\n\r\n/**\r\n * Adds plugins.\r\n * @param addedPlugin The plugin(s) to add.\r\n * @returns The added plugin modules of the registered plugins.\r\n */\r\nexport const addPlugins = (addedPlugin: Plugin[]) => {\r\n each(addedPlugin, (plugin) =>\r\n each(plugin, (_, key) => {\r\n pluginModules[key] = plugin[key];\r\n })\r\n );\r\n};\r\n\r\nexport const registerPluginModuleInstances = (\r\n plugin: Plugin,\r\n staticObj: OverlayScrollbarsStatic,\r\n instanceInfo?: [\r\n instanceObj: OverlayScrollbars,\r\n event: InstancePluginEvent,\r\n instancePluginMap?: Record<string, PluginModuleInstance>,\r\n ]\r\n): Array<PluginModuleInstance | void> =>\r\n keys(plugin).map((name) => {\r\n const { static: osStatic, instance: osInstance } = (\r\n plugin as Plugin<string, PluginModuleInstance, PluginModuleInstance>\r\n )[name];\r\n const [instanceObj, event, instancePluginMap] = instanceInfo || [];\r\n const ctor = instanceInfo ? osInstance : osStatic;\r\n if (ctor) {\r\n const instance = instanceInfo\r\n ? (\r\n ctor as Extract<\r\n typeof ctor,\r\n (\r\n osInstance: OverlayScrollbars,\r\n event: InstancePluginEvent,\r\n osStatic: OverlayScrollbarsStatic\r\n ) => PluginModuleInstance | void\r\n >\r\n )(instanceObj!, event!, staticObj)\r\n : (\r\n ctor as Extract<\r\n typeof ctor,\r\n (osStatic: OverlayScrollbarsStatic) => PluginModuleInstance | void\r\n >\r\n )(staticObj);\r\n return ((instancePluginMap || staticPluginModuleInstances)[name] = instance);\r\n }\r\n });\r\n\r\nexport const getStaticPluginModuleInstance = <T extends StaticPlugin>(\r\n pluginModuleName: T extends StaticPlugin<infer N> ? N : never\r\n): InferStaticPluginModuleInstance<T> | undefined =>\r\n staticPluginModuleInstances[pluginModuleName] as InferStaticPluginModuleInstance<T> | undefined;\r\n", "import type {\r\n Options,\r\n PartialOptions,\r\n OverflowBehavior,\r\n ScrollbarsVisibilityBehavior,\r\n ScrollbarsAutoHideBehavior,\r\n ScrollbarsClickScrollBehavior,\r\n} from '../../options';\r\nimport type { OptionsTemplate, OptionsTemplateValue } from './validation';\r\nimport type { StaticPlugin } from '../plugins';\r\nimport { validateOptions, optionsTemplateTypes as oTypes } from './validation';\r\n\r\nexport const optionsValidationPluginModuleName = '__osOptionsValidationPlugin';\r\n\r\nexport const OptionsValidationPlugin = /* @__PURE__ */ (() => ({\r\n [optionsValidationPluginModuleName]: {\r\n static: () => {\r\n const numberAllowedValues: OptionsTemplateValue<number> = oTypes.number;\r\n const booleanAllowedValues: OptionsTemplateValue<boolean> = oTypes.boolean;\r\n const arrayNullValues: OptionsTemplateValue<Array<unknown> | null> = [\r\n oTypes.array,\r\n oTypes.null,\r\n ];\r\n const overflowAllowedValues: OptionsTemplateValue<OverflowBehavior> =\r\n 'hidden scroll visible visible-hidden';\r\n const scrollbarsVisibilityAllowedValues: OptionsTemplateValue<ScrollbarsVisibilityBehavior> =\r\n 'visible hidden auto';\r\n const scrollbarsAutoHideAllowedValues: OptionsTemplateValue<ScrollbarsAutoHideBehavior> =\r\n 'never scroll leavemove';\r\n const scrollbarsClickScrollAllowedValues: OptionsTemplateValue<ScrollbarsClickScrollBehavior> =\r\n [booleanAllowedValues, oTypes.string];\r\n\r\n const optionsTemplate: OptionsTemplate<Options> = {\r\n paddingAbsolute: booleanAllowedValues, // true || false\r\n showNativeOverlaidScrollbars: booleanAllowedValues, // true || false\r\n update: {\r\n elementEvents: arrayNullValues, // array of tuples || null\r\n attributes: arrayNullValues,\r\n debounce: [oTypes.number, oTypes.array, oTypes.object, oTypes.null], // number || number array || object || null\r\n ignoreMutation: [oTypes.function, oTypes.null], // function || null\r\n },\r\n overflow: {\r\n x: overflowAllowedValues, // visible-hidden || visible-scroll || hidden || scroll\r\n y: overflowAllowedValues, // visible-hidden || visible-scroll || hidden || scroll\r\n },\r\n scrollbars: {\r\n theme: [oTypes.string, oTypes.null], // string || null\r\n visibility: scrollbarsVisibilityAllowedValues, // visible || hidden || auto\r\n autoHide: scrollbarsAutoHideAllowedValues, // never || scroll || leave || move ||\r\n autoHideDelay: numberAllowedValues, // number\r\n autoHideSuspend: booleanAllowedValues, // true || false\r\n dragScroll: booleanAllowedValues, // true || false\r\n clickScroll: scrollbarsClickScrollAllowedValues, // true || false || instant\r\n pointers: [oTypes.array, oTypes.null], // string array\r\n },\r\n /*\r\n textarea: {\r\n dynWidth: booleanAllowedValues, // true || false\r\n dynHeight: booleanAllowedValues, // true || false\r\n inheritedAttrs: stringArrayNullAllowedValues, // string || array || nul\r\n },\r\n */\r\n };\r\n return (options: PartialOptions, doWriteErrors?: boolean): PartialOptions => {\r\n const [validated, foreign] = validateOptions(optionsTemplate, options, doWriteErrors);\r\n return { ...foreign, ...validated };\r\n };\r\n },\r\n },\r\n}))() satisfies StaticPlugin<typeof optionsValidationPluginModuleName>;\r\n", "import { strOverflowX, strOverflowY } from './support';\r\n\r\nconst dataAttributePrefix = `data-overlayscrollbars`;\r\n\r\n// environment\r\nexport const classNameEnvironment = 'os-environment';\r\nexport const classNameEnvironmentScrollbarHidden = `${classNameEnvironment}-scrollbar-hidden`;\r\n\r\n// initialize\r\nexport const dataAttributeInitialize = `${dataAttributePrefix}-initialize`;\r\n\r\n// shared\r\nexport const dataValueNoClipping = 'noClipping';\r\n\r\n// body\r\nexport const dataAttributeHtmlBody = `${dataAttributePrefix}-body`;\r\n\r\n// host\r\nexport const dataAttributeHost = dataAttributePrefix;\r\nexport const dataValueHostIsHost = 'host';\r\n\r\n// viewport\r\nexport const dataAttributeViewport = `${dataAttributePrefix}-viewport`;\r\nexport const dataValueViewportOverflowXPrefix = strOverflowX;\r\nexport const dataValueViewportOverflowYPrefix = strOverflowY;\r\nexport const dataValueViewportArrange = 'arrange';\r\nexport const dataValueViewportMeasuring = 'measuring';\r\nexport const dataValueViewportScrolling = 'scrolling';\r\nexport const dataValueViewportScrollbarHidden = 'scrollbarHidden';\r\nexport const dataValueViewportNoContent = 'noContent';\r\n\r\n// padding\r\nexport const dataAttributePadding = `${dataAttributePrefix}-padding`;\r\n\r\n// content\r\nexport const dataAttributeContent = `${dataAttributePrefix}-content`;\r\n\r\n// size observer\r\nexport const classNameSizeObserver = 'os-size-observer';\r\nexport const classNameSizeObserverAppear = `${classNameSizeObserver}-appear`;\r\nexport const classNameSizeObserverListener = `${classNameSizeObserver}-listener`;\r\nexport const classNameSizeObserverListenerScroll = `${classNameSizeObserverListener}-scroll`;\r\nexport const classNameSizeObserverListenerItem = `${classNameSizeObserverListener}-item`;\r\nexport const classNameSizeObserverListenerItemFinal = `${classNameSizeObserverListenerItem}-final`;\r\n\r\n// trinsic observer\r\nexport const classNameTrinsicObserver = 'os-trinsic-observer';\r\n\r\n// scrollbars\r\nexport const classNameScrollbarThemeNone = 'os-theme-none';\r\nexport const classNameScrollbar = 'os-scrollbar';\r\nexport const classNameScrollbarRtl = `${classNameScrollbar}-rtl`;\r\nexport const classNameScrollbarHorizontal = `${classNameScrollbar}-horizontal`;\r\nexport const classNameScrollbarVertical = `${classNameScrollbar}-vertical`;\r\nexport const classNameScrollbarTrack = `${classNameScrollbar}-track`;\r\nexport const classNameScrollbarHandle = `${classNameScrollbar}-handle`;\r\nexport const classNameScrollbarVisible = `${classNameScrollbar}-visible`;\r\nexport const classNameScrollbarCornerless = `${classNameScrollbar}-cornerless`;\r\nexport const classNameScrollbarTransitionless = `${classNameScrollbar}-transitionless`;\r\nexport const classNameScrollbarInteraction = `${classNameScrollbar}-interaction`;\r\nexport const classNameScrollbarUnusable = `${classNameScrollbar}-unusable`;\r\nexport const classNameScrollbarAutoHide = `${classNameScrollbar}-auto-hide`;\r\nexport const classNameScrollbarAutoHideHidden = `${classNameScrollbarAutoHide}-hidden`;\r\nexport const classNameScrollbarWheel = `${classNameScrollbar}-wheel`;\r\nexport const classNameScrollbarTrackInteractive = `${classNameScrollbarTrack}-interactive`;\r\nexport const classNameScrollbarHandleInteractive = `${classNameScrollbarHandle}-interactive`;\r\n", "/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport type { StaticPlugin } from '../plugins';\r\nimport {\r\n createDOM,\r\n appendChildren,\r\n getOffsetSize,\r\n addEventListener,\r\n addClass,\r\n equalWH,\r\n cAF,\r\n rAF,\r\n stopPropagation,\r\n bind,\r\n scrollElementTo,\r\n strWidth,\r\n strHeight,\r\n setStyles,\r\n} from '../../support';\r\nimport {\r\n classNameSizeObserverListenerScroll,\r\n classNameSizeObserverListenerItem,\r\n classNameSizeObserverListenerItemFinal,\r\n} from '../../classnames';\r\n\r\nexport const sizeObserverPluginName = '__osSizeObserverPlugin';\r\n\r\nexport const SizeObserverPlugin = /* @__PURE__ */ (() => ({\r\n [sizeObserverPluginName]: {\r\n static:\r\n () =>\r\n (\r\n listenerElement: HTMLElement,\r\n onSizeChangedCallback: (appear: boolean) => any,\r\n observeAppearChange: boolean | null | undefined\r\n ): [appearCallback: () => void, offFns: (() => any)[]] => {\r\n const scrollAmount = 3333333;\r\n const scrollEventName = 'scroll';\r\n const observerElementChildren = createDOM(\r\n `<div class=\"${classNameSizeObserverListenerItem}\" dir=\"ltr\"><div class=\"${classNameSizeObserverListenerItem}\"><div class=\"${classNameSizeObserverListenerItemFinal}\"></div></div><div class=\"${classNameSizeObserverListenerItem}\"><div class=\"${classNameSizeObserverListenerItemFinal}\" style=\"width: 200%; height: 200%\"></div></div></div>`\r\n );\r\n const observerElementChildrenRoot = observerElementChildren[0] as HTMLElement;\r\n const shrinkElement = observerElementChildrenRoot.lastChild as HTMLElement;\r\n const expandElement = observerElementChildrenRoot.firstChild as HTMLElement;\r\n const expandElementChild = expandElement?.firstChild as HTMLElement;\r\n\r\n let cacheSize = getOffsetSize(observerElementChildrenRoot);\r\n let currSize = cacheSize;\r\n let isDirty = false;\r\n let rAFId: number;\r\n\r\n const reset = () => {\r\n scrollElementTo(expandElement, scrollAmount);\r\n scrollElementTo(shrinkElement, scrollAmount);\r\n };\r\n const onResized = (appear?: unknown) => {\r\n rAFId = 0;\r\n if (isDirty) {\r\n cacheSize = currSize;\r\n onSizeChangedCallback(appear === true);\r\n }\r\n };\r\n const onScroll = (scrollEvent?: Event | false) => {\r\n currSize = getOffsetSize(observerElementChildrenRoot);\r\n isDirty = !scrollEvent || !equalWH(currSize, cacheSize);\r\n\r\n if (scrollEvent) {\r\n stopPropagation(scrollEvent);\r\n\r\n if (isDirty && !rAFId) {\r\n cAF!(rAFId);\r\n rAFId = rAF!(onResized);\r\n }\r\n } else {\r\n onResized(scrollEvent === false);\r\n }\r\n\r\n reset();\r\n };\r\n const destroyFns = [\r\n appendChildren(listenerElement, observerElementChildren),\r\n addEventListener(expandElement, scrollEventName, onScroll),\r\n addEventListener(shrinkElement, scrollEventName, onScroll),\r\n ];\r\n\r\n addClass(listenerElement, classNameSizeObserverListenerScroll);\r\n\r\n // lets assume that the divs will never be that large and a constant value is enough\r\n setStyles(expandElementChild, {\r\n [strWidth]: scrollAmount,\r\n [strHeight]: scrollAmount,\r\n });\r\n\r\n rAF!(reset);\r\n\r\n return [observeAppearChange ? bind(onScroll, false) : reset, destroyFns];\r\n },\r\n },\r\n}))() satisfies StaticPlugin<typeof sizeObserverPluginName>;\r\n", "import type { Env } from '../../environment';\r\nimport type { Options, OptionsCheckFn, OverflowBehavior } from '../../options';\r\nimport type { OverflowStyle } from '../../typings';\r\nimport {\r\n getStyles,\r\n strHidden,\r\n strOverflowX,\r\n strOverflowY,\r\n strScroll,\r\n strVisible,\r\n XY,\r\n} from '../../support';\r\n\r\nexport const getShowNativeOverlaidScrollbars = (checkOption: OptionsCheckFn<Options>, env: Env) => {\r\n const { _nativeScrollbarsOverlaid } = env;\r\n const [showNativeOverlaidScrollbarsOption, showNativeOverlaidScrollbarsChanged] = checkOption(\r\n 'showNativeOverlaidScrollbars'\r\n );\r\n\r\n return [\r\n showNativeOverlaidScrollbarsOption &&\r\n _nativeScrollbarsOverlaid.x &&\r\n _nativeScrollbarsOverlaid.y,\r\n showNativeOverlaidScrollbarsChanged,\r\n ] as const;\r\n};\r\n\r\nexport const overflowIsVisible = (overflow: string) => overflow.indexOf(strVisible) === 0;\r\n\r\nexport const overflowBehaviorToOverflowStyle = (\r\n overflowBehavior: OverflowBehavior\r\n): OverflowStyle => overflowBehavior.replace(`${strVisible}-`, '') as OverflowStyle;\r\n\r\nexport const overflowCssValueToOverflowStyle = (\r\n cssValue: string | undefined,\r\n hasOverflow?: boolean\r\n): OverflowStyle => {\r\n if (cssValue === 'auto') {\r\n return hasOverflow ? strScroll : strHidden;\r\n }\r\n\r\n const finalCssValue = cssValue || strHidden;\r\n return [strHidden, strScroll, strVisible].includes(finalCssValue)\r\n ? (finalCssValue as OverflowStyle)\r\n : strHidden;\r\n};\r\n\r\nexport const getElementOverflowStyle = (\r\n element: HTMLElement,\r\n hasOverflow: Partial<XY<boolean>>\r\n): XY<OverflowStyle> => {\r\n const { overflowX, overflowY } = getStyles(element, [strOverflowX, strOverflowY]);\r\n\r\n return {\r\n x: overflowCssValueToOverflowStyle(overflowX, hasOverflow.x),\r\n y: overflowCssValueToOverflowStyle(overflowY, hasOverflow.y),\r\n };\r\n};\r\n", "import type { ObserversSetupState } from '../../setups';\r\nimport type { Options, OptionsCheckFn } from '../../options';\r\nimport type { StructureSetupElementsObj } from '../../setups/structureSetup/structureSetup.elements';\r\nimport type { Env } from '../../environment';\r\nimport type { WH, XY } from '../../support';\r\nimport type { OverflowStyle, StyleObject, StyleObjectKey } from '../../typings';\r\nimport type { StructureSetupState } from '../../setups/structureSetup';\r\nimport type { StaticPlugin } from '../plugins';\r\nimport {\r\n getShowNativeOverlaidScrollbars,\r\n getElementOverflowStyle,\r\n} from '../../setups/structureSetup/structureSetup.utils';\r\nimport { dataValueViewportArrange, dataAttributeViewport } from '../../classnames';\r\nimport {\r\n keys,\r\n noop,\r\n each,\r\n assignDeep,\r\n strMarginBottom,\r\n strMarginLeft,\r\n strMarginRight,\r\n strPaddingBottom,\r\n strPaddingLeft,\r\n strPaddingRight,\r\n strPaddingTop,\r\n getStyles,\r\n setStyles,\r\n removeAttrClass,\r\n strWidth,\r\n strScroll,\r\n} from '../../support';\r\n\r\nexport const scrollbarsHidingPluginName = '__osScrollbarsHidingPlugin';\r\n\r\nexport const ScrollbarsHidingPlugin = /* @__PURE__ */ (() => ({\r\n [scrollbarsHidingPluginName]: {\r\n static: () => ({\r\n _viewportArrangement: (\r\n structureSetupElements: StructureSetupElementsObj,\r\n structureSetupState: StructureSetupState,\r\n observersSetupState: ObserversSetupState,\r\n env: Env,\r\n checkOptions: OptionsCheckFn<Options>\r\n ) => {\r\n const { _viewportIsTarget, _viewport } = structureSetupElements;\r\n const { _nativeScrollbarsHiding, _nativeScrollbarsOverlaid, _nativeScrollbarsSize } = env;\r\n const doViewportArrange =\r\n !_viewportIsTarget &&\r\n !_nativeScrollbarsHiding &&\r\n (_nativeScrollbarsOverlaid.x || _nativeScrollbarsOverlaid.y);\r\n const [showNativeOverlaidScrollbars] = getShowNativeOverlaidScrollbars(checkOptions, env);\r\n\r\n /**\r\n * Gets the hide offset matching the passed overflow state.\r\n * @param viewportOverflowState The overflow state of the viewport\r\n */\r\n const _getViewportOverflowHideOffset = (viewportOverflowStyle: XY<OverflowStyle>) => {\r\n const arrangeHideOffset =\r\n _nativeScrollbarsHiding || showNativeOverlaidScrollbars ? 0 : 42;\r\n\r\n const getHideOffsetPerAxis = (\r\n isOverlaid: boolean,\r\n overflowScroll: boolean,\r\n nativeScrollbarSize: number\r\n ) => {\r\n const nonScrollbarStylingHideOffset = isOverlaid\r\n ? arrangeHideOffset\r\n : nativeScrollbarSize;\r\n const scrollbarsHideOffset =\r\n overflowScroll && !_nativeScrollbarsHiding ? nonScrollbarStylingHideOffset : 0;\r\n const scrollbarsHideOffsetArrange = isOverlaid && !!arrangeHideOffset;\r\n\r\n return [scrollbarsHideOffset, scrollbarsHideOffsetArrange] as const;\r\n };\r\n\r\n const [xScrollbarsHideOffset, xScrollbarsHideOffsetArrange] = getHideOffsetPerAxis(\r\n _nativeScrollbarsOverlaid.x,\r\n viewportOverflowStyle.x === strScroll,\r\n _nativeScrollbarsSize.x\r\n );\r\n const [yScrollbarsHideOffset, yScrollbarsHideOffsetArrange] = getHideOffsetPerAxis(\r\n _nativeScrollbarsOverlaid.y,\r\n viewportOverflowStyle.y === strScroll,\r\n _nativeScrollbarsSize.y\r\n );\r\n\r\n return {\r\n _scrollbarsHideOffset: {\r\n x: xScrollbarsHideOffset,\r\n y: yScrollbarsHideOffset,\r\n },\r\n _scrollbarsHideOffsetArrange: {\r\n x: xScrollbarsHideOffsetArrange,\r\n y: yScrollbarsHideOffsetArrange,\r\n },\r\n };\r\n };\r\n\r\n /**\r\n * Hides the native scrollbars according to the passed parameters.\r\n * @param viewportOverflowStyle The viewport overflow style.\r\n * @param directionIsRTL Whether the direction is RTL or not.\r\n * @param viewportArrange Whether special styles related to the viewport arrange strategy shall be applied.\r\n * @param viewportStyleObj The viewport style object to which the needed styles shall be applied.\r\n */\r\n const _hideNativeScrollbars = (\r\n viewportOverflowStyle: XY<OverflowStyle>\r\n ): StyleObject | undefined => {\r\n if (!_viewportIsTarget) {\r\n const { _directionIsRTL } = observersSetupState;\r\n const viewportStyleObj: StyleObject = assignDeep(\r\n {},\r\n {\r\n [strMarginRight]: 0,\r\n [strMarginBottom]: 0,\r\n [strMarginLeft]: 0,\r\n }\r\n );\r\n const { _scrollbarsHideOffset, _scrollbarsHideOffsetArrange } =\r\n _getViewportOverflowHideOffset(viewportOverflowStyle);\r\n const { x: arrangeX, y: arrangeY } = _scrollbarsHideOffsetArrange;\r\n const { x: hideOffsetX, y: hideOffsetY } = _scrollbarsHideOffset;\r\n const { _viewportPaddingStyle } = structureSetupState;\r\n const horizontalMarginKey: keyof StyleObject = _directionIsRTL\r\n ? strMarginLeft\r\n : strMarginRight;\r\n const viewportHorizontalPaddingKey: keyof StyleObject = _directionIsRTL\r\n ? strPaddingLeft\r\n : strPaddingRight;\r\n const horizontalMarginValue = _viewportPaddingStyle[horizontalMarginKey] as number;\r\n const verticalMarginValue = _viewportPaddingStyle[strMarginBottom] as number;\r\n const horizontalPaddingValue = _viewportPaddingStyle[\r\n viewportHorizontalPaddingKey\r\n ] as number;\r\n const verticalPaddingValue = _viewportPaddingStyle[strPaddingBottom] as number;\r\n\r\n // horizontal\r\n viewportStyleObj[strWidth] = `calc(100% + ${\r\n hideOffsetY + horizontalMarginValue * -1\r\n }px)`;\r\n viewportStyleObj[horizontalMarginKey] = -hideOffsetY + horizontalMarginValue;\r\n\r\n // vertical\r\n viewportStyleObj[strMarginBottom] = -hideOffsetX + verticalMarginValue;\r\n\r\n // viewport arrange additional styles\r\n if (doViewportArrange) {\r\n viewportStyleObj[viewportHorizontalPaddingKey] =\r\n horizontalPaddingValue + (arrangeY ? hideOffsetY : 0);\r\n viewportStyleObj[strPaddingBottom] =\r\n verticalPaddingValue + (arrangeX ? hideOffsetX : 0);\r\n }\r\n\r\n return viewportStyleObj;\r\n }\r\n };\r\n\r\n /**\r\n * Sets the styles of the viewport arrange element.\r\n * @param viewportOverflowStyle The viewport overflow style according to which the scrollbars shall be hidden.\r\n * @param viewportScrollSize The content scroll size.\r\n * @param directionIsRTL Whether the direction is RTL or not.\r\n * @returns A boolean which indicates whether the viewport arrange element was adjusted.\r\n */\r\n const _arrangeViewport = (\r\n viewportOverflowStyle: XY<OverflowStyle>,\r\n viewportScrollSize: WH<number>,\r\n sizeFraction: WH<number>\r\n ) => {\r\n if (doViewportArrange) {\r\n const { _viewportPaddingStyle } = structureSetupState;\r\n const { _scrollbarsHideOffset, _scrollbarsHideOffsetArrange } =\r\n _getViewportOverflowHideOffset(viewportOverflowStyle);\r\n const { x: arrangeX, y: arrangeY } = _scrollbarsHideOffsetArrange;\r\n const { x: hideOffsetX, y: hideOffsetY } = _scrollbarsHideOffset;\r\n const { _directionIsRTL } = observersSetupState;\r\n const viewportArrangeHorizontalPaddingKey: keyof StyleObject = _directionIsRTL\r\n ? strPaddingRight\r\n : strPaddingLeft;\r\n const viewportArrangeHorizontalPaddingValue = _viewportPaddingStyle[\r\n viewportArrangeHorizontalPaddingKey\r\n ] as number;\r\n const viewportArrangeVerticalPaddingValue = _viewportPaddingStyle.paddingTop as number;\r\n const fractionalContentWidth = viewportScrollSize.w + sizeFraction.w;\r\n const fractionalContenHeight = viewportScrollSize.h + sizeFraction.h;\r\n const arrangeSize = {\r\n w:\r\n hideOffsetY && arrangeY\r\n ? `${\r\n hideOffsetY + fractionalContentWidth - viewportArrangeHorizontalPaddingValue\r\n }px`\r\n : '',\r\n h:\r\n hideOffsetX && arrangeX\r\n ? `${\r\n hideOffsetX + fractionalContenHeight - viewportArrangeVerticalPaddingValue\r\n }px`\r\n : '',\r\n };\r\n\r\n setStyles(_viewport, {\r\n '--os-vaw': arrangeSize.w,\r\n '--os-vah': arrangeSize.h,\r\n });\r\n }\r\n\r\n return doViewportArrange;\r\n };\r\n\r\n /**\r\n * Removes all styles applied because of the viewport arrange strategy.\r\n */\r\n const _undoViewportArrange = () => {\r\n if (doViewportArrange) {\r\n const { _hasOverflow, _viewportPaddingStyle: viewportPaddingStyle } =\r\n structureSetupState;\r\n const viewportOverflowStyle = getElementOverflowStyle(_viewport, _hasOverflow);\r\n const { _scrollbarsHideOffsetArrange } =\r\n _getViewportOverflowHideOffset(viewportOverflowStyle);\r\n const { x: arrangeX, y: arrangeY } = _scrollbarsHideOffsetArrange;\r\n const finalPaddingStyle: StyleObject = {};\r\n const assignProps = (props: string[]) =>\r\n each(props, (prop) => {\r\n finalPaddingStyle[prop as StyleObjectKey] =\r\n viewportPaddingStyle[prop as StyleObjectKey];\r\n });\r\n\r\n if (arrangeX) {\r\n assignProps([strMarginBottom, strPaddingTop, strPaddingBottom]);\r\n }\r\n\r\n if (arrangeY) {\r\n assignProps([strMarginLeft, strMarginRight, strPaddingLeft, strPaddingRight]);\r\n }\r\n\r\n const prevStyle = getStyles(_viewport, keys(finalPaddingStyle) as StyleObjectKey[]);\r\n const addArrange = removeAttrClass(\r\n _viewport,\r\n dataAttributeViewport,\r\n dataValueViewportArrange\r\n );\r\n\r\n setStyles(_viewport, finalPaddingStyle);\r\n\r\n return () => {\r\n setStyles(\r\n _viewport,\r\n assignDeep({}, prevStyle, _hideNativeScrollbars(viewportOverflowStyle))\r\n );\r\n addArrange();\r\n };\r\n }\r\n return noop;\r\n };\r\n\r\n return {\r\n _arrangeViewport,\r\n _undoViewportArrange,\r\n _hideNativeScrollbars,\r\n };\r\n },\r\n }),\r\n },\r\n}))() satisfies StaticPlugin<typeof scrollbarsHidingPluginName>;\r\n", "import type { StaticPlugin } from '../plugins';\r\nimport { animateNumber, noop, selfClearTimeout } from '../../support';\r\n\r\nexport const clickScrollPluginModuleName = '__osClickScrollPlugin';\r\n\r\nexport const ClickScrollPlugin = /* @__PURE__ */ (() => ({\r\n [clickScrollPluginModuleName]: {\r\n static:\r\n () =>\r\n (\r\n moveHandleRelative: (deltaMovement: number) => void,\r\n targetOffset: number,\r\n handleLength: number,\r\n onClickScrollCompleted: (stopped: boolean) => void\r\n ) => {\r\n // click scroll animation has 2 main parts:\r\n // 1. the \"click\" which scrolls 100% of the viewport in a certain amount of time\r\n // 2. the \"press\" which scrolls to the point where the cursor is located, the \"press\" always waits for the \"click\" to finish\r\n // The \"click\" should not be canceled by a \"pointerup\" event because very fast clicks or taps would cancel it too fast\r\n // The \"click\" should only be canceled by a subsequent \"pointerdown\" event because otherwise 2 animations would run\r\n // The \"press\" should be canceld by the next \"pointerup\" event\r\n\r\n let stopped = false;\r\n let stopPressAnimation = noop;\r\n const linearScrollMs = 133;\r\n const easedScrollMs = 222;\r\n const [setPressAnimationTimeout, clearPressAnimationTimeout] =\r\n selfClearTimeout(linearScrollMs);\r\n const targetOffsetSign = Math.sign(targetOffset);\r\n const handleLengthWithTargetSign = handleLength * targetOffsetSign;\r\n const handleLengthWithTargetSignHalf = handleLengthWithTargetSign / 2;\r\n const easing = (x: number) => 1 - (1 - x) * (1 - x); // easeOutQuad;\r\n const easedEndPressAnimation = (from: number, to: number) =>\r\n animateNumber(from, to, easedScrollMs, moveHandleRelative, easing);\r\n const linearPressAnimation = (linearFrom: number, msFactor: number) =>\r\n animateNumber(\r\n linearFrom,\r\n targetOffset - handleLengthWithTargetSign,\r\n linearScrollMs * msFactor,\r\n (progress, _, completed) => {\r\n moveHandleRelative(progress);\r\n\r\n if (completed) {\r\n stopPressAnimation = easedEndPressAnimation(progress, targetOffset);\r\n }\r\n }\r\n );\r\n const stopClickAnimation = animateNumber(\r\n 0,\r\n handleLengthWithTargetSign,\r\n easedScrollMs,\r\n (clickAnimationProgress, _, clickAnimationCompleted) => {\r\n moveHandleRelative(clickAnimationProgress);\r\n\r\n if (clickAnimationCompleted) {\r\n onClickScrollCompleted(stopped);\r\n\r\n if (!stopped) {\r\n const remainingScrollDistance = targetOffset - clickAnimationProgress;\r\n const continueWithPress =\r\n Math.sign(remainingScrollDistance - handleLengthWithTargetSignHalf) ===\r\n targetOffsetSign;\r\n\r\n if (continueWithPress) {\r\n setPressAnimationTimeout(() => {\r\n const remainingLinearScrollDistance =\r\n remainingScrollDistance - handleLengthWithTargetSign;\r\n const linearBridge =\r\n Math.sign(remainingLinearScrollDistance) === targetOffsetSign;\r\n\r\n stopPressAnimation = linearBridge\r\n ? linearPressAnimation(\r\n clickAnimationProgress,\r\n Math.abs(remainingLinearScrollDistance) / handleLength\r\n )\r\n : easedEndPressAnimation(clickAnimationProgress, targetOffset);\r\n });\r\n }\r\n }\r\n }\r\n },\r\n easing\r\n );\r\n\r\n return (stopClick?: boolean) => {\r\n stopped = true;\r\n\r\n if (stopClick) {\r\n stopClickAnimation();\r\n }\r\n\r\n clearPressAnimationTimeout();\r\n stopPressAnimation();\r\n };\r\n },\r\n },\r\n}))() satisfies StaticPlugin<typeof clickScrollPluginModuleName>;\r\n", "/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport type { DeepPartial, DeepReadonly } from './typings';\r\nimport {\r\n assignDeep,\r\n each,\r\n isObject,\r\n keys,\r\n isArray,\r\n hasOwnProperty,\r\n isFunction,\r\n isEmptyObject,\r\n concat,\r\n} from './support';\r\n\r\nexport type OptionsField = string;\r\n\r\nexport type OptionsPrimitiveValue =\r\n | boolean\r\n | number\r\n | string\r\n | Array<any>\r\n | ReadonlyArray<any>\r\n | [any]\r\n | [any, ...any[]]\r\n | ((this: any, ...args: any[]) => any)\r\n | null;\r\n\r\nexport type OptionsObject = {\r\n [field: OptionsField]: OptionsPrimitiveValue | OptionsObject;\r\n};\r\n\r\ntype OptionsObjectFieldNameTuples<T> = T extends OptionsPrimitiveValue\r\n ? []\r\n : {\r\n [K in Extract<keyof T, OptionsField>]: [K, ...OptionsObjectFieldNameTuples<T[K]>];\r\n }[Extract<keyof T, OptionsField>];\r\n\r\ntype JoinOptionsObjectFieldTuples<\r\n T extends OptionsField[],\r\n IncompletePath extends boolean = false,\r\n> = T extends [infer F]\r\n ? F\r\n : T extends [infer F, ...infer R]\r\n ? F extends OptionsField\r\n ?\r\n | (IncompletePath extends true ? F : never)\r\n | `${F}.${JoinOptionsObjectFieldTuples<Extract<R, OptionsField[]>>}`\r\n : never\r\n : OptionsField;\r\n\r\ntype SplitJoinedOptionsObjectFieldTuples<S extends string> = string extends S\r\n ? OptionsField[]\r\n : S extends ''\r\n ? []\r\n : S extends `${infer T}.${infer U}`\r\n ? [T, ...SplitJoinedOptionsObjectFieldTuples<U>]\r\n : [S];\r\n\r\ntype OptionsObjectFieldTuplesType<O, T extends OptionsField[]> = T extends [infer F]\r\n ? F extends keyof O\r\n ? O[F]\r\n : never\r\n : T extends [infer F, ...infer R]\r\n ? F extends keyof O\r\n ? O[F] extends OptionsPrimitiveValue\r\n ? O[F]\r\n : OptionsObjectFieldTuplesType<O[F], Extract<R, OptionsField[]>>\r\n : never\r\n : never;\r\n\r\ntype OptionsObjectFieldPath<O extends OptionsObject> = JoinOptionsObjectFieldTuples<\r\n OptionsObjectFieldNameTuples<O>,\r\n true\r\n>;\r\n\r\ntype OptionsObjectFieldPathType<\r\n O extends OptionsObject,\r\n P extends string,\r\n> = OptionsObjectFieldTuplesType<O, SplitJoinedOptionsObjectFieldTuples<P>>;\r\n\r\nconst opsStringify = (value: any) =>\r\n JSON.stringify(value, (_, val) => {\r\n if (isFunction(val)) {\r\n throw 0;\r\n }\r\n return val;\r\n });\r\n\r\nconst getPropByPath = <T>(obj: any, path: string): T =>\r\n obj\r\n ? `${path}`\r\n .split('.')\r\n .reduce((o, prop) => (o && hasOwnProperty(o, prop) ? o[prop] : undefined), obj)\r\n : (undefined as T);\r\n\r\n/**\r\n * The overflow behavior of an axis.\r\n */\r\nexport type OverflowBehavior =\r\n /** No scrolling is possible and the content is clipped. */\r\n | 'hidden'\r\n /** No scrolling is possible and the content isn't clipped. */\r\n | 'visible'\r\n /** Scrolling is possible if there is an overflow. */\r\n | 'scroll'\r\n /**\r\n * If the other axis has no overflow the behavior is similar to `visible`.\r\n * If the other axis has overflow the behavior is similar to `hidden`.\r\n */\r\n | 'visible-hidden'\r\n /**\r\n * If the other axis has no overflow the behavior is similar to `visible`.\r\n * If the other axis has overflow the behavior is similar to `scroll`.\r\n */\r\n | 'visible-scroll';\r\n\r\n/**\r\n * The scrollbars visibility behavior.\r\n */\r\nexport type ScrollbarsVisibilityBehavior =\r\n /** The scrollbars are always visible. */\r\n | 'visible'\r\n /** The scrollbars are always hidden. */\r\n | 'hidden'\r\n /** The scrollbars are only visibile if there is overflow. */\r\n | 'auto';\r\n\r\n/**\r\n * The scrollbars auto hide behavior\r\n */\r\nexport type ScrollbarsAutoHideBehavior =\r\n /** The scrollbars are never hidden automatically. */\r\n | 'never'\r\n /** The scrollbars are hidden unless the user scrolls. */\r\n | 'scroll'\r\n /** The scrollbars are hidden unless the pointer moves in the host element or the user scrolls. */\r\n | 'move'\r\n /** The scrollbars are hidden if the pointer leaves the host element or unless the user scrolls. */\r\n | 'leave';\r\n\r\n/**\r\n * The scrollbar click scroll behavior.\r\n */\r\nexport type ScrollbarsClickScrollBehavior = boolean | 'instant';\r\n\r\n/**\r\n * A debounce value:\r\n * If a tuple is provided you can customize the `timeout` and the `maxWait` in milliseconds. The third value `leading` indicates whether the debounce is also executed on the leading edge\r\n * Only a number customizes the `timeout` in milliseconds.\r\n * If the `timeout` is `0`, a debounce still exists. (its executed via `requestAnimationFrame`).\r\n */\r\nexport type OptionsDebounceValue =\r\n | [\r\n timeout?: number | false | null | undefined,\r\n maxWait?: number | false | null | undefined,\r\n leading?: boolean | null | undefined,\r\n ]\r\n | number\r\n | false\r\n | null;\r\n\r\n/**\r\n * @deprecated Use the debounce object instead.\r\n */\r\nexport type OptionsDebounceLegacy = OptionsDebounceValue;\r\n\r\n/**\r\n * The options of a OverlayScrollbars instance.\r\n */\r\nexport type Options = {\r\n /** Whether the padding shall be absolute. */\r\n paddingAbsolute: boolean;\r\n /** Whether to show the native scrollbars. Has only an effect it the native scrollbars are overlaid. */\r\n showNativeOverlaidScrollbars: boolean;\r\n /** Customizes the automatic update behavior. */\r\n update: {\r\n /**\r\n * The given Event(s) from the elements with the given selector(s) will trigger an update.\r\n * Useful for everything the MutationObserver and ResizeObserver can't detect\r\n * e.g.: and Images `load` event or the `transitionend` / `animationend` events.\r\n */\r\n elementEvents: Array<[elementSelector: string, eventNames: string]> | null;\r\n /**\r\n * Options to debounce updates to fine-tune performance.\r\n * It is possible to debounce updates caused by mutations, resizes, events and environmental changes.\r\n */\r\n debounce:\r\n | {\r\n /** Debounce updates which were triggered by a MutationObserver. */\r\n mutation: OptionsDebounceValue;\r\n /** Debounce updates which were triggered by a ResizeObserver. */\r\n resize: OptionsDebounceValue;\r\n /** Debounce updates which were triggered by a Event. */\r\n event: OptionsDebounceValue;\r\n /** Debounce updates which were triggered by environmental changes. (e.g. zooming & window resize) */\r\n env: OptionsDebounceValue;\r\n }\r\n | OptionsDebounceLegacy;\r\n /**\r\n * HTML attributes which will trigger an update if they're changed.\r\n * Basic attributes like `id`, `class`, `style` etc. are always observed and doesn't have to be added explicitly.\r\n */\r\n attributes: string[] | null;\r\n /**\r\n * A function which makes it possible to ignore a content mutation or null if nothing shall be ignored.\r\n * @param mutation The MutationRecord from the MutationObserver.\r\n * @returns A Truthy value if the mutation shall be ignored, a falsy value otherwise.\r\n */\r\n ignoreMutation: ((mutation: MutationRecord) => any) | null;\r\n };\r\n /** Customizes the overflow behavior per axis. */\r\n overflow: {\r\n /** The overflow behavior of the horizontal (x) axis. */\r\n x: OverflowBehavior;\r\n /** The overflow behavior of the vertical (y) axis. */\r\n y: OverflowBehavior;\r\n };\r\n /** Customizes appearance of the scrollbars. */\r\n scrollbars: {\r\n /**\r\n * The scrollbars theme.\r\n * The theme value will be added as `class` to all `scrollbar` elements of the instance.\r\n */\r\n theme: string | null;\r\n /** The scrollbars visibility behavior. */\r\n visibility: ScrollbarsVisibilityBehavior;\r\n /** The scrollbars auto hide behavior. */\r\n autoHide: ScrollbarsAutoHideBehavior;\r\n /** The scrollbars auto hide delay in milliseconds. */\r\n autoHideDelay: number;\r\n /** Whether the scrollbars auto hide behavior is suspended until a scroll happened. */\r\n autoHideSuspend: boolean;\r\n /** Whether it is possible to drag the handle of a scrollbar to scroll the viewport. */\r\n dragScroll: boolean;\r\n /** Whether it is possible to click the track of a scrollbar to scroll the viewport. */\r\n clickScroll: ScrollbarsClickScrollBehavior;\r\n /**\r\n * An array of pointer types which shall be supported.\r\n * Common pointer types are: `mouse`, `pen` and `touch`.\r\n * https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType\r\n */\r\n pointers: string[] | null;\r\n };\r\n};\r\n\r\nexport type ReadonlyOptions = DeepReadonly<Options>;\r\n\r\nexport type PartialOptions = DeepPartial<Options>;\r\n\r\nexport type OptionsCheckFn<O extends OptionsObject> = <P extends OptionsObjectFieldPath<O>>(\r\n path: P\r\n) => [value: OptionsObjectFieldPathType<O, P>, changed: boolean];\r\n\r\nexport const defaultOptionsUpdateDebounceMutation = [0, 33] satisfies OptionsDebounceValue;\r\nexport const defaultOptionsUpdateDebounceEvent = [33, 99] satisfies OptionsDebounceValue;\r\nexport const defaultOptionsUpdateDebounceEnv = [222, 666, true] satisfies OptionsDebounceValue;\r\nexport const defaultOptions: ReadonlyOptions = {\r\n paddingAbsolute: false,\r\n showNativeOverlaidScrollbars: false,\r\n update: {\r\n elementEvents: [['img', 'load']],\r\n debounce: {\r\n mutation: defaultOptionsUpdateDebounceMutation,\r\n resize: null,\r\n event: defaultOptionsUpdateDebounceEvent,\r\n env: defaultOptionsUpdateDebounceEnv,\r\n },\r\n attributes: null,\r\n ignoreMutation: null,\r\n },\r\n overflow: {\r\n x: 'scroll',\r\n y: 'scroll',\r\n },\r\n scrollbars: {\r\n theme: 'os-theme-dark',\r\n visibility: 'auto',\r\n autoHide: 'never',\r\n autoHideDelay: 1300,\r\n autoHideSuspend: false,\r\n dragScroll: true,\r\n clickScroll: false,\r\n pointers: ['mouse', 'touch', 'pen'],\r\n },\r\n} satisfies OptionsObject & Options;\r\n\r\nexport const getOptionsDiff = <T>(currOptions: T, newOptions: DeepPartial<T>): DeepPartial<T> => {\r\n const diff: DeepPartial<T> = {};\r\n const optionsKeys = concat(keys(newOptions), keys(currOptions)) as Array<\r\n keyof T & keyof DeepPartial<T>\r\n >;\r\n\r\n each(optionsKeys, (optionKey) => {\r\n const currOptionValue = currOptions[optionKey];\r\n const newOptionValue = newOptions[optionKey];\r\n\r\n if (isObject(currOptionValue) && isObject(newOptionValue)) {\r\n assignDeep((diff[optionKey] = {} as any), getOptionsDiff(currOptionValue, newOptionValue));\r\n // delete empty nested objects\r\n if (isEmptyObject(diff[optionKey])) {\r\n delete diff[optionKey];\r\n }\r\n } else if (hasOwnProperty(newOptions, optionKey) && newOptionValue !== currOptionValue) {\r\n let isDiff = true;\r\n\r\n if (isArray(currOptionValue) || isArray(newOptionValue)) {\r\n try {\r\n if (opsStringify(currOptionValue) === opsStringify(newOptionValue)) {\r\n isDiff = false;\r\n }\r\n // eslint-disable-next-line no-empty\r\n } catch {}\r\n }\r\n\r\n if (isDiff) {\r\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\r\n // @ts-ignore\r\n diff[optionKey] = newOptionValue;\r\n }\r\n }\r\n });\r\n\r\n return diff;\r\n};\r\n\r\nexport const createOptionCheck =\r\n <T extends OptionsObject>(\r\n options: T,\r\n changedOptions: DeepPartial<T>,\r\n force?: boolean\r\n ): OptionsCheckFn<T> =>\r\n (path) => [\r\n getPropByPath(options, path),\r\n force || getPropByPath(changedOptions, path) !== undefined,\r\n ];\r\n", "let nonce: string | undefined;\r\n\r\nexport const getNonce = () => nonce;\r\nexport const setNonce = (newNonce: string | undefined) => {\r\n nonce = newNonce;\r\n};\r\n", "import type { XY, EventListener } from './support';\r\nimport type { Options, PartialOptions } from './options';\r\nimport type { Initialization, PartialInitialization } from './initialization';\r\nimport type { StyleObjectKey } from './typings';\r\nimport { defaultOptions } from './options';\r\nimport { classNameEnvironment, classNameEnvironmentScrollbarHidden } from './classnames';\r\nimport {\r\n createDOM,\r\n addClass,\r\n appendChildren,\r\n getFractionalSize,\r\n getClientSize,\r\n getOffsetSize,\r\n removeAttrs,\r\n removeElements,\r\n assignDeep,\r\n createCache,\r\n equalXY,\r\n createEventListenerHub,\r\n scrollT,\r\n bind,\r\n wnd,\r\n getStyles,\r\n isBodyElement,\r\n isFunction,\r\n addEventListener,\r\n} from './support';\r\nimport { getNonce } from './nonce';\r\n\r\ntype EnvironmentEventArgs = {\r\n r: [scrollbarSizeChanged?: boolean];\r\n};\r\n\r\nexport interface Env {\r\n readonly _nativeScrollbarsSize: XY;\r\n readonly _nativeScrollbarsOverlaid: XY<boolean>;\r\n readonly _nativeScrollbarsHiding: boolean;\r\n readonly _scrollTimeline: boolean;\r\n readonly _staticDefaultInitialization: Initialization;\r\n readonly _staticDefaultOptions: Options;\r\n _addResizeListener(listener: EventListener<EnvironmentEventArgs, 'r'>): () => void;\r\n _getDefaultInitialization(): Initialization;\r\n _setDefaultInitialization(newInitialization: PartialInitialization): Initialization;\r\n _getDefaultOptions(): Options;\r\n _setDefaultOptions(newDefaultOptions: PartialOptions): Options;\r\n}\r\n\r\nlet environmentInstance: Env;\r\n\r\nconst createEnvironment = (): Env => {\r\n const getNativeScrollbarSize = (\r\n measureElm: HTMLElement,\r\n measureElmChild: HTMLElement,\r\n clear?: boolean\r\n ): XY => {\r\n // fix weird safari issue where getComputedStyle returns all empty styles by appending twice\r\n appendChildren(document.body, measureElm);\r\n appendChildren(document.body, measureElm);\r\n\r\n const cSize = getClientSize(measureElm);\r\n const oSize = getOffsetSize(measureElm);\r\n const fSize = getFractionalSize(measureElmChild);\r\n\r\n if (clear) {\r\n removeElements(measureElm);\r\n }\r\n\r\n return {\r\n x: oSize.h - cSize.h + fSize.h,\r\n y: oSize.w - cSize.w + fSize.w,\r\n };\r\n };\r\n\r\n const getNativeScrollbarsHiding = (testElm: HTMLElement): boolean => {\r\n let result = false;\r\n const revertClass = addClass(testElm, classNameEnvironmentScrollbarHidden);\r\n try {\r\n result =\r\n getStyles(testElm, 'scrollbar-width' as StyleObjectKey) === 'none' ||\r\n getStyles(testElm, 'display', '::-webkit-scrollbar') === 'none';\r\n // eslint-disable-next-line no-empty\r\n } catch {}\r\n revertClass();\r\n return result;\r\n };\r\n\r\n // changes to this styles need to be reflected in the \"hide native scrollbars\" section of the structure styles\r\n const envStyle = `.${classNameEnvironment}{scroll-behavior:auto!important;position:fixed;opacity:0;visibility:hidden;overflow:scroll;height:200px;width:200px;z-index:-1}.${classNameEnvironment} div{width:200%;height:200%;margin:10px 0}.${classNameEnvironmentScrollbarHidden}{scrollbar-width:none!important}.${classNameEnvironmentScrollbarHidden}::-webkit-scrollbar,.${classNameEnvironmentScrollbarHidden}::-webkit-scrollbar-corner{appearance:none!important;display:none!important;width:0!important;height:0!important}`;\r\n const envDOM = createDOM(\r\n `<div class=\"${classNameEnvironment}\"><div></div><style>${envStyle}</style></div>`\r\n );\r\n const envElm = envDOM[0] as HTMLElement;\r\n const envChildElm = envElm.firstChild as HTMLElement;\r\n const styleElm = envElm.lastChild as HTMLStyleElement;\r\n const nonce = getNonce();\r\n\r\n if (nonce) {\r\n styleElm.nonce = nonce;\r\n }\r\n\r\n const [addEvent, , triggerEvent] = createEventListenerHub<EnvironmentEventArgs>();\r\n const [updateNativeScrollbarSizeCache, getNativeScrollbarSizeCache] = createCache(\r\n {\r\n _initialValue: getNativeScrollbarSize(envElm, envChildElm),\r\n _equal: equalXY,\r\n },\r\n bind(getNativeScrollbarSize, envElm, envChildElm, true)\r\n );\r\n const [nativeScrollbarsSize] = getNativeScrollbarSizeCache();\r\n const nativeScrollbarsHiding = getNativeScrollbarsHiding(envElm);\r\n const nativeScrollbarsOverlaid = {\r\n x: nativeScrollbarsSize.x === 0,\r\n y: nativeScrollbarsSize.y === 0,\r\n };\r\n const staticDefaultInitialization: Initialization = {\r\n elements: {\r\n host: null,\r\n padding: !nativeScrollbarsHiding,\r\n viewport: (target) => nativeScrollbarsHiding && isBodyElement(target) && target,\r\n content: false,\r\n },\r\n scrollbars: {\r\n slot: true,\r\n },\r\n cancel: {\r\n nativeScrollbarsOverlaid: false,\r\n body: null,\r\n },\r\n };\r\n const staticDefaultOptions = assignDeep({}, defaultOptions);\r\n const getDefaultOptions = bind(\r\n assignDeep as typeof assignDeep<Options, Options>,\r\n {} as Options,\r\n staticDefaultOptions\r\n );\r\n const getDefaultInitialization = bind(\r\n assignDeep as typeof assignDeep<Initialization, Initialization>,\r\n {} as Initialization,\r\n staticDefaultInitialization\r\n );\r\n\r\n const env: Env = {\r\n _nativeScrollbarsSize: nativeScrollbarsSize,\r\n _nativeScrollbarsOverlaid: nativeScrollbarsOverlaid,\r\n _nativeScrollbarsHiding: nativeScrollbarsHiding,\r\n _scrollTimeline: !!scrollT,\r\n _addResizeListener: bind(addEvent, 'r'),\r\n _getDefaultInitialization: getDefaultInitialization,\r\n _setDefaultInitialization: (newInitializationStrategy) =>\r\n assignDeep(staticDefaultInitialization, newInitializationStrategy) &&\r\n getDefaultInitialization(),\r\n _getDefaultOptions: getDefaultOptions,\r\n _setDefaultOptions: (newDefaultOptions) =>\r\n assignDeep(staticDefaultOptions, newDefaultOptions) && getDefaultOptions(),\r\n _staticDefaultInitialization: assignDeep({}, staticDefaultInitialization),\r\n _staticDefaultOptions: assignDeep({}, staticDefaultOptions),\r\n };\r\n\r\n removeAttrs(envElm, 'style');\r\n removeElements(envElm);\r\n\r\n // needed in case content has css viewport units\r\n addEventListener(wnd, 'resize', () => {\r\n triggerEvent('r', []);\r\n });\r\n\r\n if (\r\n isFunction(wnd.matchMedia) &&\r\n !nativeScrollbarsHiding &&\r\n (!nativeScrollbarsOverlaid.x || !nativeScrollbarsOverlaid.y)\r\n ) {\r\n const addZoomListener = (onZoom: () => void) => {\r\n const media = wnd.matchMedia(`(resolution: ${wnd.devicePixelRatio}dppx)`);\r\n addEventListener(\r\n media,\r\n 'change',\r\n () => {\r\n onZoom();\r\n addZoomListener(onZoom);\r\n },\r\n {\r\n _once: true,\r\n }\r\n );\r\n };\r\n addZoomListener(() => {\r\n const [updatedNativeScrollbarSize, nativeScrollbarSizeChanged] =\r\n updateNativeScrollbarSizeCache();\r\n\r\n assignDeep(env._nativeScrollbarsSize, updatedNativeScrollbarSize); // keep the object and just re-assign!\r\n triggerEvent('r', [nativeScrollbarSizeChanged]);\r\n });\r\n }\r\n\r\n return env;\r\n};\r\n\r\nexport const getEnvironment = (): Env => {\r\n if (!environmentInstance) {\r\n environmentInstance = createEnvironment();\r\n }\r\n return environmentInstance;\r\n};\r\n", "/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport {\r\n each,\r\n noop,\r\n MutationObserverConstructor,\r\n addEventListener,\r\n is,\r\n find,\r\n push,\r\n runEachAndClear,\r\n bind,\r\n isEmptyArray,\r\n deduplicateArray,\r\n inArray,\r\n concat,\r\n getAttr,\r\n isString,\r\n} from '../support';\r\n\r\ntype DOMContentObserverCallback = (contentChangedThroughEvent: boolean) => any;\r\n\r\ntype DOMTargetObserverCallback = (targetChangedAttrs: string[], targetStyleChanged: boolean) => any;\r\n\r\ninterface DOMObserverOptionsBase {\r\n _attributes?: string[];\r\n /**\r\n * A function which can ignore a changed attribute if it returns true.\r\n * for DOMTargetObserver this applies to the changes to the observed target\r\n * for DOMContentObserver this applies to changes to nested targets -> nested targets are elements which match the \"_nestedTargetSelector\" selector\r\n */\r\n _ignoreTargetChange?: DOMObserverIgnoreTargetChange;\r\n}\r\n\r\ninterface DOMContentObserverOptions extends DOMObserverOptionsBase {\r\n _eventContentChange?: DOMObserverEventContentChange; // [selector, eventname(s) | function returning eventname(s)] -> eventnames divided by whitespaces\r\n _nestedTargetSelector?: string;\r\n _ignoreContentChange?: DOMObserverIgnoreContentChange; // function which will prevent marking certain dom changes as content change if it returns true\r\n}\r\n\r\ninterface DOMTargetObserverOptions extends DOMObserverOptionsBase {\r\n /**\r\n * Marks certain attributes as style changing, should be a subset of the _attributes prop.\r\n * Used to set the \"targetStyleChanged\" param in the DOMTargetObserverCallback.\r\n */\r\n _styleChangingAttributes?: string[] | readonly string[];\r\n}\r\n\r\ntype ContentChangeArrayItem = [selector?: string, eventNames?: string] | null | undefined;\r\n\r\nexport type DOMObserverEventContentChange =\r\n | Array<ContentChangeArrayItem>\r\n | false\r\n | null\r\n | undefined;\r\n\r\nexport type DOMObserverIgnoreContentChange = (\r\n mutation: MutationRecord,\r\n isNestedTarget: boolean,\r\n domObserverTarget: HTMLElement,\r\n domObserverOptions?: DOMContentObserverOptions\r\n) => boolean;\r\n\r\nexport type DOMObserverIgnoreTargetChange = (\r\n target: Node,\r\n attributeName: string,\r\n oldAttributeValue: string | null,\r\n newAttributeValue: string | null\r\n) => boolean;\r\n\r\nexport type DOMObserverCallback<ContentObserver extends boolean> = ContentObserver extends true\r\n ? DOMContentObserverCallback\r\n : DOMTargetObserverCallback;\r\n\r\nexport type DOMObserverOptions<ContentObserver extends boolean> = ContentObserver extends true\r\n ? DOMContentObserverOptions\r\n : DOMTargetObserverOptions;\r\n\r\nexport type DOMObserver<ContentObserver extends boolean> = [\r\n construct: () => () => void,\r\n update: () => void | false | Parameters<DOMObserverCallback<ContentObserver>>,\r\n];\r\n\r\ntype EventContentChangeUpdateElement = (\r\n getElements?: (selector: string) => Node[],\r\n removed?: boolean\r\n) => void;\r\ntype EventContentChange = [destroy: () => void, updateElements: EventContentChangeUpdateElement];\r\n\r\n/**\r\n * Creates a set of helper functions to observe events of elements inside the target element.\r\n * @param target The target element of which the children elements shall be observed. (not only direct children but also nested ones)\r\n * @param eventContentChange The event content change array. (array of tuples: selector and eventname(s))\r\n * @param callback Callback which is called if one of the elements emits the corresponding event.\r\n * @returns A object which contains a set of helper functions to destroy and update the observation of elements.\r\n */\r\nconst createEventContentChange = (\r\n target: HTMLElement,\r\n callback: (...args: any) => any,\r\n eventContentChange?: DOMObserverEventContentChange\r\n): EventContentChange => {\r\n let destroyed = false;\r\n const map = eventContentChange ? new WeakMap<Node, (() => any)[]>() : false; // weak map to prevent memory leak for detached elements\r\n const destroy = () => {\r\n destroyed = true;\r\n };\r\n const updateElements: EventContentChangeUpdateElement = (getElements) => {\r\n if (map && eventContentChange) {\r\n const eventElmList = eventContentChange.map((item) => {\r\n const [selector, eventNames] = item || [];\r\n const elements = eventNames && selector ? (getElements || find)(selector, target) : [];\r\n return [elements, eventNames] as const;\r\n });\r\n\r\n each(eventElmList, (item) =>\r\n each(item[0], (elm) => {\r\n const eventNames = item[1];\r\n const entries = map.get(elm) || [];\r\n const isTargetChild = target.contains(elm);\r\n\r\n if (isTargetChild && eventNames) {\r\n const removeListener = addEventListener(elm, eventNames, (event: Event) => {\r\n if (destroyed) {\r\n removeListener();\r\n map.delete(elm);\r\n } else {\r\n callback(event);\r\n }\r\n });\r\n map.set(elm, push(entries, removeListener));\r\n } else {\r\n runEachAndClear(entries);\r\n map.delete(elm);\r\n }\r\n })\r\n );\r\n }\r\n };\r\n\r\n updateElements();\r\n\r\n return [destroy, updateElements];\r\n};\r\n\r\n/**\r\n * Creates a DOM observer which observes DOM changes to either the target element or its children.\r\n * @param target The element which shall be observed.\r\n * @param isContentObserver Whether this observer is just observing the target or just the targets children. (not only direct children but also nested ones)\r\n * @param callback The callback which gets called if a change was detected.\r\n * @param options The options for DOM change detection.\r\n * @returns A object which represents the instance of the DOM observer.\r\n */\r\nexport const createDOMObserver = <ContentObserver extends boolean>(\r\n target: HTMLElement,\r\n isContentObserver: ContentObserver,\r\n callback: DOMObserverCallback<ContentObserver>,\r\n options?: DOMObserverOptions<ContentObserver>\r\n): DOMObserver<ContentObserver> => {\r\n let isConnected = false;\r\n const {\r\n _attributes,\r\n _styleChangingAttributes,\r\n _eventContentChange,\r\n _nestedTargetSelector,\r\n _ignoreTargetChange,\r\n _ignoreContentChange,\r\n } = (options as DOMContentObserverOptions & DOMTargetObserverOptions) || {};\r\n const [destroyEventContentChange, updateEventContentChangeElements] = createEventContentChange(\r\n target,\r\n () => isConnected && (callback as DOMContentObserverCallback)(true),\r\n _eventContentChange\r\n );\r\n\r\n // MutationObserver\r\n const finalAttributes = _attributes || [];\r\n const finalStyleChangingAttributes = _styleChangingAttributes || [];\r\n const observedAttributes = concat(finalAttributes, finalStyleChangingAttributes);\r\n const observerCallback = (\r\n fromRecords: boolean,\r\n mutations: MutationRecord[]\r\n ): void | Parameters<DOMObserverCallback<ContentObserver>> => {\r\n if (!isEmptyArray(mutations)) {\r\n const ignoreTargetChange = _ignoreTargetChange || noop;\r\n const ignoreContentChange = _ignoreContentChange || noop;\r\n const totalChangedNodes: Node[] = [];\r\n const targetChangedAttrs: string[] = [];\r\n let targetStyleChanged: boolean | '' | null | undefined = false;\r\n let contentChanged: boolean | '' | null | undefined = false;\r\n let childListChanged: boolean | '' | null | undefined = false;\r\n\r\n each(mutations, (mutation) => {\r\n const {\r\n attributeName,\r\n target: mutationTarget,\r\n type,\r\n oldValue,\r\n addedNodes,\r\n removedNodes,\r\n } = mutation;\r\n const isAttributesType = type === 'attributes';\r\n const isChildListType = type === 'childList';\r\n const targetIsMutationTarget = target === mutationTarget;\r\n const isAttrChange = isAttributesType && attributeName;\r\n const newValue =\r\n isAttrChange && getAttr(mutationTarget as HTMLElement, attributeName || '');\r\n // narrow down attributeValue type to `string` or `null` but don't overwrite `<empty string>` with `null`\r\n const attributeValue = isString(newValue) ? newValue : null;\r\n const attributeChanged = isAttrChange && oldValue !== attributeValue;\r\n const styleChangingAttrChanged =\r\n inArray(finalStyleChangingAttributes, attributeName) && attributeChanged;\r\n\r\n // if is content observer and something changed in children\r\n if (isContentObserver && (isChildListType || !targetIsMutationTarget)) {\r\n const contentAttrChanged = isAttributesType && attributeChanged;\r\n const isNestedTarget =\r\n contentAttrChanged &&\r\n _nestedTargetSelector &&\r\n is(mutationTarget, _nestedTargetSelector);\r\n const baseAssertion = isNestedTarget\r\n ? !ignoreTargetChange(mutationTarget, attributeName, oldValue, attributeValue)\r\n : !isAttributesType || contentAttrChanged;\r\n const contentFinalChanged =\r\n baseAssertion && !ignoreContentChange(mutation, !!isNestedTarget, target, options);\r\n\r\n each(addedNodes, (node) => push(totalChangedNodes, node));\r\n each(removedNodes, (node) => push(totalChangedNodes, node));\r\n\r\n contentChanged = contentChanged || contentFinalChanged;\r\n childListChanged = childListChanged || isChildListType;\r\n }\r\n // if is target observer and target attr changed\r\n if (\r\n !isContentObserver &&\r\n targetIsMutationTarget &&\r\n attributeChanged &&\r\n !ignoreTargetChange(mutationTarget, attributeName!, oldValue, attributeValue)\r\n ) {\r\n push(targetChangedAttrs, attributeName);\r\n targetStyleChanged = targetStyleChanged || styleChangingAttrChanged;\r\n }\r\n });\r\n\r\n // adds / removes the new elements from the event content change\r\n updateEventContentChangeElements((selector: string) =>\r\n deduplicateArray(totalChangedNodes).reduce<Node[]>((arr, node) => {\r\n push(arr, find(selector, node));\r\n return is(node, selector) ? push(arr, node) : arr;\r\n }, [])\r\n );\r\n\r\n if (isContentObserver) {\r\n if (!fromRecords && contentChanged) {\r\n (callback as DOMContentObserverCallback)(false);\r\n }\r\n return [false] satisfies Parameters<DOMObserverCallback<true>> as Parameters<\r\n DOMObserverCallback<ContentObserver>\r\n >;\r\n }\r\n\r\n if (!isEmptyArray(targetChangedAttrs) || targetStyleChanged) {\r\n const args = [\r\n deduplicateArray(targetChangedAttrs),\r\n targetStyleChanged,\r\n ] satisfies Parameters<DOMTargetObserverCallback> & Parameters<DOMObserverCallback<false>>;\r\n\r\n if (!fromRecords) {\r\n (callback as DOMTargetObserverCallback).apply(0, args);\r\n }\r\n\r\n return args as Parameters<DOMObserverCallback<ContentObserver>>;\r\n }\r\n }\r\n };\r\n const mutationObserver: MutationObserver = new MutationObserverConstructor!(\r\n bind(observerCallback, false)\r\n );\r\n\r\n return [\r\n () => {\r\n mutationObserver.observe(target, {\r\n attributes: true,\r\n attributeOldValue: true,\r\n attributeFilter: observedAttributes,\r\n subtree: isContentObserver,\r\n childList: isContentObserver,\r\n characterData: isContentObserver,\r\n });\r\n isConnected = true;\r\n\r\n return () => {\r\n if (isConnected) {\r\n destroyEventContentChange();\r\n mutationObserver.disconnect();\r\n isConnected = false;\r\n }\r\n };\r\n },\r\n () => {\r\n if (isConnected) {\r\n return observerCallback(true, mutationObserver.takeRecords());\r\n }\r\n },\r\n ];\r\n};\r\n", "import type { SizeObserverPlugin } from '../plugins';\r\nimport {\r\n createCache,\r\n createDOM,\r\n runEachAndClear,\r\n addEventListener,\r\n addClass,\r\n push,\r\n ResizeObserverConstructor,\r\n appendChildren,\r\n domRectHasDimensions,\r\n bind,\r\n noop,\r\n domRectAppeared,\r\n concat,\r\n debounce,\r\n isBoolean,\r\n isArray,\r\n isEmptyArray,\r\n} from '../support';\r\nimport {\r\n classNameSizeObserver,\r\n classNameSizeObserverAppear,\r\n classNameSizeObserverListener,\r\n} from '../classnames';\r\nimport { getStaticPluginModuleInstance, sizeObserverPluginName } from '../plugins';\r\n\r\nexport interface SizeObserverOptions {\r\n /** Whether appearing should be observed. */\r\n _appear?: boolean;\r\n}\r\n\r\nexport interface SizeObserverCallbackParams {\r\n _sizeChanged: boolean;\r\n _appear?: boolean;\r\n}\r\n\r\nexport type SizeObserver = () => () => void;\r\n\r\nlet resizeObserverBoxSupport: boolean | null = null;\r\n\r\n/**\r\n * Creates a size observer which observes any size, padding, border, margin and box-sizing changes of the target element. Depending on the options also direction and appear can be observed.\r\n * @param target The target element which shall be observed.\r\n * @param onSizeChangedCallback The callback which gets called after a size change was detected.\r\n * @param options The options for size detection, whether to observe also direction and appear.\r\n * @returns A object which represents the instance of the size observer.\r\n */\r\nexport const createSizeObserver = (\r\n target: HTMLElement,\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSizeChangedCallback: (params: SizeObserverCallbackParams) => any,\r\n options?: SizeObserverOptions\r\n): SizeObserver => {\r\n const { _appear: observeAppearChange } = options || {};\r\n const sizeObserverPlugin =\r\n getStaticPluginModuleInstance<typeof SizeObserverPlugin>(sizeObserverPluginName);\r\n const [updateResizeObserverContentRectCache] = createCache<DOMRectReadOnly | false>({\r\n _initialValue: false,\r\n _alwaysUpdateValues: true,\r\n });\r\n\r\n return () => {\r\n const destroyFns: (() => void)[] = [];\r\n const polyfillElements = createDOM(\r\n `<div class=\"${classNameSizeObserver}\"><div class=\"${classNameSizeObserverListener}\"></div></div>`\r\n );\r\n const polyfillRootElement = polyfillElements[0] as HTMLElement;\r\n const polyfillTargetElement = polyfillRootElement.firstChild as HTMLElement;\r\n\r\n const onSizeChangedCallbackProxy = (sizeChangedContext?: ResizeObserverEntry[] | boolean) => {\r\n const isResizeObserverCall = isArray(sizeChangedContext) && !isEmptyArray(sizeChangedContext);\r\n\r\n let skip = false;\r\n let appear = false;\r\n\r\n // if triggered from RO.\r\n if (isResizeObserverCall) {\r\n const resizeObserverEntry = sizeChangedContext[0];\r\n const [currContentRect, , prevContentRect] = updateResizeObserverContentRectCache(\r\n resizeObserverEntry.contentRect\r\n );\r\n const hasDimensions = domRectHasDimensions(currContentRect);\r\n appear = domRectAppeared(currContentRect, prevContentRect);\r\n skip = !appear && !hasDimensions; // skip if display is none or when window resize\r\n }\r\n // else if it triggered with appear from polyfill\r\n else {\r\n appear = sizeChangedContext === true;\r\n }\r\n\r\n if (!skip) {\r\n onSizeChangedCallback({\r\n _sizeChanged: true,\r\n _appear: appear,\r\n });\r\n }\r\n };\r\n\r\n if (ResizeObserverConstructor) {\r\n if (!isBoolean(resizeObserverBoxSupport)) {\r\n const detectSupportResizeObserver = new ResizeObserverConstructor(noop);\r\n detectSupportResizeObserver.observe(target, {\r\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\r\n // @ts-ignore -> void === undefined\r\n get box() {\r\n resizeObserverBoxSupport = true;\r\n },\r\n });\r\n resizeObserverBoxSupport = resizeObserverBoxSupport || false;\r\n detectSupportResizeObserver.disconnect();\r\n }\r\n\r\n /*\r\n const { port1, port2 } = new MessageChannel();\r\n const tasks: Set<() => void> = new Set();\r\n const debounceTiming: DebounceTiming = {\r\n _debouncer: (task) => {\r\n tasks.add(task);\r\n port2.postMessage(0);\r\n return () => {\r\n tasks.delete(task);\r\n };\r\n },\r\n };\r\n port1.onmessage = () => {\r\n tasks.forEach((task) => task());\r\n };\r\n */\r\n const debouncedOnSizeChangedCallbackProxy = debounce(onSizeChangedCallbackProxy, {\r\n _debounceTiming: 0,\r\n _maxDebounceTiming: 0,\r\n });\r\n const resizeObserverCallback = (entries: ResizeObserverEntry[]) =>\r\n debouncedOnSizeChangedCallbackProxy(entries);\r\n const contentBoxResizeObserver = new ResizeObserverConstructor(resizeObserverCallback);\r\n contentBoxResizeObserver.observe(resizeObserverBoxSupport ? target : polyfillTargetElement);\r\n\r\n push(destroyFns, [\r\n () => {\r\n contentBoxResizeObserver.disconnect();\r\n /*\r\n port1.close();\r\n port2.close();\r\n tasks.clear();\r\n */\r\n },\r\n !resizeObserverBoxSupport && appendChildren(target, polyfillRootElement),\r\n ]);\r\n\r\n if (resizeObserverBoxSupport) {\r\n const borderBoxResizeObserver = new ResizeObserverConstructor(resizeObserverCallback);\r\n borderBoxResizeObserver.observe(target, {\r\n box: 'border-box',\r\n });\r\n push(destroyFns, () => borderBoxResizeObserver.disconnect());\r\n }\r\n } else if (sizeObserverPlugin) {\r\n const [pluginAppearCallback, pluginDestroyFns] = sizeObserverPlugin(\r\n polyfillTargetElement,\r\n onSizeChangedCallbackProxy,\r\n observeAppearChange\r\n );\r\n push(\r\n destroyFns,\r\n concat(\r\n [\r\n addClass(polyfillRootElement, classNameSizeObserverAppear),\r\n addEventListener(polyfillRootElement, 'animationstart', pluginAppearCallback),\r\n appendChildren(target, polyfillRootElement),\r\n ],\r\n pluginDestroyFns\r\n )\r\n );\r\n } else {\r\n return noop;\r\n }\r\n\r\n return bind(runEachAndClear, destroyFns);\r\n };\r\n};\r\n", "import type { WH, CacheValues } from '../support';\r\nimport { createSizeObserver } from './sizeObserver';\r\nimport { classNameTrinsicObserver } from '../classnames';\r\nimport {\r\n createDiv,\r\n getOffsetSize,\r\n runEachAndClear,\r\n createCache,\r\n push,\r\n IntersectionObserverConstructor,\r\n appendChildren,\r\n bind,\r\n} from '../support';\r\n\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nexport type TrinsicObserverCallback = (heightIntrinsic: CacheValues<boolean>) => any;\r\nexport type TrinsicObserver = [\r\n construct: () => () => void,\r\n update: () => void | false | null | undefined | Parameters<TrinsicObserverCallback>,\r\n];\r\n\r\n/**\r\n * Creates a trinsic observer which observes changes to intrinsic or extrinsic sizing for the height of the target element.\r\n * @param target The element which shall be observed.\r\n * @param onTrinsicChangedCallback The callback which gets called after a change was detected.\r\n * @returns A object which represents the instance of the trinsic observer.\r\n */\r\nexport const createTrinsicObserver = (\r\n target: HTMLElement,\r\n onTrinsicChangedCallback: TrinsicObserverCallback\r\n): TrinsicObserver => {\r\n let intersectionObserverInstance: undefined | IntersectionObserver;\r\n const isHeightIntrinsic = (ioEntryOrSize: IntersectionObserverEntry | WH<number>): boolean =>\r\n (ioEntryOrSize as WH<number>).h === 0 ||\r\n (ioEntryOrSize as IntersectionObserverEntry).isIntersecting ||\r\n (ioEntryOrSize as IntersectionObserverEntry).intersectionRatio > 0;\r\n const trinsicObserver = createDiv(classNameTrinsicObserver);\r\n const [updateHeightIntrinsicCache] = createCache({\r\n _initialValue: false,\r\n });\r\n const triggerOnTrinsicChangedCallback = (\r\n updateValue: IntersectionObserverEntry | WH<number> | undefined,\r\n fromRecords?: boolean\r\n ): void | Parameters<TrinsicObserverCallback> => {\r\n if (updateValue) {\r\n const heightIntrinsic = updateHeightIntrinsicCache(isHeightIntrinsic(updateValue));\r\n const [, heightIntrinsicChanged] = heightIntrinsic;\r\n return (\r\n heightIntrinsicChanged &&\r\n !fromRecords &&\r\n onTrinsicChangedCallback(heightIntrinsic) && [heightIntrinsic]\r\n );\r\n }\r\n };\r\n const intersectionObserverCallback = (\r\n fromRecords: boolean,\r\n entries: IntersectionObserverEntry[]\r\n ) => triggerOnTrinsicChangedCallback(entries.pop(), fromRecords);\r\n\r\n return [\r\n () => {\r\n const destroyFns: (() => void)[] = [];\r\n\r\n if (IntersectionObserverConstructor) {\r\n intersectionObserverInstance = new IntersectionObserverConstructor(\r\n bind(intersectionObserverCallback, false),\r\n { root: target }\r\n );\r\n intersectionObserverInstance.observe(trinsicObserver);\r\n push(destroyFns, () => {\r\n intersectionObserverInstance!.disconnect();\r\n });\r\n } else {\r\n const onSizeChanged = () => {\r\n const newSize = getOffsetSize(trinsicObserver);\r\n triggerOnTrinsicChangedCallback(newSize);\r\n };\r\n push(destroyFns, createSizeObserver(trinsicObserver, onSizeChanged)());\r\n onSizeChanged();\r\n }\r\n\r\n return bind(runEachAndClear, push(destroyFns, appendChildren(target, trinsicObserver)));\r\n },\r\n () =>\r\n intersectionObserverInstance &&\r\n intersectionObserverCallback(true, intersectionObserverInstance.takeRecords()),\r\n ];\r\n};\r\n", "import type { Options, OptionsCheckFn, OptionsDebounceValue } from '../../options';\r\nimport type { ScrollbarsHidingPlugin } from '../../plugins';\r\nimport type { SizeObserverCallbackParams } from '../../observers';\r\nimport type { StructureSetupElementsObj } from '../structureSetup/structureSetup.elements';\r\nimport type { Setup, SetupUpdateInfo, StructureSetupState } from '../../setups';\r\nimport type { CacheValues, DebounceLeading, DebounceTiming, WH } from '../../support';\r\nimport type { PlainObject } from '../../typings';\r\nimport { defaultOptionsUpdateDebounceEnv, defaultOptionsUpdateDebounceEvent } from '../../options';\r\nimport { getStaticPluginModuleInstance, scrollbarsHidingPluginName } from '../../plugins';\r\nimport {\r\n classNameScrollbar,\r\n dataAttributeHost,\r\n dataAttributeViewport,\r\n dataValueViewportMeasuring,\r\n dataValueViewportArrange,\r\n dataValueNoClipping,\r\n} from '../../classnames';\r\nimport { getEnvironment } from '../../environment';\r\nimport { createDOMObserver, createSizeObserver, createTrinsicObserver } from '../../observers';\r\nimport {\r\n ResizeObserverConstructor,\r\n assignDeep,\r\n closest,\r\n createCache,\r\n debounce,\r\n equalWH,\r\n getFractionalSize,\r\n isArray,\r\n isFunction,\r\n isNumber,\r\n isPlainObject,\r\n keys,\r\n liesBetween,\r\n getScrollSize,\r\n getElementScroll,\r\n scrollElementTo,\r\n domRectAppeared,\r\n concat,\r\n getStyles,\r\n hasAttrClass,\r\n} from '../../support';\r\n\r\nexport interface ObserversSetupState {\r\n _heightIntrinsic: boolean;\r\n _directionIsRTL: boolean;\r\n}\r\n\r\nexport interface ObserversSetupUpdateInfo extends SetupUpdateInfo {\r\n _takeRecords?: boolean;\r\n}\r\n\r\nexport type ObserversSetupUpdateHints = {\r\n _sizeChanged?: boolean;\r\n _directionChanged?: boolean;\r\n _heightIntrinsicChanged?: boolean;\r\n _hostMutation?: boolean;\r\n _contentMutation?: boolean;\r\n _appear?: boolean;\r\n _scrollbarSizeChanged?: boolean;\r\n};\r\n\r\nexport type ObserversSetup = Setup<\r\n ObserversSetupUpdateInfo,\r\n ObserversSetupState,\r\n ObserversSetupUpdateHints\r\n>;\r\n\r\nexport const createObserversSetup = (\r\n structureSetupElements: StructureSetupElementsObj,\r\n structureSetupState: StructureSetupState,\r\n getCurrentOption: OptionsCheckFn<Options>,\r\n onObserversUpdated: (updateHints: ObserversSetupUpdateHints) => void\r\n): ObserversSetup => {\r\n // latest debounce options\r\n let debounceMutation: OptionsDebounceValue | undefined;\r\n let debounceResize: OptionsDebounceValue | undefined;\r\n let debounceEvent: OptionsDebounceValue | undefined;\r\n let debounceEnv: OptionsDebounceValue | undefined;\r\n\r\n let updateContentMutationObserver: (() => void) | undefined;\r\n let destroyContentMutationObserver: (() => void) | undefined;\r\n let prevContentRect: DOMRectReadOnly | undefined;\r\n let prevDirectionIsRTL: boolean | undefined;\r\n const hostSelector = `[${dataAttributeHost}]`;\r\n\r\n // TODO: observer textarea attrs if textarea\r\n\r\n const viewportSelector = `[${dataAttributeViewport}]`;\r\n const baseStyleChangingAttrs = ['id', 'class', 'style', 'open', 'wrap', 'cols', 'rows'];\r\n const {\r\n _target,\r\n _host,\r\n _viewport,\r\n _scrollOffsetElement,\r\n _content,\r\n _viewportIsTarget,\r\n _isBody,\r\n _viewportHasClass,\r\n _viewportAddRemoveClass,\r\n _removeScrollObscuringStyles,\r\n } = structureSetupElements;\r\n const getDirectionIsRTL = (elm: HTMLElement): boolean => getStyles(elm, 'direction') === 'rtl';\r\n const createDebouncedObservesUpdate = () => {\r\n let currDebounceTiming: DebounceTiming;\r\n let currMaxDebounceTiming: DebounceTiming;\r\n let currDebounceLeading: DebounceLeading;\r\n const debouncedFn = debounce(onObserversUpdated, {\r\n _debounceTiming: () => currDebounceTiming,\r\n _maxDebounceTiming: () => currMaxDebounceTiming,\r\n _leading: () => currDebounceLeading,\r\n _mergeParams(prev, curr) {\r\n const [prevObj] = prev;\r\n const [currObj] = curr;\r\n return [\r\n concat(keys(prevObj), keys(currObj)).reduce((obj, key) => {\r\n obj[key] = prevObj[key as keyof typeof prevObj] || currObj[key as keyof typeof currObj];\r\n return obj;\r\n }, {} as PlainObject),\r\n ] as [Partial<ObserversSetupUpdateHints>];\r\n },\r\n });\r\n const fn = (\r\n updateHints: ObserversSetupUpdateHints,\r\n debounceOption: OptionsDebounceValue | false | undefined\r\n ) => {\r\n if (isArray(debounceOption)) {\r\n const [timing, maxTiming, leading] = debounceOption;\r\n currDebounceTiming = timing;\r\n currMaxDebounceTiming = maxTiming;\r\n currDebounceLeading = leading;\r\n } else if (isNumber(debounceOption)) {\r\n currDebounceTiming = debounceOption;\r\n currMaxDebounceTiming = false;\r\n currDebounceLeading = false;\r\n } else {\r\n currDebounceTiming = false;\r\n currMaxDebounceTiming = false;\r\n currDebounceLeading = false;\r\n }\r\n\r\n debouncedFn(updateHints);\r\n };\r\n fn._flush = debouncedFn._flush;\r\n\r\n return fn;\r\n };\r\n\r\n const state: ObserversSetupState = {\r\n _heightIntrinsic: false,\r\n _directionIsRTL: getDirectionIsRTL(_target),\r\n };\r\n const env = getEnvironment();\r\n const scrollbarsHidingPlugin = getStaticPluginModuleInstance<typeof ScrollbarsHidingPlugin>(\r\n scrollbarsHidingPluginName\r\n );\r\n const [updateContentSizeCache] = createCache<WH<number>>(\r\n {\r\n _equal: equalWH,\r\n _initialValue: { w: 0, h: 0 },\r\n },\r\n () => {\r\n const undoViewportArrange =\r\n scrollbarsHidingPlugin &&\r\n scrollbarsHidingPlugin._viewportArrangement(\r\n structureSetupElements,\r\n structureSetupState,\r\n state,\r\n env,\r\n getCurrentOption\r\n )._undoViewportArrange;\r\n\r\n const viewportIsTargetBody = _isBody && _viewportIsTarget;\r\n const noClipping =\r\n !viewportIsTargetBody && hasAttrClass(_host, dataAttributeHost, dataValueNoClipping);\r\n const isArranged = !_viewportIsTarget && _viewportHasClass(dataValueViewportArrange);\r\n const scrollOffset = isArranged && getElementScroll(_scrollOffsetElement);\r\n const revertScrollObscuringStyles = scrollOffset && _removeScrollObscuringStyles();\r\n\r\n const revertMeasuring = _viewportAddRemoveClass(dataValueViewportMeasuring, noClipping);\r\n const redoViewportArrange = isArranged && undoViewportArrange && undoViewportArrange();\r\n const viewportScroll = getScrollSize(_viewport);\r\n const fractional = getFractionalSize(_viewport);\r\n\r\n if (redoViewportArrange) {\r\n redoViewportArrange();\r\n }\r\n\r\n scrollElementTo(_scrollOffsetElement, scrollOffset);\r\n if (revertScrollObscuringStyles) {\r\n revertScrollObscuringStyles();\r\n }\r\n if (noClipping) {\r\n revertMeasuring();\r\n }\r\n\r\n return {\r\n w: viewportScroll.w + fractional.w,\r\n h: viewportScroll.h + fractional.h,\r\n };\r\n }\r\n );\r\n const onObserversUpdatedDebounced = createDebouncedObservesUpdate();\r\n const setDirection = (updateHints: ObserversSetupUpdateHints) => {\r\n const newDirectionIsRTL = getDirectionIsRTL(_target);\r\n assignDeep(updateHints, { _directionChanged: prevDirectionIsRTL !== newDirectionIsRTL });\r\n assignDeep(state, { _directionIsRTL: newDirectionIsRTL });\r\n prevDirectionIsRTL = newDirectionIsRTL;\r\n };\r\n const onTrinsicChanged = (\r\n heightIntrinsicCache: CacheValues<boolean>,\r\n fromRecords?: true\r\n ): ObserversSetupUpdateHints => {\r\n const [heightIntrinsic, heightIntrinsicChanged] = heightIntrinsicCache;\r\n const updateHints: ObserversSetupUpdateHints = {\r\n _heightIntrinsicChanged: heightIntrinsicChanged,\r\n };\r\n\r\n assignDeep(state, { _heightIntrinsic: heightIntrinsic });\r\n\r\n if (!fromRecords) {\r\n onObserversUpdated(updateHints);\r\n }\r\n\r\n return updateHints;\r\n };\r\n const onSizeChanged = ({ _sizeChanged, _appear }: SizeObserverCallbackParams) => {\r\n // only don't debounce appear since it shouldn't happen that frequently\r\n const updateFn = _appear ? onObserversUpdated : onObserversUpdatedDebounced;\r\n const updateHints: ObserversSetupUpdateHints = {\r\n _sizeChanged: _sizeChanged || _appear,\r\n _appear,\r\n };\r\n\r\n setDirection(updateHints);\r\n updateFn(updateHints, debounceResize);\r\n };\r\n const onContentMutation = (\r\n contentChangedThroughEvent: boolean,\r\n fromRecords?: true\r\n ): ObserversSetupUpdateHints => {\r\n const [, _contentMutation] = updateContentSizeCache();\r\n const updateHints: ObserversSetupUpdateHints = {\r\n _contentMutation,\r\n };\r\n\r\n setDirection(updateHints);\r\n\r\n if (_contentMutation && !fromRecords) {\r\n onObserversUpdatedDebounced(\r\n updateHints,\r\n contentChangedThroughEvent ? debounceEvent : debounceMutation\r\n );\r\n }\r\n\r\n return updateHints;\r\n };\r\n const onHostMutation = (\r\n targetChangedAttrs: string[],\r\n targetStyleChanged: boolean,\r\n fromRecords?: true\r\n ): ObserversSetupUpdateHints => {\r\n const updateHints: ObserversSetupUpdateHints = {\r\n _hostMutation: targetStyleChanged,\r\n };\r\n\r\n setDirection(updateHints);\r\n\r\n if (targetStyleChanged && !fromRecords) {\r\n onObserversUpdatedDebounced(updateHints, debounceMutation);\r\n }\r\n /*\r\n else if (!_viewportIsTarget) {\r\n updateViewportAttrsFromHost(targetChangedAttrs);\r\n }\r\n */\r\n\r\n return updateHints;\r\n };\r\n const [constructTrinsicObserver, updateTrinsicObserver] = _content\r\n ? createTrinsicObserver(_host, onTrinsicChanged)\r\n : [];\r\n const constructSizeObserver =\r\n !_viewportIsTarget &&\r\n createSizeObserver(_host, onSizeChanged, {\r\n _appear: true,\r\n });\r\n const [constructHostMutationObserver, updateHostMutationObserver] = createDOMObserver(\r\n _host,\r\n false,\r\n onHostMutation,\r\n {\r\n _styleChangingAttributes: baseStyleChangingAttrs,\r\n _attributes: baseStyleChangingAttrs,\r\n }\r\n );\r\n const viewportIsTargetResizeObserver =\r\n _viewportIsTarget &&\r\n ResizeObserverConstructor &&\r\n new ResizeObserverConstructor((entries) => {\r\n const currContentRect = entries[entries.length - 1].contentRect;\r\n onSizeChanged({\r\n _sizeChanged: true,\r\n _appear: domRectAppeared(currContentRect, prevContentRect),\r\n });\r\n prevContentRect = currContentRect;\r\n });\r\n\r\n return [\r\n () => {\r\n // order is matter!\r\n // updateViewportAttrsFromHost();\r\n if (viewportIsTargetResizeObserver) {\r\n viewportIsTargetResizeObserver.observe(_host);\r\n }\r\n const destroySizeObserver = constructSizeObserver && constructSizeObserver();\r\n const destroyTrinsicObserver = constructTrinsicObserver && constructTrinsicObserver();\r\n const destroyHostMutationObserver = constructHostMutationObserver();\r\n const removeResizeListener = env._addResizeListener((_scrollbarSizeChanged) => {\r\n const [, _contentMutation] = updateContentSizeCache();\r\n onObserversUpdatedDebounced(\r\n { _scrollbarSizeChanged, _contentMutation, _sizeChanged: _isBody },\r\n debounceEnv\r\n );\r\n });\r\n\r\n return () => {\r\n if (viewportIsTargetResizeObserver) {\r\n viewportIsTargetResizeObserver.disconnect();\r\n }\r\n if (destroySizeObserver) {\r\n destroySizeObserver();\r\n }\r\n if (destroyTrinsicObserver) {\r\n destroyTrinsicObserver();\r\n }\r\n if (destroyContentMutationObserver) {\r\n destroyContentMutationObserver();\r\n }\r\n destroyHostMutationObserver();\r\n removeResizeListener();\r\n };\r\n },\r\n ({ _checkOption, _takeRecords, _force }) => {\r\n const updateHints: ObserversSetupUpdateHints = {};\r\n\r\n const [ignoreMutation] = _checkOption('update.ignoreMutation');\r\n const [attributes, attributesChanged] = _checkOption('update.attributes');\r\n const [elementEvents, elementEventsChanged] = _checkOption('update.elementEvents');\r\n const [debounceValue, debounceChanged] = _checkOption('update.debounce');\r\n const contentMutationObserverChanged = elementEventsChanged || attributesChanged;\r\n const takeRecords = _takeRecords || _force;\r\n const ignoreMutationFromOptions = (mutation: MutationRecord) =>\r\n isFunction(ignoreMutation) && ignoreMutation(mutation);\r\n\r\n if (contentMutationObserverChanged) {\r\n if (updateContentMutationObserver) {\r\n updateContentMutationObserver();\r\n }\r\n if (destroyContentMutationObserver) {\r\n destroyContentMutationObserver();\r\n }\r\n\r\n const [construct, update] = createDOMObserver(\r\n _content || _viewport,\r\n true,\r\n onContentMutation,\r\n {\r\n _attributes: concat(baseStyleChangingAttrs, attributes || []),\r\n _eventContentChange: elementEvents,\r\n _nestedTargetSelector: hostSelector,\r\n _ignoreContentChange: (mutation, isNestedTarget) => {\r\n const { target: mutationTarget, attributeName } = mutation;\r\n const ignore =\r\n !isNestedTarget && attributeName && !_viewportIsTarget\r\n ? liesBetween(mutationTarget, hostSelector, viewportSelector)\r\n : false;\r\n return (\r\n ignore ||\r\n !!closest(mutationTarget, `.${classNameScrollbar}`) || // ignore explicitely all scrollbar elements\r\n !!ignoreMutationFromOptions(mutation)\r\n );\r\n },\r\n }\r\n );\r\n\r\n destroyContentMutationObserver = construct();\r\n updateContentMutationObserver = update;\r\n }\r\n\r\n if (debounceChanged) {\r\n onObserversUpdatedDebounced._flush();\r\n // parse and distribute the debounce option\r\n if (isArray(debounceValue) || isNumber(debounceValue)) {\r\n // deprecated behavior: Value applies to mutation. resize and event are undefined\r\n debounceMutation = debounceValue;\r\n debounceResize = false;\r\n debounceEvent = defaultOptionsUpdateDebounceEvent;\r\n debounceEnv = defaultOptionsUpdateDebounceEnv;\r\n } else if (isPlainObject(debounceValue)) {\r\n debounceMutation = debounceValue.mutation;\r\n debounceResize = debounceValue.resize;\r\n debounceEvent = debounceValue.event;\r\n debounceEnv = debounceValue.env;\r\n } else {\r\n debounceMutation = false;\r\n debounceResize = false;\r\n debounceEvent = false;\r\n debounceEnv = false;\r\n }\r\n }\r\n\r\n if (takeRecords) {\r\n const hostUpdateResult = updateHostMutationObserver();\r\n const trinsicUpdateResult = updateTrinsicObserver && updateTrinsicObserver();\r\n const contentUpdateResult =\r\n updateContentMutationObserver && updateContentMutationObserver();\r\n\r\n if (hostUpdateResult) {\r\n assignDeep(\r\n updateHints,\r\n onHostMutation(hostUpdateResult[0], hostUpdateResult[1], takeRecords)\r\n );\r\n }\r\n\r\n if (trinsicUpdateResult) {\r\n assignDeep(updateHints, onTrinsicChanged(trinsicUpdateResult[0], takeRecords));\r\n }\r\n\r\n if (contentUpdateResult) {\r\n assignDeep(updateHints, onContentMutation(contentUpdateResult[0], takeRecords));\r\n }\r\n }\r\n\r\n setDirection(updateHints);\r\n\r\n return updateHints;\r\n },\r\n state,\r\n ];\r\n};\r\n", "/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport type { DeepPartial } from './typings';\r\nimport { isFunction, isHTMLElement, isNull, isUndefined } from './support';\r\nimport { getEnvironment } from './environment';\r\n\r\ntype FallbackStaticInitializtationElement<Args extends any[]> =\r\n Extract<StaticInitializationElement<Args>, (...args: Args) => any> extends (\r\n ...args: infer P\r\n ) => any\r\n ? (...args: P) => HTMLElement\r\n : never;\r\ntype FallbackDynamicInitializtationElement<Args extends any[]> =\r\n Extract<DynamicInitializationElement<Args>, (...args: Args) => any> extends (\r\n ...args: infer P\r\n ) => any\r\n ? (...args: P) => HTMLElement\r\n : never;\r\n\r\nexport type StaticInitialization = HTMLElement | false | null;\r\nexport type DynamicInitialization = HTMLElement | boolean | null;\r\n\r\n/**\r\n * Static elements are elements which MUST be present in the final DOM.\r\n * If an `HTMLElement` is passed the passed element will be taken as the repsective element.\r\n * With `false`, `null` or `undefined` an appropriate element is generated automatically.\r\n */\r\nexport type StaticInitializationElement<Args extends any[]> =\r\n /** A function which returns the the StaticInitialization value. */\r\n | ((...args: Args) => StaticInitialization)\r\n /** The StaticInitialization value. */\r\n | StaticInitialization;\r\n\r\n/**\r\n * Dynamic elements are elements which CAN be present in the final DOM.\r\n * If an `HTMLElement`is passed the passed element will be taken as the repsective element.\r\n * With `true` an appropriate element is generated automatically.\r\n * With `false`, `null` or `undefined` the element won't be in the DOM.\r\n */\r\nexport type DynamicInitializationElement<Args extends any[]> =\r\n /** A function which returns the the DynamicInitialization value. */\r\n | ((...args: Args) => DynamicInitialization)\r\n /** The DynamicInitialization value. */\r\n | DynamicInitialization;\r\n\r\n/**\r\n * Describes how a OverlayScrollbar instance should initialize.\r\n */\r\nexport type Initialization = {\r\n /**\r\n * Customizes which elements are generated and used.\r\n * If a function is passed to any of the fields, it receives the `target` element as its argument.\r\n * Any passed function should be a \"pure\" function. (same input produces same output)\r\n */\r\n elements: {\r\n /**\r\n * Assign a custom element as the host element.\r\n * Only relevant if the target element is a Textarea.\r\n */\r\n host: StaticInitializationElement<[target: InitializationTargetElement]>;\r\n /** Assign a custom element as the viewport element. */\r\n viewport: StaticInitializationElement<[target: InitializationTargetElement]>;\r\n /** Assign a custom element as the padding element or force the element not to be generated. */\r\n padding: DynamicInitializationElement<[target: InitializationTargetElement]>;\r\n /** Assign a custom element as the content element or force the element not to be generated. */\r\n content: DynamicInitializationElement<[target: InitializationTargetElement]>;\r\n };\r\n /**\r\n * Customizes elements related to the scrollbars.\r\n * If a function is passed, it receives the `target`, `host` and `viewport` element as arguments.\r\n */\r\n scrollbars: {\r\n slot: DynamicInitializationElement<\r\n [target: InitializationTargetElement, host: HTMLElement, viewport: HTMLElement]\r\n >;\r\n };\r\n /**\r\n * Customizes the cancelation behavior.\r\n */\r\n cancel: {\r\n /** Whether the initialization shall be canceled if the native scrollbars are overlaid. */\r\n nativeScrollbarsOverlaid: boolean;\r\n /**\r\n * Whether the initialization shall be canceled if its applied to a body element.\r\n * With `true` an initialization is always canceled, with `false` its never canceled.\r\n * With `null` the initialization will only be canceled when the initialization would affect the browsers functionality. (window.scrollTo, mobile browser behavior etc.)\r\n */\r\n body: boolean | null;\r\n };\r\n};\r\n\r\nexport type PartialInitialization = DeepPartial<Initialization>;\r\n\r\n/** The initialization target element. */\r\nexport type InitializationTargetElement = HTMLElement; // | HTMLTextAreaElement;\r\n\r\n/**\r\n * The initialization target object.\r\n * OverlayScrollbars({ target: myElement }) is equivalent to OverlayScrollbars(myElement).\r\n */\r\nexport type InitializationTargetObject = PartialInitialization & {\r\n target: InitializationTargetElement;\r\n};\r\n\r\n/** The initialization target. */\r\nexport type InitializationTarget = InitializationTargetElement | InitializationTargetObject;\r\n\r\nexport const resolveInitialization = <T extends StaticInitialization | DynamicInitialization>(\r\n args: any,\r\n value: any\r\n): T => (isFunction(value) ? value.apply(0, args) : value);\r\n\r\nexport const staticInitializationElement = <Args extends any[]>(\r\n args: Args,\r\n fallbackStaticInitializationElement: FallbackStaticInitializtationElement<Args>,\r\n defaultStaticInitializationElement: StaticInitializationElement<Args>,\r\n staticInitializationElementValue?: StaticInitializationElement<Args>\r\n): HTMLElement => {\r\n const staticInitialization = isUndefined(staticInitializationElementValue)\r\n ? defaultStaticInitializationElement\r\n : staticInitializationElementValue;\r\n const resolvedInitialization = resolveInitialization<StaticInitialization>(\r\n args,\r\n staticInitialization\r\n );\r\n return resolvedInitialization || fallbackStaticInitializationElement.apply(0, args);\r\n};\r\n\r\nexport const dynamicInitializationElement = <Args extends any[]>(\r\n args: Args,\r\n fallbackDynamicInitializationElement: FallbackDynamicInitializtationElement<Args>,\r\n defaultDynamicInitializationElement: DynamicInitializationElement<Args>,\r\n dynamicInitializationElementValue?: DynamicInitializationElement<Args>\r\n): HTMLElement | false => {\r\n const dynamicInitialization = isUndefined(dynamicInitializationElementValue)\r\n ? defaultDynamicInitializationElement\r\n : dynamicInitializationElementValue;\r\n const resolvedInitialization = resolveInitialization<DynamicInitialization>(\r\n args,\r\n dynamicInitialization\r\n );\r\n return (\r\n !!resolvedInitialization &&\r\n (isHTMLElement(resolvedInitialization)\r\n ? resolvedInitialization\r\n : fallbackDynamicInitializationElement.apply(0, args))\r\n );\r\n};\r\n\r\nexport const cancelInitialization = (\r\n isBody: boolean,\r\n cancelInitializationValue?: DeepPartial<Initialization['cancel']> | false | null | undefined\r\n): boolean => {\r\n const { nativeScrollbarsOverlaid, body } = cancelInitializationValue || {};\r\n const { _nativeScrollbarsOverlaid, _nativeScrollbarsHiding, _getDefaultInitialization } =\r\n getEnvironment();\r\n const { nativeScrollbarsOverlaid: defaultNativeScrollbarsOverlaid, body: defaultbody } =\r\n _getDefaultInitialization().cancel;\r\n\r\n const resolvedNativeScrollbarsOverlaid =\r\n nativeScrollbarsOverlaid ?? defaultNativeScrollbarsOverlaid;\r\n const resolvedDocumentScrollingElement = isUndefined(body) ? defaultbody : body;\r\n\r\n const finalNativeScrollbarsOverlaid =\r\n (_nativeScrollbarsOverlaid.x || _nativeScrollbarsOverlaid.y) &&\r\n resolvedNativeScrollbarsOverlaid;\r\n const finalDocumentScrollingElement =\r\n isBody &&\r\n (isNull(resolvedDocumentScrollingElement)\r\n ? !_nativeScrollbarsHiding\r\n : resolvedDocumentScrollingElement);\r\n\r\n return !!finalNativeScrollbarsOverlaid || !!finalDocumentScrollingElement;\r\n};\r\n", "import type { XY } from '../../support';\r\nimport type {\r\n InitializationTarget,\r\n InitializationTargetElement,\r\n InitializationTargetObject,\r\n} from '../../initialization';\r\nimport type { StructureSetupElementsObj } from '../structureSetup/structureSetup.elements';\r\nimport type { ScrollbarsSetupEvents } from './scrollbarsSetup.events';\r\nimport type { StyleObject } from '../../typings';\r\nimport type { StructureSetupState } from '../structureSetup';\r\nimport { dynamicInitializationElement as generalDynamicInitializationElement } from '../../initialization';\r\nimport { getEnvironment } from '../../environment';\r\nimport {\r\n classNameScrollbar,\r\n classNameScrollbarHorizontal,\r\n classNameScrollbarVertical,\r\n classNameScrollbarTrack,\r\n classNameScrollbarHandle,\r\n} from '../../classnames';\r\nimport {\r\n addClass,\r\n appendChildren,\r\n createDiv,\r\n each,\r\n getTrasformTranslateValue,\r\n isBoolean,\r\n parent,\r\n push,\r\n removeClass,\r\n removeElements,\r\n runEachAndClear,\r\n scrollT,\r\n bind,\r\n getElementScroll,\r\n numberToCssPx,\r\n setStyles,\r\n capNumber,\r\n getScrollCoordinatesPercent,\r\n isDefaultDirectionScrollCoordinates,\r\n roundCssNumber,\r\n} from '../../support';\r\n\r\nexport interface ScrollbarStructure {\r\n _scrollbar: HTMLElement;\r\n _track: HTMLElement;\r\n _handle: HTMLElement;\r\n}\r\n\r\nexport interface ScrollbarsSetupElement {\r\n _scrollbarStructures: ScrollbarStructure[];\r\n _clone: () => ScrollbarStructure;\r\n _style: (\r\n elmStyle: (\r\n scrollbarStructure: ScrollbarStructure\r\n ) => [HTMLElement | false | null | undefined, StyleObject]\r\n ) => void;\r\n}\r\n\r\nexport interface ScrollbarsSetupElementsObj {\r\n _scrollbarsAddRemoveClass: (\r\n classNames: string | false | null | undefined,\r\n add?: boolean,\r\n isHorizontal?: boolean\r\n ) => void;\r\n _refreshScrollbarsHandleLength: () => void;\r\n _refreshScrollbarsHandleOffset: () => void;\r\n _refreshScrollbarsScrollbarOffset: () => void;\r\n _refreshScrollbarsScrollCoordinates: () => void;\r\n _horizontal: ScrollbarsSetupElement;\r\n _vertical: ScrollbarsSetupElement;\r\n}\r\n\r\nexport type ScrollbarsSetupElements = [\r\n elements: ScrollbarsSetupElementsObj,\r\n appendElements: () => () => void,\r\n];\r\n\r\ntype ScrollbarStyleFn = (\r\n scrollbarStructure: ScrollbarStructure\r\n) => [HTMLElement | false | null | undefined, StyleObject | false | null | undefined];\r\n\r\nexport const createScrollbarsSetupElements = (\r\n target: InitializationTarget,\r\n structureSetupElements: StructureSetupElementsObj,\r\n structureSetupState: StructureSetupState,\r\n scrollbarsSetupEvents: ScrollbarsSetupEvents\r\n): ScrollbarsSetupElements => {\r\n const cssCustomPropViewportPercent = '--os-viewport-percent';\r\n const cssCustomPropScrollPercent = '--os-scroll-percent';\r\n const cssCustomPropScrollDirection = '--os-scroll-direction';\r\n const { _getDefaultInitialization } = getEnvironment();\r\n const { scrollbars: defaultInitScrollbars } = _getDefaultInitialization();\r\n const { slot: defaultInitScrollbarsSlot } = defaultInitScrollbars;\r\n const {\r\n _target,\r\n _host,\r\n _viewport,\r\n _targetIsElm,\r\n _scrollOffsetElement,\r\n _isBody,\r\n _viewportIsTarget,\r\n } = structureSetupElements;\r\n const { scrollbars: scrollbarsInit } = (_targetIsElm ? {} : target) as InitializationTargetObject;\r\n const { slot: initScrollbarsSlot } = scrollbarsInit || {};\r\n const destroyFns: (() => void)[] = [];\r\n const horizontalScrollbars: ScrollbarStructure[] = [];\r\n const verticalScrollbars: ScrollbarStructure[] = [];\r\n const evaluatedScrollbarSlot = generalDynamicInitializationElement<\r\n [InitializationTargetElement, HTMLElement, HTMLElement]\r\n >(\r\n [_target, _host, _viewport],\r\n () => (_viewportIsTarget && _isBody ? _target : _host),\r\n defaultInitScrollbarsSlot,\r\n initScrollbarsSlot\r\n );\r\n\r\n const initScrollTimeline = (axis: keyof XY<unknown>) => {\r\n if (scrollT) {\r\n let currAnimation: Animation | null = null;\r\n let currAnimationTransform: string[] = [];\r\n const timeline = new scrollT({\r\n source: _scrollOffsetElement,\r\n axis,\r\n });\r\n const cancelAnimation = () => {\r\n if (currAnimation) {\r\n currAnimation.cancel();\r\n }\r\n currAnimation = null;\r\n };\r\n const _setScrollPercentAnimation = (structure: ScrollbarStructure) => {\r\n const { _scrollCoordinates } = structureSetupState;\r\n const defaultDirectionScroll =\r\n isDefaultDirectionScrollCoordinates(_scrollCoordinates)[axis];\r\n const isHorizontal = axis === 'x';\r\n const transformArray = [\r\n getTrasformTranslateValue(0, isHorizontal),\r\n getTrasformTranslateValue(`calc(-100% + 100cq${isHorizontal ? 'w' : 'h'})`, isHorizontal),\r\n ];\r\n const transform = defaultDirectionScroll ? transformArray : transformArray.reverse();\r\n\r\n // if the animation keyframes are identical, do nothing and keep current animation\r\n if (\r\n currAnimationTransform[0] === transform[0] &&\r\n currAnimationTransform[1] === transform[1]\r\n ) {\r\n return cancelAnimation;\r\n }\r\n\r\n currAnimationTransform = transform;\r\n\r\n cancelAnimation();\r\n currAnimation = structure._handle.animate(\r\n {\r\n // dummy keyframe which fixes bug where the scrollbar handle is reverted to origin position when it should be at its max position\r\n clear: ['left'],\r\n // transform is a temporary fix for: https://github.com/KingSora/OverlayScrollbars/issues/705\r\n // can be reverted to just animate \"cssCustomPropScrollPercent\" when browsers implement an optimization possibility\r\n transform,\r\n // [cssCustomPropScrollPercent]: [0, 1],\r\n },\r\n {\r\n timeline,\r\n }\r\n );\r\n\r\n return cancelAnimation;\r\n };\r\n\r\n return {\r\n _setScrollPercentAnimation,\r\n };\r\n }\r\n };\r\n const scrollTimeline = {\r\n x: initScrollTimeline('x'),\r\n y: initScrollTimeline('y'),\r\n };\r\n const getViewportPercent = () => {\r\n const { _overflowAmount, _overflowEdge } = structureSetupState;\r\n const getAxisValue = (axisViewportSize: number, axisOverflowAmount: number) =>\r\n capNumber(0, 1, axisViewportSize / (axisViewportSize + axisOverflowAmount) || 0);\r\n\r\n return {\r\n x: getAxisValue(_overflowEdge.x, _overflowAmount.x),\r\n y: getAxisValue(_overflowEdge.y, _overflowAmount.y),\r\n };\r\n };\r\n const scrollbarStructureAddRemoveClass = (\r\n scrollbarStructures: ScrollbarStructure[],\r\n classNames: string | false | null | undefined,\r\n add?: boolean\r\n ) => {\r\n const action = add ? addClass : removeClass;\r\n each(scrollbarStructures, (scrollbarStructure) => {\r\n action(scrollbarStructure._scrollbar, classNames);\r\n });\r\n };\r\n const scrollbarStyle = (\r\n scrollbarStructures: ScrollbarStructure[],\r\n elmStyle: ScrollbarStyleFn\r\n ) => {\r\n each(scrollbarStructures, (scrollbarStructure) => {\r\n const [elm, styles] = elmStyle(scrollbarStructure);\r\n setStyles(elm, styles);\r\n });\r\n };\r\n const scrollbarsAddRemoveClass = (\r\n className: string | false | null | undefined,\r\n add?: boolean,\r\n onlyHorizontal?: boolean\r\n ) => {\r\n const singleAxis = isBoolean(onlyHorizontal);\r\n const runHorizontal = singleAxis ? onlyHorizontal : true;\r\n const runVertical = singleAxis ? !onlyHorizontal : true;\r\n if (runHorizontal) {\r\n scrollbarStructureAddRemoveClass(horizontalScrollbars, className, add);\r\n }\r\n if (runVertical) {\r\n scrollbarStructureAddRemoveClass(verticalScrollbars, className, add);\r\n }\r\n };\r\n const refreshScrollbarsHandleLength = () => {\r\n const viewportPercent = getViewportPercent();\r\n const createScrollbarStyleFn =\r\n (axisViewportPercent: number): ScrollbarStyleFn =>\r\n (structure: ScrollbarStructure) => [\r\n structure._scrollbar,\r\n {\r\n [cssCustomPropViewportPercent]: roundCssNumber(axisViewportPercent) + '',\r\n },\r\n ];\r\n\r\n scrollbarStyle(horizontalScrollbars, createScrollbarStyleFn(viewportPercent.x));\r\n scrollbarStyle(verticalScrollbars, createScrollbarStyleFn(viewportPercent.y));\r\n };\r\n const refreshScrollbarsHandleOffset = () => {\r\n if (!scrollT) {\r\n const { _scrollCoordinates } = structureSetupState;\r\n const scrollPercent = getScrollCoordinatesPercent(\r\n _scrollCoordinates,\r\n getElementScroll(_scrollOffsetElement)\r\n );\r\n const createScrollbarStyleFn =\r\n (axisScrollPercent: number): ScrollbarStyleFn =>\r\n (structure: ScrollbarStructure) => [\r\n structure._scrollbar,\r\n {\r\n [cssCustomPropScrollPercent]: roundCssNumber(axisScrollPercent) + '',\r\n },\r\n ];\r\n\r\n scrollbarStyle(horizontalScrollbars, createScrollbarStyleFn(scrollPercent.x));\r\n scrollbarStyle(verticalScrollbars, createScrollbarStyleFn(scrollPercent.y));\r\n }\r\n };\r\n const refreshScrollbarsScrollCoordinates = () => {\r\n const { _scrollCoordinates } = structureSetupState;\r\n const defaultDirectionScroll = isDefaultDirectionScrollCoordinates(_scrollCoordinates);\r\n const createScrollbarStyleFn =\r\n (axisIsDefaultDirectionScrollCoordinates: boolean): ScrollbarStyleFn =>\r\n (structure: ScrollbarStructure) => [\r\n structure._scrollbar,\r\n {\r\n [cssCustomPropScrollDirection]: axisIsDefaultDirectionScrollCoordinates ? '0' : '1',\r\n },\r\n ];\r\n\r\n scrollbarStyle(horizontalScrollbars, createScrollbarStyleFn(defaultDirectionScroll.x));\r\n scrollbarStyle(verticalScrollbars, createScrollbarStyleFn(defaultDirectionScroll.y));\r\n\r\n // temporary fix for: https://github.com/KingSora/OverlayScrollbars/issues/705\r\n if (scrollT) {\r\n horizontalScrollbars.forEach(scrollTimeline.x!._setScrollPercentAnimation);\r\n verticalScrollbars.forEach(scrollTimeline.y!._setScrollPercentAnimation);\r\n }\r\n };\r\n const refreshScrollbarsScrollbarOffset = () => {\r\n if (_viewportIsTarget && !_isBody) {\r\n const { _overflowAmount, _scrollCoordinates } = structureSetupState;\r\n const isDefaultDirectionScroll = isDefaultDirectionScrollCoordinates(_scrollCoordinates);\r\n const scrollPercent = getScrollCoordinatesPercent(\r\n _scrollCoordinates,\r\n getElementScroll(_scrollOffsetElement)\r\n );\r\n const styleScrollbarPosition: ScrollbarStyleFn = (structure: ScrollbarStructure) => {\r\n const { _scrollbar } = structure;\r\n const elm = parent(_scrollbar) === _viewport && _scrollbar;\r\n const getTranslateValue = (\r\n axisScrollPercent: number,\r\n axisOverflowAmount: number,\r\n axisIsDefaultCoordinates: boolean\r\n ) => {\r\n const px = axisOverflowAmount * axisScrollPercent;\r\n return numberToCssPx(axisIsDefaultCoordinates ? px : -px);\r\n };\r\n\r\n return [\r\n elm,\r\n elm && {\r\n transform: getTrasformTranslateValue({\r\n x: getTranslateValue(scrollPercent.x, _overflowAmount.x, isDefaultDirectionScroll.x),\r\n y: getTranslateValue(scrollPercent.y, _overflowAmount.y, isDefaultDirectionScroll.y),\r\n }),\r\n },\r\n ];\r\n };\r\n\r\n scrollbarStyle(horizontalScrollbars, styleScrollbarPosition);\r\n scrollbarStyle(verticalScrollbars, styleScrollbarPosition);\r\n }\r\n };\r\n const generateScrollbarDOM = (isHorizontal?: boolean): ScrollbarStructure => {\r\n const xyKey = isHorizontal ? 'x' : 'y';\r\n const scrollbarClassName = isHorizontal\r\n ? classNameScrollbarHorizontal\r\n : classNameScrollbarVertical;\r\n const scrollbar = createDiv(`${classNameScrollbar} ${scrollbarClassName}`);\r\n const track = createDiv(classNameScrollbarTrack);\r\n const handle = createDiv(classNameScrollbarHandle);\r\n const result = {\r\n _scrollbar: scrollbar,\r\n _track: track,\r\n _handle: handle,\r\n };\r\n const timeline = scrollTimeline[xyKey];\r\n\r\n push(isHorizontal ? horizontalScrollbars : verticalScrollbars, result);\r\n push(destroyFns, [\r\n appendChildren(scrollbar, track),\r\n appendChildren(track, handle),\r\n bind(removeElements, scrollbar),\r\n timeline && timeline._setScrollPercentAnimation(result),\r\n scrollbarsSetupEvents(result, scrollbarsAddRemoveClass, isHorizontal),\r\n ]);\r\n\r\n return result;\r\n };\r\n const generateHorizontalScrollbarStructure = bind(generateScrollbarDOM, true);\r\n const generateVerticalScrollbarStructure = bind(generateScrollbarDOM, false);\r\n const appendElements = () => {\r\n appendChildren(evaluatedScrollbarSlot, horizontalScrollbars[0]._scrollbar);\r\n appendChildren(evaluatedScrollbarSlot, verticalScrollbars[0]._scrollbar);\r\n\r\n return bind(runEachAndClear, destroyFns);\r\n };\r\n\r\n generateHorizontalScrollbarStructure();\r\n generateVerticalScrollbarStructure();\r\n\r\n return [\r\n {\r\n _refreshScrollbarsHandleLength: refreshScrollbarsHandleLength,\r\n _refreshScrollbarsHandleOffset: refreshScrollbarsHandleOffset,\r\n _refreshScrollbarsScrollCoordinates: refreshScrollbarsScrollCoordinates,\r\n _refreshScrollbarsScrollbarOffset: refreshScrollbarsScrollbarOffset,\r\n _scrollbarsAddRemoveClass: scrollbarsAddRemoveClass,\r\n _horizontal: {\r\n _scrollbarStructures: horizontalScrollbars,\r\n _clone: generateHorizontalScrollbarStructure,\r\n _style: bind(scrollbarStyle, horizontalScrollbars),\r\n },\r\n _vertical: {\r\n _scrollbarStructures: verticalScrollbars,\r\n _clone: generateVerticalScrollbarStructure,\r\n _style: bind(scrollbarStyle, verticalScrollbars),\r\n },\r\n },\r\n appendElements,\r\n ];\r\n};\r\n", "import type { XY } from '../../support';\r\nimport type { ClickScrollPlugin } from '../../plugins';\r\nimport type { ReadonlyOptions } from '../../options';\r\nimport type { StructureSetupState } from '../../setups';\r\nimport type { ScrollbarsSetupElementsObj, ScrollbarStructure } from './scrollbarsSetup.elements';\r\nimport type { StructureSetupElementsObj } from '../structureSetup/structureSetup.elements';\r\nimport {\r\n classNameScrollbarHandle,\r\n classNameScrollbarInteraction,\r\n classNameScrollbarWheel,\r\n dataAttributeHost,\r\n dataAttributeViewport,\r\n} from '../../classnames';\r\nimport { clickScrollPluginModuleName, getStaticPluginModuleInstance } from '../../plugins';\r\nimport {\r\n getBoundingClientRect,\r\n getOffsetSize,\r\n addEventListener,\r\n preventDefault,\r\n runEachAndClear,\r\n selfClearTimeout,\r\n parent,\r\n closest,\r\n push,\r\n bind,\r\n mathRound,\r\n strWidth,\r\n strHeight,\r\n getElementScroll,\r\n scrollElementTo,\r\n getFocusedElement,\r\n setT,\r\n hasAttr,\r\n stopAndPrevent,\r\n isFunction,\r\n mathAbs,\r\n focusElement,\r\n} from '../../support';\r\n\r\nexport type ScrollbarsSetupEvents = (\r\n scrollbarStructure: ScrollbarStructure,\r\n scrollbarsAddRemoveClass: ScrollbarsSetupElementsObj['_scrollbarsAddRemoveClass'],\r\n isHorizontal?: boolean\r\n) => () => void;\r\n\r\nexport const createScrollbarsSetupEvents = (\r\n options: ReadonlyOptions,\r\n structureSetupElements: StructureSetupElementsObj,\r\n structureSetupState: StructureSetupState,\r\n scrollbarHandlePointerInteraction: (event: PointerEvent) => void\r\n): ScrollbarsSetupEvents => {\r\n return (scrollbarStructure, scrollbarsAddRemoveClass, isHorizontal) => {\r\n const {\r\n _host,\r\n _viewport,\r\n _viewportIsTarget,\r\n _scrollOffsetElement,\r\n _documentElm,\r\n _removeScrollObscuringStyles,\r\n } = structureSetupElements;\r\n const { _scrollbar, _track, _handle } = scrollbarStructure;\r\n const [wheelTimeout, clearWheelTimeout] = selfClearTimeout(333);\r\n const [scrollSnapScrollTransitionTimeout, clearScrollSnapScrollTransitionTimeout] =\r\n selfClearTimeout(444);\r\n const scrollOffsetElementScrollBy = (coordinates: XY<number>) => {\r\n if (isFunction(_scrollOffsetElement.scrollBy)) {\r\n _scrollOffsetElement.scrollBy({\r\n behavior: 'smooth',\r\n left: coordinates.x,\r\n top: coordinates.y,\r\n });\r\n }\r\n };\r\n\r\n const createInteractiveScrollEvents = () => {\r\n const releasePointerCaptureEvents = 'pointerup pointercancel lostpointercapture';\r\n const clientXYKey = `client${isHorizontal ? 'X' : 'Y'}` as 'clientX' | 'clientY';\r\n const widthHeightKey = isHorizontal ? strWidth : strHeight;\r\n const leftTopKey = isHorizontal ? 'left' : 'top';\r\n const whKey = isHorizontal ? 'w' : 'h';\r\n const xyKey = isHorizontal ? 'x' : 'y';\r\n\r\n const createRelativeHandleMove =\r\n (mouseDownScroll: number, invertedScale: number) => (deltaMovement: number) => {\r\n const { _overflowAmount } = structureSetupState;\r\n const handleTrackDiff = getOffsetSize(_track)[whKey] - getOffsetSize(_handle)[whKey];\r\n const scrollDeltaPercent = (invertedScale * deltaMovement) / handleTrackDiff;\r\n const scrollDelta = scrollDeltaPercent * _overflowAmount[xyKey];\r\n\r\n scrollElementTo(_scrollOffsetElement, {\r\n [xyKey]: mouseDownScroll + scrollDelta,\r\n });\r\n };\r\n const pointerdownCleanupFns: Array<() => void> = [];\r\n\r\n return addEventListener(_track, 'pointerdown', (pointerDownEvent: PointerEvent) => {\r\n const isDragScroll =\r\n closest(pointerDownEvent.target as Node, `.${classNameScrollbarHandle}`) === _handle;\r\n const pointerCaptureElement = isDragScroll ? _handle : _track;\r\n\r\n const scrollbarOptions = options.scrollbars;\r\n const dragClickScrollOption = scrollbarOptions[isDragScroll ? 'dragScroll' : 'clickScroll'];\r\n const { button, isPrimary, pointerType } = pointerDownEvent;\r\n const { pointers } = scrollbarOptions;\r\n\r\n const continuePointerDown =\r\n button === 0 &&\r\n isPrimary &&\r\n dragClickScrollOption &&\r\n (pointers || []).includes(pointerType);\r\n\r\n if (continuePointerDown) {\r\n runEachAndClear(pointerdownCleanupFns);\r\n clearScrollSnapScrollTransitionTimeout();\r\n\r\n const instantClickScroll =\r\n !isDragScroll && (pointerDownEvent.shiftKey || dragClickScrollOption === 'instant');\r\n const getHandleRect = bind(getBoundingClientRect, _handle);\r\n const getTrackRect = bind(getBoundingClientRect, _track);\r\n const getHandleOffset = (handleRect?: DOMRect, trackRect?: DOMRect) =>\r\n (handleRect || getHandleRect())[leftTopKey] - (trackRect || getTrackRect())[leftTopKey];\r\n const axisScale =\r\n mathRound(getBoundingClientRect(_scrollOffsetElement)[widthHeightKey]) /\r\n getOffsetSize(_scrollOffsetElement)[whKey] || 1;\r\n const moveHandleRelative = createRelativeHandleMove(\r\n getElementScroll(_scrollOffsetElement)[xyKey],\r\n 1 / axisScale\r\n );\r\n const pointerDownOffset = pointerDownEvent[clientXYKey];\r\n const handleRect = getHandleRect();\r\n const trackRect = getTrackRect();\r\n const handleLength = handleRect[widthHeightKey];\r\n const handleCenter = getHandleOffset(handleRect, trackRect) + handleLength / 2;\r\n const relativeTrackPointerOffset = pointerDownOffset - trackRect[leftTopKey];\r\n const startOffset = isDragScroll ? 0 : relativeTrackPointerOffset - handleCenter;\r\n const releasePointerCapture = (pointerUpEvent: PointerEvent) => {\r\n runEachAndClear(pointerupCleanupFns);\r\n pointerCaptureElement.releasePointerCapture(pointerUpEvent.pointerId);\r\n };\r\n const nonAnimatedScroll = isDragScroll || instantClickScroll;\r\n const revertScrollObscuringStyles = _removeScrollObscuringStyles();\r\n\r\n const pointerupCleanupFns = [\r\n addEventListener(_documentElm, releasePointerCaptureEvents, releasePointerCapture),\r\n addEventListener(_documentElm, 'selectstart', (event: Event) => preventDefault(event), {\r\n _passive: false,\r\n }),\r\n addEventListener(_track, releasePointerCaptureEvents, releasePointerCapture),\r\n nonAnimatedScroll &&\r\n addEventListener(_track, 'pointermove', (pointerMoveEvent: PointerEvent) =>\r\n moveHandleRelative(\r\n startOffset + (pointerMoveEvent[clientXYKey] - pointerDownOffset)\r\n )\r\n ),\r\n nonAnimatedScroll &&\r\n (() => {\r\n const withoutSnapScrollOffset = getElementScroll(_scrollOffsetElement);\r\n revertScrollObscuringStyles();\r\n const withSnapScrollOffset = getElementScroll(_scrollOffsetElement);\r\n const snapScrollDiff = {\r\n x: withSnapScrollOffset.x - withoutSnapScrollOffset.x,\r\n y: withSnapScrollOffset.y - withoutSnapScrollOffset.y,\r\n };\r\n\r\n if (mathAbs(snapScrollDiff.x) > 3 || mathAbs(snapScrollDiff.y) > 3) {\r\n _removeScrollObscuringStyles();\r\n scrollElementTo(_scrollOffsetElement, withoutSnapScrollOffset);\r\n scrollOffsetElementScrollBy(snapScrollDiff);\r\n scrollSnapScrollTransitionTimeout(revertScrollObscuringStyles);\r\n }\r\n }),\r\n ];\r\n\r\n pointerCaptureElement.setPointerCapture(pointerDownEvent.pointerId);\r\n\r\n if (instantClickScroll) {\r\n moveHandleRelative(startOffset);\r\n } else if (!isDragScroll) {\r\n const animateClickScroll = getStaticPluginModuleInstance<typeof ClickScrollPlugin>(\r\n clickScrollPluginModuleName\r\n );\r\n if (animateClickScroll) {\r\n const stopClickScrollAnimation = animateClickScroll(\r\n moveHandleRelative,\r\n startOffset,\r\n handleLength,\r\n (stopped) => {\r\n // if the scroll animation doesn't continue with a press\r\n if (stopped) {\r\n revertScrollObscuringStyles();\r\n } else {\r\n push(pointerupCleanupFns, revertScrollObscuringStyles);\r\n }\r\n }\r\n );\r\n\r\n push(pointerupCleanupFns, stopClickScrollAnimation);\r\n push(pointerdownCleanupFns, bind(stopClickScrollAnimation, true));\r\n }\r\n }\r\n }\r\n });\r\n };\r\n\r\n let wheelScrollBy = true;\r\n\r\n return bind(runEachAndClear, [\r\n addEventListener(_handle, 'pointermove pointerleave', scrollbarHandlePointerInteraction),\r\n addEventListener(_scrollbar, 'pointerenter', () => {\r\n scrollbarsAddRemoveClass(classNameScrollbarInteraction, true);\r\n }),\r\n addEventListener(_scrollbar, 'pointerleave pointercancel', () => {\r\n scrollbarsAddRemoveClass(classNameScrollbarInteraction, false);\r\n }),\r\n // focus viewport when clicking on a scrollbar (mouse only)\r\n !_viewportIsTarget &&\r\n addEventListener(_scrollbar, 'mousedown', () => {\r\n const focusedElement = getFocusedElement();\r\n // dont steal focus from buttons or other interactive elements\r\n if (\r\n hasAttr(focusedElement, dataAttributeViewport) ||\r\n hasAttr(focusedElement, dataAttributeHost) ||\r\n focusedElement === document.body\r\n ) {\r\n setT(bind(focusElement, _viewport), 25);\r\n }\r\n }),\r\n // propagate wheel events to viewport when mouse is over scrollbar\r\n addEventListener(\r\n _scrollbar,\r\n 'wheel',\r\n (wheelEvent: WheelEvent) => {\r\n const { deltaX, deltaY, deltaMode } = wheelEvent;\r\n\r\n // the first wheel event is swallowed, simulate scroll to compensate for it\r\n if (wheelScrollBy && deltaMode === 0 && parent(_scrollbar) === _host) {\r\n scrollOffsetElementScrollBy({\r\n x: deltaX,\r\n y: deltaY,\r\n });\r\n }\r\n\r\n wheelScrollBy = false;\r\n scrollbarsAddRemoveClass(classNameScrollbarWheel, true);\r\n wheelTimeout(() => {\r\n wheelScrollBy = true;\r\n scrollbarsAddRemoveClass(classNameScrollbarWheel);\r\n });\r\n\r\n preventDefault(wheelEvent);\r\n },\r\n { _passive: false, _capture: true }\r\n ),\r\n // solve problem of interaction causing `click` events (https://github.com/KingSora/OverlayScrollbars/issues/251)\r\n // 1. on `scrollbar` pointer down register a `document` click event which gets prevented and propagation is stopped\r\n // 2. on `document` pointerup / pointercancel remove that click event after a timeout (in case the click is never triggered)\r\n addEventListener(\r\n _scrollbar,\r\n 'pointerdown',\r\n () => {\r\n const removeClickEvent = addEventListener(\r\n _documentElm,\r\n 'click',\r\n (clickEvent: Event) => {\r\n removePointerEvents();\r\n stopAndPrevent(clickEvent);\r\n },\r\n {\r\n _once: true,\r\n _capture: true,\r\n _passive: false,\r\n }\r\n );\r\n const removePointerEvents = addEventListener(\r\n _documentElm,\r\n 'pointerup pointercancel',\r\n () => {\r\n removePointerEvents();\r\n setTimeout(removeClickEvent, 150);\r\n },\r\n {\r\n _capture: true,\r\n _passive: true,\r\n }\r\n );\r\n },\r\n { _capture: true, _passive: true }\r\n ),\r\n createInteractiveScrollEvents(),\r\n clearWheelTimeout,\r\n clearScrollSnapScrollTransitionTimeout,\r\n ]);\r\n };\r\n};\r\n", "import type { OverflowBehavior, ReadonlyOptions } from '../../options';\r\nimport type { ScrollbarsSetupElementsObj } from './scrollbarsSetup.elements';\r\nimport type {\r\n ObserversSetupState,\r\n ObserversSetupUpdateHints,\r\n Setup,\r\n SetupUpdateInfo,\r\n StructureSetupState,\r\n StructureSetupUpdateHints,\r\n} from '../../setups';\r\nimport type { InitializationTarget } from '../../initialization';\r\nimport type { OverflowStyle } from '../../typings';\r\nimport type { StructureSetupElementsObj } from '../structureSetup/structureSetup.elements';\r\nimport {\r\n classNameScrollbarThemeNone,\r\n classNameScrollbarVisible,\r\n classNameScrollbarUnusable,\r\n classNameScrollbarCornerless,\r\n classNameScrollbarAutoHideHidden,\r\n classNameScrollbarHandleInteractive,\r\n classNameScrollbarTrackInteractive,\r\n classNameScrollbarRtl,\r\n classNameScrollbarAutoHide,\r\n} from '../../classnames';\r\nimport { getEnvironment } from '../../environment';\r\nimport {\r\n bind,\r\n noop,\r\n addEventListener,\r\n push,\r\n runEachAndClear,\r\n selfClearTimeout,\r\n strScroll,\r\n strVisible,\r\n} from '../../support';\r\nimport { createScrollbarsSetupElements } from './scrollbarsSetup.elements';\r\nimport { createScrollbarsSetupEvents } from './scrollbarsSetup.events';\r\nimport {\r\n getStaticPluginModuleInstance,\r\n ScrollbarsHidingPlugin,\r\n scrollbarsHidingPluginName,\r\n} from '../../plugins';\r\n\r\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\r\nexport interface ScrollbarsSetupState {}\r\n\r\nexport interface ScrollbarsSetupUpdateInfo extends SetupUpdateInfo {\r\n _observersUpdateHints?: ObserversSetupUpdateHints;\r\n _structureUpdateHints?: StructureSetupUpdateHints;\r\n}\r\n\r\nexport type ScrollbarsSetup = [\r\n ...Setup<ScrollbarsSetupUpdateInfo, ScrollbarsSetupState, void>,\r\n /** The elements created by the scrollbars setup. */\r\n ScrollbarsSetupElementsObj,\r\n];\r\n\r\nexport const createScrollbarsSetup = (\r\n target: InitializationTarget,\r\n options: ReadonlyOptions,\r\n observersSetupState: ObserversSetupState,\r\n structureSetupState: StructureSetupState,\r\n structureSetupElements: StructureSetupElementsObj,\r\n onScroll: (event: Event) => void\r\n): ScrollbarsSetup => {\r\n let mouseInHost: boolean | undefined;\r\n let autoHideIsMove: boolean | undefined;\r\n let autoHideIsLeave: boolean | undefined;\r\n let autoHideIsNever: boolean | undefined;\r\n let prevTheme: string | null | undefined;\r\n let instanceAutoHideSuspendScrollDestroyFn = noop;\r\n let instanceAutoHideDelay = 0;\r\n const hoverablePointerTypes = ['mouse', 'pen'];\r\n\r\n // needed to not fire unnecessary operations for pointer events on ios safari which will cause side effects: https://github.com/KingSora/OverlayScrollbars/issues/560\r\n const isHoverablePointerType = (event: PointerEvent) =>\r\n hoverablePointerTypes.includes(event.pointerType);\r\n\r\n const [requestScrollAnimationFrame, cancelScrollAnimationFrame] = selfClearTimeout();\r\n const [autoHideInstantInteractionTimeout, clearAutoHideInstantInteractionTimeout] =\r\n selfClearTimeout(100);\r\n const [autoHideSuspendTimeout, clearAutoHideSuspendTimeout] = selfClearTimeout(100);\r\n const [auotHideTimeout, clearAutoHideTimeout] = selfClearTimeout(() => instanceAutoHideDelay);\r\n const [elements, appendElements] = createScrollbarsSetupElements(\r\n target,\r\n structureSetupElements,\r\n structureSetupState,\r\n createScrollbarsSetupEvents(\r\n options,\r\n structureSetupElements,\r\n structureSetupState,\r\n (event) => isHoverablePointerType(event) && manageScrollbarsAutoHideInstantInteraction()\r\n )\r\n );\r\n const { _host, _scrollEventElement, _isBody } = structureSetupElements;\r\n const {\r\n _scrollbarsAddRemoveClass,\r\n _refreshScrollbarsHandleLength,\r\n _refreshScrollbarsHandleOffset,\r\n _refreshScrollbarsScrollCoordinates,\r\n _refreshScrollbarsScrollbarOffset,\r\n } = elements;\r\n const manageScrollbarsAutoHide = (removeAutoHide: boolean, delayless?: boolean) => {\r\n clearAutoHideTimeout();\r\n if (removeAutoHide) {\r\n _scrollbarsAddRemoveClass(classNameScrollbarAutoHideHidden);\r\n } else {\r\n const hide = bind(_scrollbarsAddRemoveClass, classNameScrollbarAutoHideHidden, true);\r\n if (instanceAutoHideDelay > 0 && !delayless) {\r\n auotHideTimeout(hide);\r\n } else {\r\n hide();\r\n }\r\n }\r\n };\r\n const manageScrollbarsAutoHideInstantInteraction = () => {\r\n if (autoHideIsLeave ? !mouseInHost : !autoHideIsNever) {\r\n manageScrollbarsAutoHide(true);\r\n autoHideInstantInteractionTimeout(() => {\r\n manageScrollbarsAutoHide(false);\r\n });\r\n }\r\n };\r\n const manageAutoHideSuspension = (add: boolean) => {\r\n _scrollbarsAddRemoveClass(classNameScrollbarAutoHide, add, true);\r\n _scrollbarsAddRemoveClass(classNameScrollbarAutoHide, add, false);\r\n };\r\n const onHostMouseEnter = (event: PointerEvent) => {\r\n if (isHoverablePointerType(event)) {\r\n mouseInHost = autoHideIsLeave;\r\n if (autoHideIsLeave) {\r\n manageScrollbarsAutoHide(true);\r\n }\r\n }\r\n };\r\n const destroyFns: (() => void)[] = [\r\n clearAutoHideTimeout,\r\n clearAutoHideInstantInteractionTimeout,\r\n clearAutoHideSuspendTimeout,\r\n cancelScrollAnimationFrame,\r\n () => instanceAutoHideSuspendScrollDestroyFn(),\r\n\r\n addEventListener(_host, 'pointerover', onHostMouseEnter, { _once: true }),\r\n addEventListener(_host, 'pointerenter', onHostMouseEnter),\r\n addEventListener(_host, 'pointerleave', (event: PointerEvent) => {\r\n if (isHoverablePointerType(event)) {\r\n mouseInHost = false;\r\n if (autoHideIsLeave) {\r\n manageScrollbarsAutoHide(false);\r\n }\r\n }\r\n }),\r\n addEventListener(_host, 'pointermove', (event: PointerEvent) => {\r\n if (isHoverablePointerType(event) && autoHideIsMove) {\r\n manageScrollbarsAutoHideInstantInteraction();\r\n }\r\n }),\r\n addEventListener(_scrollEventElement, 'scroll', (event) => {\r\n requestScrollAnimationFrame(() => {\r\n _refreshScrollbarsHandleOffset();\r\n manageScrollbarsAutoHideInstantInteraction();\r\n });\r\n\r\n onScroll(event);\r\n\r\n _refreshScrollbarsScrollbarOffset();\r\n }),\r\n ];\r\n const scrollbarsHidingPlugin = getStaticPluginModuleInstance<typeof ScrollbarsHidingPlugin>(\r\n scrollbarsHidingPluginName\r\n );\r\n\r\n return [\r\n () => bind(runEachAndClear, push(destroyFns, appendElements())),\r\n ({ _checkOption, _force, _observersUpdateHints, _structureUpdateHints }) => {\r\n const {\r\n _overflowEdgeChanged,\r\n _overflowAmountChanged,\r\n _overflowStyleChanged,\r\n _scrollCoordinatesChanged,\r\n } = _structureUpdateHints || {};\r\n const { _directionChanged, _appear } = _observersUpdateHints || {};\r\n const { _directionIsRTL } = observersSetupState;\r\n const { _nativeScrollbarsOverlaid, _nativeScrollbarsHiding } = getEnvironment();\r\n const { _overflowStyle, _hasOverflow } = structureSetupState;\r\n const [showNativeOverlaidScrollbarsOption, showNativeOverlaidScrollbarsChanged] =\r\n _checkOption('showNativeOverlaidScrollbars');\r\n const [theme, themeChanged] = _checkOption('scrollbars.theme');\r\n const [visibility, visibilityChanged] = _checkOption('scrollbars.visibility');\r\n const [autoHide, autoHideChanged] = _checkOption('scrollbars.autoHide');\r\n const [autoHideSuspend, autoHideSuspendChanged] = _checkOption('scrollbars.autoHideSuspend');\r\n const [autoHideDelay] = _checkOption('scrollbars.autoHideDelay');\r\n const [dragScroll, dragScrollChanged] = _checkOption('scrollbars.dragScroll');\r\n const [clickScroll, clickScrollChanged] = _checkOption('scrollbars.clickScroll');\r\n const [overflow, overflowChanged] = _checkOption('overflow');\r\n const trulyAppeared = _appear && !_force;\r\n const hasOverflow = _hasOverflow.x || _hasOverflow.y;\r\n const updateScrollbars =\r\n _overflowEdgeChanged ||\r\n _overflowAmountChanged ||\r\n _scrollCoordinatesChanged ||\r\n _directionChanged ||\r\n _force;\r\n const updateVisibility = _overflowStyleChanged || visibilityChanged || overflowChanged;\r\n const showNativeOverlaidScrollbars =\r\n showNativeOverlaidScrollbarsOption &&\r\n _nativeScrollbarsOverlaid.x &&\r\n _nativeScrollbarsOverlaid.y;\r\n const cantHideScrollbars = !_nativeScrollbarsHiding && !scrollbarsHidingPlugin;\r\n const showNativeScrollbars = showNativeOverlaidScrollbars || cantHideScrollbars;\r\n\r\n const setScrollbarVisibility = (\r\n overflowBehavior: OverflowBehavior,\r\n overflowStyle: OverflowStyle,\r\n isHorizontal: boolean\r\n ) => {\r\n const isVisible =\r\n overflowBehavior.includes(strScroll) &&\r\n (visibility === strVisible || (visibility === 'auto' && overflowStyle === strScroll));\r\n\r\n _scrollbarsAddRemoveClass(classNameScrollbarVisible, isVisible, isHorizontal);\r\n\r\n return isVisible;\r\n };\r\n\r\n instanceAutoHideDelay = autoHideDelay;\r\n\r\n if (trulyAppeared) {\r\n if (autoHideSuspend && hasOverflow) {\r\n manageAutoHideSuspension(false);\r\n instanceAutoHideSuspendScrollDestroyFn();\r\n autoHideSuspendTimeout(() => {\r\n instanceAutoHideSuspendScrollDestroyFn = addEventListener(\r\n _scrollEventElement,\r\n 'scroll',\r\n bind(manageAutoHideSuspension, true),\r\n {\r\n _once: true,\r\n }\r\n );\r\n });\r\n } else {\r\n manageAutoHideSuspension(true);\r\n }\r\n }\r\n\r\n if (showNativeOverlaidScrollbarsChanged || cantHideScrollbars) {\r\n _scrollbarsAddRemoveClass(classNameScrollbarThemeNone, showNativeScrollbars);\r\n }\r\n\r\n if (themeChanged) {\r\n _scrollbarsAddRemoveClass(prevTheme);\r\n _scrollbarsAddRemoveClass(theme, true);\r\n\r\n prevTheme = theme;\r\n }\r\n\r\n if (autoHideSuspendChanged && !autoHideSuspend) {\r\n manageAutoHideSuspension(true);\r\n }\r\n\r\n if (autoHideChanged) {\r\n autoHideIsMove = autoHide === 'move';\r\n autoHideIsLeave = autoHide === 'leave';\r\n autoHideIsNever = autoHide === 'never';\r\n manageScrollbarsAutoHide(autoHideIsNever, true);\r\n }\r\n\r\n if (dragScrollChanged) {\r\n _scrollbarsAddRemoveClass(classNameScrollbarHandleInteractive, dragScroll);\r\n }\r\n\r\n if (clickScrollChanged) {\r\n _scrollbarsAddRemoveClass(classNameScrollbarTrackInteractive, !!clickScroll);\r\n }\r\n\r\n // always update scrollbar visibility before scrollbar size\r\n // the scrollbar size is influenced whether both or just one scrollbar is visible (because of the corner element)\r\n if (updateVisibility) {\r\n const xVisible = setScrollbarVisibility(overflow.x, _overflowStyle.x, true);\r\n const yVisible = setScrollbarVisibility(overflow.y, _overflowStyle.y, false);\r\n const hasCorner = xVisible && yVisible;\r\n\r\n _scrollbarsAddRemoveClass(classNameScrollbarCornerless, !hasCorner);\r\n }\r\n\r\n // always update scrollbar sizes after the visibility\r\n if (updateScrollbars) {\r\n _refreshScrollbarsHandleOffset();\r\n _refreshScrollbarsHandleLength();\r\n _refreshScrollbarsScrollbarOffset();\r\n if (_scrollCoordinatesChanged) {\r\n _refreshScrollbarsScrollCoordinates();\r\n }\r\n\r\n _scrollbarsAddRemoveClass(classNameScrollbarUnusable, !_hasOverflow.x, true);\r\n _scrollbarsAddRemoveClass(classNameScrollbarUnusable, !_hasOverflow.y, false);\r\n _scrollbarsAddRemoveClass(classNameScrollbarRtl, _directionIsRTL && !_isBody);\r\n }\r\n },\r\n {},\r\n elements,\r\n ];\r\n};\r\n", "import type {\r\n InitializationTarget,\r\n InitializationTargetElement,\r\n InitializationTargetObject,\r\n} from '../../initialization';\r\nimport {\r\n isHTMLElement,\r\n appendChildren,\r\n createDiv,\r\n contents,\r\n parent,\r\n removeElements,\r\n push,\r\n runEachAndClear,\r\n removeAttrs,\r\n hasAttrClass,\r\n addEventListener,\r\n bind,\r\n inArray,\r\n addAttrClass,\r\n addRemoveAttrClass,\r\n setAttrs,\r\n getAttr,\r\n isBodyElement,\r\n getFocusedElement,\r\n wnd,\r\n focusElement,\r\n stopAndPrevent,\r\n getOffsetSize,\r\n getScrollSize,\r\n getStyles,\r\n strOverflowX,\r\n strOverflowY,\r\n} from '../../support';\r\nimport {\r\n dataAttributeHost,\r\n dataAttributeInitialize,\r\n dataAttributeViewport,\r\n dataValueViewportScrollbarHidden,\r\n dataAttributePadding,\r\n dataAttributeContent,\r\n dataAttributeHtmlBody,\r\n dataValueHostIsHost,\r\n dataValueViewportScrolling,\r\n} from '../../classnames';\r\nimport { getEnvironment } from '../../environment';\r\nimport {\r\n staticInitializationElement as generalStaticInitializationElement,\r\n dynamicInitializationElement as generalDynamicInitializationElement,\r\n} from '../../initialization';\r\nimport { overflowIsVisible } from './structureSetup.utils';\r\n\r\nexport type StructureSetupElements = [\r\n elements: StructureSetupElementsObj,\r\n appendElements: () => () => void,\r\n canceled: () => void,\r\n];\r\n\r\nexport interface StructureSetupElementsObj {\r\n _target: InitializationTargetElement;\r\n _host: HTMLElement;\r\n _viewport: HTMLElement;\r\n _padding: HTMLElement | false;\r\n _content: HTMLElement | false;\r\n _scrollOffsetElement: HTMLElement;\r\n _scrollEventElement: HTMLElement | Document;\r\n _originalScrollOffsetElement: HTMLElement;\r\n // ctx ----\r\n _isBody: boolean;\r\n _documentElm: Document;\r\n _targetIsElm: boolean;\r\n _viewportIsTarget: boolean;\r\n _windowElm: () => Window;\r\n _viewportHasClass: (viewportAttributeClassName: string) => boolean;\r\n _viewportAddRemoveClass: (viewportAttributeClassName: string, add?: boolean) => () => void;\r\n _removeScrollObscuringStyles: () => () => void;\r\n}\r\n\r\nexport const createStructureSetupElements = (\r\n target: InitializationTarget\r\n): StructureSetupElements => {\r\n const env = getEnvironment();\r\n const { _getDefaultInitialization, _nativeScrollbarsHiding } = env;\r\n const { elements: defaultInitElements } = _getDefaultInitialization();\r\n const {\r\n padding: defaultPaddingInitialization,\r\n viewport: defaultViewportInitialization,\r\n content: defaultContentInitialization,\r\n } = defaultInitElements;\r\n const targetIsElm = isHTMLElement(target);\r\n const targetStructureInitialization = (targetIsElm ? {} : target) as InitializationTargetObject;\r\n const { elements: initElements } = targetStructureInitialization;\r\n const {\r\n padding: paddingInitialization,\r\n viewport: viewportInitialization,\r\n content: contentInitialization,\r\n } = initElements || {};\r\n\r\n const targetElement = targetIsElm ? target : targetStructureInitialization.target;\r\n const isBody = isBodyElement(targetElement);\r\n const ownerDocument = targetElement.ownerDocument;\r\n const docElement = ownerDocument.documentElement;\r\n const getDocumentWindow = () => ownerDocument.defaultView || wnd;\r\n const staticInitializationElement = bind(generalStaticInitializationElement, [targetElement]);\r\n const dynamicInitializationElement = bind(generalDynamicInitializationElement, [targetElement]);\r\n const createNewDiv = bind(createDiv, '');\r\n const generateViewportElement = bind(\r\n staticInitializationElement,\r\n createNewDiv,\r\n defaultViewportInitialization\r\n );\r\n const generateContentElement = bind(\r\n dynamicInitializationElement,\r\n createNewDiv,\r\n defaultContentInitialization\r\n );\r\n const elementHasOverflow = (elm: HTMLElement) => {\r\n const offsetSize = getOffsetSize(elm);\r\n const scrollSize = getScrollSize(elm);\r\n const overflowX = getStyles(elm, strOverflowX);\r\n const overflowY = getStyles(elm, strOverflowY);\r\n\r\n return (\r\n (scrollSize.w - offsetSize.w > 0 && !overflowIsVisible(overflowX)) ||\r\n (scrollSize.h - offsetSize.h > 0 && !overflowIsVisible(overflowY))\r\n );\r\n };\r\n const possibleViewportElement = generateViewportElement(viewportInitialization);\r\n const viewportIsTarget = possibleViewportElement === targetElement;\r\n const viewportIsTargetBody = viewportIsTarget && isBody;\r\n const possibleContentElement = !viewportIsTarget && generateContentElement(contentInitialization);\r\n // edge case if passed viewportElement is contentElement:\r\n // viewport element has higher priority and content element will not be generated\r\n // will act the same way as initialization: `{ elements: { viewport, content: false } }`\r\n const viewportIsContent = !viewportIsTarget && possibleViewportElement === possibleContentElement;\r\n const viewportElement = viewportIsTargetBody ? docElement : possibleViewportElement;\r\n const hostElement = viewportIsTargetBody ? viewportElement : targetElement;\r\n const paddingElement =\r\n !viewportIsTarget &&\r\n dynamicInitializationElement(createNewDiv, defaultPaddingInitialization, paddingInitialization);\r\n const contentElement = !viewportIsContent && possibleContentElement;\r\n const generatedElements = [contentElement, viewportElement, paddingElement, hostElement].map(\r\n (elm) => isHTMLElement(elm) && !parent(elm) && elm\r\n );\r\n const elementIsGenerated = (elm: HTMLElement | false) => elm && inArray(generatedElements, elm);\r\n const originalNonBodyScrollOffsetElement =\r\n !elementIsGenerated(viewportElement) && elementHasOverflow(viewportElement)\r\n ? viewportElement\r\n : targetElement;\r\n const scrollOffsetElement = viewportIsTargetBody ? docElement : viewportElement;\r\n const scrollEventElement = viewportIsTargetBody ? ownerDocument : viewportElement;\r\n\r\n const evaluatedTargetObj: StructureSetupElementsObj = {\r\n _target: targetElement,\r\n _host: hostElement,\r\n _viewport: viewportElement,\r\n _padding: paddingElement,\r\n _content: contentElement,\r\n _scrollOffsetElement: scrollOffsetElement,\r\n _scrollEventElement: scrollEventElement,\r\n _originalScrollOffsetElement: isBody ? docElement : originalNonBodyScrollOffsetElement,\r\n _documentElm: ownerDocument,\r\n _isBody: isBody,\r\n _targetIsElm: targetIsElm,\r\n _viewportIsTarget: viewportIsTarget,\r\n _windowElm: getDocumentWindow,\r\n _viewportHasClass: (viewportAttributeClassName: string) =>\r\n hasAttrClass(viewportElement, dataAttributeViewport, viewportAttributeClassName),\r\n _viewportAddRemoveClass: (viewportAttributeClassName: string, add?: boolean) =>\r\n addRemoveAttrClass(viewportElement, dataAttributeViewport, viewportAttributeClassName, add),\r\n _removeScrollObscuringStyles: () =>\r\n addRemoveAttrClass(\r\n scrollOffsetElement,\r\n dataAttributeViewport,\r\n dataValueViewportScrolling,\r\n true\r\n ),\r\n };\r\n const { _target, _host, _padding, _viewport, _content } = evaluatedTargetObj;\r\n const destroyFns: (() => void)[] = [\r\n () => {\r\n // always remove dataAttributeHost & dataAttributeInitialize from host and from <html> element if target is body\r\n removeAttrs(_host, [dataAttributeHost, dataAttributeInitialize]);\r\n removeAttrs(_target, dataAttributeInitialize);\r\n if (isBody) {\r\n removeAttrs(docElement, [dataAttributeInitialize, dataAttributeHost]);\r\n }\r\n },\r\n ];\r\n let targetContents = contents(\r\n [_content, _viewport, _padding, _host, _target].find((elm) => elm && !elementIsGenerated(elm))\r\n );\r\n const contentSlot = viewportIsTargetBody ? _target : _content || _viewport;\r\n const destroy = bind(runEachAndClear, destroyFns);\r\n const appendElements = () => {\r\n const docWnd = getDocumentWindow();\r\n const initActiveElm = getFocusedElement();\r\n const unwrap = (elm: HTMLElement | false | null | undefined) => {\r\n appendChildren(parent(elm), contents(elm));\r\n removeElements(elm);\r\n };\r\n // wrapping / unwrapping will cause the focused element to blur, this should prevent those events to surface\r\n const prepareWrapUnwrapFocus = (activeElement: Element | false | null | undefined) =>\r\n addEventListener(activeElement, 'focusin focusout focus blur', stopAndPrevent, {\r\n _capture: true,\r\n _passive: false,\r\n });\r\n const tabIndexStr = 'tabindex';\r\n const originalViewportTabIndex = getAttr(_viewport, tabIndexStr);\r\n const undoInitWrapUndwrapFocus = prepareWrapUnwrapFocus(initActiveElm);\r\n setAttrs(_host, dataAttributeHost, viewportIsTarget ? '' : dataValueHostIsHost);\r\n setAttrs(_padding, dataAttributePadding, '');\r\n setAttrs(_viewport, dataAttributeViewport, '');\r\n setAttrs(_content, dataAttributeContent, '');\r\n\r\n if (!viewportIsTarget) {\r\n setAttrs(_viewport, tabIndexStr, originalViewportTabIndex || '-1');\r\n if (isBody) {\r\n setAttrs(docElement, dataAttributeHtmlBody, '');\r\n }\r\n }\r\n\r\n appendChildren(contentSlot, targetContents);\r\n appendChildren(_host, _padding);\r\n appendChildren(_padding || _host, !viewportIsTarget && _viewport);\r\n appendChildren(_viewport, _content);\r\n\r\n push(destroyFns, [\r\n undoInitWrapUndwrapFocus,\r\n () => {\r\n const destroyActiveElm = getFocusedElement();\r\n const viewportIsGenerated = elementIsGenerated(_viewport);\r\n // if the focused element is viewport and viewport will be destroyed shift the focus to target\r\n // otherwise keep the focused element\r\n const destroyFocusElement =\r\n viewportIsGenerated && destroyActiveElm === _viewport ? _target : destroyActiveElm;\r\n const undoDestroyWrapUndwrapFocus = prepareWrapUnwrapFocus(destroyFocusElement);\r\n removeAttrs(_padding, dataAttributePadding);\r\n removeAttrs(_content, dataAttributeContent);\r\n removeAttrs(_viewport, dataAttributeViewport);\r\n if (isBody) {\r\n removeAttrs(docElement, dataAttributeHtmlBody);\r\n }\r\n if (originalViewportTabIndex) {\r\n setAttrs(_viewport, tabIndexStr, originalViewportTabIndex);\r\n } else {\r\n removeAttrs(_viewport, tabIndexStr);\r\n }\r\n\r\n if (elementIsGenerated(_content)) {\r\n unwrap(_content);\r\n }\r\n if (viewportIsGenerated) {\r\n unwrap(_viewport);\r\n }\r\n if (elementIsGenerated(_padding)) {\r\n unwrap(_padding);\r\n }\r\n\r\n focusElement(destroyFocusElement);\r\n undoDestroyWrapUndwrapFocus();\r\n },\r\n ]);\r\n\r\n if (_nativeScrollbarsHiding && !viewportIsTarget) {\r\n addAttrClass(_viewport, dataAttributeViewport, dataValueViewportScrollbarHidden);\r\n push(destroyFns, bind(removeAttrs, _viewport, dataAttributeViewport));\r\n }\r\n\r\n // keep the original focused element focused except when\r\n // the target is body and viewport is not target, then shift the focus to the viewport element\r\n focusElement(\r\n !viewportIsTarget && isBody && initActiveElm === _target && docWnd.top === docWnd\r\n ? _viewport\r\n : initActiveElm\r\n );\r\n undoInitWrapUndwrapFocus();\r\n\r\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\r\n // @ts-ignore\r\n targetContents = 0;\r\n\r\n return destroy;\r\n };\r\n\r\n return [evaluatedTargetObj, appendElements, destroy];\r\n};\r\n", "import type { CreateStructureUpdateSegment } from '../structureSetup';\r\nimport { setStyles, strHeight } from '../../../support';\r\n\r\n/**\r\n * Lifecycle with the responsibility to adjust the trinsic behavior of the content element.\r\n * @param structureUpdateHub\r\n * @returns\r\n */\r\nexport const createTrinsicUpdateSegment: CreateStructureUpdateSegment =\r\n ({ _content }) =>\r\n ({ _observersUpdateHints, _observersState, _force }) => {\r\n const { _heightIntrinsicChanged } = _observersUpdateHints || {};\r\n const { _heightIntrinsic } = _observersState;\r\n const heightIntrinsicChanged = _content && (_heightIntrinsicChanged || _force);\r\n\r\n if (heightIntrinsicChanged) {\r\n setStyles(_content, {\r\n [strHeight]: _heightIntrinsic && '100%',\r\n });\r\n }\r\n };\r\n", "import type { StyleObject } from '../../../typings';\r\nimport type { CreateStructureUpdateSegment } from '../structureSetup';\r\nimport {\r\n createCache,\r\n topRightBottomLeft,\r\n equalTRBL,\r\n assignDeep,\r\n bind,\r\n strMarginBottom,\r\n strMarginLeft,\r\n strMarginRight,\r\n strPaddingBottom,\r\n strPaddingLeft,\r\n strPaddingRight,\r\n strPaddingTop,\r\n strWidth,\r\n setStyles,\r\n} from '../../../support';\r\nimport { getEnvironment } from '../../../environment';\r\n\r\n/**\r\n * Lifecycle with the responsibility to adjust the padding styling of the padding and viewport element.\r\n * @param structureUpdateHub\r\n * @returns\r\n */\r\nexport const createPaddingUpdateSegment: CreateStructureUpdateSegment = (\r\n { _host, _padding, _viewport, _viewportIsTarget },\r\n state\r\n) => {\r\n const [updatePaddingCache, currentPaddingCache] = createCache(\r\n {\r\n _equal: equalTRBL,\r\n _initialValue: topRightBottomLeft(),\r\n },\r\n bind(topRightBottomLeft, _host, 'padding', '')\r\n );\r\n\r\n return ({ _checkOption, _observersUpdateHints, _observersState, _force }) => {\r\n let [padding, paddingChanged] = currentPaddingCache(_force);\r\n const { _nativeScrollbarsHiding } = getEnvironment();\r\n const { _sizeChanged, _contentMutation, _directionChanged } = _observersUpdateHints || {};\r\n const { _directionIsRTL } = _observersState;\r\n const [paddingAbsolute, paddingAbsoluteChanged] = _checkOption('paddingAbsolute');\r\n const contentMutation = _force || _contentMutation;\r\n\r\n if (_sizeChanged || paddingChanged || contentMutation) {\r\n [padding, paddingChanged] = updatePaddingCache(_force);\r\n }\r\n\r\n const paddingStyleChanged =\r\n !_viewportIsTarget && (paddingAbsoluteChanged || _directionChanged || paddingChanged);\r\n\r\n if (paddingStyleChanged) {\r\n // if there is no padding element and no scrollbar styling, paddingAbsolute isn't supported\r\n const paddingRelative = !paddingAbsolute || (!_padding && !_nativeScrollbarsHiding);\r\n const paddingHorizontal = padding.r + padding.l;\r\n const paddingVertical = padding.t + padding.b;\r\n\r\n const paddingStyle: StyleObject = {\r\n [strMarginRight]: paddingRelative && !_directionIsRTL ? -paddingHorizontal : 0,\r\n [strMarginBottom]: paddingRelative ? -paddingVertical : 0,\r\n [strMarginLeft]: paddingRelative && _directionIsRTL ? -paddingHorizontal : 0,\r\n top: paddingRelative ? -padding.t : 0,\r\n right: paddingRelative ? (_directionIsRTL ? -padding.r : 'auto') : 0,\r\n left: paddingRelative ? (_directionIsRTL ? 'auto' : -padding.l) : 0,\r\n [strWidth]: paddingRelative && `calc(100% + ${paddingHorizontal}px)`,\r\n };\r\n const viewportStyle: StyleObject = {\r\n [strPaddingTop]: paddingRelative ? padding.t : 0,\r\n [strPaddingRight]: paddingRelative ? padding.r : 0,\r\n [strPaddingBottom]: paddingRelative ? padding.b : 0,\r\n [strPaddingLeft]: paddingRelative ? padding.l : 0,\r\n };\r\n\r\n // if there is no padding element apply the style to the viewport element instead\r\n setStyles(_padding || _viewport, paddingStyle);\r\n setStyles(_viewport, viewportStyle);\r\n\r\n assignDeep(state, {\r\n _padding: padding,\r\n _paddingAbsolute: !paddingRelative,\r\n _viewportPaddingStyle: _padding\r\n ? viewportStyle\r\n : assignDeep({}, paddingStyle, viewportStyle),\r\n });\r\n }\r\n\r\n return {\r\n _paddingStyleChanged: paddingStyleChanged,\r\n };\r\n };\r\n};\r\n", "import type { ScrollCoordinates, WH, XY } from '../../../support';\r\nimport type { ScrollbarsHidingPlugin } from '../../../plugins/scrollbarsHidingPlugin';\r\nimport type { OverflowStyle } from '../../../typings';\r\nimport type { CreateStructureUpdateSegment } from '../structureSetup';\r\nimport {\r\n createCache,\r\n getScrollSize,\r\n getFractionalSize,\r\n equalWH,\r\n getClientSize,\r\n equalXY,\r\n assignDeep,\r\n bind,\r\n wnd,\r\n mathMax,\r\n getWindowSize,\r\n addRemoveAttrClass,\r\n capitalizeFirstLetter,\r\n setStyles,\r\n strVisible,\r\n strHidden,\r\n keys,\r\n strScroll,\r\n scrollElementTo,\r\n getElementScroll,\r\n sanitizeScrollCoordinates,\r\n getStyles,\r\n equal,\r\n getZeroScrollCoordinates,\r\n hasDimensions,\r\n addEventListener,\r\n stopPropagation,\r\n rAF,\r\n hasAttrClass,\r\n} from '../../../support';\r\nimport { getEnvironment } from '../../../environment';\r\nimport {\r\n dataAttributeHost,\r\n dataValueNoClipping,\r\n dataValueViewportScrollbarHidden,\r\n dataAttributePadding,\r\n dataValueViewportOverflowXPrefix,\r\n dataValueViewportOverflowYPrefix,\r\n dataValueViewportNoContent,\r\n dataValueViewportMeasuring,\r\n} from '../../../classnames';\r\nimport { getStaticPluginModuleInstance, scrollbarsHidingPluginName } from '../../../plugins';\r\nimport {\r\n getShowNativeOverlaidScrollbars,\r\n getElementOverflowStyle,\r\n overflowBehaviorToOverflowStyle,\r\n overflowCssValueToOverflowStyle,\r\n overflowIsVisible,\r\n} from '../structureSetup.utils';\r\nimport { OverflowBehavior } from '../../../options';\r\n\r\ninterface FlowDirectionStyles {\r\n display?: string;\r\n direction?: string;\r\n flexDirection?: string;\r\n writingMode?: string;\r\n}\r\n\r\n/**\r\n * Lifecycle with the responsibility to set the correct overflow and scrollbar hiding styles of the viewport element.\r\n * @param structureUpdateHub\r\n * @returns\r\n */\r\nexport const createOverflowUpdateSegment: CreateStructureUpdateSegment = (\r\n structureSetupElements,\r\n structureSetupState\r\n) => {\r\n const env = getEnvironment();\r\n const {\r\n _host,\r\n _padding,\r\n _viewport,\r\n _viewportIsTarget,\r\n _scrollEventElement,\r\n _scrollOffsetElement,\r\n _isBody,\r\n _viewportAddRemoveClass,\r\n _windowElm,\r\n } = structureSetupElements;\r\n const { _nativeScrollbarsHiding } = env;\r\n const viewportIsTargetBody = _isBody && _viewportIsTarget;\r\n const max0 = bind(mathMax, 0);\r\n const flowDirectionCanBeNonDefaultMap: Record<\r\n keyof FlowDirectionStyles,\r\n (styleValue: string) => boolean\r\n > = {\r\n display: () => false,\r\n direction: (directionStyle) => directionStyle !== 'ltr',\r\n flexDirection: (flexDirectionStyle) => flexDirectionStyle.endsWith('-reverse'),\r\n writingMode: (writingModeStyle) => writingModeStyle !== 'horizontal-tb',\r\n };\r\n const flowDirectionStyleArr = keys(flowDirectionCanBeNonDefaultMap) as Array<\r\n keyof FlowDirectionStyles\r\n >;\r\n const whCacheOptions = {\r\n _equal: equalWH,\r\n _initialValue: { w: 0, h: 0 },\r\n };\r\n const partialXYOptions = {\r\n _equal: equalXY,\r\n _initialValue: {},\r\n };\r\n\r\n const setMeasuringMode = (active: boolean) => {\r\n // viewportIsTargetBody never needs measuring\r\n _viewportAddRemoveClass(dataValueViewportMeasuring, !viewportIsTargetBody && active);\r\n };\r\n\r\n const getMeasuredScrollCoordinates = (flowDirectionStyles: FlowDirectionStyles) => {\r\n const flowDirectionCanBeNonDefault = flowDirectionStyleArr.some((styleName) => {\r\n const styleValue = flowDirectionStyles[styleName];\r\n return styleValue && flowDirectionCanBeNonDefaultMap[styleName](styleValue);\r\n });\r\n\r\n // if the direction can not be non-default return default scroll coordinates (only the sign of the numbers matters)\r\n if (!flowDirectionCanBeNonDefault) {\r\n return {\r\n _start: { x: 0, y: 0 },\r\n _end: { x: 1, y: 1 },\r\n };\r\n }\r\n\r\n setMeasuringMode(true);\r\n\r\n const originalScrollOffset = getElementScroll(_scrollOffsetElement);\r\n const removeNoContent = _viewportAddRemoveClass(dataValueViewportNoContent, true);\r\n const removeScrollBlock = addEventListener(\r\n _scrollEventElement,\r\n strScroll,\r\n (event) => {\r\n const scrollEventScrollOffset = getElementScroll(_scrollOffsetElement);\r\n // if scroll offset didnt change\r\n if (\r\n event.isTrusted &&\r\n scrollEventScrollOffset.x === originalScrollOffset.x &&\r\n scrollEventScrollOffset.y === originalScrollOffset.y\r\n ) {\r\n stopPropagation(event);\r\n }\r\n },\r\n {\r\n _capture: true,\r\n _once: true,\r\n }\r\n );\r\n\r\n scrollElementTo(_scrollOffsetElement, {\r\n x: 0,\r\n y: 0,\r\n });\r\n removeNoContent();\r\n\r\n const _start = getElementScroll(_scrollOffsetElement);\r\n const scrollSize = getScrollSize(_scrollOffsetElement);\r\n scrollElementTo(_scrollOffsetElement, {\r\n x: scrollSize.w,\r\n y: scrollSize.h,\r\n });\r\n\r\n const tmp = getElementScroll(_scrollOffsetElement);\r\n scrollElementTo(_scrollOffsetElement, {\r\n // if tmp is very close start there porbably wasn't any scroll happening so scroll again in different direction\r\n x: tmp.x - _start.x < 1 && -scrollSize.w,\r\n y: tmp.y - _start.y < 1 && -scrollSize.h,\r\n });\r\n\r\n const _end = getElementScroll(_scrollOffsetElement);\r\n scrollElementTo(_scrollOffsetElement, originalScrollOffset);\r\n rAF(() => removeScrollBlock());\r\n\r\n return {\r\n _start,\r\n _end,\r\n };\r\n };\r\n const getOverflowAmount = (\r\n viewportScrollSize: WH<number>,\r\n viewportClientSize: WH<number>\r\n ): WH<number> => {\r\n const tollerance = wnd.devicePixelRatio % 1 !== 0 ? 1 : 0;\r\n const amount = {\r\n w: max0(viewportScrollSize.w - viewportClientSize.w),\r\n h: max0(viewportScrollSize.h - viewportClientSize.h),\r\n };\r\n\r\n return {\r\n w: amount.w > tollerance ? amount.w : 0,\r\n h: amount.h > tollerance ? amount.h : 0,\r\n };\r\n };\r\n const getViewportOverflowStyle = (\r\n hasOverflow: Partial<XY<boolean>>,\r\n overflowBehavior: XY<OverflowBehavior>\r\n ): XY<OverflowStyle> => {\r\n const getAxisOverflowStyle = (\r\n axisBehavior: OverflowBehavior,\r\n axisHasOverflow: boolean | undefined,\r\n perpendicularBehavior: OverflowBehavior,\r\n perpendicularOverflow: boolean | undefined\r\n ): OverflowStyle => {\r\n // convert behavior to style:\r\n // 'visible' -> 'hidden'\r\n // 'hidden' -> 'hidden'\r\n // 'scroll' -> 'scroll'\r\n // 'visible-hidden' -> 'hidden'\r\n // 'visible-scroll' -> 'scroll'\r\n const behaviorStyle =\r\n axisBehavior === strVisible ? strHidden : overflowBehaviorToOverflowStyle(axisBehavior);\r\n const axisOverflowVisible = overflowIsVisible(axisBehavior);\r\n const perpendicularOverflowVisible = overflowIsVisible(perpendicularBehavior);\r\n\r\n // if no axis has overflow set 'hidden'\r\n if (!axisHasOverflow && !perpendicularOverflow) {\r\n return strHidden;\r\n }\r\n\r\n // if both axis have a visible behavior ('visible', 'visible-hidden', 'visible-scroll') set 'visible'\r\n if (axisOverflowVisible && perpendicularOverflowVisible) {\r\n return strVisible;\r\n }\r\n\r\n // this this axis has a visible behavior\r\n if (axisOverflowVisible) {\r\n const nonPerpendicularOverflow = axisHasOverflow ? strVisible : strHidden;\r\n return axisHasOverflow && perpendicularOverflow\r\n ? behaviorStyle // if both axis have an overflow set ('hidden' or 'scroll')\r\n : nonPerpendicularOverflow; // if only this axis has an overflow set 'visible', if no axis has an overflow set 'hidden'\r\n }\r\n\r\n const nonOverflow =\r\n perpendicularOverflowVisible && perpendicularOverflow ? strVisible : strHidden;\r\n return axisHasOverflow\r\n ? behaviorStyle // if this axis has an overflow\r\n : nonOverflow; // if the perp. axis has a visible behavior and has an overflow set 'visible', otherwise set 'hidden'\r\n };\r\n\r\n return {\r\n x: getAxisOverflowStyle(overflowBehavior.x, hasOverflow.x, overflowBehavior.y, hasOverflow.y),\r\n y: getAxisOverflowStyle(overflowBehavior.y, hasOverflow.y, overflowBehavior.x, hasOverflow.x),\r\n };\r\n };\r\n const setViewportOverflowStyle = (viewportOverflowStyle: XY<OverflowStyle>) => {\r\n // `createAllOverflowStyleClassNames` and `allOverflowStyleClassNames` could be one scope further up but would increase bundle size\r\n const createAllOverflowStyleClassNames = (isHorizontal?: boolean) =>\r\n [strVisible, strHidden, strScroll].map((style) =>\r\n createViewportOverflowStyleClassName(overflowCssValueToOverflowStyle(style), isHorizontal)\r\n );\r\n const allOverflowStyleClassNames = createAllOverflowStyleClassNames(true)\r\n .concat(createAllOverflowStyleClassNames())\r\n .join(' ');\r\n\r\n _viewportAddRemoveClass(allOverflowStyleClassNames);\r\n _viewportAddRemoveClass(\r\n (keys(viewportOverflowStyle) as Array<keyof typeof viewportOverflowStyle>)\r\n .map((axis) =>\r\n createViewportOverflowStyleClassName(viewportOverflowStyle[axis], axis === 'x')\r\n )\r\n .join(' '),\r\n true\r\n );\r\n };\r\n\r\n const [updateSizeFraction, getCurrentSizeFraction] = createCache<WH<number>>(\r\n whCacheOptions,\r\n bind(getFractionalSize, _viewport)\r\n );\r\n const [updateViewportScrollSizeCache, getCurrentViewportScrollSizeCache] = createCache<\r\n WH<number>\r\n >(whCacheOptions, bind(getScrollSize, _viewport));\r\n const [updateOverflowAmountCache, getCurrentOverflowAmountCache] =\r\n createCache<WH<number>>(whCacheOptions);\r\n const [updateHasOverflowCache] = createCache<Partial<XY<boolean>>>(partialXYOptions);\r\n const [updateOverflowEdge, getCurrentOverflowEdgeCache] = createCache<WH<number>>(whCacheOptions);\r\n const [updateOverflowStyleCache] = createCache<Partial<XY<OverflowStyle>>>(partialXYOptions);\r\n const [updateFlowDirectionStyles] = createCache<FlowDirectionStyles>(\r\n {\r\n _equal: (currVal, newValu) => equal(currVal, newValu, flowDirectionStyleArr),\r\n _initialValue: {},\r\n },\r\n () => (hasDimensions(_viewport) ? getStyles(_viewport, flowDirectionStyleArr) : {})\r\n );\r\n const [updateMeasuredScrollCoordinates, getCurrentMeasuredScrollCoordinates] =\r\n createCache<ScrollCoordinates>({\r\n _equal: (currVal, newVal) =>\r\n equalXY(currVal._start, newVal._start) && equalXY(currVal._end, newVal._end),\r\n _initialValue: getZeroScrollCoordinates(),\r\n });\r\n\r\n const scrollbarsHidingPlugin = getStaticPluginModuleInstance<typeof ScrollbarsHidingPlugin>(\r\n scrollbarsHidingPluginName\r\n );\r\n\r\n const createViewportOverflowStyleClassName = (\r\n overflowStyle: OverflowStyle,\r\n isHorizontal?: boolean\r\n ) => {\r\n const prefix = isHorizontal\r\n ? dataValueViewportOverflowXPrefix\r\n : dataValueViewportOverflowYPrefix;\r\n return `${prefix}${capitalizeFirstLetter(overflowStyle)}`;\r\n };\r\n\r\n return (\r\n { _checkOption, _observersUpdateHints, _observersState, _force },\r\n { _paddingStyleChanged }\r\n ) => {\r\n const {\r\n _sizeChanged,\r\n _hostMutation,\r\n _contentMutation,\r\n _directionChanged,\r\n _appear,\r\n _scrollbarSizeChanged,\r\n } = _observersUpdateHints || {};\r\n const scrollbarsHidingPluginViewportArrangement =\r\n scrollbarsHidingPlugin &&\r\n scrollbarsHidingPlugin._viewportArrangement(\r\n structureSetupElements,\r\n structureSetupState,\r\n _observersState,\r\n env,\r\n _checkOption\r\n );\r\n\r\n const { _arrangeViewport, _undoViewportArrange, _hideNativeScrollbars } =\r\n scrollbarsHidingPluginViewportArrangement || {};\r\n\r\n const [showNativeOverlaidScrollbars, showNativeOverlaidScrollbarsChanged] =\r\n getShowNativeOverlaidScrollbars(_checkOption, env);\r\n const [overflow, overflowChanged] = _checkOption('overflow');\r\n const overflowXVisible = overflowIsVisible(overflow.x);\r\n const overflowYVisible = overflowIsVisible(overflow.y);\r\n\r\n const viewportChanged =\r\n _sizeChanged ||\r\n _paddingStyleChanged ||\r\n _contentMutation ||\r\n _directionChanged ||\r\n _scrollbarSizeChanged ||\r\n showNativeOverlaidScrollbarsChanged;\r\n\r\n let sizeFractionCache = getCurrentSizeFraction(_force);\r\n let viewportScrollSizeCache = getCurrentViewportScrollSizeCache(_force);\r\n let overflowAmuntCache = getCurrentOverflowAmountCache(_force);\r\n let overflowEdgeCache = getCurrentOverflowEdgeCache(_force);\r\n\r\n if (showNativeOverlaidScrollbarsChanged && _nativeScrollbarsHiding) {\r\n _viewportAddRemoveClass(dataValueViewportScrollbarHidden, !showNativeOverlaidScrollbars);\r\n }\r\n\r\n if (viewportChanged) {\r\n if (hasAttrClass(_host, dataAttributeHost, dataValueNoClipping)) {\r\n setMeasuringMode(true);\r\n }\r\n\r\n const redoViewportArrange = _undoViewportArrange && _undoViewportArrange();\r\n\r\n const [sizeFraction] = (sizeFractionCache = updateSizeFraction(_force));\r\n const [viewportScrollSize] = (viewportScrollSizeCache =\r\n updateViewportScrollSizeCache(_force));\r\n const viewportClientSize = getClientSize(_viewport);\r\n const windowInnerSize = viewportIsTargetBody && getWindowSize(_windowElm());\r\n const overflowAmountScrollSize = {\r\n w: max0(viewportScrollSize.w + sizeFraction.w),\r\n h: max0(viewportScrollSize.h + sizeFraction.h),\r\n };\r\n\r\n const overflowAmountClientSize = {\r\n w: max0(\r\n (windowInnerSize\r\n ? windowInnerSize.w\r\n : viewportClientSize.w + max0(viewportClientSize.w - viewportScrollSize.w)) +\r\n sizeFraction.w\r\n ),\r\n h: max0(\r\n (windowInnerSize\r\n ? windowInnerSize.h\r\n : viewportClientSize.h + max0(viewportClientSize.h - viewportScrollSize.h)) +\r\n sizeFraction.h\r\n ),\r\n };\r\n\r\n if (redoViewportArrange) {\r\n redoViewportArrange();\r\n }\r\n\r\n overflowEdgeCache = updateOverflowEdge(overflowAmountClientSize);\r\n overflowAmuntCache = updateOverflowAmountCache(\r\n getOverflowAmount(overflowAmountScrollSize, overflowAmountClientSize),\r\n _force\r\n );\r\n }\r\n\r\n const [overflowEdge, overflowEdgeChanged] = overflowEdgeCache;\r\n const [overflowAmount, overflowAmountChanged] = overflowAmuntCache;\r\n const [viewportScrollSize, viewportScrollSizeChanged] = viewportScrollSizeCache;\r\n const [sizeFraction, sizeFractionChanged] = sizeFractionCache;\r\n const [hasOverflow, hasOverflowChanged] = updateHasOverflowCache({\r\n x: overflowAmount.w > 0,\r\n y: overflowAmount.h > 0,\r\n });\r\n const removeClipping =\r\n (overflowXVisible && overflowYVisible && (hasOverflow.x || hasOverflow.y)) ||\r\n (overflowXVisible && hasOverflow.x && !hasOverflow.y) ||\r\n (overflowYVisible && hasOverflow.y && !hasOverflow.x);\r\n const adjustViewportStyle =\r\n _paddingStyleChanged ||\r\n _directionChanged ||\r\n _scrollbarSizeChanged ||\r\n sizeFractionChanged ||\r\n viewportScrollSizeChanged ||\r\n overflowEdgeChanged ||\r\n overflowAmountChanged ||\r\n overflowChanged ||\r\n showNativeOverlaidScrollbarsChanged ||\r\n viewportChanged ||\r\n (_hostMutation && viewportIsTargetBody);\r\n const [flowDirectionStyles, flowDirectionStylesChanged] = updateFlowDirectionStyles(_force);\r\n const adjustMeasuredScrollCoordinates =\r\n _directionChanged || _appear || flowDirectionStylesChanged || hasOverflowChanged || _force;\r\n const [scrollCoordinates, scrollCoordinatesChanged] = adjustMeasuredScrollCoordinates\r\n ? updateMeasuredScrollCoordinates(getMeasuredScrollCoordinates(flowDirectionStyles), _force)\r\n : getCurrentMeasuredScrollCoordinates();\r\n\r\n let viewportOverflowStyle = getViewportOverflowStyle(hasOverflow, overflow);\r\n\r\n setMeasuringMode(false);\r\n\r\n if (adjustViewportStyle) {\r\n setViewportOverflowStyle(viewportOverflowStyle);\r\n\r\n viewportOverflowStyle = getElementOverflowStyle(_viewport, hasOverflow);\r\n\r\n if (_hideNativeScrollbars && _arrangeViewport) {\r\n _arrangeViewport(viewportOverflowStyle, viewportScrollSize, sizeFraction);\r\n\r\n setStyles(_viewport, _hideNativeScrollbars(viewportOverflowStyle));\r\n }\r\n }\r\n\r\n const [overflowStyle, overflowStyleChanged] = updateOverflowStyleCache(viewportOverflowStyle);\r\n\r\n addRemoveAttrClass(_host, dataAttributeHost, dataValueNoClipping, removeClipping);\r\n addRemoveAttrClass(_padding, dataAttributePadding, dataValueNoClipping, removeClipping);\r\n\r\n assignDeep(structureSetupState, {\r\n _overflowStyle: overflowStyle,\r\n _overflowEdge: {\r\n x: overflowEdge.w,\r\n y: overflowEdge.h,\r\n },\r\n _overflowAmount: {\r\n x: overflowAmount.w,\r\n y: overflowAmount.h,\r\n },\r\n _hasOverflow: hasOverflow,\r\n _scrollCoordinates: sanitizeScrollCoordinates(scrollCoordinates, overflowAmount),\r\n });\r\n\r\n return {\r\n _overflowStyleChanged: overflowStyleChanged,\r\n _overflowEdgeChanged: overflowEdgeChanged,\r\n _overflowAmountChanged: overflowAmountChanged,\r\n _scrollCoordinatesChanged: scrollCoordinatesChanged || overflowAmountChanged,\r\n };\r\n };\r\n};\r\n", "import type { TRBL, XY, ScrollCoordinates } from '../../support';\r\nimport type { StructureSetupElementsObj } from './structureSetup.elements';\r\nimport type {\r\n ObserversSetupState,\r\n ObserversSetupUpdateHints,\r\n Setup,\r\n SetupUpdateInfo,\r\n} from '../../setups';\r\nimport type { InitializationTarget } from '../../initialization';\r\nimport type { StyleObject, OverflowStyle } from '../../typings';\r\nimport {\r\n assignDeep,\r\n each,\r\n getElementScroll,\r\n getZeroScrollCoordinates,\r\n scrollElementTo,\r\n strHidden,\r\n strMarginBottom,\r\n strMarginLeft,\r\n strMarginRight,\r\n strPaddingBottom,\r\n strPaddingLeft,\r\n strPaddingRight,\r\n strPaddingTop,\r\n} from '../../support';\r\nimport { getEnvironment } from '../../environment';\r\nimport { createStructureSetupElements } from './structureSetup.elements';\r\nimport {\r\n createOverflowUpdateSegment,\r\n createPaddingUpdateSegment,\r\n createTrinsicUpdateSegment,\r\n} from './updateSegments';\r\n\r\nexport interface StructureSetupState {\r\n _padding: TRBL;\r\n _paddingAbsolute: boolean;\r\n _viewportPaddingStyle: StyleObject;\r\n _overflowEdge: XY<number>;\r\n _overflowAmount: XY<number>;\r\n _overflowStyle: XY<OverflowStyle>;\r\n _hasOverflow: XY<boolean>;\r\n _scrollCoordinates: ScrollCoordinates;\r\n}\r\n\r\nexport interface StructureSetupUpdateInfo extends SetupUpdateInfo {\r\n _observersState: ObserversSetupState;\r\n _observersUpdateHints?: ObserversSetupUpdateHints;\r\n}\r\n\r\nexport type StructureSetupUpdateHints = {\r\n _overflowEdgeChanged?: boolean;\r\n _overflowAmountChanged?: boolean;\r\n _overflowStyleChanged?: boolean;\r\n _paddingStyleChanged?: boolean;\r\n _scrollCoordinatesChanged?: boolean;\r\n};\r\n\r\nexport type StructureSetup = [\r\n ...Setup<StructureSetupUpdateInfo, StructureSetupState, StructureSetupUpdateHints>,\r\n /** The elements created by the structure setup. */\r\n StructureSetupElementsObj,\r\n /** Function to be called when the initialization was canceled. */\r\n () => void,\r\n];\r\n\r\nexport type StructureUpdateSegment = (\r\n updateInfo: StructureSetupUpdateInfo,\r\n updateHints: Readonly<StructureSetupUpdateHints>\r\n) => StructureSetupUpdateHints | void;\r\n\r\nexport type CreateStructureUpdateSegment = (\r\n structureSetupElements: StructureSetupElementsObj,\r\n state: StructureSetupState\r\n) => StructureUpdateSegment;\r\n\r\nexport const createStructureSetup = (target: InitializationTarget): StructureSetup => {\r\n const [elements, appendStructureElements, canceled] = createStructureSetupElements(target);\r\n const state: StructureSetupState = {\r\n _padding: {\r\n t: 0,\r\n r: 0,\r\n b: 0,\r\n l: 0,\r\n },\r\n _paddingAbsolute: false,\r\n _viewportPaddingStyle: {\r\n [strMarginRight]: 0,\r\n [strMarginBottom]: 0,\r\n [strMarginLeft]: 0,\r\n [strPaddingTop]: 0,\r\n [strPaddingRight]: 0,\r\n [strPaddingBottom]: 0,\r\n [strPaddingLeft]: 0,\r\n },\r\n _overflowEdge: { x: 0, y: 0 },\r\n _overflowAmount: { x: 0, y: 0 },\r\n _overflowStyle: {\r\n x: strHidden,\r\n y: strHidden,\r\n },\r\n _hasOverflow: {\r\n x: false,\r\n y: false,\r\n },\r\n _scrollCoordinates: getZeroScrollCoordinates(),\r\n };\r\n const { _target, _scrollOffsetElement, _viewportIsTarget, _removeScrollObscuringStyles } =\r\n elements;\r\n const { _nativeScrollbarsHiding, _nativeScrollbarsOverlaid } = getEnvironment();\r\n const doViewportArrange =\r\n !_nativeScrollbarsHiding && (_nativeScrollbarsOverlaid.x || _nativeScrollbarsOverlaid.y);\r\n\r\n const updateSegments: StructureUpdateSegment[] = [\r\n createTrinsicUpdateSegment(elements, state),\r\n createPaddingUpdateSegment(elements, state),\r\n createOverflowUpdateSegment(elements, state),\r\n ];\r\n\r\n return [\r\n appendStructureElements,\r\n (updateInfo) => {\r\n const updateHints: StructureSetupUpdateHints = {};\r\n const adjustScrollOffset = doViewportArrange;\r\n const scrollOffset = adjustScrollOffset && getElementScroll(_scrollOffsetElement);\r\n const revertScrollObscuringStyles = scrollOffset && _removeScrollObscuringStyles();\r\n\r\n each(updateSegments, (updateSegment) => {\r\n assignDeep(updateHints, updateSegment(updateInfo, updateHints) || {});\r\n });\r\n\r\n scrollElementTo(_scrollOffsetElement, scrollOffset);\r\n if (revertScrollObscuringStyles) {\r\n revertScrollObscuringStyles();\r\n }\r\n if (!_viewportIsTarget) {\r\n scrollElementTo(_target, 0);\r\n }\r\n\r\n return updateHints;\r\n },\r\n state,\r\n elements,\r\n canceled,\r\n ];\r\n};\r\n", "import type { OptionsCheckFn, Options, PartialOptions, ReadonlyOptions } from '../options';\r\nimport type { DeepReadonly } from '../typings';\r\nimport type { InitializationTarget } from '../initialization';\r\nimport type { ObserversSetupState, ObserversSetupUpdateHints } from './observersSetup';\r\nimport type { StructureSetupState, StructureSetupUpdateHints } from './structureSetup';\r\nimport type { StructureSetupElementsObj } from './structureSetup/structureSetup.elements';\r\nimport type { ScrollbarsSetupElementsObj } from './scrollbarsSetup/scrollbarsSetup.elements';\r\nimport { createOptionCheck } from '../options';\r\nimport {\r\n assignDeep,\r\n bind,\r\n getElementScroll,\r\n isEmptyObject,\r\n keys,\r\n runEachAndClear,\r\n scrollElementTo,\r\n} from '../support';\r\nimport { createObserversSetup } from './observersSetup';\r\nimport { createScrollbarsSetup } from './scrollbarsSetup';\r\nimport { createStructureSetup } from './structureSetup';\r\n\r\nexport type SetupUpdateHints = Partial<Record<string, boolean>>;\r\n\r\nexport type SetupUpdateInfo = {\r\n _checkOption: OptionsCheckFn<Options>;\r\n _changedOptions: PartialOptions;\r\n _force: boolean;\r\n};\r\n\r\nexport type Setup<\r\n U extends SetupUpdateInfo,\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n S extends Readonly<Record<string, any>>,\r\n H extends SetupUpdateHints | void,\r\n> = [\r\n /** The create function which returns the `destroy` function. */\r\n _create: () => () => void,\r\n /** Function which updates the setup and returns the update result. */\r\n _update: (updateInfo: U) => H,\r\n /** Function which returns the current state. */\r\n _state: S,\r\n];\r\n\r\nexport interface SetupsUpdateInfo {\r\n /** The options that changed or `undefined` if none changed. */\r\n _changedOptions?: PartialOptions;\r\n /** Whether chache should be ignored. */\r\n _force?: boolean;\r\n /** Whether observers should take their records and thus update as well. */\r\n _takeRecords?: boolean;\r\n /** Whether one or more scrollbars has been cloned. */\r\n _cloneScrollbar?: boolean;\r\n}\r\n\r\nexport interface SetupsUpdateHints {\r\n readonly _observersUpdateHints: DeepReadonly<ObserversSetupUpdateHints>;\r\n readonly _structureUpdateHints: DeepReadonly<StructureSetupUpdateHints>;\r\n}\r\n\r\nexport interface SetupsState {\r\n readonly _observersSetupState: DeepReadonly<ObserversSetupState>;\r\n readonly _structureSetupState: DeepReadonly<StructureSetupState>;\r\n}\r\n\r\nexport interface SetupsElements {\r\n readonly _structureSetupElements: DeepReadonly<StructureSetupElementsObj>;\r\n readonly _scrollbarsSetupElements: DeepReadonly<ScrollbarsSetupElementsObj>;\r\n}\r\n\r\nexport type Setups = [\r\n construct: () => () => void,\r\n update: (updateInfo: SetupsUpdateInfo) => boolean,\r\n getState: () => SetupsState,\r\n elements: SetupsElements,\r\n canceled: () => void,\r\n];\r\n\r\nexport const createSetups = (\r\n target: InitializationTarget,\r\n options: ReadonlyOptions,\r\n isDestroyed: () => boolean,\r\n onUpdated: (updateInfo: SetupsUpdateInfo, updateHints: SetupsUpdateHints) => void,\r\n onScroll: (scrollEvent: Event) => void\r\n): Setups => {\r\n let cacheAndOptionsInitialized = false;\r\n const getCurrentOption = createOptionCheck(options, {});\r\n const [\r\n structureSetupCreate,\r\n structureSetupUpdate,\r\n structureSetupState,\r\n structureSetupElements,\r\n structureSetupCanceled,\r\n ] = createStructureSetup(target);\r\n const [observersSetupCreate, observersSetupUpdate, observersSetupState] = createObserversSetup(\r\n structureSetupElements,\r\n structureSetupState,\r\n getCurrentOption,\r\n (observersUpdateHints) => {\r\n update({}, observersUpdateHints);\r\n }\r\n );\r\n const [scrollbarsSetupCreate, scrollbarsSetupUpdate, , scrollbarsSetupElements] =\r\n createScrollbarsSetup(\r\n target,\r\n options,\r\n observersSetupState,\r\n structureSetupState,\r\n structureSetupElements,\r\n onScroll\r\n );\r\n\r\n const updateHintsAreTruthy = (hints: SetupUpdateHints) =>\r\n keys(hints).some((key) => !!hints[key as keyof typeof hints]);\r\n\r\n const update = (\r\n updateInfo: SetupsUpdateInfo,\r\n observerUpdateHints?: ObserversSetupUpdateHints\r\n ): boolean => {\r\n if (isDestroyed()) {\r\n return false;\r\n }\r\n\r\n const {\r\n _changedOptions: rawChangedOptions,\r\n _force: rawForce,\r\n _takeRecords,\r\n _cloneScrollbar,\r\n } = updateInfo;\r\n\r\n const _changedOptions = rawChangedOptions || {};\r\n const _force = !!rawForce || !cacheAndOptionsInitialized;\r\n const baseUpdateInfoObj: SetupUpdateInfo = {\r\n _checkOption: createOptionCheck(options, _changedOptions, _force),\r\n _changedOptions,\r\n _force,\r\n };\r\n\r\n if (_cloneScrollbar) {\r\n scrollbarsSetupUpdate(baseUpdateInfoObj);\r\n return false;\r\n }\r\n\r\n const observersHints =\r\n observerUpdateHints ||\r\n observersSetupUpdate(\r\n assignDeep({}, baseUpdateInfoObj, {\r\n _takeRecords,\r\n })\r\n );\r\n\r\n const structureHints = structureSetupUpdate(\r\n assignDeep({}, baseUpdateInfoObj, {\r\n _observersState: observersSetupState,\r\n _observersUpdateHints: observersHints,\r\n })\r\n );\r\n\r\n scrollbarsSetupUpdate(\r\n assignDeep({}, baseUpdateInfoObj, {\r\n _observersUpdateHints: observersHints,\r\n _structureUpdateHints: structureHints,\r\n })\r\n );\r\n\r\n const truthyObserversHints = updateHintsAreTruthy(observersHints);\r\n const truthyStructureHints = updateHintsAreTruthy(structureHints);\r\n const changed =\r\n truthyObserversHints || truthyStructureHints || !isEmptyObject(_changedOptions) || _force;\r\n\r\n cacheAndOptionsInitialized = true;\r\n\r\n if (changed) {\r\n onUpdated(updateInfo, {\r\n _observersUpdateHints: observersHints,\r\n _structureUpdateHints: structureHints,\r\n });\r\n }\r\n\r\n return changed;\r\n };\r\n\r\n return [\r\n () => {\r\n const { _originalScrollOffsetElement, _scrollOffsetElement, _removeScrollObscuringStyles } =\r\n structureSetupElements;\r\n const initialScroll = getElementScroll(_originalScrollOffsetElement);\r\n const destroyFns = [observersSetupCreate(), structureSetupCreate(), scrollbarsSetupCreate()];\r\n const revertScrollObscuringStyles = _removeScrollObscuringStyles();\r\n\r\n scrollElementTo(_scrollOffsetElement, initialScroll);\r\n revertScrollObscuringStyles();\r\n\r\n return bind(runEachAndClear, destroyFns);\r\n },\r\n update,\r\n () => ({\r\n _observersSetupState: observersSetupState,\r\n _structureSetupState: structureSetupState,\r\n }),\r\n {\r\n _structureSetupElements: structureSetupElements,\r\n _scrollbarsSetupElements: scrollbarsSetupElements,\r\n },\r\n structureSetupCanceled,\r\n ];\r\n};\r\n", "import type { OverlayScrollbars } from './overlayscrollbars';\r\n\r\nconst targetInstanceMap: WeakMap<Element, OverlayScrollbars> = new WeakMap();\r\n\r\n/**\r\n * Adds the given OverlayScrollbars instance to the given element.\r\n * @param target The element which is the target of the OverlayScrollbars instance.\r\n * @param osInstance The OverlayScrollbars instance.\r\n */\r\nexport const addInstance = (target: Element, osInstance: OverlayScrollbars): void => {\r\n targetInstanceMap.set(target, osInstance);\r\n};\r\n\r\n/**\r\n * Removes a OverlayScrollbars instance from the given element.\r\n * @param target The element from which its OverlayScrollbars instance shall be removed.\r\n */\r\nexport const removeInstance = (target: Element): void => {\r\n targetInstanceMap.delete(target);\r\n};\r\n\r\n/**\r\n * Gets the OverlayScrollbars from the given element or undefined if it doesn't have one.\r\n * @param target The element of which its OverlayScrollbars instance shall be get.\r\n */\r\nexport const getInstance = (target: Element): OverlayScrollbars | undefined =>\r\n targetInstanceMap.get(target);\r\n", "/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport type { XY, TRBL } from './support';\r\nimport type { Options, PartialOptions, ReadonlyOptions } from './options';\r\nimport type {\r\n InferInstancePluginModuleInstance,\r\n InferStaticPluginModuleInstance,\r\n InstancePlugin,\r\n OptionsValidationPlugin,\r\n Plugin,\r\n PluginModuleInstance,\r\n StaticPlugin,\r\n} from './plugins';\r\nimport type { Initialization, InitializationTarget, PartialInitialization } from './initialization';\r\nimport type { OverflowStyle } from './typings';\r\nimport type { EventListenerArgs, EventListener, EventListeners } from './eventListeners';\r\nimport type {\r\n ScrollbarsSetupElement,\r\n ScrollbarStructure,\r\n} from './setups/scrollbarsSetup/scrollbarsSetup.elements';\r\nimport {\r\n addPlugins,\r\n getStaticPluginModuleInstance,\r\n optionsValidationPluginModuleName,\r\n pluginModules,\r\n registerPluginModuleInstances,\r\n} from './plugins';\r\nimport { createSetups } from './setups';\r\nimport { addInstance, getInstance, removeInstance } from './instances';\r\nimport { cancelInitialization } from './initialization';\r\nimport { getEnvironment } from './environment';\r\nimport { getOptionsDiff } from './options';\r\nimport {\r\n assignDeep,\r\n isEmptyObject,\r\n isFunction,\r\n isHTMLElement,\r\n createEventListenerHub,\r\n isPlainObject,\r\n keys,\r\n isArray,\r\n push,\r\n runEachAndClear,\r\n bind,\r\n removeUndefinedProperties,\r\n} from './support';\r\nimport { setNonce } from './nonce';\r\nimport { setTrustedTypePolicy } from './trustedTypePolicy';\r\n\r\n// Notes:\r\n// Height intrinsic detection use \"content: true\" init strategy - or open ticket for custom height intrinsic observer\r\n\r\n/**\r\n * Describes the OverlayScrollbars environment.\r\n */\r\nexport interface Environment {\r\n /** The native scrollbars size of the browser / system. */\r\n scrollbarsSize: XY<number>;\r\n /** Whether the native scrollbars are overlaid. */\r\n scrollbarsOverlaid: XY<boolean>;\r\n /** Whether the browser supports native scrollbars hiding. */\r\n scrollbarsHiding: boolean;\r\n /** Whether the browser supports the ScrollTimeline API. */\r\n scrollTimeline: boolean;\r\n /** The default Initialization to use if nothing else is specified. */\r\n staticDefaultInitialization: Initialization;\r\n /** The default Options to use if nothing else is specified. */\r\n staticDefaultOptions: Options;\r\n\r\n /** Returns the current default Initialization. */\r\n getDefaultInitialization(): Initialization;\r\n /** Returns the current default Options. */\r\n getDefaultOptions(): Options;\r\n\r\n /**\r\n * Sets a new default Initialization.\r\n * If the new default Initialization is partially filled, its deeply merged with the current default Initialization.\r\n * @param newDefaultInitialization The new default Initialization.\r\n * @returns The current default Initialization.\r\n */\r\n setDefaultInitialization(newDefaultInitialization: PartialInitialization): Initialization;\r\n /**\r\n * Sets new default Options.\r\n * If the new default Options are partially filled, they're deeply merged with the current default Options.\r\n * @param newDefaultOptions The new default Options.\r\n * @returns The current default options.\r\n */\r\n setDefaultOptions(newDefaultOptions: PartialOptions): Options;\r\n}\r\n\r\n/**\r\n * The primary entry point to OverlayScrollbars.\r\n */\r\nexport interface OverlayScrollbarsStatic {\r\n /**\r\n * Returns the current OverlayScrollbars instance if the target already has an instance.\r\n * @param target The initialization target to from which the instance shall be returned.\r\n */\r\n (target: InitializationTarget): OverlayScrollbars | undefined;\r\n /**\r\n * Initializes a new OverlayScrollbars instance to the given target\r\n * or returns the current OverlayScrollbars instance if the target already has an instance.\r\n * @param target The target.\r\n * @param options The options. (Can be just an empty object)\r\n * @param eventListeners Optional event listeners.\r\n */\r\n (\r\n target: InitializationTarget,\r\n options: PartialOptions,\r\n eventListeners?: EventListeners\r\n ): OverlayScrollbars;\r\n\r\n /**\r\n * Checks whether the passed value is a valid and not destroyed overlayscrollbars instance.\r\n * @param osInstance The value which shall be checked.\r\n */\r\n valid(osInstance: any): osInstance is OverlayScrollbars;\r\n /**\r\n * Gets the environment.\r\n */\r\n env(): Environment;\r\n /**\r\n * Sets the nonce attribute for inline styles.\r\n */\r\n nonce(newNonce: string | undefined): void;\r\n /**\r\n * Sets the trusted type policy used for DOM operations.\r\n */\r\n trustedTypePolicy(newTrustedTypePolicy: unknown | undefined): void;\r\n /**\r\n * Adds a single plugin.\r\n * @param plugin The plugin to be added.\r\n * @returns The plugins static modules instance or `void` if no instance was found.\r\n */\r\n plugin<P extends Plugin>(\r\n plugin: P\r\n ): P extends StaticPlugin ? InferStaticPluginModuleInstance<P> : void;\r\n /**\r\n * Adds multiple plugins.\r\n * @param plugins The plugins to be added.\r\n * @returns The plugins static modules instances or `void` if no instance was found.\r\n */\r\n plugin<P extends [Plugin, ...Plugin[]]>(\r\n plugins: P\r\n ): P extends [Plugin, ...Plugin[]]\r\n ? {\r\n [K in keyof P]: P[K] extends StaticPlugin ? InferStaticPluginModuleInstance<P[K]> : void;\r\n }\r\n : void;\r\n}\r\n\r\n/**\r\n * Describes a OverlayScrollbars instances state.\r\n */\r\nexport interface State {\r\n /** Describes the current padding in pixel. */\r\n padding: TRBL;\r\n /** Whether the current padding is absolute. */\r\n paddingAbsolute: boolean;\r\n /** The client width (x) & height (y) of the viewport in pixel. */\r\n overflowEdge: XY<number>;\r\n /** The overflow amount in pixel. */\r\n overflowAmount: XY<number>;\r\n /** The css overflow style of the viewport. */\r\n overflowStyle: XY<OverflowStyle>;\r\n /** Whether the viewport has an overflow. */\r\n hasOverflow: XY<boolean>;\r\n /** The scroll coordinates of the viewport. */\r\n scrollCoordinates: {\r\n /** The start (origin) scroll coordinates for each axis. */\r\n start: XY<number>;\r\n /** The end scroll coordinates for each axis. */\r\n end: XY<number>;\r\n };\r\n /** Whether the direction is considered rtl. */\r\n directionRTL: boolean;\r\n /** Whether the instance is considered destroyed. */\r\n destroyed: boolean;\r\n}\r\n\r\n/**\r\n * Describes the elements of a scrollbar.\r\n */\r\nexport interface ScrollbarElements {\r\n /**\r\n * The root element of the scrollbar.\r\n * The HTML structure looks like this:\r\n * <scrollbar>\r\n * <track>\r\n * <handle />\r\n * </track>\r\n * </scrollbar>\r\n */\r\n scrollbar: HTMLElement;\r\n /** The track element of the scrollbar. */\r\n track: HTMLElement;\r\n /** The handle element of the scrollbar. */\r\n handle: HTMLElement;\r\n}\r\n\r\n/**\r\n * Describes the elements of a scrollbar and provides the possibility to clone them.\r\n */\r\nexport interface CloneableScrollbarElements extends ScrollbarElements {\r\n /**\r\n * Clones the current scrollbar and returns the cloned elements.\r\n * The returned elements aren't added to the DOM.\r\n */\r\n clone(): ScrollbarElements;\r\n}\r\n\r\n/**\r\n * Describes the elements of a OverlayScrollbars instance.\r\n */\r\nexport interface Elements {\r\n /** The element the instance was applied to. */\r\n target: HTMLElement;\r\n /** The host element. Its the root of all other elements. */\r\n host: HTMLElement;\r\n /**\r\n * The element which is responsible to apply correct paddings.\r\n * Depending on the Initialization it can be the same as the viewport element.\r\n */\r\n padding: HTMLElement;\r\n /** The element which is responsible to do any scrolling. */\r\n viewport: HTMLElement;\r\n /**\r\n * The element which is responsible to hold the content.\r\n * Depending on the Initialization it can be the same as the viewport element.\r\n */\r\n content: HTMLElement;\r\n /**\r\n * The element through which you can get the current `scrollLeft` or `scrollTop` offset.\r\n * Depending on the target element it can be the same as the viewport element.\r\n */\r\n scrollOffsetElement: HTMLElement;\r\n /**\r\n * The element through which you can add `scroll` events.\r\n * Depending on the target element it can be the same as the viewport element.\r\n */\r\n scrollEventElement: HTMLElement | Document;\r\n /** The horizontal scrollbar elements. */\r\n scrollbarHorizontal: CloneableScrollbarElements;\r\n /** The vertical scrollbar elements. */\r\n scrollbarVertical: CloneableScrollbarElements;\r\n}\r\n\r\n/**\r\n * Describes a OverlayScrollbars instance.\r\n */\r\nexport interface OverlayScrollbars {\r\n /** Gets the current options of the instance. */\r\n options(): Options;\r\n /**\r\n * Sets the options of the instance.\r\n * If the new options are partially filled, they're deeply merged with either the current options or the current default options.\r\n * @param newOptions The new options which should be applied.\r\n * @param pure Whether the options should be reset before the new options are added.\r\n * @returns Returns the current options of the instance.\r\n */\r\n options(newOptions: PartialOptions, pure?: boolean): Options;\r\n\r\n /**\r\n * Adds event listeners to the instance.\r\n * @param eventListeners An object which contains the added listeners.\r\n * @param pure Whether all already added event listeners should be removed before the new listeners are added.\r\n * @returns Returns a function which removes the added listeners.\r\n */\r\n on(eventListeners: EventListeners, pure?: boolean): () => void;\r\n /**\r\n * Adds a single event listener to the instance.\r\n * @param name The name of the event.\r\n * @param listener The listener which is invoked on that event.\r\n * @returns Returns a function which removes the added listeners.\r\n */\r\n on<N extends keyof EventListenerArgs>(name: N, listener: EventListener<N>): () => void;\r\n /**\r\n * Adds multiple event listeners to the instance.\r\n * @param name The name of the event.\r\n * @param listener The listeners which are invoked on that event.\r\n * @returns Returns a function which removes the added listeners.\r\n */\r\n on<N extends keyof EventListenerArgs>(name: N, listener: EventListener<N>[]): () => void;\r\n\r\n /**\r\n * Removes a single event listener from the instance.\r\n * @param name The name of the event.\r\n * @param listener The listener which shall be removed.\r\n */\r\n off<N extends keyof EventListenerArgs>(name: N, listener: EventListener<N>): void;\r\n /**\r\n * Removes multiple event listeners from the instance.\r\n * @param name The name of the event.\r\n * @param listener The listeners which shall be removed.\r\n */\r\n off<N extends keyof EventListenerArgs>(name: N, listener: EventListener<N>[]): void;\r\n\r\n /**\r\n * Updates the instance.\r\n * @param force Whether the update should force the cache to be invalidated.\r\n * @returns A boolean which indicates whether the `update` event was triggered through this update.\r\n * The update event is only triggered if something changed because of this update.\r\n */\r\n update(force?: boolean): boolean;\r\n /** Returns the state of the instance. */\r\n state(): State;\r\n /** Returns the elements of the instance. */\r\n elements(): Elements;\r\n /** Destroys the instance and removes all added elements. */\r\n destroy(): void;\r\n /** Returns the instance of the passed plugin or `undefined` if no instance was found. */\r\n plugin<P extends InstancePlugin>(osPlugin: P): InferInstancePluginModuleInstance<P> | undefined;\r\n}\r\n\r\nexport const OverlayScrollbars: OverlayScrollbarsStatic = (\r\n target: InitializationTarget,\r\n options?: PartialOptions,\r\n eventListeners?: EventListeners\r\n) => {\r\n const { _getDefaultOptions } = getEnvironment();\r\n const targetIsElement = isHTMLElement(target);\r\n const instanceTarget = targetIsElement ? target : target.target;\r\n const potentialInstance = getInstance(instanceTarget);\r\n if (options && !potentialInstance) {\r\n let destroyed = false;\r\n const destroyFns: (() => void)[] = [];\r\n const instancePluginModuleInstances: Record<string, PluginModuleInstance> = {};\r\n const validateOptions = (newOptions: PartialOptions) => {\r\n const newOptionsWithoutUndefined = removeUndefinedProperties(newOptions, true);\r\n const pluginValidate = getStaticPluginModuleInstance<typeof OptionsValidationPlugin>(\r\n optionsValidationPluginModuleName\r\n );\r\n return pluginValidate\r\n ? pluginValidate(newOptionsWithoutUndefined, true)\r\n : newOptionsWithoutUndefined;\r\n };\r\n const currentOptions: ReadonlyOptions = assignDeep(\r\n {},\r\n _getDefaultOptions(),\r\n validateOptions(options)\r\n );\r\n const [addPluginEvent, removePluginEvents, triggerPluginEvent] =\r\n createEventListenerHub<EventListenerArgs>();\r\n const [addInstanceEvent, removeInstanceEvents, triggerInstanceEvent] =\r\n createEventListenerHub(eventListeners);\r\n const triggerEvent: typeof triggerPluginEvent = (name, args) => {\r\n triggerInstanceEvent(name, args);\r\n triggerPluginEvent(name, args);\r\n };\r\n const [setupsConstruct, setupsUpdate, setupsState, setupsElements, setupsCanceled] =\r\n createSetups(\r\n target,\r\n currentOptions,\r\n () => destroyed,\r\n ({ _changedOptions, _force }, { _observersUpdateHints, _structureUpdateHints }) => {\r\n const {\r\n _sizeChanged,\r\n _directionChanged,\r\n _heightIntrinsicChanged,\r\n _contentMutation,\r\n _hostMutation,\r\n _appear,\r\n } = _observersUpdateHints;\r\n\r\n const {\r\n _overflowEdgeChanged,\r\n _overflowAmountChanged,\r\n _overflowStyleChanged,\r\n _scrollCoordinatesChanged,\r\n } = _structureUpdateHints;\r\n\r\n triggerEvent('updated', [\r\n instance,\r\n {\r\n updateHints: {\r\n sizeChanged: !!_sizeChanged,\r\n directionChanged: !!_directionChanged,\r\n heightIntrinsicChanged: !!_heightIntrinsicChanged,\r\n overflowEdgeChanged: !!_overflowEdgeChanged,\r\n overflowAmountChanged: !!_overflowAmountChanged,\r\n overflowStyleChanged: !!_overflowStyleChanged,\r\n scrollCoordinatesChanged: !!_scrollCoordinatesChanged,\r\n contentMutation: !!_contentMutation,\r\n hostMutation: !!_hostMutation,\r\n appear: !!_appear,\r\n },\r\n changedOptions: _changedOptions || {},\r\n force: !!_force,\r\n },\r\n ]);\r\n },\r\n\r\n (scrollEvent) => triggerEvent('scroll', [instance, scrollEvent])\r\n );\r\n\r\n const destroy = (canceled: boolean) => {\r\n removeInstance(instanceTarget);\r\n runEachAndClear(destroyFns);\r\n\r\n destroyed = true;\r\n\r\n triggerEvent('destroyed', [instance, canceled]);\r\n removePluginEvents();\r\n removeInstanceEvents();\r\n };\r\n\r\n const instance: OverlayScrollbars = {\r\n options(newOptions?: PartialOptions, pure?: boolean) {\r\n if (newOptions) {\r\n const base = pure ? _getDefaultOptions() : {};\r\n const changedOptions = getOptionsDiff(\r\n currentOptions,\r\n assignDeep(base, validateOptions(newOptions))\r\n );\r\n if (!isEmptyObject(changedOptions)) {\r\n assignDeep(currentOptions, changedOptions);\r\n setupsUpdate({ _changedOptions: changedOptions });\r\n }\r\n }\r\n return assignDeep({}, currentOptions);\r\n },\r\n on: addInstanceEvent,\r\n off: (name, listener) => {\r\n if (name && listener) {\r\n removeInstanceEvents(name, listener);\r\n }\r\n },\r\n state() {\r\n const { _observersSetupState, _structureSetupState } = setupsState();\r\n const { _directionIsRTL } = _observersSetupState;\r\n const {\r\n _overflowEdge,\r\n _overflowAmount,\r\n _overflowStyle,\r\n _hasOverflow,\r\n _padding,\r\n _paddingAbsolute,\r\n _scrollCoordinates,\r\n } = _structureSetupState;\r\n return assignDeep(\r\n {},\r\n {\r\n overflowEdge: _overflowEdge,\r\n overflowAmount: _overflowAmount,\r\n overflowStyle: _overflowStyle,\r\n hasOverflow: _hasOverflow,\r\n scrollCoordinates: {\r\n start: _scrollCoordinates._start,\r\n end: _scrollCoordinates._end,\r\n },\r\n padding: _padding,\r\n paddingAbsolute: _paddingAbsolute,\r\n directionRTL: _directionIsRTL,\r\n destroyed,\r\n }\r\n );\r\n },\r\n elements() {\r\n const {\r\n _target,\r\n _host,\r\n _padding,\r\n _viewport,\r\n _content,\r\n _scrollOffsetElement,\r\n _scrollEventElement,\r\n } = setupsElements._structureSetupElements;\r\n const { _horizontal, _vertical } = setupsElements._scrollbarsSetupElements;\r\n const translateScrollbarStructure = (\r\n scrollbarStructure: ScrollbarStructure\r\n ): ScrollbarElements => {\r\n const { _handle, _track, _scrollbar } = scrollbarStructure;\r\n return {\r\n scrollbar: _scrollbar,\r\n track: _track,\r\n handle: _handle,\r\n };\r\n };\r\n const translateScrollbarsSetupElement = (\r\n scrollbarsSetupElement: ScrollbarsSetupElement\r\n ): CloneableScrollbarElements => {\r\n const { _scrollbarStructures, _clone } = scrollbarsSetupElement;\r\n const translatedStructure = translateScrollbarStructure(_scrollbarStructures[0]);\r\n\r\n return assignDeep({}, translatedStructure, {\r\n clone: () => {\r\n const result = translateScrollbarStructure(_clone());\r\n setupsUpdate({ _cloneScrollbar: true });\r\n return result;\r\n },\r\n });\r\n };\r\n return assignDeep(\r\n {},\r\n {\r\n target: _target,\r\n host: _host,\r\n padding: _padding || _viewport,\r\n viewport: _viewport,\r\n content: _content || _viewport,\r\n scrollOffsetElement: _scrollOffsetElement,\r\n scrollEventElement: _scrollEventElement,\r\n scrollbarHorizontal: translateScrollbarsSetupElement(_horizontal),\r\n scrollbarVertical: translateScrollbarsSetupElement(_vertical),\r\n }\r\n );\r\n },\r\n update: (_force?: boolean) => setupsUpdate({ _force, _takeRecords: true }),\r\n destroy: bind(destroy, false),\r\n plugin: <P extends InstancePlugin>(plugin: P) =>\r\n instancePluginModuleInstances[keys(plugin)[0]] as\r\n | InferInstancePluginModuleInstance<P>\r\n | undefined,\r\n };\r\n\r\n push(destroyFns, [setupsCanceled]);\r\n\r\n // valid inside plugins\r\n addInstance(instanceTarget, instance);\r\n\r\n // init plugins\r\n registerPluginModuleInstances(pluginModules, OverlayScrollbars, [\r\n instance,\r\n addPluginEvent,\r\n instancePluginModuleInstances,\r\n ]);\r\n\r\n if (\r\n cancelInitialization(\r\n setupsElements._structureSetupElements._isBody,\r\n !targetIsElement && target.cancel\r\n )\r\n ) {\r\n destroy(true);\r\n return instance;\r\n }\r\n\r\n push(destroyFns, setupsConstruct());\r\n\r\n triggerEvent('initialized', [instance]);\r\n\r\n instance.update();\r\n\r\n return instance;\r\n }\r\n return potentialInstance!;\r\n};\r\n\r\nOverlayScrollbars.plugin = (plugins: Plugin | Plugin[]) => {\r\n const isArr = isArray(plugins);\r\n const pluginsToAdd: Plugin<string, void | PluginModuleInstance, void | PluginModuleInstance>[] =\r\n isArr ? plugins : [plugins];\r\n const result = pluginsToAdd.map(\r\n (plugin) => registerPluginModuleInstances(plugin, OverlayScrollbars)[0]\r\n );\r\n addPlugins(pluginsToAdd);\r\n return isArr ? result : (result[0] as any);\r\n};\r\nOverlayScrollbars.valid = (osInstance: any): osInstance is OverlayScrollbars => {\r\n const hasElmsFn = osInstance && (osInstance as OverlayScrollbars).elements;\r\n const elements = isFunction(hasElmsFn) && hasElmsFn();\r\n return isPlainObject(elements) && !!getInstance(elements.target);\r\n};\r\nOverlayScrollbars.env = () => {\r\n const {\r\n _nativeScrollbarsSize,\r\n _nativeScrollbarsOverlaid,\r\n _nativeScrollbarsHiding,\r\n _scrollTimeline,\r\n _staticDefaultInitialization,\r\n _staticDefaultOptions,\r\n _getDefaultInitialization,\r\n _setDefaultInitialization,\r\n _getDefaultOptions,\r\n _setDefaultOptions,\r\n } = getEnvironment();\r\n return assignDeep(\r\n {},\r\n {\r\n scrollbarsSize: _nativeScrollbarsSize,\r\n scrollbarsOverlaid: _nativeScrollbarsOverlaid,\r\n scrollbarsHiding: _nativeScrollbarsHiding,\r\n scrollTimeline: _scrollTimeline,\r\n staticDefaultInitialization: _staticDefaultInitialization,\r\n staticDefaultOptions: _staticDefaultOptions,\r\n\r\n getDefaultInitialization: _getDefaultInitialization,\r\n setDefaultInitialization: _setDefaultInitialization,\r\n getDefaultOptions: _getDefaultOptions,\r\n setDefaultOptions: _setDefaultOptions,\r\n }\r\n );\r\n};\r\nOverlayScrollbars.nonce = setNonce;\r\nOverlayScrollbars.trustedTypePolicy = setTrustedTypePolicy;\r\n", "import { ClickScrollPlugin, OverlayScrollbars } from 'overlayscrollbars';\nimport { forwardRef, useImperativeHandle, useLayoutEffect, useRef, useSyncExternalStore } from 'react';\nimport type { PropsWithChildren } from 'react';\nimport 'overlayscrollbars/overlayscrollbars.css';\n\nimport { fluentComponents } from '../../fluent';\n\nconst { mergeClasses } = fluentComponents;\n\nOverlayScrollbars.plugin(ClickScrollPlugin);\n\nexport type ScrollAxes = 'both' | 'horizontal' | 'vertical';\nconst SCROLL_AREA_HOST_CLASS = 'fwt-scroll-area relative overflow-hidden';\n\ninterface ScrollAreaProps extends PropsWithChildren {\n axes: ScrollAxes;\n className?: string;\n contentClassName?: string;\n noTabIndex?: boolean;\n /**\n * Styles the scrollport itself -- the box that clips. Padding on the host is\n * outside the clip, so a shadow, focus ring or outline drawn inside the\n * scroller is cut at the scrollport's edge; padding here keeps the overhang.\n */\n viewportClassName?: string;\n}\n\nlet nativeScrollbarSize = 0;\nlet scrollbarProbe: HTMLDivElement | null = null;\nconst scrollbarSizeListeners = new Set<() => void>();\n\n// The probe is parked off-page rather than hidden, because an unpainted box is\n// a poor place to read a painted scrollbar's width from. It stays in the\n// document so a ResizeObserver can watch it: the answer changes under a running\n// page without necessarily resizing the window.\nconst ensureScrollbarProbe = () => {\n if (typeof document === 'undefined' || !document.body) return null;\n if (scrollbarProbe) {\n if (!scrollbarProbe.isConnected) {\n throw new Error('The native scrollbar probe left the document. Something is removing nodes from <body>; until it stops, every scroll area reads the platform as having overlay scrollbars.');\n }\n return scrollbarProbe;\n }\n const outer = document.createElement('div');\n outer.setAttribute('aria-hidden', 'true');\n outer.style.cssText = 'position:absolute;top:-9999px;width:500px;height:500px;overflow:auto;';\n const inner = document.createElement('div');\n inner.style.cssText = 'width:1000px;height:1000px;';\n outer.appendChild(inner);\n document.body.appendChild(outer);\n scrollbarProbe = outer;\n new ResizeObserver(updateNativeScrollbarSize).observe(outer);\n window.addEventListener('resize', updateNativeScrollbarSize);\n return outer;\n};\n\nfunction updateNativeScrollbarSize() {\n const probe = ensureScrollbarProbe();\n if (!probe) return;\n const next = Math.max(probe.offsetWidth - probe.clientWidth, probe.offsetHeight - probe.clientHeight);\n if (next === nativeScrollbarSize) return;\n nativeScrollbarSize = next;\n scrollbarSizeListeners.forEach(listener => listener());\n}\n\n// The first ScrollArea must know the answer before React renders it; the\n// listener only covers tooling that imports the module earlier than a browser\n// would.\nif (typeof document !== 'undefined') {\n if (document.body) updateNativeScrollbarSize();\n else document.addEventListener('DOMContentLoaded', updateNativeScrollbarSize, { once: true });\n}\n\nconst subscribeToScrollbarSize = (listener: () => void) => {\n scrollbarSizeListeners.add(listener);\n return () => scrollbarSizeListeners.delete(listener);\n};\n\nconst getNativeScrollbarSize = () => nativeScrollbarSize;\nconst getServerScrollbarSize = () => 0;\n\nconst useOverlayScrollbarsEnabled = (): boolean => useSyncExternalStore(\n subscribeToScrollbarSize,\n getNativeScrollbarSize,\n getServerScrollbarSize,\n) > 0;\n\n// In the library's vocabulary there is no `auto`, and `scroll` means \"this axis\n// is mine\", not \"reserve a bar\".\nconst libraryOverflowFor = (axes: ScrollAxes) => ({\n x: axes === 'vertical' ? 'hidden' as const : 'scroll' as const,\n y: axes === 'horizontal' ? 'hidden' as const : 'scroll' as const,\n});\n\n// The element carries this inline from the first render, before the library has\n// initialised, so `scroll` unconditionally would hand every native scroller a\n// permanent reserved strip for that window.\nconst elementOverflowFor = (axes: ScrollAxes, overlayScrollbarsEnabled: boolean) => {\n const scrollable = overlayScrollbarsEnabled ? 'scroll' as const : 'auto' as const;\n return {\n x: axes === 'vertical' ? 'hidden' as const : scrollable,\n y: axes === 'horizontal' ? 'hidden' as const : scrollable,\n };\n};\n\nconst initializeScrollArea = (\n host: HTMLElement,\n viewport: HTMLElement,\n axes: ScrollAxes,\n noTabIndex: boolean,\n overlayScrollbarsEnabled: boolean,\n) => {\n if (!overlayScrollbarsEnabled) return;\n const instance = OverlayScrollbars({ target: host, elements: { viewport } }, {\n overflow: libraryOverflowFor(axes),\n scrollbars: {\n autoHide: 'leave',\n autoHideSuspend: true,\n clickScroll: true,\n },\n }, {\n initialized(current) {\n if (noTabIndex) current.elements().viewport.removeAttribute('tabindex');\n },\n });\n return () => instance.destroy();\n};\n\ninterface ScrollAreaHost {\n axes: ScrollAxes;\n noTabIndex?: boolean;\n /**\n * A host whose scrollport is built by something else -- a virtualised list\n * owning its own element -- hands it over here instead of taking\n * `viewportRef`, so the wiring waits for the element the same way.\n */\n viewport?: HTMLElement | null;\n}\n\n/**\n * The whole recipe a scroll area host needs: the two elements, the props that\n * mark the host, the scrollport's own overflow, and the library binding\n * between them. `ScrollArea` is this hook over a plain div; a host that has to\n * be some other element calls the hook directly.\n */\nexport const useScrollAreaHost = ({ axes, noTabIndex = false, viewport }: ScrollAreaHost) => {\n const hostRef = useRef<HTMLDivElement>(null);\n const viewportRef = useRef<HTMLDivElement>(null);\n const overlayScrollbarsEnabled = useOverlayScrollbarsEnabled();\n\n useLayoutEffect(() => {\n const host = hostRef.current;\n const scrollport = viewport === undefined ? viewportRef.current : viewport;\n if (!host || !scrollport) return;\n return initializeScrollArea(host, scrollport, axes, noTabIndex, overlayScrollbarsEnabled);\n }, [axes, noTabIndex, overlayScrollbarsEnabled, viewport]);\n\n const overflow = elementOverflowFor(axes, overlayScrollbarsEnabled);\n return {\n hostProps: {\n className: SCROLL_AREA_HOST_CLASS,\n ...(overlayScrollbarsEnabled ? { 'data-overlayscrollbars-initialize': '' } : {}),\n ref: hostRef,\n },\n viewportRef,\n viewportStyle: { overflowX: overflow.x, overflowY: overflow.y },\n };\n};\n\nexport const ScrollArea = forwardRef<HTMLDivElement, ScrollAreaProps>(function ScrollArea({\n axes,\n children,\n className,\n contentClassName = '',\n noTabIndex = false,\n viewportClassName,\n}, forwardedRef) {\n const { hostProps, viewportRef, viewportStyle } = useScrollAreaHost({ axes, noTabIndex });\n useImperativeHandle(forwardedRef, () => viewportRef.current as HTMLDivElement, [viewportRef]);\n\n return (\n <div {...hostProps} className={mergeClasses(hostProps.className, className)}>\n <div\n className={mergeClasses('h-full w-full', viewportClassName)}\n ref={viewportRef}\n style={viewportStyle}\n >\n <div className={contentClassName}>{children}</div>\n </div>\n </div>\n );\n});\n", "import { createContext, useCallback, useContext, useMemo } from 'react';\nimport type { PropsWithChildren } from 'react';\n\n// The components under ../components/ui are imported from Floway unchanged, and\n// there they read their few strings through the dashboard's i18n module at this\n// same relative path. This module stands in for it: the same `useTranslation`\n// shape over only the keys those components use, with Floway's English and\n// Simplified Chinese text, so a sync from upstream needs no edit to them.\nconst en = {\n 'common.on': 'On',\n 'common.off': 'Off',\n 'common.cancel': 'Cancel',\n 'common.dismiss': 'Dismiss',\n 'common.noOptions': 'No options',\n 'common.noSuggestions': 'No suggestions',\n 'common.discard.title': 'Discard unsaved changes?',\n 'common.discard.message': 'This form has changes that have not been saved.',\n 'common.discard.keep': 'Keep editing',\n 'common.discard.discard': 'Discard',\n 'common.copy.action': 'Copy',\n 'common.copy.copied': 'Copied',\n 'common.copy.failed': 'Copy failed',\n} as const;\n\nexport type WinuiStringKey = keyof typeof en;\nexport type WinuiStrings = Record<WinuiStringKey, string>;\n\nconst zhHans: WinuiStrings = {\n 'common.on': '\u5F00',\n 'common.off': '\u5173',\n 'common.cancel': '\u53D6\u6D88',\n 'common.dismiss': '\u5173\u95ED',\n 'common.noOptions': '\u65E0\u53EF\u9009\u9879',\n 'common.noSuggestions': '\u65E0\u5EFA\u8BAE',\n 'common.discard.title': '\u653E\u5F03\u672A\u4FDD\u5B58\u7684\u66F4\u6539\uFF1F',\n 'common.discard.message': '\u8BE5\u8868\u5355\u4ECD\u6709\u5C1A\u672A\u4FDD\u5B58\u7684\u4FEE\u6539\u3002',\n 'common.discard.keep': '\u7EE7\u7EED\u7F16\u8F91',\n 'common.discard.discard': '\u653E\u5F03',\n 'common.copy.action': '\u590D\u5236',\n 'common.copy.copied': '\u5DF2\u590D\u5236',\n 'common.copy.failed': '\u590D\u5236\u5931\u8D25',\n};\n\nexport const winuiStringsByLocale = { en, 'zh-Hans': zhHans } as const satisfies Record<string, WinuiStrings>;\nexport type WinuiLocale = keyof typeof winuiStringsByLocale;\n\nconst StringsContext = createContext<WinuiStrings>(en);\n\nexport interface WinuiStringsProviderProps {\n /** Built-in string table to start from. Defaults to English. */\n locale?: WinuiLocale;\n /** Per-key overrides applied on top of the locale's table. */\n strings?: Partial<WinuiStrings>;\n}\n\n/** Supplies the text the components render for their own controls (Cancel, Copy, On/Off, ...). */\nexport function WinuiStringsProvider({ locale = 'en', strings, children }: PropsWithChildren<WinuiStringsProviderProps>) {\n const value = useMemo(() => ({ ...winuiStringsByLocale[locale], ...strings }), [locale, strings]);\n return <StringsContext.Provider value={value}>{children}</StringsContext.Provider>;\n}\n\nexport const useTranslation = (): { t: (key: WinuiStringKey) => string } => {\n const strings = useContext(StringsContext);\n const t = useCallback((key: WinuiStringKey) => strings[key], [strings]);\n return { t };\n};\n", "import { useMemo } from 'react';\nimport type { ReactNode } from 'react';\n\nimport { highlight, prismTokenStyles } from './prism';\nimport { ScrollArea } from './scroll-area';\nimport { copyOutcomeIcon, useCopyLabel, type CopyOutcome } from './use-copy-to-clipboard';\nimport { fluentComponents } from '../../fluent';\nimport { useTranslation } from '../../i18n/translation';\n\nconst { Button, makeStyles, mergeClasses } = fluentComponents;\n\n// The two fills come from the Expander, WinUI's one surface that stacks a strip\n// above a content region in a single frame. Deliberately not the Expander's own\n// CardBackgroundFill and CardStroke: those are washes meant to sit over Mica, so\n// the card fill disappears on the white panel this block sits on in light and\n// CardStrokeColorDefault is black at 10%, invisible, in dark. The solid ramp and\n// ControlStrokeColorDefault carry in both themes.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/Expander/Expander_themeresources.xaml#L5\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/Expander/Expander_themeresources.xaml#L25\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L46\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L39\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L243\nconst useStyles = makeStyles({\n // ControlCornerRadius. The clip is why the region's focus visual below is\n // drawn inside the viewport rather than around it.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/Expander/Expander.xaml#L26\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/CornerRadius_themeresources.xaml#L5\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L68\n root: {\n backgroundColor: 'var(--winui-solid-background-fill-tertiary)',\n border: '1px solid var(--winui-control-stroke-default)',\n borderRadius: 'var(--winui-control-corner-radius)',\n minWidth: 0,\n overflow: 'hidden',\n },\n // Height and inset are ours: the Expander's header is a 48px click target\n // padded to 16, where this strip is sized to what it holds.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L70\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/Expander/Expander_themeresources.xaml#L9\n header: {\n alignItems: 'center',\n backgroundColor: 'var(--winui-solid-background-fill-quarternary)',\n borderBottom: '1px solid var(--winui-control-stroke-default)',\n display: 'flex',\n gap: '8px',\n justifyContent: 'space-between',\n minHeight: '38px',\n padding: '4px 8px 4px 12px',\n },\n // TextFillSecondary, in the code face so the caption reads as a label on that\n // face rather than as prose above it.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L6\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L210\n lang: {\n color: 'var(--winui-text-fill-secondary)',\n fontFamily: 'var(--fontFamilyMonospace)',\n fontSize: 'var(--fwt-font-size-mono)',\n },\n // Under an auto min-width the scrollable region ends where the text does, so\n // the trailing padding is never reachable and the last character sits against\n // the frame. min-width rather than width keeps it filling a short sample.\n pre: {\n margin: 0,\n minWidth: 'max-content',\n padding: '12px',\n tabSize: '2',\n },\n // Prism marks one token \"table\", which the utility sheet would otherwise lay\n // out as a table.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L5\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L209\n code: {\n ...prismTokenStyles,\n '& .token.table': {\n display: 'inline',\n },\n color: 'var(--winui-text-fill-primary)',\n whiteSpace: 'pre',\n },\n scroll: {\n maxHeight: '340px',\n },\n wrappedPre: { minWidth: 0 },\n wrappedCode: { whiteSpace: 'pre-wrap', overflowWrap: 'anywhere' },\n});\n\nexport function CodeBlock({ code, collapsed = false, copyOutcome, disabled = false, header, language, onCopy, wrap = false }: {\n code: string;\n collapsed?: boolean;\n copyOutcome: CopyOutcome;\n disabled?: boolean;\n /** Replaces the language caption in the header bar, for switchers that pick which code this block shows. */\n header?: ReactNode;\n language: string;\n onCopy: () => void;\n wrap?: boolean;\n}) {\n const { t } = useTranslation();\n const styles = useStyles();\n const copyLabel = useCopyLabel();\n const highlighted = useMemo(\n () => highlight(code, language),\n [code, language],\n );\n\n return (\n <div className={styles.root}>\n <div aria-live=\"polite\" className={styles.header}>\n {header ?? <span className={styles.lang}>{language}</span>}\n <Button\n appearance=\"subtle\"\n disabled={disabled}\n icon={copyOutcomeIcon(copyOutcome)}\n onClick={onCopy}\n size=\"small\"\n >\n {copyLabel(copyOutcome, t('common.copy.action'))}\n </Button>\n </div>\n {!collapsed && <ScrollArea axes={wrap ? 'vertical' : 'both'} className={mergeClasses('winui-focus-rect-within', styles.scroll)}>\n <pre className={mergeClasses(`language-${language}`, styles.pre, wrap && styles.wrappedPre)}>\n <code\n className={mergeClasses(`language-${language}`, styles.code, wrap && styles.wrappedCode)}\n dangerouslySetInnerHTML={{ __html: highlighted }}\n />\n </pre>\n </ScrollArea>}\n </div>\n );\n}\n", "import Prism from 'prismjs';\nimport 'prismjs/components/prism-bash';\nimport 'prismjs/components/prism-json';\nimport 'prismjs/components/prism-markdown';\nimport 'prismjs/components/prism-powershell';\nimport 'prismjs/components/prism-toml';\nimport 'prismjs/components/prism-typescript';\n\nimport { fluentComponents } from '../../fluent';\n\nconst { tokens } = fluentComponents;\n\n// Every grammar the dashboard can render is registered above, so this module\n// is the whole of Prism as far as the app is concerned. A language it does not\n// name resolves to the empty plain grammar, which stringifies to escaped\n// source rather than throwing.\nconst grammarFor = (language: string) => Prism.languages[language] ?? Prism.languages.plain;\n\nexport const highlight = (code: string, language: string): string =>\n Prism.highlight(code, grammarFor(language), language);\n\nexport const prismTokenStyles = {\n '& .token.comment, & .token.prolog, & .token.doctype, & .token.cdata': {\n color: tokens.colorNeutralForeground3,\n },\n '& .token.punctuation': { color: tokens.colorNeutralForeground2 },\n '& .token.property, & .token.tag, & .token.constant, & .token.symbol, & .token.deleted': {\n color: tokens.colorPaletteRedForeground2,\n },\n '& .token.boolean, & .token.number': { color: tokens.colorPalettePurpleForeground2 },\n '& .token.selector, & .token.attr-name, & .token.string, & .token.char, & .token.builtin, & .token.inserted': {\n color: tokens.colorPaletteGreenForeground2,\n },\n '& .token.operator, & .token.entity, & .token.url, & .language-css .token.string': {\n color: tokens.colorPaletteMarigoldForeground2,\n },\n '& .token.atrule, & .token.attr-value, & .token.keyword': { color: tokens.colorBrandForeground1 },\n '& .token.function, & .token.class-name': { color: tokens.colorPaletteBlueForeground2 },\n '& .token.regex, & .token.important, & .token.variable': { color: tokens.colorPaletteMarigoldForeground2 },\n} as const;\n", "import Prism from \"prismjs\";\n(function (Prism) {\n\t// $ set | grep '^[A-Z][^[:space:]]*=' | cut -d= -f1 | tr '\\n' '|'\n\t// + LC_ALL, RANDOM, REPLY, SECONDS.\n\t// + make sure PS1..4 are here as they are not always set,\n\t// - some useless things.\n\tvar envVars = '\\\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\\\b';\n\n\tvar commandAfterHeredoc = {\n\t\tpattern: /(^([\"']?)\\w+\\2)[ \\t]+\\S.*/,\n\t\tlookbehind: true,\n\t\talias: 'punctuation', // this looks reasonably well in all themes\n\t\tinside: null // see below\n\t};\n\n\tvar insideString = {\n\t\t'bash': commandAfterHeredoc,\n\t\t'environment': {\n\t\t\tpattern: RegExp('\\\\$' + envVars),\n\t\t\talias: 'constant'\n\t\t},\n\t\t'variable': [\n\t\t\t// [0]: Arithmetic Environment\n\t\t\t{\n\t\t\t\tpattern: /\\$?\\(\\([\\s\\S]+?\\)\\)/,\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: {\n\t\t\t\t\t// If there is a $ sign at the beginning highlight $(( and )) as variable\n\t\t\t\t\t'variable': [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpattern: /(^\\$\\(\\([\\s\\S]+)\\)\\)/,\n\t\t\t\t\t\t\tlookbehind: true\n\t\t\t\t\t\t},\n\t\t\t\t\t\t/^\\$\\(\\(/\n\t\t\t\t\t],\n\t\t\t\t\t'number': /\\b0x[\\dA-Fa-f]+\\b|(?:\\b\\d+(?:\\.\\d*)?|\\B\\.\\d+)(?:[Ee]-?\\d+)?/,\n\t\t\t\t\t// Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic\n\t\t\t\t\t'operator': /--|\\+\\+|\\*\\*=?|<<=?|>>=?|&&|\\|\\||[=!+\\-*/%<>^&|]=?|[?~:]/,\n\t\t\t\t\t// If there is no $ sign at the beginning highlight (( and )) as punctuation\n\t\t\t\t\t'punctuation': /\\(\\(?|\\)\\)?|,|;/\n\t\t\t\t}\n\t\t\t},\n\t\t\t// [1]: Command Substitution\n\t\t\t{\n\t\t\t\tpattern: /\\$\\((?:\\([^)]+\\)|[^()])+\\)|`[^`]+`/,\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'variable': /^\\$\\(|^`|\\)$|`$/\n\t\t\t\t}\n\t\t\t},\n\t\t\t// [2]: Brace expansion\n\t\t\t{\n\t\t\t\tpattern: /\\$\\{[^}]+\\}/,\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'operator': /:[-=?+]?|[!\\/]|##?|%%?|\\^\\^?|,,?/,\n\t\t\t\t\t'punctuation': /[\\[\\]]/,\n\t\t\t\t\t'environment': {\n\t\t\t\t\t\tpattern: RegExp('(\\\\{)' + envVars),\n\t\t\t\t\t\tlookbehind: true,\n\t\t\t\t\t\talias: 'constant'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t/\\$(?:\\w+|[#?*!@$])/\n\t\t],\n\t\t// Escape sequences from echo and printf's manuals, and escaped quotes.\n\t\t'entity': /\\\\(?:[abceEfnrtv\\\\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/\n\t};\n\n\tPrism.languages.bash = {\n\t\t'shebang': {\n\t\t\tpattern: /^#!\\s*\\/.*/,\n\t\t\talias: 'important'\n\t\t},\n\t\t'comment': {\n\t\t\tpattern: /(^|[^\"{\\\\$])#.*/,\n\t\t\tlookbehind: true\n\t\t},\n\t\t'function-name': [\n\t\t\t// a) function foo {\n\t\t\t// b) foo() {\n\t\t\t// c) function foo() {\n\t\t\t// but not \u201Cfoo {\u201D\n\t\t\t{\n\t\t\t\t// a) and c)\n\t\t\t\tpattern: /(\\bfunction\\s+)[\\w-]+(?=(?:\\s*\\(?:\\s*\\))?\\s*\\{)/,\n\t\t\t\tlookbehind: true,\n\t\t\t\talias: 'function'\n\t\t\t},\n\t\t\t{\n\t\t\t\t// b)\n\t\t\t\tpattern: /\\b[\\w-]+(?=\\s*\\(\\s*\\)\\s*\\{)/,\n\t\t\t\talias: 'function'\n\t\t\t}\n\t\t],\n\t\t// Highlight variable names as variables in for and select beginnings.\n\t\t'for-or-select': {\n\t\t\tpattern: /(\\b(?:for|select)\\s+)\\w+(?=\\s+in\\s)/,\n\t\t\talias: 'variable',\n\t\t\tlookbehind: true\n\t\t},\n\t\t// Highlight variable names as variables in the left-hand part\n\t\t// of assignments (\u201C=\u201D and \u201C+=\u201D).\n\t\t'assign-left': {\n\t\t\tpattern: /(^|[\\s;|&]|[<>]\\()\\w+(?:\\.\\w+)*(?=\\+?=)/,\n\t\t\tinside: {\n\t\t\t\t'environment': {\n\t\t\t\t\tpattern: RegExp('(^|[\\\\s;|&]|[<>]\\\\()' + envVars),\n\t\t\t\t\tlookbehind: true,\n\t\t\t\t\talias: 'constant'\n\t\t\t\t}\n\t\t\t},\n\t\t\talias: 'variable',\n\t\t\tlookbehind: true\n\t\t},\n\t\t// Highlight parameter names as variables\n\t\t'parameter': {\n\t\t\tpattern: /(^|\\s)-{1,2}(?:\\w+:[+-]?)?\\w+(?:\\.\\w+)*(?=[=\\s]|$)/,\n\t\t\talias: 'variable',\n\t\t\tlookbehind: true\n\t\t},\n\t\t'string': [\n\t\t\t// Support for Here-documents https://en.wikipedia.org/wiki/Here_document\n\t\t\t{\n\t\t\t\tpattern: /((?:^|[^<])<<-?\\s*)(\\w+)\\s[\\s\\S]*?(?:\\r?\\n|\\r)\\2/,\n\t\t\t\tlookbehind: true,\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: insideString\n\t\t\t},\n\t\t\t// Here-document with quotes around the tag\n\t\t\t// \u2192 No expansion (so no \u201Cinside\u201D).\n\t\t\t{\n\t\t\t\tpattern: /((?:^|[^<])<<-?\\s*)([\"'])(\\w+)\\2\\s[\\s\\S]*?(?:\\r?\\n|\\r)\\3/,\n\t\t\t\tlookbehind: true,\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'bash': commandAfterHeredoc\n\t\t\t\t}\n\t\t\t},\n\t\t\t// \u201CNormal\u201D string\n\t\t\t{\n\t\t\t\t// https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html\n\t\t\t\tpattern: /(^|[^\\\\](?:\\\\\\\\)*)\"(?:\\\\[\\s\\S]|\\$\\([^)]+\\)|\\$(?!\\()|`[^`]+`|[^\"\\\\`$])*\"/,\n\t\t\t\tlookbehind: true,\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: insideString\n\t\t\t},\n\t\t\t{\n\t\t\t\t// https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html\n\t\t\t\tpattern: /(^|[^$\\\\])'[^']*'/,\n\t\t\t\tlookbehind: true,\n\t\t\t\tgreedy: true\n\t\t\t},\n\t\t\t{\n\t\t\t\t// https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html\n\t\t\t\tpattern: /\\$'(?:[^'\\\\]|\\\\[\\s\\S])*'/,\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'entity': insideString.entity\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\t'environment': {\n\t\t\tpattern: RegExp('\\\\$?' + envVars),\n\t\t\talias: 'constant'\n\t\t},\n\t\t'variable': insideString.variable,\n\t\t'function': {\n\t\t\tpattern: /(^|[\\s;|&]|[<>]\\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\\s;|&])/,\n\t\t\tlookbehind: true\n\t\t},\n\t\t'keyword': {\n\t\t\tpattern: /(^|[\\s;|&]|[<>]\\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\\s;|&])/,\n\t\t\tlookbehind: true\n\t\t},\n\t\t// https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html\n\t\t'builtin': {\n\t\t\tpattern: /(^|[\\s;|&]|[<>]\\()(?:\\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\\s;|&])/,\n\t\t\tlookbehind: true,\n\t\t\t// Alias added to make those easier to distinguish from strings.\n\t\t\talias: 'class-name'\n\t\t},\n\t\t'boolean': {\n\t\t\tpattern: /(^|[\\s;|&]|[<>]\\()(?:false|true)(?=$|[)\\s;|&])/,\n\t\t\tlookbehind: true\n\t\t},\n\t\t'file-descriptor': {\n\t\t\tpattern: /\\B&\\d\\b/,\n\t\t\talias: 'important'\n\t\t},\n\t\t'operator': {\n\t\t\t// Lots of redirections here, but not just that.\n\t\t\tpattern: /\\d?<>|>\\||\\+=|=[=~]?|!=?|<<[<-]?|[&\\d]?>>|\\d[<>]&?|[<>][&=]?|&[>&]?|\\|[&|]?/,\n\t\t\tinside: {\n\t\t\t\t'file-descriptor': {\n\t\t\t\t\tpattern: /^\\d/,\n\t\t\t\t\talias: 'important'\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t'punctuation': /\\$?\\(\\(?|\\)\\)?|\\.\\.|[{}[\\];\\\\]/,\n\t\t'number': {\n\t\t\tpattern: /(^|\\s)(?:[1-9]\\d*|0)(?:[.,]\\d+)?\\b/,\n\t\t\tlookbehind: true\n\t\t}\n\t};\n\n\tcommandAfterHeredoc.inside = Prism.languages.bash;\n\n\t/* Patterns in command substitution. */\n\tvar toBeCopied = [\n\t\t'comment',\n\t\t'function-name',\n\t\t'for-or-select',\n\t\t'assign-left',\n\t\t'parameter',\n\t\t'string',\n\t\t'environment',\n\t\t'function',\n\t\t'keyword',\n\t\t'builtin',\n\t\t'boolean',\n\t\t'file-descriptor',\n\t\t'operator',\n\t\t'punctuation',\n\t\t'number'\n\t];\n\tvar inside = insideString.variable[1].inside;\n\tfor (var i = 0; i < toBeCopied.length; i++) {\n\t\tinside[toBeCopied[i]] = Prism.languages.bash[toBeCopied[i]];\n\t}\n\n\tPrism.languages.sh = Prism.languages.bash;\n\tPrism.languages.shell = Prism.languages.bash;\n}(Prism));\n", "import Prism from \"prismjs\";\n// https://www.json.org/json-en.html\nPrism.languages.json = {\n\t'property': {\n\t\tpattern: /(^|[^\\\\])\"(?:\\\\.|[^\\\\\"\\r\\n])*\"(?=\\s*:)/,\n\t\tlookbehind: true,\n\t\tgreedy: true\n\t},\n\t'string': {\n\t\tpattern: /(^|[^\\\\])\"(?:\\\\.|[^\\\\\"\\r\\n])*\"(?!\\s*:)/,\n\t\tlookbehind: true,\n\t\tgreedy: true\n\t},\n\t'comment': {\n\t\tpattern: /\\/\\/.*|\\/\\*[\\s\\S]*?(?:\\*\\/|$)/,\n\t\tgreedy: true\n\t},\n\t'number': /-?\\b\\d+(?:\\.\\d+)?(?:e[+-]?\\d+)?\\b/i,\n\t'punctuation': /[{}[\\],]/,\n\t'operator': /:/,\n\t'boolean': /\\b(?:false|true)\\b/,\n\t'null': {\n\t\tpattern: /\\bnull\\b/,\n\t\talias: 'keyword'\n\t}\n};\n\nPrism.languages.webmanifest = Prism.languages.json;\n", "import Prism from \"prismjs\";\n(function (Prism) {\n\n\t// Allow only one line break\n\tvar inner = /(?:\\\\.|[^\\\\\\n\\r]|(?:\\n|\\r\\n?)(?![\\r\\n]))/.source;\n\n\t/**\n\t * This function is intended for the creation of the bold or italic pattern.\n\t *\n\t * This also adds a lookbehind group to the given pattern to ensure that the pattern is not backslash-escaped.\n\t *\n\t * _Note:_ Keep in mind that this adds a capturing group.\n\t *\n\t * @param {string} pattern\n\t * @returns {RegExp}\n\t */\n\tfunction createInline(pattern) {\n\t\tpattern = pattern.replace(/<inner>/g, function () { return inner; });\n\t\treturn RegExp(/((?:^|[^\\\\])(?:\\\\{2})*)/.source + '(?:' + pattern + ')');\n\t}\n\n\n\tvar tableCell = /(?:\\\\.|``(?:[^`\\r\\n]|`(?!`))+``|`[^`\\r\\n]+`|[^\\\\|\\r\\n`])+/.source;\n\tvar tableRow = /\\|?__(?:\\|__)+\\|?(?:(?:\\n|\\r\\n?)|(?![\\s\\S]))/.source.replace(/__/g, function () { return tableCell; });\n\tvar tableLine = /\\|?[ \\t]*:?-{3,}:?[ \\t]*(?:\\|[ \\t]*:?-{3,}:?[ \\t]*)+\\|?(?:\\n|\\r\\n?)/.source;\n\n\n\tPrism.languages.markdown = Prism.languages.extend('markup', {});\n\tPrism.languages.insertBefore('markdown', 'prolog', {\n\t\t'front-matter-block': {\n\t\t\tpattern: /(^(?:\\s*[\\r\\n])?)---(?!.)[\\s\\S]*?[\\r\\n]---(?!.)/,\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true,\n\t\t\tinside: {\n\t\t\t\t'punctuation': /^---|---$/,\n\t\t\t\t'front-matter': {\n\t\t\t\t\tpattern: /\\S+(?:\\s+\\S+)*/,\n\t\t\t\t\talias: ['yaml', 'language-yaml'],\n\t\t\t\t\tinside: Prism.languages.yaml\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t'blockquote': {\n\t\t\t// > ...\n\t\t\tpattern: /^>(?:[\\t ]*>)*/m,\n\t\t\talias: 'punctuation'\n\t\t},\n\t\t'table': {\n\t\t\tpattern: RegExp('^' + tableRow + tableLine + '(?:' + tableRow + ')*', 'm'),\n\t\t\tinside: {\n\t\t\t\t'table-data-rows': {\n\t\t\t\t\tpattern: RegExp('^(' + tableRow + tableLine + ')(?:' + tableRow + ')*$'),\n\t\t\t\t\tlookbehind: true,\n\t\t\t\t\tinside: {\n\t\t\t\t\t\t'table-data': {\n\t\t\t\t\t\t\tpattern: RegExp(tableCell),\n\t\t\t\t\t\t\tinside: Prism.languages.markdown\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'punctuation': /\\|/\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t'table-line': {\n\t\t\t\t\tpattern: RegExp('^(' + tableRow + ')' + tableLine + '$'),\n\t\t\t\t\tlookbehind: true,\n\t\t\t\t\tinside: {\n\t\t\t\t\t\t'punctuation': /\\||:?-{3,}:?/\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t'table-header-row': {\n\t\t\t\t\tpattern: RegExp('^' + tableRow + '$'),\n\t\t\t\t\tinside: {\n\t\t\t\t\t\t'table-header': {\n\t\t\t\t\t\t\tpattern: RegExp(tableCell),\n\t\t\t\t\t\t\talias: 'important',\n\t\t\t\t\t\t\tinside: Prism.languages.markdown\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'punctuation': /\\|/\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t'code': [\n\t\t\t{\n\t\t\t\t// Prefixed by 4 spaces or 1 tab and preceded by an empty line\n\t\t\t\tpattern: /((?:^|\\n)[ \\t]*\\n|(?:^|\\r\\n?)[ \\t]*\\r\\n?)(?: {4}|\\t).+(?:(?:\\n|\\r\\n?)(?: {4}|\\t).+)*/,\n\t\t\t\tlookbehind: true,\n\t\t\t\talias: 'keyword'\n\t\t\t},\n\t\t\t{\n\t\t\t\t// ```optional language\n\t\t\t\t// code block\n\t\t\t\t// ```\n\t\t\t\tpattern: /^```[\\s\\S]*?^```$/m,\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'code-block': {\n\t\t\t\t\t\tpattern: /^(```.*(?:\\n|\\r\\n?))[\\s\\S]+?(?=(?:\\n|\\r\\n?)^```$)/m,\n\t\t\t\t\t\tlookbehind: true\n\t\t\t\t\t},\n\t\t\t\t\t'code-language': {\n\t\t\t\t\t\tpattern: /^(```).+/,\n\t\t\t\t\t\tlookbehind: true\n\t\t\t\t\t},\n\t\t\t\t\t'punctuation': /```/\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\t'title': [\n\t\t\t{\n\t\t\t\t// title 1\n\t\t\t\t// =======\n\n\t\t\t\t// title 2\n\t\t\t\t// -------\n\t\t\t\tpattern: /\\S.*(?:\\n|\\r\\n?)(?:==+|--+)(?=[ \\t]*$)/m,\n\t\t\t\talias: 'important',\n\t\t\t\tinside: {\n\t\t\t\t\tpunctuation: /==+$|--+$/\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\t// # title 1\n\t\t\t\t// ###### title 6\n\t\t\t\tpattern: /(^\\s*)#.+/m,\n\t\t\t\tlookbehind: true,\n\t\t\t\talias: 'important',\n\t\t\t\tinside: {\n\t\t\t\t\tpunctuation: /^#+|#+$/\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\t'hr': {\n\t\t\t// ***\n\t\t\t// ---\n\t\t\t// * * *\n\t\t\t// -----------\n\t\t\tpattern: /(^\\s*)([*-])(?:[\\t ]*\\2){2,}(?=\\s*$)/m,\n\t\t\tlookbehind: true,\n\t\t\talias: 'punctuation'\n\t\t},\n\t\t'list': {\n\t\t\t// * item\n\t\t\t// + item\n\t\t\t// - item\n\t\t\t// 1. item\n\t\t\tpattern: /(^\\s*)(?:[*+-]|\\d+\\.)(?=[\\t ].)/m,\n\t\t\tlookbehind: true,\n\t\t\talias: 'punctuation'\n\t\t},\n\t\t'url-reference': {\n\t\t\t// [id]: http://example.com \"Optional title\"\n\t\t\t// [id]: http://example.com 'Optional title'\n\t\t\t// [id]: http://example.com (Optional title)\n\t\t\t// [id]: <http://example.com> \"Optional title\"\n\t\t\tpattern: /!?\\[[^\\]]+\\]:[\\t ]+(?:\\S+|<(?:\\\\.|[^>\\\\])+>)(?:[\\t ]+(?:\"(?:\\\\.|[^\"\\\\])*\"|'(?:\\\\.|[^'\\\\])*'|\\((?:\\\\.|[^)\\\\])*\\)))?/,\n\t\t\tinside: {\n\t\t\t\t'variable': {\n\t\t\t\t\tpattern: /^(!?\\[)[^\\]]+/,\n\t\t\t\t\tlookbehind: true\n\t\t\t\t},\n\t\t\t\t'string': /(?:\"(?:\\\\.|[^\"\\\\])*\"|'(?:\\\\.|[^'\\\\])*'|\\((?:\\\\.|[^)\\\\])*\\))$/,\n\t\t\t\t'punctuation': /^[\\[\\]!:]|[<>]/\n\t\t\t},\n\t\t\talias: 'url'\n\t\t},\n\t\t'bold': {\n\t\t\t// **strong**\n\t\t\t// __strong__\n\n\t\t\t// allow one nested instance of italic text using the same delimiter\n\t\t\tpattern: createInline(/\\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\\b|\\*\\*(?:(?!\\*)<inner>|\\*(?:(?!\\*)<inner>)+\\*)+\\*\\*/.source),\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true,\n\t\t\tinside: {\n\t\t\t\t'content': {\n\t\t\t\t\tpattern: /(^..)[\\s\\S]+(?=..$)/,\n\t\t\t\t\tlookbehind: true,\n\t\t\t\t\tinside: {} // see below\n\t\t\t\t},\n\t\t\t\t'punctuation': /\\*\\*|__/\n\t\t\t}\n\t\t},\n\t\t'italic': {\n\t\t\t// *em*\n\t\t\t// _em_\n\n\t\t\t// allow one nested instance of bold text using the same delimiter\n\t\t\tpattern: createInline(/\\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\\b|\\*(?:(?!\\*)<inner>|\\*\\*(?:(?!\\*)<inner>)+\\*\\*)+\\*/.source),\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true,\n\t\t\tinside: {\n\t\t\t\t'content': {\n\t\t\t\t\tpattern: /(^.)[\\s\\S]+(?=.$)/,\n\t\t\t\t\tlookbehind: true,\n\t\t\t\t\tinside: {} // see below\n\t\t\t\t},\n\t\t\t\t'punctuation': /[*_]/\n\t\t\t}\n\t\t},\n\t\t'strike': {\n\t\t\t// ~~strike through~~\n\t\t\t// ~strike~\n\t\t\t// eslint-disable-next-line regexp/strict\n\t\t\tpattern: createInline(/(~~?)(?:(?!~)<inner>)+\\2/.source),\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true,\n\t\t\tinside: {\n\t\t\t\t'content': {\n\t\t\t\t\tpattern: /(^~~?)[\\s\\S]+(?=\\1$)/,\n\t\t\t\t\tlookbehind: true,\n\t\t\t\t\tinside: {} // see below\n\t\t\t\t},\n\t\t\t\t'punctuation': /~~?/\n\t\t\t}\n\t\t},\n\t\t'code-snippet': {\n\t\t\t// `code`\n\t\t\t// ``code``\n\t\t\tpattern: /(^|[^\\\\`])(?:``[^`\\r\\n]+(?:`[^`\\r\\n]+)*``(?!`)|`[^`\\r\\n]+`(?!`))/,\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true,\n\t\t\talias: ['code', 'keyword']\n\t\t},\n\t\t'url': {\n\t\t\t// [example](http://example.com \"Optional title\")\n\t\t\t// [example][id]\n\t\t\t// [example] [id]\n\t\t\tpattern: createInline(/!?\\[(?:(?!\\])<inner>)+\\](?:\\([^\\s)]+(?:[\\t ]+\"(?:\\\\.|[^\"\\\\])*\")?\\)|[ \\t]?\\[(?:(?!\\])<inner>)+\\])/.source),\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true,\n\t\t\tinside: {\n\t\t\t\t'operator': /^!/,\n\t\t\t\t'content': {\n\t\t\t\t\tpattern: /(^\\[)[^\\]]+(?=\\])/,\n\t\t\t\t\tlookbehind: true,\n\t\t\t\t\tinside: {} // see below\n\t\t\t\t},\n\t\t\t\t'variable': {\n\t\t\t\t\tpattern: /(^\\][ \\t]?\\[)[^\\]]+(?=\\]$)/,\n\t\t\t\t\tlookbehind: true\n\t\t\t\t},\n\t\t\t\t'url': {\n\t\t\t\t\tpattern: /(^\\]\\()[^\\s)]+/,\n\t\t\t\t\tlookbehind: true\n\t\t\t\t},\n\t\t\t\t'string': {\n\t\t\t\t\tpattern: /(^[ \\t]+)\"(?:\\\\.|[^\"\\\\])*\"(?=\\)$)/,\n\t\t\t\t\tlookbehind: true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\t['url', 'bold', 'italic', 'strike'].forEach(function (token) {\n\t\t['url', 'bold', 'italic', 'strike', 'code-snippet'].forEach(function (inside) {\n\t\t\tif (token !== inside) {\n\t\t\t\tPrism.languages.markdown[token].inside.content.inside[inside] = Prism.languages.markdown[inside];\n\t\t\t}\n\t\t});\n\t});\n\n\tPrism.hooks.add('after-tokenize', function (env) {\n\t\tif (env.language !== 'markdown' && env.language !== 'md') {\n\t\t\treturn;\n\t\t}\n\n\t\tfunction walkTokens(tokens) {\n\t\t\tif (!tokens || typeof tokens === 'string') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfor (var i = 0, l = tokens.length; i < l; i++) {\n\t\t\t\tvar token = tokens[i];\n\n\t\t\t\tif (token.type !== 'code') {\n\t\t\t\t\twalkTokens(token.content);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\t * Add the correct `language-xxxx` class to this code block. Keep in mind that the `code-language` token\n\t\t\t\t * is optional. But the grammar is defined so that there is only one case we have to handle:\n\t\t\t\t *\n\t\t\t\t * token.content = [\n\t\t\t\t * <span class=\"punctuation\">```</span>,\n\t\t\t\t * <span class=\"code-language\">xxxx</span>,\n\t\t\t\t * '\\n', // exactly one new lines (\\r or \\n or \\r\\n)\n\t\t\t\t * <span class=\"code-block\">...</span>,\n\t\t\t\t * '\\n', // exactly one new lines again\n\t\t\t\t * <span class=\"punctuation\">```</span>\n\t\t\t\t * ];\n\t\t\t\t */\n\n\t\t\t\tvar codeLang = token.content[1];\n\t\t\t\tvar codeBlock = token.content[3];\n\n\t\t\t\tif (codeLang && codeBlock &&\n\t\t\t\t\tcodeLang.type === 'code-language' && codeBlock.type === 'code-block' &&\n\t\t\t\t\ttypeof codeLang.content === 'string') {\n\n\t\t\t\t\t// this might be a language that Prism does not support\n\n\t\t\t\t\t// do some replacements to support C++, C#, and F#\n\t\t\t\t\tvar lang = codeLang.content.replace(/\\b#/g, 'sharp').replace(/\\b\\+\\+/g, 'pp');\n\t\t\t\t\t// only use the first word\n\t\t\t\t\tlang = (/[a-z][\\w-]*/i.exec(lang) || [''])[0].toLowerCase();\n\t\t\t\t\tvar alias = 'language-' + lang;\n\n\t\t\t\t\t// add alias\n\t\t\t\t\tif (!codeBlock.alias) {\n\t\t\t\t\t\tcodeBlock.alias = [alias];\n\t\t\t\t\t} else if (typeof codeBlock.alias === 'string') {\n\t\t\t\t\t\tcodeBlock.alias = [codeBlock.alias, alias];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcodeBlock.alias.push(alias);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\twalkTokens(env.tokens);\n\t});\n\n\tPrism.hooks.add('wrap', function (env) {\n\t\tif (env.type !== 'code-block') {\n\t\t\treturn;\n\t\t}\n\n\t\tvar codeLang = '';\n\t\tfor (var i = 0, l = env.classes.length; i < l; i++) {\n\t\t\tvar cls = env.classes[i];\n\t\t\tvar match = /language-(.+)/.exec(cls);\n\t\t\tif (match) {\n\t\t\t\tcodeLang = match[1];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tvar grammar = Prism.languages[codeLang];\n\n\t\tif (!grammar) {\n\t\t\tif (codeLang && codeLang !== 'none' && Prism.plugins.autoloader) {\n\t\t\t\tvar id = 'md-' + new Date().valueOf() + '-' + Math.floor(Math.random() * 1e16);\n\t\t\t\tenv.attributes['id'] = id;\n\n\t\t\t\tPrism.plugins.autoloader.loadLanguages(codeLang, function () {\n\t\t\t\t\tvar ele = document.getElementById(id);\n\t\t\t\t\tif (ele) {\n\t\t\t\t\t\tele.innerHTML = Prism.highlight(ele.textContent, Prism.languages[codeLang], codeLang);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tenv.content = Prism.highlight(textContent(env.content), grammar, codeLang);\n\t\t}\n\t});\n\n\tvar tagPattern = RegExp(Prism.languages.markup.tag.pattern.source, 'gi');\n\n\t/**\n\t * A list of known entity names.\n\t *\n\t * This will always be incomplete to save space. The current list is the one used by lowdash's unescape function.\n\t *\n\t * @see {@link https://github.com/lodash/lodash/blob/2da024c3b4f9947a48517639de7560457cd4ec6c/unescape.js#L2}\n\t */\n\tvar KNOWN_ENTITY_NAMES = {\n\t\t'amp': '&',\n\t\t'lt': '<',\n\t\t'gt': '>',\n\t\t'quot': '\"',\n\t};\n\n\t// IE 11 doesn't support `String.fromCodePoint`\n\tvar fromCodePoint = String.fromCodePoint || String.fromCharCode;\n\n\t/**\n\t * Returns the text content of a given HTML source code string.\n\t *\n\t * @param {string} html\n\t * @returns {string}\n\t */\n\tfunction textContent(html) {\n\t\t// remove all tags\n\t\tvar text = html.replace(tagPattern, '');\n\n\t\t// decode known entities\n\t\ttext = text.replace(/&(\\w{1,8}|#x?[\\da-f]{1,8});/gi, function (m, code) {\n\t\t\tcode = code.toLowerCase();\n\n\t\t\tif (code[0] === '#') {\n\t\t\t\tvar value;\n\t\t\t\tif (code[1] === 'x') {\n\t\t\t\t\tvalue = parseInt(code.slice(2), 16);\n\t\t\t\t} else {\n\t\t\t\t\tvalue = Number(code.slice(1));\n\t\t\t\t}\n\n\t\t\t\treturn fromCodePoint(value);\n\t\t\t} else {\n\t\t\t\tvar known = KNOWN_ENTITY_NAMES[code];\n\t\t\t\tif (known) {\n\t\t\t\t\treturn known;\n\t\t\t\t}\n\n\t\t\t\t// unable to decode\n\t\t\t\treturn m;\n\t\t\t}\n\t\t});\n\n\t\treturn text;\n\t}\n\n\tPrism.languages.md = Prism.languages.markdown;\n\n}(Prism));\n", "import Prism from \"prismjs\";\n(function (Prism) {\n\n\tvar powershell = Prism.languages.powershell = {\n\t\t'comment': [\n\t\t\t{\n\t\t\t\tpattern: /(^|[^`])<#[\\s\\S]*?#>/,\n\t\t\t\tlookbehind: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /(^|[^`])#.*/,\n\t\t\t\tlookbehind: true\n\t\t\t}\n\t\t],\n\t\t'string': [\n\t\t\t{\n\t\t\t\tpattern: /\"(?:`[\\s\\S]|[^`\"])*\"/,\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: null // see below\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /'(?:[^']|'')*'/,\n\t\t\t\tgreedy: true\n\t\t\t}\n\t\t],\n\t\t// Matches name spaces as well as casts, attribute decorators. Force starting with letter to avoid matching array indices\n\t\t// Supports two levels of nested brackets (e.g. `[OutputType([System.Collections.Generic.List[int]])]`)\n\t\t'namespace': /\\[[a-z](?:\\[(?:\\[[^\\]]*\\]|[^\\[\\]])*\\]|[^\\[\\]])*\\]/i,\n\t\t'boolean': /\\$(?:false|true)\\b/i,\n\t\t'variable': /\\$\\w+\\b/,\n\t\t// Cmdlets and aliases. Aliases should come last, otherwise \"write\" gets preferred over \"write-host\" for example\n\t\t// Get-Command | ?{ $_.ModuleName -match \"Microsoft.PowerShell.(Util|Core|Management)\" }\n\t\t// Get-Alias | ?{ $_.ReferencedCommand.Module.Name -match \"Microsoft.PowerShell.(Util|Core|Management)\" }\n\t\t'function': [\n\t\t\t/\\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\\b/i,\n\t\t\t/\\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\\b/i\n\t\t],\n\t\t// per http://technet.microsoft.com/en-us/library/hh847744.aspx\n\t\t'keyword': /\\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\\b/i,\n\t\t'operator': {\n\t\t\tpattern: /(^|\\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\\b|-[-=]?|\\+[+=]?|[*\\/%]=?)/i,\n\t\t\tlookbehind: true\n\t\t},\n\t\t'punctuation': /[|{}[\\];(),.]/\n\t};\n\n\t// Variable interpolation inside strings, and nested expressions\n\tpowershell.string[0].inside = {\n\t\t'function': {\n\t\t\t// Allow for one level of nesting\n\t\t\tpattern: /(^|[^`])\\$\\((?:\\$\\([^\\r\\n()]*\\)|(?!\\$\\()[^\\r\\n)])*\\)/,\n\t\t\tlookbehind: true,\n\t\t\tinside: powershell\n\t\t},\n\t\t'boolean': powershell.boolean,\n\t\t'variable': powershell.variable,\n\t};\n\n}(Prism));\n", "import Prism from \"prismjs\";\n(function (Prism) {\n\n\tvar key = /(?:[\\w-]+|'[^'\\n\\r]*'|\"(?:\\\\.|[^\\\\\"\\r\\n])*\")/.source;\n\n\t/**\n\t * @param {string} pattern\n\t */\n\tfunction insertKey(pattern) {\n\t\treturn pattern.replace(/__/g, function () { return key; });\n\t}\n\n\tPrism.languages.toml = {\n\t\t'comment': {\n\t\t\tpattern: /#.*/,\n\t\t\tgreedy: true\n\t\t},\n\t\t'table': {\n\t\t\tpattern: RegExp(insertKey(/(^[\\t ]*\\[\\s*(?:\\[\\s*)?)__(?:\\s*\\.\\s*__)*(?=\\s*\\])/.source), 'm'),\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true,\n\t\t\talias: 'class-name'\n\t\t},\n\t\t'key': {\n\t\t\tpattern: RegExp(insertKey(/(^[\\t ]*|[{,]\\s*)__(?:\\s*\\.\\s*__)*(?=\\s*=)/.source), 'm'),\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true,\n\t\t\talias: 'property'\n\t\t},\n\t\t'string': {\n\t\t\tpattern: /\"\"\"(?:\\\\[\\s\\S]|[^\\\\])*?\"\"\"|'''[\\s\\S]*?'''|'[^'\\n\\r]*'|\"(?:\\\\.|[^\\\\\"\\r\\n])*\"/,\n\t\t\tgreedy: true\n\t\t},\n\t\t'date': [\n\t\t\t{\n\t\t\t\t// Offset Date-Time, Local Date-Time, Local Date\n\t\t\t\tpattern: /\\b\\d{4}-\\d{2}-\\d{2}(?:[T\\s]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2})?)?\\b/i,\n\t\t\t\talias: 'number'\n\t\t\t},\n\t\t\t{\n\t\t\t\t// Local Time\n\t\t\t\tpattern: /\\b\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?\\b/,\n\t\t\t\talias: 'number'\n\t\t\t}\n\t\t],\n\t\t'number': /(?:\\b0(?:x[\\da-zA-Z]+(?:_[\\da-zA-Z]+)*|o[0-7]+(?:_[0-7]+)*|b[10]+(?:_[10]+)*))\\b|[-+]?\\b\\d+(?:_\\d+)*(?:\\.\\d+(?:_\\d+)*)?(?:[eE][+-]?\\d+(?:_\\d+)*)?\\b|[-+]?\\b(?:inf|nan)\\b/,\n\t\t'boolean': /\\b(?:false|true)\\b/,\n\t\t'punctuation': /[.,=[\\]{}]/\n\t};\n}(Prism));\n", "import Prism from \"prismjs\";\n(function (Prism) {\n\n\tPrism.languages.typescript = Prism.languages.extend('javascript', {\n\t\t'class-name': {\n\t\t\tpattern: /(\\b(?:class|extends|implements|instanceof|interface|new|type)\\s+)(?!keyof\\b)(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*(?:\\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true,\n\t\t\tinside: null // see below\n\t\t},\n\t\t'builtin': /\\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\\b/,\n\t});\n\n\t// The keywords TypeScript adds to JavaScript\n\tPrism.languages.typescript.keyword.push(\n\t\t/\\b(?:abstract|declare|is|keyof|readonly|require)\\b/,\n\t\t// keywords that have to be followed by an identifier\n\t\t/\\b(?:asserts|infer|interface|module|namespace|type)\\b(?=\\s*(?:[{_$a-zA-Z\\xA0-\\uFFFF]|$))/,\n\t\t// This is for `import type *, {}`\n\t\t/\\btype\\b(?=\\s*(?:[\\{*]|$))/\n\t);\n\n\t// doesn't work with TS because TS is too complex\n\tdelete Prism.languages.typescript['parameter'];\n\tdelete Prism.languages.typescript['literal-property'];\n\n\t// a version of typescript specifically for highlighting types\n\tvar typeInside = Prism.languages.extend('typescript', {});\n\tdelete typeInside['class-name'];\n\n\tPrism.languages.typescript['class-name'].inside = typeInside;\n\n\tPrism.languages.insertBefore('typescript', 'function', {\n\t\t'decorator': {\n\t\t\tpattern: /@[$\\w\\xA0-\\uFFFF]+/,\n\t\t\tinside: {\n\t\t\t\t'at': {\n\t\t\t\t\tpattern: /^@/,\n\t\t\t\t\talias: 'operator'\n\t\t\t\t},\n\t\t\t\t'function': /^[\\s\\S]+/\n\t\t\t}\n\t\t},\n\t\t'generic-function': {\n\t\t\t// e.g. foo<T extends \"bar\" | \"baz\">( ...\n\t\t\tpattern: /#?(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*\\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\\s*\\()/,\n\t\t\tgreedy: true,\n\t\t\tinside: {\n\t\t\t\t'function': /^#?(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*/,\n\t\t\t\t'generic': {\n\t\t\t\t\tpattern: /<[\\s\\S]+/, // everything after the first <\n\t\t\t\t\talias: 'class-name',\n\t\t\t\t\tinside: typeInside\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\tPrism.languages.ts = Prism.languages.typescript;\n\n}(Prism));\n", "import { CheckmarkRegular, CopyRegular, DismissRegular } from '@fluentui/react-icons';\nimport { createElement, useCallback, useState } from 'react';\nimport type { ReactElement } from 'react';\n\nimport { copyToClipboard } from './copy-to-clipboard';\nimport { useTranslation } from '../../i18n/translation';\n\nconst COPIED_MS = 1500;\nconst FAILED_MS = 2000;\n\nexport type CopyOutcome = 'idle' | 'copied' | 'failed';\n\nconst COPY_OUTCOME_ICON = {\n idle: CopyRegular,\n copied: CheckmarkRegular,\n failed: DismissRegular,\n} as const;\n\nexport const copyOutcomeIcon = (outcome: CopyOutcome): ReactElement =>\n createElement(COPY_OUTCOME_ICON[outcome]);\n\nconst COPY_OUTCOME_LABEL_KEY = {\n copied: 'common.copy.copied',\n failed: 'common.copy.failed',\n} as const;\n\nexport const useCopyLabel = (): ((outcome: CopyOutcome, idle: string) => string) => {\n const { t } = useTranslation();\n return useCallback(\n (outcome, idle) => (outcome === 'idle' ? idle : t(COPY_OUTCOME_LABEL_KEY[outcome])),\n [t],\n );\n};\n\nexport interface ClipboardCopy {\n /**\n * `tag` names which button is showing the outcome, so one hook can serve a\n * whole table of them and a late expiry can only clear its own result.\n */\n copy: (text: string, tag?: string) => void;\n outcomeFor: (tag?: string) => CopyOutcome;\n}\n\nexport const useCopyToClipboard = (): ClipboardCopy => {\n const [result, setResult] = useState<{ outcome: Exclude<CopyOutcome, 'idle'>; tag: string } | null>(null);\n\n const copy = useCallback((text: string, tag = '') => {\n // Synchronous up to the first await, so the legacy copy path inside still\n // runs within the click that asked for it.\n void copyToClipboard(text).then(copied => {\n const outcome = copied ? 'copied' : 'failed';\n setResult({ outcome, tag });\n window.setTimeout(() => {\n setResult(current => (current?.tag === tag && current.outcome === outcome ? null : current));\n }, copied ? COPIED_MS : FAILED_MS);\n });\n }, []);\n\n const outcomeFor = useCallback(\n (tag = ''): CopyOutcome => (result?.tag === tag ? result.outcome : 'idle'),\n [result],\n );\n\n return { copy, outcomeFor };\n};\n", "// The synchronous legacy command runs first because it is the only path still\n// inside the click's user gesture, and the only one at all outside a secure\n// context; awaiting the Clipboard API first spends the gesture.\n// https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand\nexport const copyToClipboard = async (text: string): Promise<boolean> => {\n if (copyWithExecCommand(text)) return true;\n try {\n await navigator.clipboard.writeText(text);\n return true;\n } catch (error) {\n console.warn('Copying to the clipboard failed.', error);\n return false;\n }\n};\n\nconst copyWithExecCommand = (text: string): boolean => {\n const previousFocus = document.activeElement;\n const selection = document.getSelection();\n const previousRange = selection && selection.rangeCount > 0 ? selection.getRangeAt(0) : null;\n const textArea = document.createElement('textarea');\n // Copying requires a focusable, selectable node, so it is made invisible\n // rather than hidden.\n textArea.style.position = 'fixed';\n textArea.style.top = '0';\n textArea.style.left = '0';\n textArea.style.width = '2em';\n textArea.style.height = '2em';\n textArea.style.padding = '0';\n textArea.style.border = 'none';\n textArea.style.outline = 'none';\n textArea.style.boxShadow = 'none';\n textArea.style.background = 'transparent';\n textArea.value = text;\n\n try {\n document.body.append(textArea);\n textArea.focus();\n textArea.select();\n return document.execCommand('copy');\n } catch {\n return false;\n } finally {\n textArea.remove();\n if (selection && previousRange) {\n selection.removeAllRanges();\n selection.addRange(previousRange);\n }\n if (previousFocus instanceof HTMLElement) previousFocus.focus();\n }\n};\n", "import type { DialogProps } from '@fluentui/react-components';\nimport type { ReactNode } from 'react';\n\nimport { ScrollArea } from './scroll-area';\nimport { fluentComponents } from '../../fluent';\n\nconst { Dialog, DialogBody, DialogContent, DialogSurface, mergeClasses } = fluentComponents;\n\n// The measures a dialog can take, each one a rule in\n// ../../winui/controls/dialog.css.ts. The prop's type is read off this record,\n// so a call site asks for a measure by name and cannot state a length.\nconst surfaceWidthClasses = {\n standard: '',\n editor: 'fwt-dialog-shell--editor',\n};\n\n// Fluent can only animate a dialog out while the surface is still mounted, so\n// `open` is a prop: a shell hard-coded to `open` and closed by unmounting leaves\n// the exit no frames to run in.\nexport function DialogShell({ actions, children, onExited, onOpenChange, onSubmit, open, surfaceClassName, title, width = 'standard' }: {\n actions: ReactNode;\n children: ReactNode;\n /**\n * Runs once the surface has finished animating out. A caller whose\n * confirmation destroys the tree the dialog lives in does the deed here:\n * closing and destroying in one handler is one React commit, and the exit\n * never gets to start.\n */\n onExited?: () => void;\n onOpenChange: DialogProps['onOpenChange'];\n onSubmit?: () => void;\n open: boolean;\n surfaceClassName?: string;\n title: ReactNode;\n width?: keyof typeof surfaceWidthClasses;\n}) {\n return (\n <Dialog\n open={open}\n onOpenChange={onOpenChange}\n surfaceMotion={{ onMotionFinish: (_, data) => { if (data.direction === 'exit') onExited?.(); } }}\n >\n <DialogSurface\n className={mergeClasses('fwt-dialog-shell !m-auto', surfaceWidthClasses[width], surfaceClassName)}\n >\n <form\n className=\"fwt-dialog-shell__form\"\n onSubmit={e => {\n e.preventDefault();\n onSubmit?.();\n }}\n >\n <DialogBody className=\"fwt-dialog-shell__body\">\n {title}\n <DialogContent className=\"fwt-dialog-shell__content\">\n <ScrollArea axes=\"vertical\" className=\"fwt-dialog-shell__scroller h-full min-h-0\" contentClassName=\"grid gap-4\" viewportClassName=\"fwt-dialog-shell__scrollport\">\n {children}\n </ScrollArea>\n </DialogContent>\n {actions}\n </DialogBody>\n </form>\n </DialogSurface>\n </Dialog>\n );\n}\n", "import { DismissRegular } from '@fluentui/react-icons';\nimport { Children, type ReactNode } from 'react';\n\nimport { fluentComponents } from '../../fluent';\nimport { useTranslation } from '../../i18n/translation';\n\nconst { Button, MessageBar, MessageBarActions, MessageBarBody, MessageBarTitle, Tooltip } = fluentComponents;\n\nconst MessageBarContent = ({ children }: { children: ReactNode }) => {\n const messages = Children.toArray(children);\n\n return messages.length > 1 ? <div className=\"winui-message-items\">{messages}</div> : messages;\n};\n\n// Nothing dismisses this on a timer: it carries a server's own words, which may\n// need to be read twice or copied.\nexport function OutcomeMessageBar({\n action,\n children,\n className,\n intent = 'error',\n onDismiss,\n title,\n}: {\n action?: ReactNode;\n children: ReactNode;\n className?: string;\n intent?: 'error' | 'warning' | 'success' | 'info';\n onDismiss?: () => void;\n title?: string;\n}) {\n const { t } = useTranslation();\n const dismissLabel = t('common.dismiss');\n\n return (\n <MessageBar className={className} intent={intent}>\n <MessageBarBody>\n {title && <MessageBarTitle>{title}</MessageBarTitle>}\n <MessageBarContent>{children}</MessageBarContent>\n </MessageBarBody>\n {(action ?? onDismiss) && <MessageBarActions\n containerAction={onDismiss && <Tooltip content={dismissLabel} relationship=\"label\">\n <Button\n appearance=\"transparent\"\n aria-label={dismissLabel}\n icon={<DismissRegular />}\n onClick={onDismiss}\n />\n </Tooltip>}\n >{action}</MessageBarActions>}\n </MessageBar>\n );\n}\n", "import { DialogShell } from './dialog-shell';\nimport { OutcomeMessageBar } from './outcome-message-bar';\nimport { fluentComponents } from '../../fluent';\nimport { useTranslation } from '../../i18n/translation';\n\nconst { Button, DialogActions, DialogTitle, makeStyles, mergeClasses } = fluentComponents;\n\nconst useStyles = makeStyles({\n // The label is StaticInverted because the fill does not follow the theme.\n // Not OnBrand: ../../winui/theme.ts re-points it at WinUI's\n // TextOnAccentFillColorPrimary, which goes black in dark, reading 3.46:1 at\n // rest and 2.36 pressed. Not DangerForegroundInverted either, which reads\n // 1.74:1 in light and 1.17:1 in dark over DangerBackground3.\n //\n // The enabled-state qualifiers keep the `!important` that outranks the WinUI\n // layer's accent fill from also outranking the disabled painting. Pressed is\n // `:active` alone because WinUI enters Pressed on a keyboard invoke as well.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Button_themeresources.xaml#L106-L110\n //\n // Colour is confined to `@media not (forced-colors: active)`: WinUI maps the\n // whole AccentButton brush set onto system brushes there.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Button_themeresources.xaml#L53-L65\n danger: {\n '@media not (forced-colors: active)': {\n '&:not(:disabled):not([aria-disabled=\"true\"])': {\n backgroundColor: 'var(--colorStatusDangerBackground3) !important',\n color: 'var(--colorNeutralForegroundStaticInverted) !important',\n },\n '&:not(:disabled):not([aria-disabled=\"true\"]):hover': {\n backgroundColor: 'var(--colorStatusDangerBackground3Hover) !important',\n },\n '&:not(:disabled):not([aria-disabled=\"true\"]):active': {\n backgroundColor: 'var(--colorStatusDangerBackground3Pressed) !important',\n },\n },\n },\n});\n\nexport function ConfirmDialog({\n actionIntent = 'danger',\n actionLabel,\n busy = false,\n cancelLabel,\n error,\n message,\n onCancel,\n onConfirm,\n onDismissError,\n onExited,\n onOpenChange,\n open,\n title,\n}: {\n actionIntent?: 'danger' | 'primary';\n actionLabel: string;\n busy?: boolean;\n cancelLabel?: string;\n error?: string | null;\n message: string;\n onCancel?: () => void;\n onConfirm: () => void;\n onDismissError?: () => void;\n /** See DialogShell: the deed a confirmation does to its own tree goes here. */\n onExited?: () => void;\n onOpenChange: (open: boolean) => void;\n open: boolean;\n title: string;\n}) {\n const { t } = useTranslation();\n const styles = useStyles();\n\n return (\n <DialogShell\n open={open}\n onExited={onExited}\n actions={<DialogActions>\n <Button\n className=\"!whitespace-nowrap\"\n disabled={busy}\n onClick={() => {\n if (onCancel) onCancel();\n else onOpenChange(false);\n }}\n >\n {cancelLabel ?? t('common.cancel')}\n </Button>\n <Button\n appearance=\"primary\"\n className={mergeClasses('!whitespace-nowrap', actionIntent === 'danger' && styles.danger)}\n disabledFocusable={busy}\n onClick={onConfirm}\n >\n {actionLabel}\n </Button>\n </DialogActions>}\n onOpenChange={(_, data) => !busy && onOpenChange(data.open)}\n surfaceClassName=\"!w-[min(430px,calc(100vw-48px))]\"\n title={<DialogTitle>{title}</DialogTitle>}\n >\n <div className=\"grid gap-3 min-w-0\">\n <span>{message}</span>\n {error && <OutcomeMessageBar onDismiss={onDismissError}>{error}</OutcomeMessageBar>}\n </div>\n </DialogShell>\n );\n}\n", "import { fluentComponents } from '../../fluent';\n\nconst { buttonClassNames, makeStyles } = fluentComponents;\n\n// WinUI's SystemFillColorCritical, the same brush the validation message and\n// the error message bar read.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L282\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L78\n//\n// Important because the WinUI layer states the foreground of a chromeless\n// button and of a menu item on doubled class names, which a single Griffel\n// class does not outrank.\nconst RED = 'var(--winui-system-fill-critical) !important';\n\n// Without this the declarations above outrank Fluent's forced-colours pairing\n// of a reached surface with Highlight, dropping the Highlight step on a menu\n// item and landing red on the system hover fill of a button.\nconst FORCED = 'Highlight !important';\n\n// A Fluent Button paints its icon slot from a descendant rule of its own, so a\n// colour on the root reaches the label and leaves the glyph. A menu item needs\n// no counterpart: ../../winui/controls/menu.css.ts already hands its icon the\n// item's own colour.\nconst ICON = `& .${buttonClassNames.icon}`;\n\n// A Button carries `:disabled` when disabled and `aria-disabled` when disabled\n// and still focusable; a menu item, being a `div`, carries only `aria-disabled`.\nconst ENABLED = '&:not(:disabled):not([aria-disabled=\"true\"])';\nconst HOVER = `${ENABLED}:hover`;\nconst PRESSED = `${ENABLED}:active`;\n// Not `:focus`, which a click also sets, leaving the colour resident after the\n// pointer has moved on.\nconst KEYBOARD = `${ENABLED}[data-fui-focus-visible]`;\n\nconst buttonPaint = { color: RED, [ICON]: { color: RED } };\nconst buttonForcedPaint = { color: FORCED, [ICON]: { color: FORCED } };\n\nconst useStyles = makeStyles({\n button: {\n [HOVER]: buttonPaint,\n [PRESSED]: buttonPaint,\n [KEYBOARD]: buttonPaint,\n '@media (forced-colors: active)': {\n [HOVER]: buttonForcedPaint,\n [PRESSED]: buttonForcedPaint,\n [KEYBOARD]: buttonForcedPaint,\n },\n },\n menuItem: {\n [HOVER]: { color: RED },\n [PRESSED]: { color: RED },\n [KEYBOARD]: { color: RED },\n '@media (forced-colors: active)': {\n [HOVER]: { color: FORCED },\n [PRESSED]: { color: FORCED },\n [KEYBOARD]: { color: FORCED },\n },\n },\n});\n\nexport const useDangerActionClasses = (): ReturnType<typeof useStyles> => useStyles();\n\nconst useTextStyles = makeStyles({\n danger: { color: 'var(--winui-system-fill-critical)' },\n});\n\nexport const useDangerTextClass = (): string => useTextStyles().danger;\n", "// WinUI states this gap as `0`\n// (https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsCard/SettingsCard.xaml#L409-L450),\n// but only where every line carries its own full leading. Our `line-height` is\n// tight, so the 4px stands in for that leading.\nexport const TIGHT_STACK_CLASS = 'grid gap-1';\n\n// WinUI's `PART_ContentPresenter` states no spacing or breakpoint, so the 900px\n// is ours, and each caller states its own gap.\nexport const HEADER_ROW_CLASS = 'flex items-center justify-between min-w-0 max-[900px]:flex-col max-[900px]:items-stretch';\n\n// A heading stacked above the content it names takes SettingsCard's own\n// header-to-content spacing, the one WinUI resource that states this distance:\n// `SettingsCardVerticalHeaderContentSpacing` = 8, applied as the root grid's\n// `RowSpacing` once the card wraps its content under its header.\n// https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsCard/SettingsCard.xaml#L109\n// and #L388-L393\nexport const SECTION_STACK_CLASS = 'grid gap-2';\n\n// A panel stacks a heading over the body it introduces inside its own inset,\n// which is the relationship WinUI states as `ContentDialogTitleMargin`'s 12px\n// bottom \u2014 the only resource giving that distance on a padded surface rather\n// than on a row. Peer blocks in the same panel take the same step, so a panel\n// with no heading reads on the same rhythm.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/ContentDialog_themeresources.xaml#L17\n// `!` because Griffel's `Card` sheet is injected after the utility sheet.\nexport const PANEL_STACK_CLASS = '!grid !gap-3';\n\n// 680 because that is where `--fwt-page-inset` and `--fwt-panel-inset`\n// already step down, so columns collapse as the space around them narrows.\nexport const TWO_COLUMN_FORM_CLASS = 'grid grid-cols-2 max-[680px]:grid-cols-1';\n\n// Reads the page inset rather than stating a number, so the 680px step-down\n// comes with the token and a shell needs no breakpoint of its own.\nexport const PANE_GAP_CLASS = 'gap-[var(--fwt-page-inset)]';\n\n// A box that fills its scrollport and carries the inset of what it holds.\n// `height: 100%` alone is enough only while the content fits: anything with a\n// floor of its own -- a pane that stops shrinking, a control that cannot get\n// shorter -- overflows a box whose height is already settled, and the overflow\n// escapes past the padding edge, so the trailing inset is not in the scrollable\n// overflow and cannot be scrolled to. `min-height: max-content` lets the box\n// grow to what it could not fit, which puts that inset back.\nexport const SCROLLPORT_FILL_CLASS = 'h-full min-h-max';\n\n// 34px is the control-row height every field takes from\n// ../../winui/controls/text-input.css.ts, and ../../winui/controls/choice.css.ts\n// and ../../winui/controls/switch.css.ts follow it. Fluent's Button derives 33\n// from its padding and line box and its icon-only square steps 24, 32 and 40, so\n// nothing Fluent offers meets that row: a button or a toolbar standing in one\n// states the height here rather than at the call site.\nexport const CONTROL_ROW_CLASS = '!min-h-[34px]';\n\n// A list of labelled checkbox rows. Each row already stands 34px tall from\n// ../../winui/controls/choice.css.ts, so the rows step at the 4px\n// TIGHT_STACK_CLASS states rather than at a field-to-field distance, and a\n// second column keeps the 8px of the form grid the list sits in.\nexport const CHECKBOX_LIST_CLASS = 'gap-x-2 gap-y-1';\n", "import type { ReactNode } from 'react';\n\nimport { HEADER_ROW_CLASS } from './layout';\nimport { fluentComponents } from '../../fluent';\n\nconst { Text, mergeClasses } = fluentComponents;\n\nexport function DashboardPageHeader({ actions, className, description, title }: {\n actions?: ReactNode;\n className?: string;\n description?: string;\n title: string;\n}) {\n return <header className={mergeClasses(HEADER_ROW_CLASS, 'gap-[18px]', className)}>\n <div className=\"grid gap-1.5 min-w-0\">\n <Text as=\"h1\" size={700} weight=\"semibold\" className=\"m-0\">\n {title}\n </Text>\n {description !== undefined && <Text size={200} className=\"text-fui-fg2 max-w-[760px]\">\n {description}\n </Text>}\n </div>\n {actions !== undefined && <div className=\"flex items-center gap-2 flex-none max-[900px]:justify-start\">\n {actions}\n </div>}\n </header>;\n}\n", "import type { ReactNode } from 'react';\n\nimport { TIGHT_STACK_CLASS } from './layout';\nimport { fluentComponents } from '../../fluent';\n\nconst { Text, mergeClasses } = fluentComponents;\n\n// Centring rather than stretching: a stretched grid item hands the slack to its\n// own rows, and the title, the line under it and the action drift to opposite\n// ends of the panel.\nconst ALIGN_CLASS = {\n center: 'text-center justify-items-center',\n start: 'justify-items-start',\n} as const;\n\nexport function EmptyState({ action, align = 'center', className, description, title }: {\n action?: ReactNode;\n align?: keyof typeof ALIGN_CLASS;\n className?: string;\n description?: ReactNode;\n title: ReactNode;\n}) {\n return <div className={mergeClasses('grid place-items-center min-h-[180px]', className)}>\n <div className={mergeClasses('grid gap-3 max-w-[480px]', ALIGN_CLASS[align])}>\n <div className={TIGHT_STACK_CLASS}>\n <Text size={300} weight=\"semibold\">{title}</Text>\n {description !== undefined && <Text size={200} className=\"text-fui-fg2\">{description}</Text>}\n </div>\n {action}\n </div>\n </div>;\n}\n\n// No inset of its own: a flush panel, a section body and a legend row each hold\n// their content off their edge by a different measure.\nexport function EmptyStateLine({ children, className }: { children: ReactNode; className?: string }) {\n return <Text block size={300} className={mergeClasses('text-fui-fg2', className)}>{children}</Text>;\n}\n", "import type { PropsWithChildren, ReactNode } from 'react';\n\nimport { ScrollArea } from './scroll-area';\nimport { fluentComponents } from '../../fluent';\n\nconst { Text } = fluentComponents;\n\nexport function ErrorShell({ action, children, message, title }: PropsWithChildren<{\n action?: ReactNode;\n /**\n * Omitted when a trace is shown and it needs nothing said about it: the\n * trace's first line is this sentence.\n */\n message?: ReactNode;\n title: string;\n}>) {\n return (\n <ScrollArea axes=\"vertical\" className=\"fwt-error-shell-viewport\" contentClassName=\"h-full\">\n {/* Fills the scroller, not the window: the viewport is shorter than the\n window whenever a scrollbar takes width, so a window-measured child\n never lets the bar retract. */}\n <main className=\"fwt-error-shell\">\n <div className=\"fwt-error-shell-stack\">\n {/* `align` rather than a rule of our own: Fluent's Text emits a\n text-align atom regardless, and Griffel injects at runtime, so an\n equal-weight rule here always loses the tie. */}\n <Text align=\"center\" as=\"h1\" size={700} weight=\"semibold\">{title}</Text>\n {message !== undefined && <Text align=\"center\" as=\"p\" className=\"text-fui-fg2\" size={300}>{message}</Text>}\n </div>\n {children}\n {action !== undefined && <div className=\"fwt-error-shell-actions\">{action}</div>}\n </main>\n </ScrollArea>\n );\n}\n\nexport function ErrorStack({ children }: PropsWithChildren) {\n return (\n <ScrollArea\n axes=\"horizontal\"\n className=\"winui-focus-rect-within w-full min-w-0 rounded-[var(--winui-overlay-corner-radius,8px)] border border-solid border-fui-stroke1 bg-fui-bg2 text-left\"\n >\n <pre className=\"m-0 w-max min-w-full p-4 font-mono\"><code>{children}</code></pre>\n </ScrollArea>\n );\n}\n", "import type { ReactNode } from 'react';\n\nimport { useBadgeHue, type BadgeHue } from './badge-hue';\nimport { fluentComponents } from '../../fluent';\n\nconst { Badge, makeStyles, mergeClasses } = fluentComponents;\n\nexport type BadgeTone = 'accent' | 'danger' | 'neutral' | 'success' | 'warning';\n\n// Every badge in the dashboard is painted by one algorithm: the hue washes the\n// surface at a tenth, outlines it at a bit over a third, and the label is solved\n// against that wash for 4.5:1 rather than picked. Fluent instead ships a literal\n// per severity per scheme, which is what let the method chips, the role pills\n// and the proxy chips give three different answers to the same question.\n//\n// The hues are WinUI's own semantic fills, which the dictionaries state twice\n// because a colour that carries a meaning against white does not carry it\n// against black. Neutral has no system fill to take, so it is a mid grey: the\n// wash and the outline need a hue with no meaning of its own, and the label is\n// solved from it like any other.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L220-L231\nconst TONE_HUES: Record<BadgeTone, BadgeHue> = {\n accent: { light: '#0078d4', dark: '#4cc2ff' },\n danger: { light: '#c42b1c', dark: '#ff99a4' },\n neutral: { light: '#8a8a8a', dark: '#9a9a9a' },\n success: { light: '#0f7b0f', dark: '#6ccb5f' },\n warning: { light: '#9d5d00', dark: '#fce100' },\n};\n\n/** Fluent's private `tagSpacingSmall`, which is what ./chip.tsx's `small` step pads its root by.\n * https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-tags/library/src/components/Tag/useTagStyles.styles.ts#L23\n * https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-tags/library/src/components/Tag/useTagStyles.styles.ts#L185-L187\n * https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-tags/library/src/components/Tag/useTagStyles.styles.ts#L199-L201 */\nconst CHIP_ROOT_PADDING = '5px';\n\n// The dashboard has two badge shapes -- this one and ./chip.tsx -- and a label\n// has to sit the same distance inside either. The chip reaches its inset in\n// three parts: a real 1px border, the root padding above, and\n// spacingHorizontalXXS on the label slot. Badge draws its stroke as an inset\n// ::after so that a border costs no layout, which leaves padding as the whole\n// inset -- and Fluent's large step, spacingHorizontalXS plus the same XXS it\n// calls textPadding, lands two pixels short of the chip.\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-tags/library/src/components/Tag/useTagStyles.styles.ts#L46\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-tags/library/src/components/Tag/useTagStyles.styles.ts#L320-L325\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-badge/library/src/components/Badge/useBadgeStyles.styles.ts#L14-L16\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-badge/library/src/components/Badge/useBadgeStyles.styles.ts#L77-L81\n// https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-badge/library/src/components/Badge/useBadgeStyles.styles.ts#L99-L101\nconst LABEL_INSET = `calc(var(--strokeWidthThin) + ${CHIP_ROOT_PADDING} + var(--spacingHorizontalXXS))`;\n\nconst useStyles = makeStyles({\n root: {\n paddingLeft: LABEL_INSET,\n paddingRight: LABEL_INSET,\n },\n});\n\n/** Fluent's `medium` default has an empty size rule, leaving the 20px root reset box, so every dashboard badge is `large`. */\nexport function StatusBadge({ children, className, tone }: {\n children: ReactNode;\n className?: string;\n tone: BadgeTone;\n}) {\n const hue = useBadgeHue(TONE_HUES[tone]);\n const styles = useStyles();\n return <Badge appearance=\"tint\" className={mergeClasses(styles.root, hue.className, className)} size=\"large\" style={hue.style}>{children}</Badge>;\n}\n", "import type { ReactNode } from 'react';\n\nimport { StatusBadge, type BadgeTone } from './status-badge';\nimport { fluentComponents } from '../../fluent';\n\nconst { makeStyles } = fluentComponents;\n\n// Monospace, but at the badge's own Caption size: the app's mono ramp shrinks a\n// pixel to sit inside prose, and a badge label has none beside it. The width\n// floor exceeds every method name, so a column of these reads as one width.\n//\n// The padding is an optical compensation, not spacing. The monospace face's\n// ascent and descent are not symmetric about its cap band, so centring the line\n// box leaves the glyph 0.75px high -- measured at 2x, 14 rows of gap above the\n// ink and 17 below in a 24px badge. Padding on one side moves centred content by\n// half of itself, so 1.5px buys the 0.75px. This is the only place the app\n// centres the monospace face in a fixed-height box; everywhere else it sets\n// running text.\nconst useStyles = makeStyles({\n root: {\n fontFamily: 'var(--fontFamilyMonospace)',\n minWidth: '48px',\n paddingTop: '1.5px',\n },\n});\n\nfunction HttpBadge({ children, tone }: { children: ReactNode; tone: BadgeTone }) {\n const styles = useStyles();\n return <StatusBadge className={styles.root} tone={tone}>\n <span translate=\"no\">{children}</span>\n </StatusBadge>;\n}\n\nexport function HttpMethodBadge({ method }: { method: string }) {\n return <HttpBadge tone={method === 'GET' ? 'accent' : method === 'POST' ? 'success' : 'neutral'}>{method}</HttpBadge>;\n}\n\nexport function HttpStatusBadge({ children, severity }: { children: ReactNode; severity: 'success' | 'warning' | 'error' }) {\n return <HttpBadge tone={severity === 'error' ? 'danger' : severity}>{children}</HttpBadge>;\n}\n", "import type { InfoLabelProps, LabelProps } from '@fluentui/react-components';\nimport type { ReactNode } from 'react';\n\nimport { fluentComponents } from '../../fluent';\n\nconst { InfoLabel } = fluentComponents;\n\n// Not for a Switch: its label carries `htmlFor`, so a click anywhere inside\n// throws the switch and the info button never opens.\n// https://react.fluentui.dev/?path=/docs/components-infolabel--docs\nexport const infoLabelSlot = (label: ReactNode, info: InfoLabelProps['info']) =>\n (_: unknown, slotProps: LabelProps) => <InfoLabel {...slotProps} info={info}>{label}</InfoLabel>;\n", "import { fluentComponents } from '../../fluent';\n\nconst { Spinner } = fluentComponents;\n\nexport function AppLoadingScreen({ label }: { label: string }) {\n return <main className=\"fwt-loading fwt-loading-app\"><Spinner label={label} /></main>;\n}\n\nexport function ContentLoadingScreen({ label }: { label: string }) {\n return <div className=\"fwt-loading\"><Spinner label={label} /></div>;\n}\n", "import type { CSSProperties } from 'react';\n\nimport { fluentComponents } from '../../fluent';\n\nconst { mergeClasses } = fluentComponents;\n\nexport function MaskedIcon({ className, maskSize = 'contain', url }: { className?: string; maskSize?: string; url: string }) {\n const style: CSSProperties = {\n backgroundColor: 'currentColor',\n maskImage: `url(${url})`,\n WebkitMaskImage: `url(${url})`,\n maskSize,\n WebkitMaskSize: maskSize,\n maskRepeat: 'no-repeat',\n WebkitMaskRepeat: 'no-repeat',\n maskPosition: 'center',\n WebkitMaskPosition: 'center',\n };\n return <span aria-hidden className={mergeClasses('block flex-none', className)} style={style} />;\n}\n", "import { useState } from 'react';\nimport type { ReactNode } from 'react';\n\nimport { Combobox } from './fluent-form-controls';\nimport { fluentComponents } from '../../fluent';\n\nconst { Option } = fluentComponents;\n\nexport interface MultiselectOption {\n value: string;\n label: string;\n}\n\nconst sameValues = (left: readonly string[], right: readonly string[]) =>\n left.length === right.length && new Set(right).size === right.length && left.every(entry => right.includes(entry));\n\n// Values and visible labels stay separate so an id can display and search by a\n// human-readable name. The query exists only while the list is open; every\n// selection and freeform entry passes through the same normalization.\nexport function MultiselectCombobox({\n ariaLabel,\n className,\n clearLabel,\n closedLabel = '',\n disabled = false,\n freeform = false,\n normalizeValue = entry => entry,\n onChange,\n options,\n placeholder,\n readOnly,\n renderOption,\n value,\n}: {\n ariaLabel?: string;\n className?: string;\n clearLabel?: string;\n closedLabel?: string;\n disabled?: boolean;\n freeform?: boolean;\n normalizeValue?: (entry: string) => string;\n onChange: (value: string[]) => void;\n options: readonly MultiselectOption[];\n placeholder: string;\n readOnly?: boolean;\n renderOption?: (option: MultiselectOption) => ReactNode;\n value: readonly string[];\n}) {\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState('');\n const needle = query.trim().toLowerCase();\n const optionValues = new Set(options.map(option => option.value));\n const completeOptions = [\n ...options,\n ...[...new Set(value)].filter(entry => !optionValues.has(entry)).map(entry => ({ value: entry, label: entry })),\n ];\n const visible = completeOptions.filter(option => option.label.toLowerCase().includes(needle));\n\n const commit = (next: readonly string[]) => {\n const normalized = [...new Set(next.map(normalizeValue).filter(Boolean))];\n if (!sameValues(normalized, value)) onChange(normalized);\n setQuery('');\n };\n\n return <Combobox\n aria-label={ariaLabel}\n className={className}\n disabled={disabled}\n freeform={freeform}\n multiselect\n onChange={event => setQuery(event.target.value)}\n onKeyDown={freeform ? event => {\n if (event.key !== 'Enter' || query.trim() === '') return;\n event.preventDefault();\n commit([...value, query]);\n } : undefined}\n onOpenChange={(_, data) => { setOpen(data.open); setQuery(''); }}\n onOptionSelect={(_, data) => commit(data.optionValue === '' ? [] : data.selectedOptions)}\n placeholder={placeholder}\n readOnly={readOnly}\n selectedOptions={clearLabel && value.length === 0 ? [''] : [...value]}\n value={open ? query : closedLabel}\n >\n {clearLabel && needle === '' && <Option text={clearLabel} value=\"\">{clearLabel}</Option>}\n {visible.map(option => <Option key={option.value} text={option.label} value={option.value}>\n {renderOption ? renderOption(option) : option.label}\n </Option>)}\n </Combobox>;\n}\n\nexport const valuesAsOptions = (values: readonly string[]): MultiselectOption[] =>\n values.map(value => ({ value, label: value }));\n", "import { Open16Regular } from '@fluentui/react-icons';\nimport type { ReactNode } from 'react';\n\nexport function OpenLinkLabel({ children }: { children: ReactNode }) {\n return <span className=\"inline-flex items-center gap-1\">{children}<Open16Regular aria-hidden className=\"block flex-none\" /></span>;\n}\n", "import { createContext, useCallback, useContext, useId, useMemo, useRef } from 'react';\nimport type { PropsWithChildren } from 'react';\n\nimport { fluentComponents } from '../../fluent';\n\nconst { Spinner, Toast, Toaster, ToastTitle, useToastController } = fluentComponents;\n\n// Success only: a failure carries the server's own words and belongs in a hand-dismissed surface next to what failed.\n\nconst TOAST_DISMISS_MS = 3000;\n\ninterface OutcomeHandle {\n succeed: (message: string) => void;\n /** Drops the pending toast. For a failure, which is reported in place. */\n settle: () => void;\n}\n\nexport interface OutcomeToasts {\n /** Announces work in flight; the toast stays until the handle settles it. */\n start: (pending: string) => OutcomeHandle;\n succeed: (message: string) => void;\n}\n\nconst OutcomeToastContext = createContext<OutcomeToasts | null>(null);\n\nexport function OutcomeToastProvider({ children }: PropsWithChildren) {\n const toasterId = useId();\n const sequence = useRef(0);\n const { dispatchToast, dismissToast, updateToast } = useToastController(toasterId);\n\n // Clicking dismisses: Fluent's Toast ships no close button, and waiting out the timeout is the only other exit.\n //\n // A settled toast leaves the media slot unset and carries an intent, which is what makes the appearance layer\n // fill the slot with the InfoBar severity mark. We keep that mark: a surface that dismisses itself in seconds\n // should carry its state without being read.\n const toastFor = useCallback((toastId: string, message: string, pending: boolean) => (\n <Toast className=\"cursor-pointer\" onClick={() => dismissToast(toastId)}>\n <ToastTitle media={pending ? <Spinner size=\"tiny\" /> : undefined}>{message}</ToastTitle>\n </Toast>\n ), [dismissToast]);\n\n const nextToastId = useCallback(() => `${toasterId}-${sequence.current++}`, [toasterId]);\n\n const succeed = useCallback((message: string) => {\n const toastId = nextToastId();\n dispatchToast(toastFor(toastId, message, false), { intent: 'success', toastId, timeout: TOAST_DISMISS_MS });\n }, [dispatchToast, nextToastId, toastFor]);\n\n const start = useCallback((pending: string): OutcomeHandle => {\n const toastId = nextToastId();\n dispatchToast(toastFor(toastId, pending, true), { toastId, timeout: -1 });\n return {\n succeed: message => updateToast({\n content: toastFor(toastId, message, false),\n intent: 'success',\n toastId,\n timeout: TOAST_DISMISS_MS,\n }),\n settle: () => dismissToast(toastId),\n };\n }, [dismissToast, dispatchToast, nextToastId, toastFor, updateToast]);\n\n const value = useMemo<OutcomeToasts>(() => ({ start, succeed }), [start, succeed]);\n\n return (\n <OutcomeToastContext.Provider value={value}>\n <Toaster toasterId={toasterId} position=\"top-end\" />\n {children}\n </OutcomeToastContext.Provider>\n );\n}\n\nexport const useOutcomeToasts = (): OutcomeToasts => {\n const value = useContext(OutcomeToastContext);\n if (!value) throw new Error('useOutcomeToasts requires an OutcomeToastProvider above it');\n return value;\n};\n", "import type { CardProps } from '@fluentui/react-components';\n\nimport { fluentComponents } from '../../fluent';\n\nconst { Card, mergeClasses } = fluentComponents;\n\n// A panel's own inset, exported for the bodies a flush panel wraps: a scrolling\n// region has to reach the panel's edges, so its content states the inset the\n// panel would otherwise have applied. Written out again below rather than\n// composed, because UnoCSS extracts class names from the source text and never\n// sees a name assembled at runtime.\nexport const PANEL_INSET_CLASS = 'p-[var(--fwt-panel-inset)]';\n\n// Fixed bands keep the panel edge inset and Fluent's compact six-pixel spacing.\nexport const PANEL_BAND_CLASS = 'px-[var(--fwt-panel-inset)] py-[var(--spacingVerticalSNudge)]';\n\nconst PADDING_CLASS = {\n content: '!p-[var(--fwt-panel-inset)]',\n flush: '!p-0',\n} as const;\n\nexport type PanelProps = CardProps & { padding?: keyof typeof PADDING_CLASS };\n\n// Griffel's sheet is injected after the utility sheet at the same specificity, so\n// a utility overriding a `Card` style \u2014 padding, display, gap \u2014 needs `!` to win.\nexport function Panel({ className, padding = 'content', ...props }: PanelProps) {\n return <Card {...props} className={mergeClasses(PADDING_CLASS[padding], className)} />;\n}\n", "import { fluentComponents } from '../../fluent';\n\nconst { makeStyles, mergeClasses } = fluentComponents;\n\n// WinUI's ProgressRing in its determinate state. The arc paints\n// ProgressRingForegroundThemeBrush -- AccentFillColorDefaultBrush in the light\n// and the dark dictionary.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/ProgressRing/ProgressRing_themeresources.xaml#L5-L11\n//\n// Sizing follows the ring's own resources rather than this call site: 32 square\n// stroked at 4, with 16 stated as the minimum, so the stroke is written as the\n// eighth of the diameter it is and holds at whatever size a caller asks for.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/ProgressRing/ProgressRing.xaml#L9-L14\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/ProgressRing/ProgressRing_themeresources.xaml#L17\nconst DIAMETER = 32;\nconst STROKE = 4;\nconst RADIUS = (DIAMETER - STROKE) / 2;\nconst CIRCUMFERENCE = 2 * Math.PI * RADIUS;\n\n// WinUI leaves the ring's own Background transparent in the light and the dark\n// dictionary alike, so an arc alone is all it draws and the unfilled remainder\n// is absent. A reading here has to say how much of an allowance is left as much\n// as how much is spent, so the remainder is drawn, and it is drawn as the\n// hairline the same design language gives ProgressBar: its track is one third\n// of the indicator's own weight, centred in the same band.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/ProgressRing/ProgressRing_themeresources.xaml#L6\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/ProgressBar/ProgressBar_themeresources.xaml#L23\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/ProgressBar/ProgressBar_themeresources.xaml#L29-L32\nconst TRACK_STROKE = STROKE / 3;\n\n// WinUI paints a critical reading SystemFillColorCritical and a cautionary one\n// SystemFillColorCaution, the pair the restyled ProgressBar reads for Fluent's\n// error and warning states.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L281-L282\nexport type ProgressRingTone = 'accent' | 'caution' | 'critical';\n\nconst TONE_STROKE: Record<ProgressRingTone, string> = {\n accent: 'var(--winui-accent-fill-default)',\n caution: 'var(--winui-system-fill-caution)',\n critical: 'var(--winui-system-fill-critical)',\n};\n\nconst useStyles = makeStyles({\n // A forced-colours palette repaints background and border colours but not an\n // SVG stroke, so each ring names its system colour itself: Highlight is what\n // HighContrast gives ProgressRingForegroundThemeBrush through\n // SystemControlHighlightAccentBrush, and the track takes CanvasText, the\n // foreground the same palette pairs with the surface behind it.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/ProgressRing/ProgressRing_themeresources.xaml#L12-L13\n arc: {\n '@media (forced-colors: active)': {\n stroke: 'Highlight',\n },\n },\n track: {\n '@media (forced-colors: active)': {\n stroke: 'CanvasText',\n },\n },\n});\n\n// The value is carried by the text this ring stands beside, so the graphic is\n// left out of the accessibility tree rather than duplicating it as a meter.\n//\n// It is centred on the cap height of that text rather than on its line box: a\n// line box is taller below the baseline than the digits standing on it, so a\n// ring centred in it reads as riding high. The caller therefore aligns on the\n// baseline -- where a replaced element sits on its bottom edge -- and the ring\n// lifts its own centre to half a cap above it. `cap` is the font's own cap\n// height, so this holds at any size and under any font.\n// https://drafts.csswg.org/css-values-4/#cap\nexport function ProgressRing({ className, percent, size = 16, tone }: {\n className?: string;\n /** Clamped to the ring: past 100 the arc is closed, not wound a second time. */\n percent: number;\n size?: number;\n tone: ProgressRingTone;\n}) {\n const styles = useStyles();\n const filled = Math.max(0, Math.min(100, percent)) / 100;\n\n return (\n <svg\n aria-hidden\n className={mergeClasses('block flex-none', className)}\n height={size}\n style={{ transform: 'translateY(calc(50% - 0.5cap))' }}\n viewBox={`0 0 ${DIAMETER} ${DIAMETER}`}\n width={size}\n >\n <circle\n className={styles.track}\n cx={DIAMETER / 2}\n cy={DIAMETER / 2}\n fill=\"none\"\n r={RADIUS}\n stroke=\"var(--winui-control-strong-stroke-default)\"\n strokeWidth={TRACK_STROKE}\n />\n <circle\n className={styles.arc}\n cx={DIAMETER / 2}\n cy={DIAMETER / 2}\n fill=\"none\"\n r={RADIUS}\n stroke={TONE_STROKE[tone]}\n strokeDasharray={`${CIRCUMFERENCE} ${CIRCUMFERENCE}`}\n strokeDashoffset={CIRCUMFERENCE * (1 - filled)}\n strokeWidth={STROKE}\n // The arc starts at twelve o'clock and closes clockwise.\n transform={`rotate(-90 ${DIAMETER / 2} ${DIAMETER / 2})`}\n />\n </svg>\n );\n}\n", "import { ReOrderDotsVerticalRegular } from '@fluentui/react-icons';\nimport { useEffect, useMemo, useRef, useState, type CSSProperties, type KeyboardEvent as ReactKeyboardEvent, type PointerEvent as ReactPointerEvent } from 'react';\n\nimport { fluentComponents } from '../../fluent';\nimport { REPOSITION_ANIMATION_MS, REPOSITION_EASING } from '../../winui/motion';\n\nconst { Button, makeStyles, mergeClasses } = fluentComponents;\n\n// ListView reorders by drag when CanReorderItems is set. The item under the\n// pointer states that it is in flight by opacity alone, and the items it\n// displaces are re-arranged into their new slots live, which their\n// ReorderThemeTransition carries -- a reposition, which is the duration and\n// spline ../../winui/motion.ts already transcribes.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/ListViewItem_themeresources.xaml#L8\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/ListViewItem_themeresources.xaml#L496-L500\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/dxaml/xcp/dxaml/lib/ListViewBase_Partial_Reorder.cpp#L2254-L2282\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/dxaml/xcp/dxaml/themes/generic.xaml#L9298-L9306\nconst REORDER_OPACITY = 0.8;\n\n// A ListViewItem does not jump out of its drag state: the whole DragStates\n// group carries one transition back to NotDragging, so the opacity the pick-up\n// took returns over this while the item is still travelling to its slot.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/ListViewItem_themeresources.xaml#L530-L533\nconst DRAG_RETURN_MS = 200;\n\n// The gesture addresses the list through the DOM rather than through a ref the\n// caller threads down: a handle sits inside the item it moves, the item inside\n// the list, and both facts are already load-bearing. The item carries its own\n// index as the attribute's value, so an item the caller withheld -- the rows an\n// access list leaves unordered -- is absent from the measurement instead of\n// shifting every index after it.\nconst LIST_ATTRIBUTE = 'data-reorder-list';\nconst ITEM_ATTRIBUTE = 'data-reorder-item';\nconst REORDERING_ATTRIBUTE = 'data-reordering';\n// Where an item sits to the eye while a gesture is moving rows, for the\n// separators that are drawn from a list's ends. Those rules read the document,\n// and under a gesture the document is no longer the order on screen.\nconst EDGE_ATTRIBUTE = 'data-reorder-edge';\n// Marks the grips so one can find its neighbours: the arrows travel between\n// them, which is what leaves the reorder to a modified chord.\nconst HANDLE_ATTRIBUTE = 'data-reorder-handle';\n\n// The travel of the item under the pointer, written to the list rather than\n// held in state: it changes at pointer rate, and a render per move would put\n// the whole list through React to move one row. The row reads it by inheritance.\nconst DRAG_Y = '--fwt-reorder-drag-y';\n\n// Constant, so React has nothing to rewrite on the row that is moving.\nconst TRACKING_TRANSFORM: CSSProperties = { transform: `translateY(var(${DRAG_Y}, 0px))` };\n\nconst useStyles = makeStyles({\n // A drag that starts on the handle travels over the rows, and without this\n // the browser reads that travel as a text selection across them.\n list: { [`&[${REORDERING_ATTRIBUTE}]`]: { userSelect: 'none' } },\n // Carried by a row only while it is travelling to a slot. Off the gesture the\n // rows are already where the committed order puts them, so a transition left\n // on would animate them away from it and back.\n travelling: {\n transitionProperty: 'transform',\n transitionDuration: `${REPOSITION_ANIMATION_MS}ms`,\n transitionTimingFunction: REPOSITION_EASING,\n '@media (prefers-reduced-motion: reduce)': { transitionDuration: 'var(--winui-reduced-motion-duration)' },\n },\n // Above the rows it passes over, which a transform alone does not settle:\n // painting order would otherwise follow the document.\n lifted: { position: 'relative', zIndex: 1 },\n grabbed: { opacity: REORDER_OPACITY },\n // The row leaves the pointer: it travels the rest of the way to its slot\n // while the drag opacity returns, on the two durations their owners state.\n settling: {\n transitionProperty: 'transform, opacity',\n transitionDuration: `${REPOSITION_ANIMATION_MS}ms, ${DRAG_RETURN_MS}ms`,\n transitionTimingFunction: `${REPOSITION_EASING}, linear`,\n '@media (prefers-reduced-motion: reduce)': {\n transitionDuration: 'var(--winui-reduced-motion-duration)',\n },\n },\n // Without the touch action the browser claims a vertical drag for panning and\n // cancels the pointer, so the grip would move nothing under a finger.\n handle: { cursor: 'grab', touchAction: 'none', '&:active': { cursor: 'grabbing' } },\n});\n\n/** One item's box in the layout a gesture started in, and the index it stands for. */\ninterface ItemBox {\n index: number;\n /** Relative to the list, so the page may scroll under a gesture in flight. */\n top: number;\n height: number;\n}\n\ninterface Gesture {\n pointerId: number;\n list: HTMLElement;\n /** Where the pointer was when the item was picked up. */\n originY: number;\n from: number;\n items: ItemBox[];\n}\n\n/** What the list is rendering: the move being previewed, or settled into. */\ninterface Preview {\n from: number;\n to: number;\n items: readonly ItemBox[];\n /** The pointer is up and the item is travelling the rest of the way to its slot. */\n settling: boolean;\n}\n\ntype DropOutcome = { ok: true } | { ok: false; error: unknown };\n\n/** The move every caller commits and the preview reads, stated once. */\nexport const moveItem = <Item, >(items: readonly Item[], from: number, to: number): Item[] => {\n const next = [...items];\n const [moved] = next.splice(from, 1);\n next.splice(to, 0, moved);\n return next;\n};\n\n// XAML's insertion rule: the container under the point takes the drag, and a\n// point at or past that container's midpoint inserts after it rather than\n// before. Applied to the boxes the gesture measured when it started, where XAML\n// re-measures containers it has already shifted and needs a hysteresis term to\n// keep them from oscillating under a still pointer. A frozen layout cannot\n// oscillate, so that term has nothing to do here.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/dxaml/xcp/components/moco/lib/StackingLayoutStrategyImpl.cpp#L356-L364\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/dxaml/xcp/components/livereorderhelper/lib/LiveReorderHelper.cpp#L79-L102\nconst insertionPosition = (items: readonly ItemBox[], y: number): number => {\n for (const [position, item] of items.entries()) {\n if (y < item.top) return position;\n if (y < item.top + item.height) return y - item.top >= item.height / 2 ? position + 1 : position;\n }\n return items.length;\n};\n\nconst positionOf = (items: readonly ItemBox[], index: number) => items.findIndex(item => item.index === index);\n\n// An insertion point sits between items and an index names one, so the two\n// differ by one for every insertion past the item being moved -- removing it\n// closes its own place up.\nconst indexUnderPointer = (items: readonly ItemBox[], from: number, y: number): number => {\n const insertion = insertionPosition(items, y);\n return items[insertion > positionOf(items, from) ? insertion - 1 : insertion].index;\n};\n\n/**\n * How far each item has to travel for the move to read as done, laid out from\n * the boxes the gesture measured. Stacking the heights rather than shifting\n * every displaced item by the moved item's own height is what keeps a list of\n * unequal rows -- an expanded alias target beside a collapsed one -- landing on\n * its slots rather than near them.\n */\nconst slotOffsets = (items: readonly ItemBox[], from: number, to: number): Map<number, number> => {\n const reordered = moveItem(items, positionOf(items, from), positionOf(items, to));\n // These lists space their items evenly or not at all, so one reading stands\n // for every gap; a list that spaced them apart would need one per slot.\n const gap = items.length > 1 ? items[1].top - (items[0].top + items[0].height) : 0;\n const offsets = new Map<number, number>();\n let cursor = items[0].top;\n for (const item of reordered) {\n offsets.set(item.index, cursor - item.top);\n cursor += item.height + gap;\n }\n return offsets;\n};\n\nconst measure = (handle: HTMLElement, from: number, pointerId: number, originY: number): Gesture => {\n const list = handle.closest<HTMLElement>(`[${LIST_ATTRIBUTE}]`);\n // Both halves are rendered by the same call site from the same hook, so\n // neither absence is a list that cannot be dragged: it is the contract having\n // come apart, which a quiet return would leave as a handle that does nothing.\n if (!list) throw new Error('A reorder handle was rendered outside the list its gesture reorders.');\n const listTop = list.getBoundingClientRect().top;\n const items = [...list.querySelectorAll<HTMLElement>(`[${ITEM_ATTRIBUTE}]`)]\n // A list nested in another list's item would otherwise contribute its own\n // items to the outer measurement.\n .filter(element => element.closest(`[${LIST_ATTRIBUTE}]`) === list)\n .map(element => {\n const box = element.getBoundingClientRect();\n return { index: Number(element.getAttribute(ITEM_ATTRIBUTE)), top: box.top - listTop, height: box.height };\n });\n if (positionOf(items, from) === -1) {\n throw new Error(`A reorder handle for index ${from} found no item carrying that index.`);\n }\n return { from, items, list, originY, pointerId };\n};\n\n// Clamped where it is painted rather than where it is accumulated, so a drag\n// that overshoots an end and comes back picks the row up from the pointer\n// instead of from wherever the clamp had parked it -- the rule the Switch drag\n// follows.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/dxaml/xcp/dxaml/lib/ToggleSwitch_Partial.cpp#L452-L458\nconst paint = (gesture: Gesture, travel: number) => {\n const items = gesture.items;\n const grabbed = items[positionOf(items, gesture.from)];\n const last = items[items.length - 1];\n const lowest = items[0].top - grabbed.top;\n const highest = last.top + last.height - (grabbed.top + grabbed.height);\n gesture.list.style.setProperty(DRAG_Y, `${Math.min(Math.max(travel, lowest), highest)}px`);\n};\n\nexport interface ReorderHandleProps {\n [HANDLE_ATTRIBUTE]: string;\n disabled: boolean;\n disabledFocusable: boolean;\n onPointerDown: (event: ReactPointerEvent<HTMLElement>) => void;\n}\n\n// XAML's reorder chord: Alt and Shift, and explicitly not Control.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/dxaml/xcp/dxaml/lib/ListViewBaseItem_Partial.cpp#L2100-L2104\nconst REORDER_CHORD = 'Alt+Shift';\nconst isReorderChord = (event: ReactKeyboardEvent) => event.altKey && event.shiftKey && !event.ctrlKey;\n\n// The grips of one list, in the order they are drawn, skipping those that have\n// left the tab order. A grip the list has made unavailable but kept focusable\n// stays reachable, so an operator mid-write is not stranded on it.\nconst siblingHandles = (handle: HTMLElement): HTMLElement[] => {\n const list = handle.closest<HTMLElement>(`[${LIST_ATTRIBUTE}]`);\n if (!list) throw new Error('A reorder handle was rendered outside the list its gesture reorders.');\n return [...list.querySelectorAll<HTMLElement>(`[${HANDLE_ATTRIBUTE}]`)]\n .filter(element => element.closest(`[${LIST_ATTRIBUTE}]`) === list && !element.hasAttribute('disabled'));\n};\n\n/**\n * Drag-to-position reordering for a list the caller renders.\n *\n * The caller spreads `listProps` on the element that holds the items,\n * `itemProps` on each item and `handleProps` on the grip, and keeps rendering\n * in its own order throughout. A gesture moves the rows with transforms,\n * starts `onDrop` at release when the caller has a write to perform, and keeps\n * the preview in place until both that write and the settle animation finish.\n * `onReorder` then commits the rendered order without another visible move.\n * `position` gives an item's previewed rank, for a list that shows one.\n */\nexport function useReorderList({ busy = false, disabled = false, length, onDrop, onDropError, onReorder }: {\n /**\n * The list's own write is in flight. The grip reads as unavailable but keeps\n * focus, so a keyboard move does not throw the operator back to the document\n * between steps -- the same line `TooltipIconButton` draws.\n */\n busy?: boolean;\n disabled?: boolean;\n length: number;\n /** Starts an asynchronous write as soon as the pointer is released. */\n onDrop?: (from: number, to: number) => Promise<void>;\n /** Runs after the visual preview has rolled back from a rejected write. */\n onDropError?: (error: unknown, from: number, to: number) => void | Promise<void>;\n onReorder: (from: number, to: number) => void;\n}) {\n const styles = useStyles();\n const gestureRef = useRef<Gesture | null>(null);\n const settleRef = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const mountedRef = useRef(true);\n const [preview, setPreview] = useState<Preview | null>(null);\n // A handle is dead while the list is locked, and a list of one has nowhere to\n // move its item to.\n const locked = busy || disabled || length < 2;\n // The list can be replaced under a gesture -- these pages poll -- and an index\n // the new list does not have would move the wrong row.\n const live = preview !== null && preview.from < length && preview.to < length ? preview : null;\n\n useEffect(() => {\n mountedRef.current = true;\n return () => {\n mountedRef.current = false;\n clearTimeout(settleRef.current);\n };\n }, []);\n\n const offsets = useMemo(() => live && slotOffsets(live.items, live.from, live.to), [live]);\n const ranks = useMemo(\n () => live && moveItem(Array.from({ length }, (_, index) => index), live.from, live.to),\n [length, live],\n );\n\n const end = () => {\n const gesture = gestureRef.current;\n gestureRef.current = null;\n gesture?.list.removeAttribute(REORDERING_ATTRIBUTE);\n gesture?.list.style.removeProperty(DRAG_Y);\n setPreview(null);\n };\n\n // Escape has to be heard wherever focus is and a lost window has to be heard\n // at all, so the whole gesture is read from one owner rather than split\n // between the grip and the document.\n const dragging = live !== null && !live.settling;\n useEffect(() => {\n if (!dragging) return;\n // Read against the list rather than against the viewport, so a page that\n // scrolls mid-gesture moves the boxes and the pointer together.\n const indexAt = (gesture: Gesture, event: PointerEvent) =>\n indexUnderPointer(gesture.items, gesture.from, event.clientY - gesture.list.getBoundingClientRect().top);\n\n const onMove = (event: PointerEvent) => {\n const gesture = gestureRef.current;\n if (!gesture || event.pointerId !== gesture.pointerId) return;\n paint(gesture, event.clientY - gesture.originY);\n const to = indexAt(gesture, event);\n setPreview(current => current?.to === to ? current : { from: gesture.from, items: gesture.items, settling: false, to });\n };\n\n const onUp = (event: PointerEvent) => {\n const gesture = gestureRef.current;\n if (!gesture || event.pointerId !== gesture.pointerId) return;\n const to = indexAt(gesture, event);\n // The row leaves the pointer and travels the rest of the way to its slot.\n // Dropping the drag attribute and writing the destination in one style\n // recalculation is what makes that a transition rather than a jump: the\n // row takes the duration the class it gains in the same commit declares.\n gesture.list.removeAttribute(REORDERING_ATTRIBUTE);\n gesture.list.style.setProperty(DRAG_Y, `${slotOffsets(gesture.items, gesture.from, to).get(gesture.from) ?? 0}px`);\n setPreview({ from: gesture.from, items: gesture.items, settling: true, to });\n clearTimeout(settleRef.current);\n if (to === gesture.from || onDrop === undefined) {\n settleRef.current = setTimeout(() => {\n if (to !== gesture.from) onReorder(gesture.from, to);\n end();\n }, REPOSITION_ANIMATION_MS);\n return;\n }\n\n let write: Promise<void>;\n try {\n write = onDrop(gesture.from, to);\n } catch (error) {\n write = Promise.reject(error);\n }\n const outcome = write.then<DropOutcome, DropOutcome>(\n () => ({ ok: true }),\n error => ({ ok: false, error }),\n );\n settleRef.current = setTimeout(() => {\n void outcome.then(async result => {\n if (!mountedRef.current) return;\n if (!result.ok) {\n end();\n await onDropError?.(result.error, gesture.from, to);\n return;\n }\n if (to !== gesture.from) onReorder(gesture.from, to);\n end();\n });\n }, REPOSITION_ANIMATION_MS);\n };\n\n const onCancel = (event: PointerEvent) => {\n if (event.pointerId === gestureRef.current?.pointerId) end();\n };\n // Abandoning leaves the list as it was, which is what the preview being a\n // transform rather than a committed move buys. A release outside the window\n // reports nothing at all, so losing the window abandons on the same terms.\n const onKey = (event: KeyboardEvent) => {\n if (event.key !== 'Escape') return;\n event.preventDefault();\n end();\n };\n\n window.addEventListener('pointermove', onMove);\n window.addEventListener('pointerup', onUp);\n window.addEventListener('pointercancel', onCancel);\n window.addEventListener('keydown', onKey);\n window.addEventListener('blur', end);\n return () => {\n window.removeEventListener('pointermove', onMove);\n window.removeEventListener('pointerup', onUp);\n window.removeEventListener('pointercancel', onCancel);\n window.removeEventListener('keydown', onKey);\n window.removeEventListener('blur', end);\n };\n }, [dragging, onDrop, onDropError, onReorder]);\n\n // An index outside the list is a caller stating that this row has no place in\n // the order -- the rows an access list leaves out of its cap -- so its grip\n // reads as the others do and does nothing.\n const handleProps = (index: number): ReorderHandleProps => {\n const inert = locked || index < 0 || index >= length;\n // A settling preview already blocks every gesture and key path. Keeping the\n // native button visually enabled avoids a one-frame disabled-colour pulse\n // when a fast write begins and ends under that preview.\n const visiblyInert = inert && live === null;\n return {\n // Everything but the list's own write in flight is the grip being made\n // unavailable from outside, which leaves the tab order.\n disabled: visiblyInert && !busy,\n disabledFocusable: visiblyInert && busy,\n [HANDLE_ATTRIBUTE]: '',\n onPointerDown: event => {\n if (inert || live || !event.isPrimary || event.button !== 0) return;\n const gesture = measure(event.currentTarget, index, event.pointerId, event.clientY);\n gestureRef.current = gesture;\n gesture.list.setAttribute(REORDERING_ATTRIBUTE, '');\n paint(gesture, 0);\n setPreview({ from: index, items: gesture.items, settling: false, to: index });\n },\n };\n };\n\n /** Where the item currently reads as sitting, which a gesture moves ahead of the commit. */\n const position = (index: number) => ranks?.indexOf(index) ?? index;\n\n // Read at the list rather than at the grip. Fluent hands a native button none\n // of its onKeyDown once the button is disabledFocusable, which is the state a\n // list holds its grips in while its own write is in flight -- exactly when an\n // operator is most likely to be pressing a key. The event still bubbles here.\n // https://github.com/microsoft/fluentui/blob/4aa1084999a8c1ac7245724ad6c76210fe80acf6/packages/react-components/react-aria/library/src/button/useARIAButtonProps.ts#L86\n const onKeyDown = (event: ReactKeyboardEvent<HTMLElement>) => {\n const step = event.key === 'ArrowUp' ? -1 : event.key === 'ArrowDown' ? 1 : 0;\n if (step === 0 || live) return;\n // Only a key pressed on a grip: the rows carry comboboxes and switches of\n // their own, whose arrows are theirs.\n const handle = (event.target as Element).closest<HTMLElement>(`[${HANDLE_ATTRIBUTE}]`);\n if (!handle) return;\n\n // The bare arrows travel between the grips, as they travel between the\n // items of a ListView, and the reorder is the chord that leaves them to it.\n // Travel is not gated on the list being writable: an operator whose last\n // move is still in flight keeps their bearings.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/dxaml/xcp/dxaml/lib/ListViewBaseItem_Partial.cpp#L2096-L2131\n if (!isReorderChord(event)) {\n if (event.ctrlKey || event.altKey || event.shiftKey || event.metaKey) return;\n const handles = siblingHandles(handle);\n const next = handles[handles.indexOf(handle) + step];\n if (!next) return;\n event.preventDefault();\n next.focus();\n return;\n }\n\n const index = Number(handle.closest(`[${ITEM_ATTRIBUTE}]`)?.getAttribute(ITEM_ATTRIBUTE) ?? -1);\n const to = index + step;\n if (locked || index < 0 || index >= length || to < 0 || to >= length) return;\n event.preventDefault();\n onReorder(index, to);\n };\n\n return {\n handleProps,\n itemProps: (index: number, className?: string) => {\n const grabbed = live?.from === index;\n const rank = live ? position(index) : index;\n return {\n [ITEM_ATTRIBUTE]: String(index),\n [EDGE_ATTRIBUTE]: !live ? undefined : rank === 0 ? 'first' : rank === length - 1 ? 'last' : undefined,\n className: mergeClasses(\n grabbed && styles.lifted,\n // The row under the pointer is not travelling toward anything -- it is\n // where the pointer put it -- so it wears the drag opacity flat, and\n // only the settle that follows the drop animates it away again.\n grabbed && (live.settling ? styles.settling : styles.grabbed),\n !!live && !grabbed && styles.travelling,\n className,\n ),\n style: !live ? undefined : grabbed ? TRACKING_TRANSFORM : { transform: `translateY(${offsets?.get(index) ?? 0}px)` },\n };\n },\n listProps: (className?: string) => ({ [LIST_ATTRIBUTE]: '', className: mergeClasses(styles.list, className), onKeyDown }),\n position,\n };\n}\n\nexport type ReorderList = ReturnType<typeof useReorderList>;\n\nexport function ReorderHandle({ label, ...gesture }: ReorderHandleProps & { label: string }) {\n const styles = useStyles();\n return <Button\n appearance=\"subtle\"\n // The grip is the only affordance left, so the chord that does the same\n // job has to announce itself from it.\n aria-keyshortcuts={`${REORDER_CHORD}+ArrowUp ${REORDER_CHORD}+ArrowDown`}\n aria-label={label}\n className={styles.handle}\n icon={<ReOrderDotsVerticalRegular />}\n size=\"small\"\n {...gesture}\n />;\n}\n", "import { AddRegular, ArrowClockwiseRegular } from '@fluentui/react-icons';\nimport type { CSSProperties, ReactElement, ReactNode } from 'react';\n\nimport { EmptyStateLine } from './empty-state';\nimport { Panel, type PanelProps } from './panel';\nimport { fluentComponents } from '../../fluent';\n\nconst { Button, Spinner, Tooltip, makeStyles, mergeClasses } = fluentComponents;\n\n// Scoped to this panel rather than the table layer: here the table is the\n// card's only content and reaches its edges, so it carries the inset itself.\n//\n// Height rather than a minimum because a table row ignores min-height, and\n// height is already the minimum there.\n// https://drafts.csswg.org/css-tables-3/#row-layout\nconst DEFAULT_ROW_HEIGHT = '44px';\nconst ROW_HEIGHT = '--fwt-resource-row-height';\nconst EDGE_INSET = 'var(--fwt-panel-inset)';\n\nconst useStyles = makeStyles({\n table: {\n '& .fui-TableRow': { height: `var(${ROW_HEIGHT})` },\n // By type rather than by position: a DataGrid row carries Tabster's focus\n // dummies, `i` elements outside layout that an unrestricted\n // first-of-type/last-of-type would land on instead.\n '& .fui-TableRow > :is(th, td, div):first-of-type': { paddingInlineStart: EDGE_INSET },\n '& .fui-TableRow > :is(th, td, div):last-of-type': { paddingInlineEnd: EDGE_INSET },\n // Fluent fixes the selection column at 44 and styles it apart from an\n // ordinary cell, so it never took the trailing padding either.\n '& .fui-TableSelectionCell': {\n maxWidth: `calc(${EDGE_INSET} + 20px + var(--spacingHorizontalS))`,\n minWidth: `calc(${EDGE_INSET} + 20px + var(--spacingHorizontalS))`,\n paddingInlineEnd: 'var(--spacingHorizontalS)',\n width: `calc(${EDGE_INSET} + 20px + var(--spacingHorizontalS))`,\n },\n // The last row's edge and the card's own would otherwise stack into one\n // heavier line a pixel above the corner; the narrow-width list that stands\n // in for a table draws the same separator.\n '& :is(.fui-TableBody:not([data-reordering]) .fui-TableRow, .fui-List > .fui-ListItem):last-child': {\n borderBottomStyle: 'none',\n },\n // A reorder gesture moves the rows without moving the markup, so the row\n // against the card's edge is no longer the last one in the document. The\n // two selectors are mutually exclusive rather than one overriding the\n // other, which leaves nothing for the atom order to decide.\n '& .fui-TableBody[data-reordering] .fui-TableRow[data-reorder-edge=\"last\"]': {\n borderBottomStyle: 'none',\n },\n },\n emptyState: { padding: EDGE_INSET },\n});\n\nexport function ResourceListPanel({ className, rowHeight = DEFAULT_ROW_HEIGHT, style, ...props }: PanelProps & { rowHeight?: string }) {\n const styles = useStyles();\n return (\n <Panel\n {...props}\n className={mergeClasses('grid min-w-0 !gap-0 overflow-hidden', styles.table, className)}\n padding=\"flush\"\n style={{ ...style, [ROW_HEIGHT]: rowHeight } as CSSProperties}\n />\n );\n}\n\ntype ResourceListActionsProps = {\n appearance?: 'subtle';\n createDisabled?: boolean;\n disabled?: boolean;\n onRefresh: () => void;\n refreshLabel: string;\n refreshing?: boolean;\n} & (\n | { createLabel: string; createTrailingIcon?: never; onCreate: () => void; createTrigger?: never }\n | { createLabel: string; createTrailingIcon?: ReactNode; createTrigger: (button: ReactElement) => ReactNode; onCreate?: never }\n | { createLabel?: never; createTrailingIcon?: never; onCreate?: never; createTrigger?: never }\n);\n\n// A refresh in flight leaves the control focusable while it reads disabled, so\n// a keyboard is not thrown back to the document mid-action. `disabled` gates\n// the whole group; `createDisabled` gates only the create button, so a page\n// whose data failed to load can withhold create and still offer the refresh\n// that recovers from it.\nexport function ResourceListActions(props: ResourceListActionsProps) {\n const { appearance, createDisabled = false, createLabel, createTrailingIcon, disabled = false, onRefresh, refreshLabel, refreshing = false } = props;\n const busy = disabled || createDisabled || refreshing;\n const createButton = createLabel !== undefined && (\n <Button\n appearance=\"primary\"\n disabled={busy}\n icon={<AddRegular />}\n onClick={'onCreate' in props ? props.onCreate : undefined}\n >\n {createLabel}\n {createTrailingIcon}\n </Button>\n );\n\n return (\n <div aria-busy={refreshing} className=\"flex items-center gap-2 flex-none\">\n <Tooltip content={refreshLabel} relationship=\"label\">\n <Button\n appearance={appearance}\n aria-label={refreshLabel}\n disabled={disabled}\n disabledFocusable={refreshing}\n icon={refreshing ? <Spinner size=\"tiny\" /> : <ArrowClockwiseRegular />}\n onClick={onRefresh}\n />\n </Tooltip>\n {createButton && (props.createTrigger === undefined ? createButton : props.createTrigger(createButton))}\n <span aria-live=\"polite\" className=\"sr-only\">{refreshing ? `${refreshLabel}\u2026` : ''}</span>\n </div>\n );\n}\n\nexport function ResourceListEmptyState({ children }: { children: ReactNode }) {\n const styles = useStyles();\n return <EmptyStateLine className={styles.emptyState}>{children}</EmptyStateLine>;\n}\n", "import type { ComponentProps, ReactNode } from 'react';\n\nimport { fluentComponents } from '../../fluent';\n\nconst { mergeClasses } = fluentComponents;\n\n// A row's own name, whether it navigates or opens the row in place. It is not a\n// link: WinUI's HyperlinkButton is accent-foreground at rest, pointer-over and\n// pressed, and states no text decoration of its own, so a hyperlink treatment\n// would repaint the name of every row an accent it does not own.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/HyperlinkButton_themeresources.xaml#L5-L8\n//\n// The name therefore keeps the body foreground and takes its underline only\n// under the pointer, over the app's focus rect.\n//\n// Paint only. The box is the button's own business, below.\nconst rowTitleClass = 'winui-focus-rect text-fui-fg1 no-underline hover:underline';\n\n// A `button` rather than an anchor. The row it opens does have an address --\n// the upstream editor names the selected model in its search params -- but that\n// address is a position inside one editing session, and a second tab on it is a\n// second editor competing over the same record rather than a second view of\n// anything. What earns an anchor is a view a reader would want beside another.\n//\n// The leading is stated because truncation brings `overflow: hidden` with it,\n// and a button's own line box is tight enough to clip a descender. The sibling\n// cell that truncates a model id states the same step for the same reason.\n// Fluent clones a Tooltip's trigger element, so any prop this button drops --\n// the ref, the pointer and focus handlers, the aria attribute tying the two\n// together -- leaves the tooltip with nothing to open on.\ntype RowTitleTriggerProps = Omit<ComponentProps<'button'>, 'children' | 'className' | 'onClick' | 'type'>;\n\nexport function RowTitleButton({ children, onClick, ...trigger }: {\n children: ReactNode;\n onClick: () => void;\n} & RowTitleTriggerProps) {\n return <button className={mergeClasses(rowTitleClass, 'block bg-transparent border-0 cursor-pointer leading-[var(--lineHeightBase300)] min-w-0 max-w-full truncate p-0 text-fui-base300 text-left')} onClick={onClick} type=\"button\" {...trigger}>\n {children}\n </button>;\n}\n", "import { useState, type ComponentProps } from 'react';\n\nimport { Input } from './fluent-form-controls';\n\ntype InputProps = ComponentProps<typeof Input>;\n\n// Password managers overwrite any empty password-typed field on load, and the\n// opt-out attributes are advisory \u2014 each manager honours a different one. The\n// field additionally stays readOnly, which is not a fill target, until the user\n// reaches for it, re-arming on blur while still empty.\nexport function SecretInput({ onChange, revealed = false, value, ...rest }: InputProps & { revealed?: boolean }) {\n const [guardLocked, setGuardLocked] = useState(true);\n const hasValue = String(value ?? '').length > 0;\n const unlock = () => setGuardLocked(false);\n\n return <Input\n {...rest}\n autoCapitalize=\"off\"\n autoComplete=\"new-password\"\n autoCorrect=\"off\"\n data-1p-ignore=\"true\"\n data-bwignore=\"true\"\n data-form-type=\"other\"\n data-lpignore=\"true\"\n onBlur={event => {\n if (!hasValue) setGuardLocked(true);\n rest.onBlur?.(event);\n }}\n onChange={onChange}\n onFocus={event => {\n unlock();\n rest.onFocus?.(event);\n }}\n onKeyDown={event => {\n unlock();\n rest.onKeyDown?.(event);\n }}\n onPaste={event => {\n unlock();\n rest.onPaste?.(event);\n }}\n onPointerDown={event => {\n unlock();\n rest.onPointerDown?.(event);\n }}\n readOnly={rest.readOnly ?? (!rest.disabled && guardLocked && !hasValue)}\n spellCheck={false}\n type={revealed ? 'text' : 'password'}\n value={value}\n />;\n}\n", "import type { InfoButtonProps } from '@fluentui/react-components';\nimport type { ReactNode } from 'react';\n\nimport { HEADER_ROW_CLASS, TIGHT_STACK_CLASS } from './layout';\nimport { fluentComponents } from '../../fluent';\n\nconst { InfoButton, Text, mergeClasses } = fluentComponents;\n\n// Level 2 is WinUI's Subtitle (20px), level 4 its BodyStrong (14px, the WinUI\n// Gallery settings section heading); level 3's 16px is ours, as WinUI steps\n// 14 \u2192 18 \u2192 20 with nothing between Body and Subtitle.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/TextBlock_themeresources.xaml#L3-L9\n// (sizes), #L10-L18 (shared SemiBold), #L26 (BodyStrong), #L36-L38 (Subtitle)\n// https://github.com/microsoft/WinUI-Gallery/blob/f4dc3eb367f4bcecac1793829d9a221e924e5bfb/WinUIGallery/Pages/SettingsPage.xaml#L13-L17\n// The 12px secondary-foreground description is SettingsCard's:\n// https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsCard/SettingsCard.xaml#L102\n// and #L421-L424\nconst TITLE_SIZE = { 2: 500, 3: 400, 4: 300 } as const;\n\nexport function SectionHeader({ actions, description, info, level, title, titleId, truncate = false }: {\n actions?: ReactNode;\n description?: ReactNode;\n info?: InfoButtonProps['info'];\n level: 2 | 3 | 4;\n title: ReactNode;\n titleId?: string;\n truncate?: boolean;\n}) {\n // Fluent's `truncate` contributes the ellipsis alone; the clip and the single\n // line come from `wrap={false}`, so a title that trims needs both.\n const headingText = <Text\n as={(`h${level}`) as 'h2'}\n className={description === undefined ? 'm-0 min-w-0' : 'm-0'}\n id={titleId}\n size={TITLE_SIZE[level]}\n truncate={truncate}\n weight=\"semibold\"\n wrap={!truncate}\n >{title}</Text>;\n const heading = info === undefined\n ? headingText\n : <div className=\"inline-flex items-center gap-1 min-w-0\">{headingText}<InfoButton info={info} /></div>;\n\n const block = description === undefined\n ? heading\n : <div className={mergeClasses(TIGHT_STACK_CLASS, 'min-w-0')}>\n {heading}\n <Text className=\"text-fui-fg2\" size={200}>{description}</Text>\n </div>;\n\n if (actions === undefined) return block;\n return <div className={mergeClasses(HEADER_ROW_CLASS, 'gap-3')}>\n {block}\n <div className=\"flex items-center gap-2 flex-none\">{actions}</div>\n </div>;\n}\n", "import { useId, useState } from 'react';\nimport type { ReactNode } from 'react';\n\nimport { Switch } from './fluent-form-controls';\nimport { fluentComponents } from '../../fluent';\nimport { useTranslation } from '../../i18n/translation';\n\nconst { Text, makeStyles, mergeClasses, shorthands } = fluentComponents;\n\n// Metrics transcribed from the Community Toolkit's SettingsCard and\n// SettingsExpander, not microsoft-ui-xaml; brushes are resolved through the\n// WinUI vocabulary this layer already carries. Forced colours are left to the\n// user agent's own substitution, which reaches every brush the toolkit's\n// HighContrast dictionary names except box-shadow.\n// https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsCard/SettingsCard.xaml#L67-L112\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/Expander/Expander_themeresources.xaml#L52-L72\n// https://drafts.csswg.org/css-color-adjust/#forced-colors-properties\n\n// SettingsCardHeaderIconMargin 2,0,20,0. The wrapped control's inset is\n// composed from the same measures rather than restated as their sum.\n// https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsCard/SettingsCard.xaml#L106\nconst ICON_MARGIN_START = '2px';\nconst ICON_MARGIN_END = '20px';\nconst ICON_SIZE = '24px';\nconst ICON_COLUMN = `calc(${ICON_MARGIN_START} + ${ICON_SIZE} + ${ICON_MARGIN_END})`;\n\n// A Griffel selector is rooted at the class it is written on, so a slot cannot\n// reach backwards to ask whether an icon preceded it. The card asks instead and\n// passes the answer down; the variable's absence is the no-icon case.\nconst ICON_MARKER = 'data-settings-card-icon';\nconst ICON_COLUMN_VAR = 'var(--fwt-settings-icon-column, 0px)';\n\n// SettingsCardWrapThreshold 476 and SettingsCardWrapNoIconThreshold 286. The\n// toolkit's ControlSizeTrigger activates on `MinWidth <= ActualWidth <\n// MaxWidth`, so range syntax keeps the two states the disjoint pair the\n// triggers make.\n// https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsCard/SettingsCard.xaml#L110-L111\n// https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsCard/SettingsCard.xaml#L312-L345\n// https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/Triggers/src/ControlSizeTrigger.cs#L174-L175\nconst WRAPPED = '@container fwt-settings-row (width < 476px)';\nconst WRAPPED_WITH_ICON = '@container fwt-settings-row (286px <= width < 476px)';\nconst WRAPPED_NO_ICON = '@container fwt-settings-row (width < 286px)';\n\nconst useStyles = makeStyles({\n // Containment sits one level out of the row so the query measures the same\n // box the toolkit's trigger reads (this element carries no padding or\n // border), and so the wrapped state can style the row itself -- a container\n // query never styles its own container.\n // https://drafts.csswg.org/css-contain-3/#size-container\n row: {\n containerName: 'fwt-settings-row',\n containerType: 'inline-size',\n },\n // MinHeight 68, Padding 16, ControlCornerRadius, a 1px card stroke. The\n // header and header icon inherit the row's foreground, which is what lets the\n // pressed state move both from one rule.\n // https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsCard/SettingsCard.xaml#L20-L21\n //\n // The 24 before the trailing control is an inset on the text block rather\n // than a row gap: a gap would also land between the icon and the text, which\n // already states its own 20.\n card: {\n alignItems: 'center',\n backgroundColor: 'var(--winui-card-background-fill-default)',\n borderTopStyle: 'solid',\n borderRightStyle: 'solid',\n borderBottomStyle: 'solid',\n borderLeftStyle: 'solid',\n borderTopWidth: '1px',\n borderRightWidth: '1px',\n borderBottomWidth: '1px',\n borderLeftWidth: '1px',\n ...shorthands.borderColor('var(--winui-card-stroke-default)'),\n borderRadius: 'var(--winui-control-corner-radius)',\n boxSizing: 'border-box',\n color: 'var(--winui-text-fill-primary)',\n display: 'flex',\n minHeight: '68px',\n padding: '16px',\n // ContentSpacingStates opens SettingsCardVerticalHeaderContentSpacing once\n // the control is on its own line. Wrapping is stated inside the query\n // rather than at every width: a flex line breaks on what its items would\n // like to be, so an unconditional wrap would send the control down at any\n // width behind a long enough header.\n // https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsCard/SettingsCard.xaml#L109\n // https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsCard/SettingsCard.xaml#L388-L395\n [WRAPPED]: { flexWrap: 'wrap', rowGap: '8px' },\n // Wrapped, the control moves into the HEADER's column, so with the icon\n // still shown it is indented to where the header text starts.\n [WRAPPED_WITH_ICON]: {\n [`&:has(> [${ICON_MARKER}])`]: { '--fwt-settings-icon-column': ICON_COLUMN },\n },\n },\n // Only a card that does something when clicked takes the pointer ramp. The\n // fill moves over the control's duration; the toolkit leaves the border\n // instant. WinUI sets that BrushTransition up only while\n // UISettings.AnimationsEnabled is on, which the web states as\n // prefers-reduced-motion.\n // https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsCard/SettingsCard.xaml#L192-L194\n // https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsCard/SettingsCard.xaml#L206-L245\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/dxaml/xcp/core/core/elements/panel.cpp#L68-L76\n interactive: {\n cursor: 'pointer',\n transitionDuration: 'var(--winui-control-faster-animation-duration)',\n transitionProperty: 'background-color',\n '@media (prefers-reduced-motion: reduce)': { transitionDuration: '0.01ms' },\n '&:hover': {\n backgroundColor: 'var(--winui-control-fill-secondary)',\n // ControlElevationBorderBrush is a gradient with one heavier edge, and\n // Griffel will not take the shorthand beside the longhands this rule\n // needs, so its two stops are named directly. The arrangement is restated\n // per theme because the light dictionary flips the gradient (ScaleY=\"-1\")\n // and the dark one does not.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L382-L390\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/Common_themeresources_any.xaml#L186-L191\n borderTopColor: 'var(--winui-control-stroke-default)',\n borderRightColor: 'var(--winui-control-stroke-default)',\n borderBottomColor: 'var(--winui-control-stroke-secondary)',\n borderLeftColor: 'var(--winui-control-stroke-default)',\n '@media (prefers-color-scheme: dark)': {\n borderTopColor: 'var(--winui-control-stroke-secondary)',\n borderBottomColor: 'var(--winui-control-stroke-default)',\n },\n },\n // `:has` alongside each pointer state: the expander's own press lands on the\n // overlay inside the row, and a row that reacts only to a press on itself\n // would hold its rest fill while the reader is holding it down.\n '&:active, &:has(> :active)': {\n backgroundColor: 'var(--winui-control-fill-tertiary)',\n ...shorthands.borderColor('var(--winui-control-stroke-default)'),\n },\n // The system focus visual: a 2px FocusStrokeColorOuter ring with a 1px\n // FocusStrokeColorInner ring immediately inside it, around the border box\n // grown by FocusVisualMargin -3. The outline carries the outer ring and a\n // 1px spread shadow the inner one; forced colours drop the shadow and leave\n // a single repainted ring.\n //\n // SettingsCard states that -3 and the toolkit's keyed expander header\n // style, carrying no BasedOn, falls back to zero. Giving both rows the -3\n // is ours and nothing sources it.\n // https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsCard/SettingsCard.xaml#L138-L139\n // https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsExpander/SettingsExpander.xaml#L297\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/ToggleButton_themeresources.xaml#L193\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/dxaml/xcp/components/FocusRect/FocusRectManager.cpp#L718\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/dxaml/xcp/components/FocusRect/FocusRectManager.cpp#L441-L451\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/dxaml/xcp/components/DependencyObject/DependencyProperty.cpp#L22-L25\n // https://drafts.csswg.org/css-color-adjust/#forced-colors-properties\n //\n // The expander's row wears the ring for the disclosure inside it: the\n // element taking focus is a stretched overlay, and a ring on the overlay\n // would sit inside the row's own edge rather than around it.\n '&:focus-visible, &:has(> :focus-visible)': {\n boxShadow: '0 0 0 1px var(--winui-focus-stroke-inner)',\n outlineColor: 'var(--winui-focus-stroke-outer)',\n outlineOffset: '1px',\n outlineStyle: 'solid',\n outlineWidth: '2px',\n },\n },\n // HeaderPanel's own trailing margin of 24, which the wrapped states drop; the\n // auto margin stays because on an expander it holds the chevron against the\n // trailing edge.\n //\n // Wrapped, the header asks for its narrowest rather than its content width:\n // a flex line breaks on what its items would like to be, so a wide header was\n // sending the chevron down ahead of the control. Narrowest rather than zero,\n // because a zero-basis header on an icon-less row leaves the control the\n // whole line and wraps the header a word per line.\n // https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsCard/SettingsCard.xaml#L200-L204\n // https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsCard/SettingsCard.xaml#L409-L412\n text: {\n display: 'grid',\n minWidth: 0,\n marginInlineEnd: 'auto',\n paddingInlineEnd: '24px',\n [WRAPPED]: { flexBasis: 'min-content', flexGrow: 1, paddingInlineEnd: 0 },\n },\n // SettingsCardHeaderIconMaxSize 20 with SettingsCardHeaderIconMargin 2,0,20,0.\n // The glyph inherits the row's foreground because the header icon presenter\n // is one of the two the pressed state repaints.\n //\n // The 20 bounds the layout box, not the ink -- a Viewbox scales its child by\n // DesiredSize -- and that read too small here, so the 24 cut is rendered at\n // 24: Fluent's 24 cut carries about 20 units of ink where its 20 cut carries\n // about 16. The substitution is ours and nothing sources it.\n // https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsCard/SettingsCard.xaml#L103-L106\n // https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsCard/SettingsCard.xaml#L398-L402\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/dxaml/xcp/core/core/elements/Viewbox.cpp#L266-L289\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/dxaml/xcp/core/core/elements/icon.cpp#L109-L126\n icon: {\n alignItems: 'center',\n display: 'flex',\n flexGrow: 0,\n flexShrink: 0,\n flexBasis: 'auto',\n fontSize: ICON_SIZE,\n justifyContent: 'center',\n '& svg': { height: ICON_SIZE, width: ICON_SIZE },\n marginInlineEnd: ICON_MARGIN_END,\n marginInlineStart: ICON_MARGIN_START,\n width: ICON_SIZE,\n // RightWrappedNoIcon collapses the holder outright, which is the same\n // display: none the toolkit's Visibility means.\n [WRAPPED_NO_ICON]: { display: 'none' },\n },\n // The header inherits the control content size; the description is the\n // caption step in the secondary fill the pressed state paints, so it holds\n // still while the header above it drops.\n // https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsCard/SettingsCard.xaml#L424\n description: { color: 'var(--winui-text-fill-secondary)' },\n // Open, the header's bottom corners square off against the region below.\n // Opening changes nothing else: the header's Checked states repaint it in the\n // same brushes its unchecked ones do.\n // https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsExpander/SettingsExpander.xaml#L420-L501\n expanderHeader: {\n position: 'relative',\n backgroundColor: 'var(--winui-card-background-fill-default)',\n ...shorthands.borderColor('var(--winui-card-stroke-default)'),\n fontFamily: 'inherit',\n fontSize: 'inherit',\n paddingInlineEnd: '4px',\n textAlign: 'start',\n width: '100%',\n },\n // A floor under a select, whose width otherwise tracks the value it currently\n // shows, leaving a column of rows with no edge to line up on. Only a select\n // reads the variable; ./fluent-form-controls.tsx declares it.\n //\n // One component, one floor: a card and an expander are the same row, and\n // whether a row happens to be expandable says nothing about the control the\n // floor sizes. The API keys retention row is the case that settles it -- the\n // same row renders as a card or as an expander depending on its own value and\n // on whether the key exists yet, so a floor scoped to one form would move\n // that row's width for a reason unrelated to what the row says.\n //\n // It applies at every width, as SettingsCardContentMinWidth does -- the\n // narrow states give the control a line of its own, which is where the room\n // comes from. The 200 is ours, not the toolkit's 120.\n // https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsCard/SettingsCard.xaml#L146-L170\n //\n // Wrapped, the control takes the row below and starts at the icon column.\n // The order keeps an expander's chevron up on the header line: flex fills its\n // lines in order-modified order, so a 100%-wide control would otherwise carry\n // the chevron down with it.\n // https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsCard/SettingsCard.xaml#L313-L345\n // https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsCard/SettingsCard.xaml#L453-L458\n action: {\n '--fwt-select-min-width': '200px',\n // Above the disclosure's stretched target, so the control it holds keeps its\n // own clicks rather than opening the row.\n position: 'relative',\n [WRAPPED]: {\n flexBasis: `calc(100% - ${ICON_COLUMN_VAR})`,\n marginInlineStart: ICON_COLUMN_VAR,\n order: 1,\n },\n },\n expanderHeaderOpen: { borderEndStartRadius: 0, borderEndEndRadius: 0 },\n // The disclosure paints nothing and lays out nothing: it carries the row's\n // click target, stretched over the row from behind, and takes its name from\n // the header the row already renders, so the action keeps its own place in\n // the flex line and its own clicks.\n expanderDisclosure: {\n appearance: 'none',\n // The row paints the ring; see the interactive style above.\n ':focus-visible': { outline: 'none' },\n background: 'none',\n ...shorthands.borderWidth(0),\n cursor: 'pointer',\n '&:disabled': { cursor: 'not-allowed' },\n inset: 0,\n margin: 0,\n padding: 0,\n position: 'absolute',\n },\n\n // The edge shared with the header above is suppressed rather than drawn twice.\n content: {\n backgroundColor: 'var(--winui-card-background-fill-secondary)',\n borderRightStyle: 'solid',\n borderBottomStyle: 'solid',\n borderLeftStyle: 'solid',\n borderRightWidth: '1px',\n borderBottomWidth: '1px',\n borderLeftWidth: '1px',\n borderRightColor: 'var(--winui-card-stroke-default)',\n borderBottomColor: 'var(--winui-card-stroke-default)',\n borderLeftColor: 'var(--winui-card-stroke-default)',\n borderEndStartRadius: 'var(--winui-control-corner-radius)',\n borderEndEndRadius: 'var(--winui-control-corner-radius)',\n boxSizing: 'border-box',\n padding: '16px',\n },\n // A 32px square holding a 16px glyph, with no margin of its own: the square\n // is what spaces the glyph. It states no pointer states because the whole\n // header row is the button. The glyph names the primary text fill rather than\n // inheriting the row's, since ExpanderChevronForeground and its pointer-over\n // and pressed counterparts are all that same fill.\n //\n // The toolkit hangs the box beside the header card with eight more of\n // trailing margin; here it sits inside the header row, so the glyph reads\n // twelve from the edge rather than sixteen. That step in is ours.\n // https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsExpander/SettingsExpander.xaml#L15\n // https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsExpander/SettingsExpander.xaml#L540-L574\n // https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsCard/SettingsCard.xaml#L99\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/Expander/Expander_themeresources.xaml#L15-L21\n chevron: {\n alignItems: 'center',\n color: 'var(--winui-text-fill-primary)',\n display: 'flex',\n flexGrow: 0,\n flexShrink: 0,\n flexBasis: 'auto',\n height: '32px',\n justifyContent: 'center',\n // The stretched disclosure beneath this decorative box owns the click.\n pointerEvents: 'none',\n width: '32px',\n },\n // The chevron's turn is the AnimatedIcon's own, not the region's: ten frames\n // of a 4.3333s 60fps composition either way, hence symmetric while the\n // Expander's open and close stay asymmetric.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/AnimatedIcon/AnimatedVisuals/AnimatedChevronUpDownSmallVisualSource.cpp#L104\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/AnimatedIcon/AnimatedVisuals/AnimatedChevronUpDownSmallVisualSource.cpp#L352\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/AnimatedIcon/AnimatedVisuals/AnimatedChevronUpDownSmallVisualSource.cpp#L428-L440\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/AnimatedIcon/AnimatedVisuals/AnimatedChevronUpDownSmallVisualSource.cpp#L789-L796\n chevronGlyph: {\n transitionDuration: '167ms',\n transitionProperty: 'rotate',\n transitionTimingFunction: 'cubic-bezier(0.167, 0.167, 0, 1)',\n // AnimatedIcon is gated on UISettings.AnimationsEnabled and displays the\n // final frame rather than playing it, which is what carries the state.\n // https://learn.microsoft.com/en-us/windows/apps/develop/ui/controls/animated-icon\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/AnimatedIcon/AnimatedIcon.cpp#L432-L444\n '@media (prefers-reduced-motion: reduce)': { transitionDuration: '0.01ms' },\n },\n // Expander's open and close, asymmetric in duration as the source is: 333ms\n // opening, 167ms closing. CSS states one duration per property rather than\n // per direction, so each direction's values sit on the rule becoming active.\n //\n // What travels is the region's own height, a simplification of ours: WinUI\n // translates the content under a composition clip. Animating the height\n // reflows everything below for the length of the transition, and the close\n // runs on the fast-out-slow-in spline rather than WinUI's\n // cubic-bezier(1, 1, 0, 1). Nothing sources that substituted spline.\n //\n // The reduce branch departs from shipped WinUI, which keeps sliding: the\n // Expander authors its motion as a VisualState storyboard, and the animations\n // gate only reaches Transition and Dynamic storyboards. A region growing from\n // nothing to full height is motion animation by WCAG's definition, so the\n // preference is honoured here.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/Expander/Expander.xaml#L62-L90\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/dxaml/xcp/components/vsm/VisualStateManagerActuator.cpp#L590-L609\n // https://github.com/w3c/wcag/blob/900ea026b967bc306a2cdbe0c586330a508d6759/guidelines/terms/21/motion-animation.html\n contentFrame: {\n display: 'grid',\n gridTemplateRows: '0fr',\n transitionDuration: 'var(--winui-collapse-animation-duration)',\n transitionProperty: 'grid-template-rows',\n transitionTimingFunction: 'var(--winui-control-fast-out-slow-in-easing)',\n '@media (prefers-reduced-motion: reduce)': { transitionDuration: '0.01ms' },\n },\n contentFrameOpen: {\n gridTemplateRows: '1fr',\n transitionDuration: 'var(--winui-expand-animation-duration)',\n transitionTimingFunction: 'var(--winui-control-fast-out-slow-in-easing)',\n '@media (prefers-reduced-motion: reduce)': { transitionDuration: '0.01ms' },\n },\n contentClip: { minHeight: 0, overflow: 'hidden' },\n chevronOpen: {\n rotate: '180deg',\n transitionDuration: 'var(--winui-expand-animation-duration)',\n },\n // A switch in a settings row reads its own state out BEFORE the track, which\n // is the reverse of the standalone ToggleSwitch template: SettingsCard pushes\n // an implicit style into its content scope that swaps the presenters into\n // column 0 and the track into column 2, and compacts the control to MinWidth\n // 0 / Height 36. The order is structural, so it survives the row wrapping.\n // The 12 is that retemplate's gap column, spent here on the wrapper because\n // the readout sits outside the Fluent control.\n // https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsCard/SettingsCard.xaml#L140-L145\n // https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsCard/SettingsCard.xaml#L483-L492\n // https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsCard/SettingsCard.xaml#L985-L1053\n switchRow: {\n alignItems: 'center',\n columnGap: '12px',\n display: 'flex',\n height: '36px',\n justifyContent: 'flex-end',\n minWidth: 0,\n // Wrapped, this row is the one control that was packing itself against the\n // trailing edge; a stretched box would have kept it there.\n [WRAPPED]: { justifyContent: 'flex-start' },\n },\n // In the retemplate the readout is the ToggleSwitch's own OnContent and\n // OffContent, painted TextFillColorDisabled with the track. Sitting outside\n // the Fluent control, it is out of reach of that styling and states the dim\n // itself.\n // https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsCard/SettingsCard.xaml#L715-L724\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/CommonStyles/ToggleSwitch_themeresources.xaml#L7-L8\n readoutDisabled: { color: 'var(--winui-text-fill-disabled)' },\n});\n\nfunction CardText({ description, header, icon, id }: { description?: string; header: ReactNode; icon?: ReactNode; id?: string }) {\n const styles = useStyles();\n return <>\n {icon !== undefined && <span aria-hidden className={styles.icon} {...{ [ICON_MARKER]: '' }}>{icon}</span>}\n <span className={styles.text}>\n <Text block id={id}>{header}</Text>\n {description !== undefined && <Text block size={200} className={styles.description}>{description}</Text>}\n </span>\n </>;\n}\n\nexport function SettingsSwitch({ checked, disabled, label, onChange }: {\n checked: boolean;\n disabled?: boolean;\n label: string;\n onChange: (checked: boolean) => void;\n}) {\n const styles = useStyles();\n const { t } = useTranslation();\n return <span className={styles.switchRow}>\n <Text className={disabled === true ? styles.readoutDisabled : undefined}>{t(checked ? 'common.on' : 'common.off')}</Text>\n <Switch aria-label={label} checked={checked} disabled={disabled} onChange={(_, data) => onChange(data.checked)} />\n </span>;\n}\n\nexport function SettingsCard({ action, description, header, icon }: {\n action?: ReactNode;\n description?: string;\n header: ReactNode;\n icon?: ReactNode;\n}) {\n const styles = useStyles();\n return <div className={styles.row}>\n <div className={styles.card}>\n <CardText description={description} header={header} icon={icon} />\n {action !== undefined && <span className={styles.action}>{action}</span>}\n </div>\n </div>;\n}\n\n// The disclosure and the trailing control are independent: the switch can be\n// thrown without opening the row and the row can be opened without touching the\n// switch. In the toolkit that falls out of routed events, which the DOM does\n// not do on its own.\n// https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsExpander/SettingsExpander.xaml\nexport function SettingsExpander({ action, children, defaultOpen = false, description, disclosureDisabled = false, header, icon, revealOn, toggledOn }: {\n action?: ReactNode;\n children: ReactNode;\n defaultOpen?: boolean;\n description?: string;\n /** Disable the disclosure while leaving a trailing action operable. */\n disclosureDisabled?: boolean;\n header: ReactNode;\n icon?: ReactNode;\n /**\n * Whether the region currently holds something that has to be seen -- a\n * validation message that refused a submit. Rising, it opens the row.\n * Falling, it does nothing: closing the row mid-correction would take the\n * editing surface off the screen.\n */\n revealOn?: boolean;\n /**\n * The state of the switch in `action`, when there is one. It moves the\n * disclosure in both directions -- what the switch admits is what the region\n * configures -- while the row stays independently openable by hand.\n */\n toggledOn?: boolean;\n}) {\n const styles = useStyles();\n const [open, setOpen] = useState(defaultOpen);\n const [toggleWas, setToggleWas] = useState(toggledOn);\n if (toggledOn !== undefined && toggledOn !== toggleWas) {\n setToggleWas(toggledOn);\n setOpen(toggledOn);\n }\n const [revealWas, setRevealWas] = useState(revealOn);\n if (revealOn !== revealWas) {\n setRevealWas(revealOn);\n if (revealOn === true) setOpen(true);\n }\n const contentId = useId();\n const headerId = useId();\n // The toolkit nests the trailing control inside the header's own click target,\n // which HTML forbids: a button may not contain a button, and the row's action\n // slot takes whatever the caller passes -- a switch is an input, a select is a\n // button. So the disclosure is its own element beside the action rather than\n // around it, and reaches the rest of the row through a stretched overlay,\n // which leaves the action a sibling that sits above it.\n // https://html.spec.whatwg.org/multipage/form-elements.html#the-button-element\n // https://github.com/CommunityToolkit/Windows/blob/c076d3dd722e43204ffbeb16057090f8498c8166/components/SettingsControls/src/SettingsExpander/SettingsExpander.xaml\n return <div className={styles.row}>\n <div className={mergeClasses(styles.card, !disclosureDisabled && styles.interactive, styles.expanderHeader, open && styles.expanderHeaderOpen)}>\n <button\n aria-controls={contentId}\n aria-expanded={open}\n aria-labelledby={headerId}\n className={styles.expanderDisclosure}\n disabled={disclosureDisabled}\n onClick={() => setOpen(value => !value)}\n type=\"button\"\n />\n <CardText description={description} header={header} icon={icon} id={headerId} />\n {action !== undefined && <span className={styles.action}>{action}</span>}\n <span aria-hidden className={styles.chevron}>\n <svg className={mergeClasses(styles.chevronGlyph, open && styles.chevronOpen)} width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\">\n <path d=\"M3.15 5.65c.2-.2.5-.2.7 0L8 9.79l4.15-4.14a.5.5 0 0 1 .7.7l-4.5 4.5a.5.5 0 0 1-.7 0l-4.5-4.5a.5.5 0 0 1 0-.7Z\" />\n </svg>\n </span>\n </div>\n <div className={mergeClasses(styles.contentFrame, open && styles.contentFrameOpen)}>\n <div className={styles.contentClip}>\n {/* Closed, the region is inert rather than hidden: `hidden` is\n `display: none`, which takes the content out of flow in the same\n frame the row starts collapsing, leaving nothing to animate\n towards. `inert` withdraws it without touching layout. */}\n <div aria-labelledby={headerId} className={styles.content} id={contentId} inert={!open} role=\"group\">{children}</div>\n </div>\n </div>\n </div>;\n}\n", "import type { InfoButtonProps } from '@fluentui/react-components';\n\nimport { Switch } from './fluent-form-controls';\nimport { fluentComponents } from '../../fluent';\n\nconst { InfoButton } = fluentComponents;\n\n// A switch whose meaning needs a sentence. The info button sits outside the\n// Switch rather than inside its label, because a Switch injects `htmlFor` into\n// that label: a button placed there toggles the switch instead of opening its\n// own popover, which is also why `infoLabelSlot` is not usable here.\nexport function SwitchSetting({ checked, description, label, onChange }: {\n checked: boolean;\n description: InfoButtonProps['info'];\n label: string;\n onChange: (checked: boolean) => void;\n}) {\n return <span className=\"inline-flex items-center gap-1\">\n <Switch checked={checked} label={label} onChange={(_, data) => onChange(data.checked)} />\n <InfoButton info={description} />\n </span>;\n}\n", "import type { TableCellProps, TableHeaderCellProps } from '@fluentui/react-components';\nimport type { MouseEvent, ReactNode } from 'react';\n\nimport { fluentComponents } from '../../fluent';\n\nconst { TableCell, TableHeaderCell, makeStyles, mergeClasses } = fluentComponents;\n\n// Both declarations are load-bearing: a cell aligns its own text, while a\n// header cell's label sits inside a button that aligns itself.\nconst useStyles = makeStyles({\n trailing: {\n textAlign: 'right',\n '& .fui-TableHeaderCell__button': { justifyContent: 'flex-end' },\n },\n centred: {\n textAlign: 'center',\n '& .fui-TableHeaderCell__button': { justifyContent: 'center' },\n },\n});\n\nexport function TableTrailingHeader({ className, ...props }: TableHeaderCellProps) {\n const styles = useStyles();\n return <TableHeaderCell {...props} className={mergeClasses(styles.trailing, className)} />;\n}\n\nexport function TableTrailingCell({ className, ...props }: TableCellProps) {\n const styles = useStyles();\n return <TableCell {...props} className={mergeClasses(styles.trailing, className)} />;\n}\n\nexport function TableCentredHeader({ className, ...props }: TableHeaderCellProps) {\n const styles = useStyles();\n return <TableHeaderCell {...props} className={mergeClasses(styles.centred, className)} />;\n}\n\nexport function TableCentredCell({ className, ...props }: TableCellProps) {\n const styles = useStyles();\n return <TableCell {...props} className={mergeClasses(styles.centred, className)} />;\n}\n\n// A selectable `TableRow` and a `ListItem` select from their own `onClick`,\n// which a nested button reaches -- through a portal too, a menu popover being a\n// React child of its trigger. The click alone: arrow keys must keep travelling\n// for focus navigation.\nexport const stopRowSelection = { onClick: (event: MouseEvent<HTMLElement>) => event.stopPropagation() };\n\nconst ACTION_GAP = 'var(--spacingHorizontalXS)';\n\n// Fluent pins a small icon-only Button to 24px.\n// https://github.com/microsoft/fluentui/blob/c771f587c6634a356605e6d7d4658681f15d689b/packages/react-components/react-button/library/src/components/Button/useButtonStyles.styles.ts#L502-L509\nconst ACTION_BUTTON_SIZE = '24px';\n\n// Every actions column is this one budget, whatever a given row's strip holds:\n// the widest strip in the dashboard is three buttons, and the column is the\n// last in its row, so its trailing padding is the panel's inset rather than the\n// cell's own. A single number keeps the strips of two routes on the same\n// vertical, which a per-route width does not.\nexport const TABLE_ACTIONS_WIDTH = `calc(3 * ${ACTION_BUTTON_SIZE} + 2 * ${ACTION_GAP} + var(--spacingHorizontalS) + var(--fwt-panel-inset))`;\n\nexport function TableActions({ children }: { children: ReactNode }) {\n return <div className=\"flex items-center justify-end\" style={{ gap: ACTION_GAP }} {...stopRowSelection}>{children}</div>;\n}\n", "// A column states its width once, on the column, so a header cell and the body\n// cells beneath it cannot be sized apart -- the drift that a width written on\n// one row's cells invites. Fluent's Table root already lays out `fixed` at full\n// width, so a call site states neither; under that layout a column group's\n// width is the track's width and a track without one shares what the sized\n// tracks leave, which makes `null` the column that absorbs the remainder.\n// https://github.com/microsoft/fluentui/blob/c771f587c6634a356605e6d7d4658681f15d689b/packages/react-components/react-table/library/src/components/Table/useTableStyles.styles.ts#L13-L20\n// https://drafts.csswg.org/css-tables-3/#width-distribution-algorithm\nexport function TableColumns({ widths }: { widths: (string | null)[] }) {\n return <colgroup>\n {widths.map((width, index) => <col key={index} style={width === null ? undefined : { width }} />)}\n </colgroup>;\n}\n", "import type { MouseEvent, ReactElement } from 'react';\n\nimport { useDangerActionClasses } from './danger';\nimport { useRouteAddress } from './route-link';\nimport { fluentComponents } from '../../fluent';\n\nconst { Button, Tooltip, mergeClasses } = fluentComponents;\n\ninterface IconButtonProps {\n className?: string;\n danger?: boolean;\n disabled?: boolean;\n disabledFocusable?: boolean;\n icon: ReactElement;\n label: string;\n}\n\n// `disabled` is for a control made unavailable by something outside itself: it\n// emits the HTML attribute, so the control leaves the tab order and focus is\n// lost. `disabledFocusable` emits aria-disabled alone, keeping focus and tab\n// order while Fluent suppresses the click, and is what a control whose own\n// command is in flight takes \u2014 the button the operator just pressed must not\n// pull focus out from under them. XAML draws the same line with\n// FrameworkElement.AllowFocusWhenDisabled.\n// https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.frameworkelement.allowfocuswhendisabled\n//\n// `to` stands where `onClick` would for the button that opens another page. It\n// paints the same, because Fluent's own root slot is already an anchor's, and\n// it keeps Enter and Space: Fluent runs an anchor root through react-aria's\n// button props, which restore the activation an anchor does not have.\n// https://github.com/microsoft/fluentui/blob/6dee27b023a2d989f032b4adacb2135d336a67fb/packages/react-components/react-aria/library/src/button/useARIAButtonProps.ts#L84-L120\nexport function TooltipIconButton(props: IconButtonProps & (\n | { onClick: (event: MouseEvent<HTMLElement>) => void; to?: never }\n | { onClick?: never; to: string }\n)) {\n return props.to === undefined\n ? <IconButton {...props} />\n : <AddressedIconButton {...props} to={props.to} />;\n}\n\nfunction AddressedIconButton({ to, ...props }: IconButtonProps & { to: string }) {\n const address = useRouteAddress(to);\n return <IconButton {...props} {...address} />;\n}\n\nfunction IconButton({ className, danger = false, disabled = false, disabledFocusable = false, href, icon, label, onClick }: IconButtonProps & {\n href?: string;\n onClick?: (event: MouseEvent<HTMLElement>) => void;\n}) {\n const dangerClasses = useDangerActionClasses();\n const shared = {\n appearance: 'subtle',\n 'aria-label': label,\n className: mergeClasses(danger && dangerClasses.button, className),\n disabled,\n disabledFocusable,\n icon,\n onClick,\n size: 'small',\n } as const;\n return <Tooltip content={label} relationship=\"label\">\n {href === undefined ? <Button {...shared} /> : <Button {...shared} as=\"a\" href={href} />}\n </Tooltip>;\n}\n", "import { useCallback, useEffect, useRef, useState, type ReactElement, type RefCallback } from 'react';\n\nimport { fluentComponents } from '../../fluent';\n\nconst { Tooltip } = fluentComponents;\n\n// `scrollWidth` and `clientWidth` are integers, so a box whose layout lands on\n// a fraction can report scrollable overflow while every glyph is painted.\n// Measured in Chromium over ~1800 fractional widths of a flex child and of a\n// fixed-layout table cell: text that fits reports 0, and a box short of its\n// text by under 2px reports 0, 1 or 2. So this pixel is the margin kept for\n// engines whose rounding was not measured, and it forgives nothing wider than\n// a box one pixel short of its own text.\n// https://drafts.csswg.org/cssom-view/#dom-element-scrollwidth\nconst OVERFLOW_TOLERANCE_PX = 1;\n\nconst collapseWhitespace = (text: string) => text.replace(/\\s+/gu, ' ').trim();\n\n// Whether the element leaves any of `content` unread: either the box clips it,\n// or what it renders is an elision of it. Both are answered from the element,\n// so a caller cannot get the two out of step.\nconst hidesContent = (node: HTMLElement, content: string) =>\n node.scrollWidth - node.clientWidth > OVERFLOW_TOLERANCE_PX\n || collapseWhitespace(node.textContent ?? '') !== collapseWhitespace(content);\n\n/**\n * A tooltip that restores text its trigger cannot show, and stays away when the\n * trigger shows all of it \u2014 a tooltip repeating a string already in full view\n * is noise.\n *\n * `measureRef` goes on the element that clips, which is not always the element\n * the tooltip opens on: a `Chip` clips inside its text slot, a\n * `TableCellLayout` inside its `main` slot. Measuring an ancestor that does not\n * clip reports no overflow and the tooltip never appears.\n */\nexport const useTruncation = (content: string, relationship: 'description' | 'label') => {\n const [truncated, setTruncated] = useState(false);\n const [visible, setVisible] = useState(false);\n const nodeRef = useRef<HTMLElement | null>(null);\n const contentRef = useRef(content);\n\n const measure = useCallback(() => {\n const node = nodeRef.current;\n if (!node) return;\n const hides = hidesContent(node, contentRef.current);\n setTruncated(hides);\n // A trigger that grows while its tooltip is open now shows the string\n // itself, and the tooltip has become the repetition it exists to avoid.\n if (!hides) setVisible(false);\n }, []);\n\n // A resize is the element's own; a text swap that keeps the box changes no\n // size at all, and a webfont arriving after first paint re-measures every\n // glyph. None of the three is observable through the other two.\n const measureRef = useCallback<RefCallback<HTMLElement>>(node => {\n nodeRef.current = node;\n if (!node) return;\n measure();\n const resizeObserver = new ResizeObserver(measure);\n resizeObserver.observe(node);\n const mutationObserver = new MutationObserver(measure);\n mutationObserver.observe(node, { characterData: true, childList: true, subtree: true });\n return () => {\n resizeObserver.disconnect();\n mutationObserver.disconnect();\n nodeRef.current = null;\n };\n }, [measure]);\n\n useEffect(() => {\n contentRef.current = content;\n measure();\n }, [content, measure]);\n\n useEffect(() => {\n let mounted = true;\n void document.fonts.ready.then(() => {\n if (mounted) measure();\n });\n return () => {\n mounted = false;\n };\n }, [measure]);\n\n // Fluent owns the delays and the pointer and focus handling; what it asks for\n // is answered here, so a request to open on a trigger that hides nothing\n // resolves to closed. Deciding at the request keeps `visible` equal to what\n // Fluent last reported, which is what makes it report the next change.\n return {\n measureRef,\n tooltipProps: {\n content,\n relationship,\n visible,\n onVisibleChange: (_: unknown, data: { visible: boolean }) => setVisible(data.visible && truncated),\n },\n };\n};\n\nexport function TruncationTooltip({ children, content, relationship }: {\n children: (measureRef: RefCallback<HTMLElement>) => ReactElement;\n content: string;\n relationship: 'description' | 'label';\n}) {\n const { measureRef, tooltipProps } = useTruncation(content, relationship);\n return <Tooltip {...tooltipProps}>{children(measureRef)}</Tooltip>;\n}\n", "import { useCallback, useMemo, useRef, useState } from 'react';\n\nexport interface DialogInvocation<Value> {\n key: number;\n value: Value;\n}\n\n// The value is kept after `close` because an unmounted surface cannot play the\n// exit its motion declares; the monotonic key is what resets a reopened form.\nexport interface DialogControl<Value> {\n close: () => void;\n invocation: DialogInvocation<Value> | null;\n isOpen: boolean;\n open: (value: Value) => void;\n}\n\nexport const useDialogInvocation = <Value>(): DialogControl<Value> => {\n const nextKey = useRef(0);\n const [invocation, setInvocation] = useState<DialogInvocation<Value> | null>(null);\n const [isOpen, setIsOpen] = useState(false);\n const open = useCallback((value: Value) => {\n setInvocation({ key: nextKey.current++, value });\n setIsOpen(true);\n }, []);\n const close = useCallback(() => setIsOpen(false), []);\n return useMemo(() => ({ close, invocation, isOpen, open }), [close, invocation, isOpen, open]);\n};\n", "import { useCallback, useRef, useState } from 'react';\n\nimport { ConfirmDialog } from './confirm-dialog';\nimport { useDialogInvocation } from './use-dialog-invocation';\nimport { useTranslation } from '../../i18n/translation';\n\n/**\n * Answers every dismissal of a dialog that holds a draft. Esc, the scrim and\n * Cancel all route through `requestClose`, so none of them can be a control\n * that does nothing when pressed, and none of them can throw away an edit the\n * operator has not been asked about.\n *\n * Dirtiness is the draft against the draft this dialog opened with, not\n * react-hook-form's own `isDirty`: these forms write most of their fields\n * through `setValue`, which leaves that flag saying whatever the last caller\n * remembered to ask for. Each dialog is mounted per invocation, so the values\n * of the first render are the ones it opened with.\n */\nexport const useDiscardGuard = <T,>({ onClose, values }: { onClose: () => void; values: T }) => {\n const { t } = useTranslation();\n const prompt = useDialogInvocation<void>();\n const discarding = useRef(false);\n const [openedWith] = useState(() => JSON.stringify(values));\n const dirty = JSON.stringify(values) !== openedWith;\n\n const requestClose = useCallback(() => {\n if (dirty) prompt.open(); else onClose();\n }, [dirty, onClose, prompt]);\n\n // Closing the guarded dialog in the same commit that closes this one would\n // unmount the surface mid-exit, so the discard is done from the exit.\n const discardConfirmation = prompt.invocation && <ConfirmDialog\n actionLabel={t('common.discard.discard')}\n cancelLabel={t('common.discard.keep')}\n key={prompt.invocation.key}\n message={t('common.discard.message')}\n onConfirm={() => { discarding.current = true; prompt.close(); }}\n onExited={() => {\n if (!discarding.current) return;\n discarding.current = false;\n onClose();\n }}\n onOpenChange={open => { if (!open) prompt.close(); }}\n open={prompt.isOpen}\n title={t('common.discard.title')}\n />;\n\n return { discardConfirmation, requestClose };\n};\n", "import { NavigationRegular } from '@fluentui/react-icons';\nimport { useLayoutEffect, useRef, useState } from 'react';\nimport type { ReactNode } from 'react';\n\nimport { SCROLLPORT_FILL_CLASS } from '../components/ui/layout';\nimport { OutcomeToastProvider } from '../components/ui/outcome-toast';\nimport { ScrollArea } from '../components/ui/scroll-area';\nimport { fluentComponents } from '../fluent';\nimport { prefersReducedMotion } from '../lib/reduced-motion';\nimport { PAGE_ENTER_EASING, PAGE_ENTER_MS, PAGE_ENTER_OFFSET_PX } from '../winui/motion';\nimport { pageFrameClassName, usePageFrames } from './page-frames';\n\nconst { Button, DrawerBody, OverlayDrawer } = fluentComponents;\n\n// Floway's dashboard layout without the dashboard: a docked navigation pane\n// beside the page, folding at 900px into a header bar whose button opens the\n// pane in a light-dismiss drawer; the page scrolls on its own and changes with\n// the WinUI page transition.\n// https://github.com/Menci/Floway/blob/fee9533cc3ed5cba8028e53e53ca13d2e64d91af/apps/web/src/routes/dashboard.tsx\n\nconst MAIN_ID = 'fwt-main';\n\nexport interface AppShellLabels {\n /** The skip link that jumps past the navigation. */\n skipToContent: string;\n /** The header button that opens the navigation drawer. */\n openNavigation: string;\n /** Accessible name of the navigation drawer. */\n navigation: string;\n}\n\nexport interface AppShellProps {\n /**\n * Renders the navigation pane, usually a `NavigationPane`. It is rendered\n * twice: docked, and in the narrow-layout drawer, where `onNavigate` is set so\n * the pane can close the drawer and show its close button.\n */\n navigation: (props: { onNavigate?: () => void }) => ReactNode;\n /** Content of the narrow-layout header bar after the menu button, e.g. the logo. */\n narrowHeader?: ReactNode;\n /** Trailing content of the narrow-layout header bar, e.g. a language picker. */\n narrowHeaderActions?: ReactNode;\n labels: AppShellLabels;\n /** Names the current page. A change plays the page transition; keep it stable across query-string rewrites. */\n pageKey: string;\n /** A workspace page fills the viewport height instead of growing with its content. */\n workspace?: boolean;\n children: ReactNode;\n}\n\nexport function AppShell({ children, labels, narrowHeader, narrowHeaderActions, navigation, pageKey, workspace = false }: AppShellProps) {\n const [navigationOpen, setNavigationOpen] = useState(false);\n // The entrance is started on the element, not declared in the sheet;\n // ../winui/page-transition.css.ts says why.\n const firstFrameRef = useRef<HTMLDivElement>(null);\n const entranceStarted = useRef(false);\n useLayoutEffect(() => {\n // StrictMode double-invokes layout effects in development; a second\n // animation would start from an offset the first has already left.\n if (entranceStarted.current) return;\n if (prefersReducedMotion()) return;\n const frame = firstFrameRef.current;\n if (!frame) return;\n entranceStarted.current = true;\n // A pending animation applies no fill, so the class holds the frame at its\n // first key frame -- in this same synchronous block, so nothing paints\n // between.\n frame.classList.add('fwt-page-entrance');\n frame.animate(\n [{ translate: `0 ${PAGE_ENTER_OFFSET_PX}px` }, { translate: 'none' }],\n { duration: PAGE_ENTER_MS, easing: PAGE_ENTER_EASING, fill: 'forwards' },\n );\n }, []);\n\n // The scroller belongs to the page, not the shell, so a held page keeps its\n // own scroll position while it leaves.\n const page = <ScrollArea\n axes=\"vertical\"\n className=\"h-full min-h-0\"\n contentClassName={workspace ? 'h-full' : 'min-h-full'}\n noTabIndex\n >\n <div className={`${workspace ? SCROLLPORT_FILL_CLASS : ''} p-[22px_var(--fwt-page-inset)_var(--fwt-page-inset)] max-[680px]:p-4`}>{children}</div>\n </ScrollArea>;\n const frames = usePageFrames(page, pageKey);\n\n return (\n <OutcomeToastProvider>\n <a\n className=\"fixed left-3 top-3 z-[100000] -translate-y-20 rounded-md bg-fui-bg1 px-3 py-2 text-fui-fg1 shadow-lg focus:translate-y-0\"\n href={`#${MAIN_ID}`}\n >\n {labels.skipToContent}\n </a>\n <div className=\"grid grid-cols-[clamp(240px,18vw,290px)_minmax(0,1fr)] grid-rows-[minmax(0,1fr)] h-[100dvh] min-h-0 max-[900px]:grid-cols-1 max-[900px]:grid-rows-[58px_minmax(0,1fr)]\">\n <div className=\"min-h-0 max-[900px]:hidden\">\n {navigation({})}\n </div>\n <header className=\"hidden max-[900px]:flex items-center gap-3 border-b border-b-solid border-fui-divider px-4\">\n <Button\n appearance=\"subtle\"\n aria-label={labels.openNavigation}\n icon={<NavigationRegular />}\n onClick={() => setNavigationOpen(true)}\n />\n {narrowHeader}\n {narrowHeaderActions !== undefined && <div className=\"ml-auto flex items-center gap-2\">{narrowHeaderActions}</div>}\n </header>\n <div className=\"grid grid-cols-[minmax(0,1fr)] grid-rows-[minmax(0,1fr)] min-h-0\">\n {frames.map(frame => <div\n aria-hidden={frame.leaving || undefined}\n className={`col-start-1 row-start-1 min-h-0 ${pageFrameClassName(frame)}`}\n id={frame.leaving ? undefined : MAIN_ID}\n role={frame.leaving ? undefined : 'main'}\n inert={frame.leaving}\n key={frame.id}\n onAnimationEnd={frame.onAnimationEnd}\n ref={frame.id === 0 && !frame.leaving ? firstFrameRef : undefined}\n tabIndex={frame.leaving ? undefined : -1}\n >{frame.node}</div>)}\n </div>\n </div>\n <OverlayDrawer\n aria-label={labels.navigation}\n backdrop={{ className: 'fwt-drawer-light-dismiss' }}\n onOpenChange={(_, data) => setNavigationOpen(data.open)}\n open={navigationOpen}\n position=\"start\"\n >\n <DrawerBody className=\"!p-0\">\n {navigation({ onNavigate: () => setNavigationOpen(false) })}\n </DrawerBody>\n </OverlayDrawer>\n </OutcomeToastProvider>\n );\n}\n", "import { useState } from 'react';\nimport type { AnimationEventHandler, ReactNode } from 'react';\n\nimport { PAGE_LEAVE_ANIMATION } from '../winui/page-transition.css';\n\n// Floway's page frames, without the router. Floway decides what counts as a page\n// change from react-router's location and history entry, and freezes the router\n// contexts so a leaving page keeps its loader data:\n// https://github.com/Menci/Floway/blob/fee9533cc3ed5cba8028e53e53ca13d2e64d91af/apps/web/src/components/page-frames.tsx\n// Here the host names the page with `pageKey`, which moves only on a page\n// change -- never on a rewrite of the same page's query string -- and, if the\n// leaving page reads context that the navigation has already replaced, wraps\n// each page with what it needs to keep rendering.\n\nexport interface PageFrame {\n /** Stable while the page stays, new on a page change. */\n id: number;\n node: ReactNode;\n leaving: boolean;\n /**\n * Belongs on the element that carries the transition classes: the leaving\n * frame is dropped when its own leave animation ends, so its lifetime is the\n * animation's rather than a second statement of the animation's length.\n */\n onAnimationEnd: AnimationEventHandler<HTMLElement>;\n}\n\n/**\n * The frames to draw: the current page, and the page it replaced for as long as\n * that one takes to leave. Render each with `pageFrameClassName(frame)`.\n *\n * The leaving frame keeps the id it already had, so React matches it to the DOM\n * already on screen; held under a new id it would mount afresh, snap back to its\n * initial state and lose its scroll position before it fades.\n */\nexport const usePageFrames = (page: ReactNode, pageKey: string): PageFrame[] => {\n const [current, setCurrent] = useState({ id: 0, key: pageKey, node: page });\n const [leaving, setLeaving] = useState<{ id: number; node: ReactNode } | null>(null);\n\n if (current.key !== pageKey) {\n // Derived during render rather than in an effect: an effect lands a frame\n // later, and that frame would already show the new page where the old one\n // is supposed to still be.\n setLeaving({ id: current.id, node: current.node });\n setCurrent({ id: current.id + 1, key: pageKey, node: page });\n }\n\n // Dropped by the animation that fades it, not by a timer of the same length:\n // a clamped animation -- what reduced motion turns the fade into -- would\n // otherwise leave an invisible copy of the page mounted for the rest of the\n // timer. The page inside the frame animates too, so only this element's own\n // leave animation counts.\n const onAnimationEnd: AnimationEventHandler<HTMLElement> = event => {\n if (event.target !== event.currentTarget || event.animationName !== PAGE_LEAVE_ANIMATION) return;\n setLeaving(null);\n };\n\n const frames: PageFrame[] = [{ id: current.id, node: page, leaving: false, onAnimationEnd }];\n if (leaving) frames.unshift({ id: leaving.id, node: leaving.node, leaving: true, onAnimationEnd });\n return frames;\n};\n\n/** The transition class a frame carries: leaving, entering, or none for the first page. */\nexport const pageFrameClassName = (frame: PageFrame): string =>\n frame.leaving ? 'fwt-page-leaving' : frame.id > 0 ? 'fwt-page-entering' : '';\n", "import type { PropsWithChildren } from 'react';\n\nexport function GradientBackground({ children }: PropsWithChildren) {\n return <div className=\"fwt-gradient-background\">{children}</div>;\n}\n", "import type { NavItemProps } from '@fluentui/react-components';\nimport { DismissRegular } from '@fluentui/react-icons';\nimport { useRef } from 'react';\nimport type { MouseEventHandler, ReactNode } from 'react';\n\nimport { NavSelectionIndicator } from '../components/nav-selection-indicator';\nimport { useRouteAddress } from '../components/ui/route-link';\nimport { ScrollArea } from '../components/ui/scroll-area';\nimport { fluentComponents } from '../fluent';\n\nconst {\n Button,\n NavDrawer,\n NavDrawerBody,\n NavDrawerFooter,\n NavDrawerHeader,\n NavItem,\n NavSectionHeader,\n makeStyles,\n} = fluentComponents;\n\n// Floway's dashboard sidebar with the dashboard taken out: the pages, the\n// account entry and the sign-out flow arrive as data from the host.\n// https://github.com/Menci/Floway/blob/fee9533cc3ed5cba8028e53e53ca13d2e64d91af/apps/web/src/components/sidebar/nav.tsx\n\nconst useStyles = makeStyles({\n // 36px is a floor rather than a fixed height, so a two-line label lengthens\n // the row instead of being cut. The left-pane template's 40px icon column\n // plus the presenter's 4 puts the label at 44; Fluent's icon slot is 20px\n // wide, so the gap carrying the label to that 44 is 12 rather than 16.\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/NavigationView/NavigationView_themeresources.xaml#L208\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/NavigationView/NavigationView_themeresources.xaml#L217\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/NavigationView/NavigationView_themeresources.xaml#L219\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/NavigationView/NavigationView_themeresources.xaml#L251\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/NavigationView/NavigationView_themeresources.xaml#L604-L616\n // https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/NavigationView/NavigationViewItemPresenter.cpp#L286-L290\n item: {\n gap: '12px',\n minHeight: '36px',\n paddingBottom: '8px',\n paddingLeft: '12px',\n paddingRight: '14px',\n paddingTop: '8px',\n },\n});\n\n// WinUI hangs the pill off the leading edge of the presenter's content root\n// with no margin of its own.\n// https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/NavigationView/NavigationView_themeresources.xaml#L220-L222\nconst NAV_INDICATOR_INSET = 0;\n\nexport interface NavigationPaneItem {\n /** Identifies the item for selection. Usually the route it leads to. */\n value: string;\n label: ReactNode;\n icon?: NavItemProps['icon'];\n /**\n * A route to link to. Followed through `WinuiRouterProvider` when one is\n * mounted, otherwise by the browser. Omit it for an action such as signing\n * out, and handle `onSelect` instead.\n */\n href?: string;\n onSelect?: () => void;\n}\n\nexport interface NavigationPaneGroup {\n /** Section header. Omit for an unlabelled first group. */\n label?: ReactNode;\n items: NavigationPaneItem[];\n}\n\nexport interface NavigationPaneProps {\n /** Accessible name of the navigation landmark. */\n label: string;\n /** Leading header content, e.g. the product logo. */\n header?: ReactNode;\n /** Trailing header content shown when docked (not in the drawer), e.g. a language picker. */\n headerActions?: ReactNode;\n groups: NavigationPaneGroup[];\n /** Items pinned to the bottom of the pane, e.g. the account and sign-out. */\n footerItems?: NavigationPaneItem[];\n selectedValue: string;\n /** The item a navigation in flight is heading to. */\n pendingValue?: string;\n /**\n * Set when the pane sits in the narrow-layout drawer: called after an in-view\n * navigation so the drawer can close, and it shows a close button.\n */\n onNavigate?: () => void;\n /** Accessible name of the drawer's close button. */\n closeLabel?: string;\n}\n\nfunction PaneLink({ item, onNavigate, pending, href }: { item: NavigationPaneItem; onNavigate?: () => void; pending: boolean; href: string }) {\n const styles = useStyles();\n const address = useRouteAddress(href);\n const handleClick: MouseEventHandler<HTMLAnchorElement> = event => {\n const followsInThisView = event.button === 0 && !event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey;\n address.onClick(event);\n if (followsInThisView) onNavigate?.();\n };\n return <NavItem\n as=\"a\"\n className={styles.item}\n data-nav-pending={pending || undefined}\n data-nav-value={item.value}\n href={address.href}\n icon={item.icon}\n onClick={handleClick}\n value={item.value}\n >{item.label}</NavItem>;\n}\n\nfunction PaneItem({ item, onNavigate, pendingValue }: { item: NavigationPaneItem; onNavigate?: () => void; pendingValue?: string }) {\n const styles = useStyles();\n if (item.href !== undefined) {\n return <PaneLink href={item.href} item={item} onNavigate={onNavigate} pending={pendingValue === item.value} />;\n }\n return <NavItem className={styles.item} data-nav-value={item.value} icon={item.icon} value={item.value}>{item.label}</NavItem>;\n}\n\nexport function NavigationPane({\n closeLabel = 'Close navigation',\n footerItems = [],\n groups,\n header,\n headerActions,\n label,\n onNavigate,\n pendingValue,\n selectedValue,\n}: NavigationPaneProps) {\n const bodyRef = useRef<HTMLDivElement>(null);\n const footerRef = useRef<HTMLDivElement>(null);\n const allItems = [...groups.flatMap(group => group.items), ...footerItems];\n\n return <NavDrawer\n aria-label={label}\n className=\"!bg-transparent !h-full !max-w-none !w-full\"\n density=\"medium\"\n onNavItemSelect={(_, data) => {\n const item = allItems.find(candidate => candidate.value === data.value);\n if (item?.href === undefined) item?.onSelect?.();\n }}\n open\n selectedValue={selectedValue}\n surfaceMotion={null}\n type=\"inline\"\n >\n <NavDrawerHeader className=\"!bg-transparent !px-5 !py-4\">\n <div className=\"flex items-center min-h-10\">\n {header}\n {!onNavigate && headerActions !== undefined && <div className=\"ml-auto flex items-center gap-2\">{headerActions}</div>}\n {onNavigate && <Button appearance=\"subtle\" aria-label={closeLabel} className=\"!ml-auto\" icon={<DismissRegular />} onClick={onNavigate} />}\n </div>\n </NavDrawerHeader>\n <NavDrawerBody className=\"!bg-transparent overflow-hidden !p-0\">\n <ScrollArea axes=\"vertical\" className=\"h-full min-h-0\" contentClassName=\"px-[10px]\" noTabIndex>\n <div className=\"relative\" ref={bodyRef}>\n <NavSelectionIndicator containerRef={bodyRef} inset={NAV_INDICATOR_INSET} otherListIs=\"below\" selectedValue={selectedValue} />\n {groups.map((group, groupIndex) => group.items.length === 0 ? null : <div key={groupIndex}>\n {group.label !== undefined && <NavSectionHeader>{group.label}</NavSectionHeader>}\n <div className=\"grid gap-1\">\n {group.items.map(item => <PaneItem item={item} key={item.value} onNavigate={onNavigate} pendingValue={pendingValue} />)}\n </div>\n </div>)}\n </div>\n </ScrollArea>\n </NavDrawerBody>\n {/* No rule above these. NavigationView's separator for this seam is\n authored collapsed and revealed only when the menu and the footer\n compete for the pane's height, which is an overflow affordance rather\n than a grouping rule.\n https://github.com/microsoft/microsoft-ui-xaml/blob/188f602b27cdb47572b28c380e9c087b02e1ccee/controls/dev/NavigationView/NavigationView.xaml#L375 */}\n {footerItems.length > 0 && <NavDrawerFooter className=\"!bg-transparent !gap-y-1 !px-[10px] !py-3\">\n <div className=\"grid gap-y-1 relative w-full\" ref={footerRef}>\n <NavSelectionIndicator containerRef={footerRef} inset={NAV_INDICATOR_INSET} otherListIs=\"above\" selectedValue={selectedValue} />\n {footerItems.map(item => <PaneItem item={item} key={item.value} onNavigate={onNavigate} pendingValue={pendingValue} />)}\n </div>\n </NavDrawerFooter>}\n </NavDrawer>;\n}\n", "// Floway drives this from react-router's `useNavigation()`; here the host says\n// when a navigation is in flight.\n// https://github.com/Menci/Floway/blob/fee9533cc3ed5cba8028e53e53ca13d2e64d91af/apps/web/src/components/navigation-progress.tsx\nexport function NavigationProgress({ active }: { active: boolean }) {\n return <div aria-hidden=\"true\" className=\"fwt-navigation-progress\" data-active={active} />;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAOA,QAAI,QAAS,OAAO,WAAW,cAC5B,SAEA,OAAO,sBAAsB,eAAe,gBAAgB,oBAC1D,OACA,CAAC;AAAA,IAGN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,QAAIA,UAAS,SAAUC,QAAO;AAG7B,UAAI,OAAO;AACX,UAAI,WAAW;AAGf,UAAI,mBAAmB,CAAC;AAGxB,UAAIC,KAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAsBP,QAAQD,OAAM,SAASA,OAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAsBnC,6BAA6BA,OAAM,SAASA,OAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAWxD,MAAM;AAAA,UACL,QAAQ,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EACF;AACF;;;ACjLS,gBAAAQ,aAAA;AADF,SAAS,mBAAmB,EAAE,OAAO,GAAwB;AAClE,SAAO,gBAAAA,MAAC,SAAI,eAAY,QAAO,WAAU,2BAA0B,eAAa,QAAQ;AAC1F;",
6
+ "names": ["Prism", "_self", "_", "tokens", "o", "v", "i", "m", "lang", "parent", "s", "e", "j", "from", "p", "k", "highlight", "React", "slotProps", "React", "_", "React", "FluentSwitch", "React", "jsx", "createElement", "a", "b", "useEffect", "useLayoutEffect", "useRef", "useState", "jsx", "useRef", "useState", "useLayoutEffect", "useEffect", "useEffect", "useEffect", "jsx", "jsx", "h", "s", "v", "makeStyles", "useStyles", "jsx", "makeStyles", "useStyles", "ChevronDown12Regular", "createElement", "forwardRef", "createCache", "options", "update", "o", "_initialValue", "i", "_equal", "u", "_alwaysUpdateValues", "_value", "_previous", "cacheUpdateContextual", "newValue", "force", "curr", "newVal", "changed", "cacheUpdateIsolated", "getCurrentCache", "isBrowser", "window", "HTMLElement", "document", "wnd", "mathMax", "Math", "max", "mathMin", "min", "mathRound", "round", "mathAbs", "abs", "mathSign", "sign", "cAF", "cancelAnimationFrame", "rAF", "requestAnimationFrame", "setT", "setTimeout", "clearT", "clearTimeout", "getApi", "name", "MutationObserverConstructor", "IntersectionObserverConstructor", "ResizeObserverConstructor", "scrollT", "isUndefined", "obj", "isNull", "isNumber", "isString", "isBoolean", "isFunction", "isArray", "Array", "isObject", "isArrayLike", "length", "lengthCorrectFormat", "isPlainObject", "constructor", "Object", "isHTMLElement", "isElement", "Element", "animationCurrentTime", "performance", "now", "animateNumber", "from", "to", "duration", "onFrame", "easing", "animationFrameId", "timeStart", "finalDuration", "frame", "complete", "timeNow", "timeElapsed", "stopAnimation", "percent", "progress", "animationCompleted", "each", "source", "callback", "keys", "key", "inArray", "arr", "item", "indexOf", "concat", "a", "b", "push", "array", "items", "arrayIsSingleItem", "prototype", "apply", "createOrKeepArray", "value", "isEmptyArray", "deduplicateArray", "Set", "runEachAndClear", "args", "keep", "runFn", "fn", "strPaddingTop", "strPaddingRight", "strPaddingLeft", "strPaddingBottom", "strMarginLeft", "strMarginRight", "strMarginBottom", "strOverflowX", "strOverflowY", "strWidth", "strHeight", "strVisible", "strHidden", "strScroll", "capitalizeFirstLetter", "str", "finalStr", "String", "toUpperCase", "slice", "equal", "props", "propMutation", "result", "prop", "compareA", "compareB", "equalWH", "equalXY", "equalTRBL", "bind", "selfClearTimeout", "timeout", "id", "setTFn", "clearTFn", "getDebouncer", "debounceTiming", "debounceTimingResult", "schedule", "clear", "task", "timeoutId", "_debouncer", "debounce", "functionToDebounce", "_debounceTiming", "_timeout", "_maxDebounceTiming", "_maxDelay", "S", "_leading", "m", "_mergeParams", "cancelMaxTimeoutDebouncer", "cancelTimeoutDebounder", "prevArguments", "leadingInvoked", "invokeFunctionToDebounce", "this", "mergeParms", "flush", "debouncedFn", "arguments", "timeoutDebouncer", "leading", "maxDelayDebouncer", "mergeParamsResult", "invokedArgs", "boundInvoke", "undefined", "_flush", "hasOwnProperty", "call", "assignDeep", "target", "object1", "object2", "object3", "object4", "object5", "object6", "sources", "_", "copy", "copyIsArray", "src", "clone", "removeUndefinedProperties", "deep", "isEmptyObject", "noop", "capNumber", "number", "getDomTokensArray", "tokens", "split", "filter", "token", "getAttr", "elm", "attrName", "getAttribute", "hasAttr", "hasAttribute", "setAttrs", "attrNames", "setAttribute", "removeAttrs", "removeAttribute", "domTokenListAttr", "initialArr", "setElmAttr", "domTokenListOperation", "operationTokens", "operation", "initialArrSet", "join", "_remove", "removeTokens", "_add", "addTokens", "_has", "hasTokens", "tokenSet", "reduce", "boolean", "includes", "removeAttrClass", "addAttrClass", "addRemoveAttrClass", "add", "hasAttrClass", "createDomTokenListClass", "removeClass", "className", "addClass", "find", "selector", "rootElm", "querySelectorAll", "findFirst", "querySelector", "is", "matches", "isBodyElement", "contents", "childNodes", "parent", "parentElement", "closest", "getFocusedElement", "doc", "activeElement", "liesBetween", "highBoundarySelector", "deepBoundarySelector", "closestHighBoundaryElm", "closestDeepBoundaryElm", "deepBoundaryIsValid", "removeElements", "nodes", "node", "parentElm", "removeChild", "appendChildren", "children", "child", "appendChild", "trustedTypePolicy", "getTrustedTypePolicy", "setTrustedTypePolicy", "newTrustedTypePolicy", "createDiv", "classNames", "div", "createElement", "createDOM", "html", "createdDiv", "trustedTypesPolicy", "trimmedHtml", "trim", "innerHTML", "createHTML", "getCSSVal", "computedStyle", "getPropertyValue", "validFiniteNumber", "notNaN", "isFinite", "parseToZeroOrNumber", "parseFloat", "roundCssNumber", "numberToCssPx", "setStyles", "styles", "rawValue", "elmStyle", "style", "setProperty", "_unused", "getStyles", "pseudoElm", "getSingleStyle", "getStylesResult", "getComputedStyle", "topRightBottomLeft", "propertyPrefix", "propertySuffix", "finalPrefix", "finalSuffix", "top", "right", "bottom", "left", "t", "r", "l", "getTrasformTranslateValue", "isHorizontal", "x", "y", "elementHasDimensions", "offsetWidth", "offsetHeight", "getClientRects", "zeroObj", "w", "h", "getElmWidthHeightProperty", "property", "getWindowSize", "customWnd", "getOffsetSize", "getClientSize", "getScrollSize", "getFractionalSize", "cssWidth", "cssHeight", "getBoundingClientRect", "hasDimensions", "domRectHasDimensions", "rect", "domRectAppeared", "currContentRect", "prevContentRect", "rectHasDimensions", "rectHadDimensions", "removeEventListener", "eventNames", "listener", "capture", "eventName", "addEventListener", "_ref", "passive", "_passive", "_capture", "once", "_once", "nativeOptions", "map", "finalListener", "evt", "stopPropagation", "preventDefault", "stopAndPrevent", "scrollElementTo", "position", "scrollLeft", "scrollTop", "getElementScroll", "getZeroScrollCoordinates", "_start", "_end", "sanitizeScrollCoordinates", "rawScrollCoordinates", "overflowAmount", "D", "M", "sanitizeAxis", "start", "end", "amount", "newStart", "newEnd", "startAbs", "endAbs", "startX", "endX", "startY", "endY", "isDefaultDirectionScrollCoordinates", "getAxis", "getScrollCoordinatesPercent", "currentScroll", "current", "focusElement", "element", "focus", "preventScroll", "focusVisible", "manageListener", "createEventListenerHub", "initialEventListeners", "events", "Map", "removeEvent", "eventSet", "get", "currListener", "forEach", "addEvent", "nameOrEventListeners", "listenerOrPure", "set", "eventListenerKeys", "offFns", "eventListener", "triggerEvent", "event", "pluginModules", "staticPluginModuleInstances", "addPlugins", "addedPlugin", "plugin", "registerPluginModuleInstances", "staticObj", "instanceInfo", "static", "osStatic", "instance", "osInstance", "instanceObj", "instancePluginMap", "ctor", "getStaticPluginModuleInstance", "pluginModuleName", "optionsValidationPluginModuleName", "dataAttributePrefix", "classNameEnvironment", "classNameEnvironmentScrollbarHidden", "dataAttributeInitialize", "dataValueNoClipping", "dataAttributeHtmlBody", "dataAttributeHost", "dataValueHostIsHost", "dataAttributeViewport", "dataValueViewportOverflowXPrefix", "dataValueViewportOverflowYPrefix", "dataValueViewportArrange", "dataValueViewportMeasuring", "dataValueViewportScrolling", "dataValueViewportScrollbarHidden", "dataValueViewportNoContent", "dataAttributePadding", "dataAttributeContent", "classNameSizeObserver", "classNameSizeObserverAppear", "classNameSizeObserverListener", "classNameSizeObserverListenerScroll", "classNameSizeObserverListenerItem", "classNameSizeObserverListenerItemFinal", "classNameTrinsicObserver", "classNameScrollbarThemeNone", "classNameScrollbar", "classNameScrollbarRtl", "classNameScrollbarHorizontal", "classNameScrollbarVertical", "classNameScrollbarTrack", "classNameScrollbarHandle", "classNameScrollbarVisible", "classNameScrollbarCornerless", "classNameScrollbarInteraction", "classNameScrollbarUnusable", "classNameScrollbarAutoHide", "classNameScrollbarAutoHideHidden", "classNameScrollbarWheel", "classNameScrollbarTrackInteractive", "classNameScrollbarHandleInteractive", "sizeObserverPluginName", "getShowNativeOverlaidScrollbars", "checkOption", "env", "k", "_nativeScrollbarsOverlaid", "showNativeOverlaidScrollbarsOption", "showNativeOverlaidScrollbarsChanged", "x", "y", "overflowIsVisible", "overflow", "indexOf", "strVisible", "overflowBehaviorToOverflowStyle", "overflowBehavior", "replace", "overflowCssValueToOverflowStyle", "cssValue", "hasOverflow", "strScroll", "strHidden", "finalCssValue", "includes", "getElementOverflowStyle", "element", "overflowX", "overflowY", "getStyles", "strOverflowX", "strOverflowY", "scrollbarsHidingPluginName", "clickScrollPluginModuleName", "ClickScrollPlugin", "static", "moveHandleRelative", "targetOffset", "handleLength", "onClickScrollCompleted", "stopped", "stopPressAnimation", "noop", "linearScrollMs", "easedScrollMs", "setPressAnimationTimeout", "clearPressAnimationTimeout", "selfClearTimeout", "targetOffsetSign", "Math", "sign", "handleLengthWithTargetSign", "handleLengthWithTargetSignHalf", "easing", "x", "easedEndPressAnimation", "from", "to", "animateNumber", "linearPressAnimation", "linearFrom", "msFactor", "progress", "_", "completed", "stopClickAnimation", "clickAnimationProgress", "clickAnimationCompleted", "remainingScrollDistance", "continueWithPress", "remainingLinearScrollDistance", "linearBridge", "abs", "stopClick", "opsStringify", "value", "JSON", "stringify", "val", "isFunction", "getPropByPath", "obj", "path", "split", "reduce", "o", "prop", "hasOwnProperty", "defaultOptionsUpdateDebounceMutation", "defaultOptionsUpdateDebounceEvent", "defaultOptionsUpdateDebounceEnv", "defaultOptions", "paddingAbsolute", "showNativeOverlaidScrollbars", "update", "elementEvents", "debounce", "mutation", "resize", "event", "env", "attributes", "ignoreMutation", "overflow", "y", "scrollbars", "theme", "visibility", "autoHide", "autoHideDelay", "autoHideSuspend", "dragScroll", "clickScroll", "pointers", "getOptionsDiff", "currOptions", "newOptions", "diff", "optionsKeys", "concat", "keys", "each", "optionKey", "currOptionValue", "newOptionValue", "isObject", "assignDeep", "isEmptyObject", "isDiff", "isArray", "_unused", "createOptionCheck", "options", "changedOptions", "force", "undefined", "nonce", "getNonce", "setNonce", "newNonce", "environmentInstance", "createEnvironment", "getNativeScrollbarSize", "measureElm", "measureElmChild", "clear", "appendChildren", "document", "body", "cSize", "getClientSize", "oSize", "getOffsetSize", "fSize", "getFractionalSize", "removeElements", "h", "w", "getNativeScrollbarsHiding", "testElm", "result", "revertClass", "addClass", "classNameEnvironmentScrollbarHidden", "getStyles", "envStyle", "classNameEnvironment", "envDOM", "createDOM", "envElm", "envChildElm", "firstChild", "styleElm", "lastChild", "addEvent", "triggerEvent", "createEventListenerHub", "updateNativeScrollbarSizeCache", "getNativeScrollbarSizeCache", "createCache", "_initialValue", "_equal", "equalXY", "bind", "nativeScrollbarsSize", "nativeScrollbarsHiding", "nativeScrollbarsOverlaid", "staticDefaultInitialization", "elements", "host", "padding", "viewport", "target", "isBodyElement", "content", "slot", "cancel", "staticDefaultOptions", "getDefaultOptions", "getDefaultInitialization", "_nativeScrollbarsSize", "_nativeScrollbarsOverlaid", "_nativeScrollbarsHiding", "_scrollTimeline", "scrollT", "_addResizeListener", "_getDefaultInitialization", "_setDefaultInitialization", "newInitializationStrategy", "_getDefaultOptions", "_setDefaultOptions", "newDefaultOptions", "_staticDefaultInitialization", "_staticDefaultOptions", "removeAttrs", "addEventListener", "wnd", "matchMedia", "addZoomListener", "onZoom", "media", "devicePixelRatio", "_once", "updatedNativeScrollbarSize", "nativeScrollbarSizeChanged", "getEnvironment", "createEventContentChange", "callback", "eventContentChange", "destroyed", "map", "WeakMap", "destroy", "updateElements", "getElements", "eventElmList", "item", "selector", "eventNames", "find", "elm", "entries", "get", "isTargetChild", "contains", "removeListener", "delete", "set", "push", "runEachAndClear", "createDOMObserver", "isContentObserver", "isConnected", "et", "_attributes", "ct", "_styleChangingAttributes", "rt", "_eventContentChange", "it", "_nestedTargetSelector", "lt", "_ignoreTargetChange", "ut", "_ignoreContentChange", "destroyEventContentChange", "updateEventContentChangeElements", "finalAttributes", "finalStyleChangingAttributes", "observedAttributes", "observerCallback", "fromRecords", "mutations", "isEmptyArray", "ignoreTargetChange", "ignoreContentChange", "totalChangedNodes", "targetChangedAttrs", "targetStyleChanged", "contentChanged", "attributeName", "mutationTarget", "type", "oldValue", "addedNodes", "removedNodes", "isAttributesType", "isChildListType", "targetIsMutationTarget", "isAttrChange", "newValue", "getAttr", "attributeValue", "isString", "attributeChanged", "styleChangingAttrChanged", "inArray", "contentAttrChanged", "isNestedTarget", "is", "baseAssertion", "contentFinalChanged", "node", "deduplicateArray", "arr", "args", "apply", "mutationObserver", "MutationObserverConstructor", "observe", "attributeOldValue", "attributeFilter", "subtree", "childList", "characterData", "disconnect", "takeRecords", "resizeObserverBoxSupport", "createSizeObserver", "onSizeChangedCallback", "_appear", "observeAppearChange", "sizeObserverPlugin", "getStaticPluginModuleInstance", "sizeObserverPluginName", "updateResizeObserverContentRectCache", "_alwaysUpdateValues", "destroyFns", "polyfillElements", "classNameSizeObserver", "classNameSizeObserverListener", "polyfillRootElement", "polyfillTargetElement", "onSizeChangedCallbackProxy", "sizeChangedContext", "isResizeObserverCall", "skip", "appear", "resizeObserverEntry", "currContentRect", "prevContentRect", "contentRect", "hasDimensions", "domRectHasDimensions", "domRectAppeared", "_sizeChanged", "ResizeObserverConstructor", "isBoolean", "detectSupportResizeObserver", "box", "debouncedOnSizeChangedCallbackProxy", "_debounceTiming", "_maxDebounceTiming", "resizeObserverCallback", "contentBoxResizeObserver", "borderBoxResizeObserver", "pluginAppearCallback", "pluginDestroyFns", "classNameSizeObserverAppear", "createTrinsicObserver", "onTrinsicChangedCallback", "intersectionObserverInstance", "isHeightIntrinsic", "ioEntryOrSize", "isIntersecting", "intersectionRatio", "trinsicObserver", "createDiv", "classNameTrinsicObserver", "updateHeightIntrinsicCache", "triggerOnTrinsicChangedCallback", "updateValue", "heightIntrinsic", "heightIntrinsicChanged", "intersectionObserverCallback", "pop", "IntersectionObserverConstructor", "root", "onSizeChanged", "newSize", "createObserversSetup", "structureSetupElements", "structureSetupState", "getCurrentOption", "onObserversUpdated", "debounceMutation", "debounceResize", "debounceEvent", "debounceEnv", "updateContentMutationObserver", "destroyContentMutationObserver", "prevDirectionIsRTL", "hostSelector", "dataAttributeHost", "viewportSelector", "dataAttributeViewport", "baseStyleChangingAttrs", "dt", "_target", "vt", "_host", "L", "_viewport", "gt", "_scrollOffsetElement", "ht", "_content", "V", "_viewportIsTarget", "bt", "_isBody", "wt", "_viewportHasClass", "yt", "_viewportAddRemoveClass", "St", "_removeScrollObscuringStyles", "getDirectionIsRTL", "createDebouncedObservesUpdate", "currDebounceTiming", "currMaxDebounceTiming", "currDebounceLeading", "debouncedFn", "_leading", "_mergeParams", "prev", "curr", "prevObj", "currObj", "key", "fn", "updateHints", "debounceOption", "timing", "maxTiming", "leading", "isNumber", "_flush", "state", "_heightIntrinsic", "_directionIsRTL", "scrollbarsHidingPlugin", "scrollbarsHidingPluginName", "updateContentSizeCache", "equalWH", "undoViewportArrange", "_viewportArrangement", "_undoViewportArrange", "viewportIsTargetBody", "noClipping", "hasAttrClass", "dataValueNoClipping", "isArranged", "dataValueViewportArrange", "scrollOffset", "getElementScroll", "revertScrollObscuringStyles", "revertMeasuring", "dataValueViewportMeasuring", "redoViewportArrange", "viewportScroll", "getScrollSize", "fractional", "scrollElementTo", "onObserversUpdatedDebounced", "setDirection", "newDirectionIsRTL", "_directionChanged", "onTrinsicChanged", "heightIntrinsicCache", "_heightIntrinsicChanged", "updateFn", "onContentMutation", "contentChangedThroughEvent", "_contentMutation", "onHostMutation", "_hostMutation", "constructTrinsicObserver", "updateTrinsicObserver", "constructSizeObserver", "constructHostMutationObserver", "updateHostMutationObserver", "viewportIsTargetResizeObserver", "length", "destroySizeObserver", "destroyTrinsicObserver", "destroyHostMutationObserver", "removeResizeListener", "_scrollbarSizeChanged", "_checkOption", "_takeRecords", "_force", "attributesChanged", "elementEventsChanged", "debounceValue", "debounceChanged", "contentMutationObserverChanged", "ignoreMutationFromOptions", "construct", "ignore", "liesBetween", "closest", "classNameScrollbar", "isPlainObject", "hostUpdateResult", "trinsicUpdateResult", "contentUpdateResult", "resolveInitialization", "staticInitializationElement", "fallbackStaticInitializationElement", "defaultStaticInitializationElement", "staticInitializationElementValue", "staticInitialization", "isUndefined", "resolvedInitialization", "dynamicInitializationElement", "fallbackDynamicInitializationElement", "defaultDynamicInitializationElement", "dynamicInitializationElementValue", "dynamicInitialization", "isHTMLElement", "cancelInitialization", "isBody", "cancelInitializationValue", "k", "U", "K", "defaultNativeScrollbarsOverlaid", "defaultbody", "resolvedNativeScrollbarsOverlaid", "resolvedDocumentScrollingElement", "finalNativeScrollbarsOverlaid", "finalDocumentScrollingElement", "isNull", "createScrollbarsSetupElements", "scrollbarsSetupEvents", "cssCustomPropViewportPercent", "cssCustomPropScrollPercent", "cssCustomPropScrollDirection", "defaultInitScrollbars", "defaultInitScrollbarsSlot", "Tt", "_targetIsElm", "scrollbarsInit", "initScrollbarsSlot", "horizontalScrollbars", "verticalScrollbars", "evaluatedScrollbarSlot", "generalDynamicInitializationElement", "initScrollTimeline", "axis", "currAnimation", "currAnimationTransform", "timeline", "source", "cancelAnimation", "_setScrollPercentAnimation", "structure", "Dt", "_scrollCoordinates", "defaultDirectionScroll", "isDefaultDirectionScrollCoordinates", "isHorizontal", "transformArray", "getTrasformTranslateValue", "transform", "reverse", "_handle", "animate", "scrollTimeline", "getViewportPercent", "Rt", "_overflowAmount", "Vt", "_overflowEdge", "getAxisValue", "axisViewportSize", "axisOverflowAmount", "capNumber", "scrollbarStructureAddRemoveClass", "scrollbarStructures", "classNames", "add", "action", "removeClass", "scrollbarStructure", "_scrollbar", "scrollbarStyle", "elmStyle", "styles", "setStyles", "scrollbarsAddRemoveClass", "className", "onlyHorizontal", "singleAxis", "runHorizontal", "runVertical", "refreshScrollbarsHandleLength", "viewportPercent", "createScrollbarStyleFn", "axisViewportPercent", "roundCssNumber", "refreshScrollbarsHandleOffset", "scrollPercent", "getScrollCoordinatesPercent", "axisScrollPercent", "refreshScrollbarsScrollCoordinates", "axisIsDefaultDirectionScrollCoordinates", "forEach", "refreshScrollbarsScrollbarOffset", "isDefaultDirectionScroll", "styleScrollbarPosition", "Lt", "parent", "getTranslateValue", "axisIsDefaultCoordinates", "px", "numberToCssPx", "generateScrollbarDOM", "xyKey", "scrollbarClassName", "classNameScrollbarHorizontal", "classNameScrollbarVertical", "scrollbar", "track", "classNameScrollbarTrack", "handle", "classNameScrollbarHandle", "_track", "generateHorizontalScrollbarStructure", "generateVerticalScrollbarStructure", "appendElements", "_refreshScrollbarsHandleLength", "_refreshScrollbarsHandleOffset", "_refreshScrollbarsScrollCoordinates", "_refreshScrollbarsScrollbarOffset", "_scrollbarsAddRemoveClass", "_horizontal", "_scrollbarStructures", "_clone", "_style", "_vertical", "createScrollbarsSetupEvents", "scrollbarHandlePointerInteraction", "Gt", "_documentElm", "Ut", "Mt", "wheelTimeout", "clearWheelTimeout", "scrollSnapScrollTransitionTimeout", "clearScrollSnapScrollTransitionTimeout", "scrollOffsetElementScrollBy", "coordinates", "scrollBy", "behavior", "left", "top", "createInteractiveScrollEvents", "releasePointerCaptureEvents", "clientXYKey", "widthHeightKey", "strWidth", "strHeight", "leftTopKey", "whKey", "createRelativeHandleMove", "mouseDownScroll", "invertedScale", "deltaMovement", "handleTrackDiff", "scrollDeltaPercent", "scrollDelta", "pointerdownCleanupFns", "pointerDownEvent", "isDragScroll", "pointerCaptureElement", "scrollbarOptions", "dragClickScrollOption", "button", "isPrimary", "pointerType", "continuePointerDown", "includes", "instantClickScroll", "shiftKey", "getHandleRect", "getBoundingClientRect", "getTrackRect", "getHandleOffset", "handleRect", "trackRect", "axisScale", "mathRound", "pointerDownOffset", "handleCenter", "relativeTrackPointerOffset", "startOffset", "releasePointerCapture", "pointerUpEvent", "pointerupCleanupFns", "pointerId", "nonAnimatedScroll", "preventDefault", "_passive", "pointerMoveEvent", "withoutSnapScrollOffset", "withSnapScrollOffset", "snapScrollDiff", "mathAbs", "setPointerCapture", "animateClickScroll", "stopClickScrollAnimation", "wheelScrollBy", "classNameScrollbarInteraction", "focusedElement", "getFocusedElement", "hasAttr", "setT", "focusElement", "wheelEvent", "deltaX", "deltaY", "deltaMode", "classNameScrollbarWheel", "_capture", "removeClickEvent", "clickEvent", "removePointerEvents", "stopAndPrevent", "setTimeout", "createScrollbarsSetup", "observersSetupState", "onScroll", "mouseInHost", "autoHideIsMove", "autoHideIsLeave", "autoHideIsNever", "prevTheme", "instanceAutoHideSuspendScrollDestroyFn", "instanceAutoHideDelay", "hoverablePointerTypes", "isHoverablePointerType", "requestScrollAnimationFrame", "cancelScrollAnimationFrame", "autoHideInstantInteractionTimeout", "clearAutoHideInstantInteractionTimeout", "autoHideSuspendTimeout", "clearAutoHideSuspendTimeout", "auotHideTimeout", "clearAutoHideTimeout", "manageScrollbarsAutoHideInstantInteraction", "Kt", "_scrollEventElement", "Ft", "Pt", "Nt", "qt", "Bt", "manageScrollbarsAutoHide", "removeAutoHide", "delayless", "classNameScrollbarAutoHideHidden", "hide", "manageAutoHideSuspension", "classNameScrollbarAutoHide", "onHostMouseEnter", "_observersUpdateHints", "_structureUpdateHints", "tn", "_overflowEdgeChanged", "nn", "_overflowAmountChanged", "sn", "_overflowStyleChanged", "en", "_scrollCoordinatesChanged", "Ct", "ft", "B", "cn", "_overflowStyle", "j", "_hasOverflow", "showNativeOverlaidScrollbarsOption", "showNativeOverlaidScrollbarsChanged", "themeChanged", "visibilityChanged", "autoHideChanged", "autoHideSuspendChanged", "dragScrollChanged", "clickScrollChanged", "overflowChanged", "trulyAppeared", "hasOverflow", "updateScrollbars", "updateVisibility", "cantHideScrollbars", "showNativeScrollbars", "setScrollbarVisibility", "overflowBehavior", "overflowStyle", "isVisible", "strScroll", "strVisible", "classNameScrollbarVisible", "classNameScrollbarThemeNone", "classNameScrollbarHandleInteractive", "classNameScrollbarTrackInteractive", "xVisible", "yVisible", "hasCorner", "classNameScrollbarCornerless", "classNameScrollbarUnusable", "classNameScrollbarRtl", "createStructureSetupElements", "defaultInitElements", "defaultPaddingInitialization", "defaultViewportInitialization", "defaultContentInitialization", "targetIsElm", "targetStructureInitialization", "initElements", "paddingInitialization", "viewportInitialization", "contentInitialization", "targetElement", "ownerDocument", "docElement", "documentElement", "getDocumentWindow", "defaultView", "generalStaticInitializationElement", "createNewDiv", "generateViewportElement", "generateContentElement", "elementHasOverflow", "offsetSize", "scrollSize", "overflowX", "strOverflowX", "overflowY", "strOverflowY", "overflowIsVisible", "possibleViewportElement", "viewportIsTarget", "possibleContentElement", "viewportIsContent", "viewportElement", "hostElement", "paddingElement", "contentElement", "generatedElements", "elementIsGenerated", "originalNonBodyScrollOffsetElement", "scrollOffsetElement", "scrollEventElement", "evaluatedTargetObj", "_padding", "_originalScrollOffsetElement", "_windowElm", "viewportAttributeClassName", "addRemoveAttrClass", "dataValueViewportScrolling", "rn", "dataAttributeInitialize", "targetContents", "contents", "contentSlot", "docWnd", "initActiveElm", "unwrap", "prepareWrapUnwrapFocus", "activeElement", "tabIndexStr", "originalViewportTabIndex", "undoInitWrapUndwrapFocus", "setAttrs", "dataValueHostIsHost", "dataAttributePadding", "dataAttributeContent", "dataAttributeHtmlBody", "destroyActiveElm", "viewportIsGenerated", "destroyFocusElement", "undoDestroyWrapUndwrapFocus", "addAttrClass", "dataValueViewportScrollbarHidden", "createTrinsicUpdateSegment", "_observersState", "$t", "Ot", "createPaddingUpdateSegment", "updatePaddingCache", "currentPaddingCache", "equalTRBL", "topRightBottomLeft", "paddingChanged", "_t", "xt", "paddingAbsoluteChanged", "contentMutation", "paddingStyleChanged", "paddingRelative", "paddingHorizontal", "r", "l", "paddingVertical", "t", "b", "paddingStyle", "strMarginRight", "strMarginBottom", "strMarginLeft", "right", "viewportStyle", "strPaddingTop", "strPaddingRight", "strPaddingBottom", "strPaddingLeft", "_paddingAbsolute", "_viewportPaddingStyle", "_paddingStyleChanged", "createOverflowUpdateSegment", "an", "max0", "mathMax", "flowDirectionCanBeNonDefaultMap", "display", "direction", "directionStyle", "flexDirection", "flexDirectionStyle", "endsWith", "writingMode", "writingModeStyle", "flowDirectionStyleArr", "whCacheOptions", "partialXYOptions", "setMeasuringMode", "active", "getMeasuredScrollCoordinates", "flowDirectionStyles", "flowDirectionCanBeNonDefault", "some", "styleName", "styleValue", "_start", "_end", "originalScrollOffset", "removeNoContent", "dataValueViewportNoContent", "removeScrollBlock", "scrollEventScrollOffset", "isTrusted", "stopPropagation", "tmp", "rAF", "getOverflowAmount", "viewportScrollSize", "viewportClientSize", "tollerance", "amount", "getViewportOverflowStyle", "getAxisOverflowStyle", "axisBehavior", "axisHasOverflow", "perpendicularBehavior", "perpendicularOverflow", "behaviorStyle", "strHidden", "overflowBehaviorToOverflowStyle", "axisOverflowVisible", "perpendicularOverflowVisible", "nonPerpendicularOverflow", "nonOverflow", "setViewportOverflowStyle", "viewportOverflowStyle", "createAllOverflowStyleClassNames", "style", "createViewportOverflowStyleClassName", "overflowCssValueToOverflowStyle", "allOverflowStyleClassNames", "join", "updateSizeFraction", "getCurrentSizeFraction", "updateViewportScrollSizeCache", "getCurrentViewportScrollSizeCache", "updateOverflowAmountCache", "getCurrentOverflowAmountCache", "updateHasOverflowCache", "updateOverflowEdge", "getCurrentOverflowEdgeCache", "updateOverflowStyleCache", "updateFlowDirectionStyles", "currVal", "newValu", "equal", "updateMeasuredScrollCoordinates", "getCurrentMeasuredScrollCoordinates", "newVal", "getZeroScrollCoordinates", "prefix", "dataValueViewportOverflowXPrefix", "dataValueViewportOverflowYPrefix", "capitalizeFirstLetter", "Ht", "Et", "scrollbarsHidingPluginViewportArrangement", "X", "_arrangeViewport", "Y", "W", "_hideNativeScrollbars", "getShowNativeOverlaidScrollbars", "overflowXVisible", "overflowYVisible", "viewportChanged", "sizeFractionCache", "viewportScrollSizeCache", "overflowAmuntCache", "overflowEdgeCache", "J", "c", "sizeFraction", "windowInnerSize", "overflowAmountScrollSize", "g", "p", "tt", "z", "a", "overflowAmount", "overflowAmountChanged", "viewportScrollSizeChanged", "sizeFractionChanged", "hasOverflowChanged", "A", "adjustViewportStyle", "overflowEdgeChanged", "flowDirectionStylesChanged", "adjustMeasuredScrollCoordinates", "scrollCoordinatesChanged", "getElementOverflowStyle", "i", "D", "overflowStyleChanged", "R", "ot", "sanitizeScrollCoordinates", "n", "s", "updateSegments", "appendStructureElements", "updateInfo", "f", "u", "adjustScrollOffset", "doViewportArrange", "updateSegment", "e", "canceled", "createSetups", "structureSetupCanceled", "createStructureSetup", "observersSetupCreate", "observersUpdateHints", "scrollbarsSetupCreate", "scrollbarsSetupUpdate", "scrollbarsSetupElements", "updateHintsAreTruthy", "isDestroyed", "_changedOptions", "baseUpdateInfoObj", "_cloneScrollbar", "observersHints", "v", "structureHints", "changed", "cacheAndOptionsInitialized", "onUpdated", "S", "ln", "_observersSetupState", "_structureSetupState", "_structureSetupElements", "_scrollbarsSetupElements", "targetInstanceMap", "addInstance", "removeInstance", "OverlayScrollbars", "getInstance", "instanceTarget", "instancePluginModuleInstances", "validateOptions", "newOptionsWithoutUndefined", "removeUndefinedProperties", "pluginValidate", "currentOptions", "addInstanceEvent", "removeInstanceEvents", "triggerInstanceEvent", "setupsConstruct", "setupsUpdate", "setupsState", "setupsElements", "d", "directionChanged", "hostMutation", "scrollEvent", "removePluginEvents", "name", "vn", "scrollCoordinates", "start", "directionRTL", "Jt", "translateScrollbarStructure", "translateScrollbarsSetupElement", "translatedStructure", "scrollbarHorizontal", "scrollbarVertical", "plugin", "setupsCanceled", "instance", "registerPluginModuleInstances", "potentialInstance", "plugins", "pluginsToAdd", "addPlugins", "valid", "hasElmsFn", "osInstance", "scrollbarsSize", "scrollbarsOverlaid", "setDefaultInitialization", "setDefaultOptions", "trustedTypePolicy", "forwardRef", "useImperativeHandle", "useLayoutEffect", "useRef", "useSyncExternalStore", "jsx", "mergeClasses", "useSyncExternalStore", "useRef", "useLayoutEffect", "forwardRef", "ScrollArea", "useImperativeHandle", "createContext", "useCallback", "useContext", "jsx", "t", "jsx", "mergeClasses", "ChevronDown12Regular", "t", "createElement", "forwardRef", "jsx", "jsxs", "makeStyles", "useStyles", "useMemo", "import_prismjs", "Prism", "i", "import_prismjs", "Prism", "import_prismjs", "Prism", "tokens", "i", "l", "m", "import_prismjs", "Prism", "import_prismjs", "Prism", "import_prismjs", "Prism", "tokens", "Prism", "createElement", "useCallback", "useState", "createElement", "t", "useCallback", "useState", "jsx", "jsxs", "Button", "makeStyles", "mergeClasses", "useStyles", "t", "useMemo", "jsx", "jsxs", "mergeClasses", "_", "e", "DismissRegular", "Children", "jsx", "jsxs", "Button", "Children", "t", "DismissRegular", "jsx", "jsxs", "Button", "makeStyles", "mergeClasses", "useStyles", "t", "_", "makeStyles", "useStyles", "jsx", "jsxs", "mergeClasses", "jsx", "jsxs", "Text", "mergeClasses", "jsx", "jsxs", "Text", "jsx", "makeStyles", "mergeClasses", "useStyles", "jsx", "makeStyles", "useStyles", "jsx", "_", "slotProps", "jsx", "jsx", "mergeClasses", "useState", "jsx", "jsxs", "Option", "useState", "_", "jsx", "jsxs", "createContext", "useCallback", "useContext", "useId", "useMemo", "useRef", "jsx", "jsxs", "Spinner", "createContext", "useId", "useRef", "useCallback", "useMemo", "useContext", "jsx", "mergeClasses", "jsx", "jsxs", "makeStyles", "mergeClasses", "useStyles", "useEffect", "useMemo", "useRef", "useState", "jsx", "Button", "makeStyles", "mergeClasses", "useStyles", "from", "y", "paint", "useRef", "useState", "useEffect", "useMemo", "_", "jsx", "jsxs", "Button", "Spinner", "Tooltip", "makeStyles", "mergeClasses", "useStyles", "jsx", "mergeClasses", "useState", "jsx", "useState", "jsx", "jsxs", "Text", "mergeClasses", "useId", "useState", "Fragment", "jsx", "jsxs", "Text", "makeStyles", "mergeClasses", "useStyles", "t", "_", "useState", "useId", "jsx", "jsxs", "InfoButton", "_", "jsx", "makeStyles", "mergeClasses", "useStyles", "jsx", "jsx", "Button", "Tooltip", "mergeClasses", "useCallback", "useEffect", "useRef", "useState", "jsx", "Tooltip", "useState", "useRef", "measure", "useCallback", "useEffect", "_", "useCallback", "useMemo", "useRef", "useState", "useCallback", "useRef", "useState", "jsx", "t", "useRef", "useState", "useCallback", "useLayoutEffect", "useRef", "useState", "useState", "useState", "jsx", "jsxs", "Button", "useState", "useRef", "useLayoutEffect", "_", "jsx", "DismissRegular", "useRef", "jsx", "jsxs", "Button", "makeStyles", "useStyles", "useRef", "_", "DismissRegular", "jsx"]
7
+ }