jbrowse-plugin-msaview 5.5.0 → 5.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MsaViewPanel/afterCreateAutoruns.js +1 -1
- package/dist/MsaViewPanel/connectedDomains.d.ts +29 -11
- package/dist/MsaViewPanel/connectedDomains.js +47 -20
- package/dist/MsaViewPanel/connectedDomains.test.js +63 -24
- package/dist/MsaViewPanel/domainTrack.d.ts +7 -8
- package/dist/MsaViewPanel/domainTrack.js +5 -18
- package/dist/MsaViewPanel/domainTrack.test.js +29 -27
- package/dist/MsaViewPanel/loadProteinDomains.js +2 -1
- package/dist/MsaViewPanel/loadProteinDomains.test.js +2 -0
- package/dist/MsaViewPanel/model.d.ts +84 -48
- package/dist/MsaViewPanel/model.js +5 -5
- package/dist/MsaViewPanel/model.test.js +33 -21
- package/dist/chunks/{AboutDialog-HCCCEJ6V.js → AboutDialog-ZHJOECNZ.js} +2 -2
- package/dist/chunks/{AboutDialog-HCCCEJ6V.js.map → AboutDialog-ZHJOECNZ.js.map} +1 -1
- package/dist/chunks/AnnotationFileDialog-6LTHZI64.js +2 -0
- package/dist/chunks/AnnotationFileDialog-6LTHZI64.js.map +7 -0
- package/dist/chunks/{ExportSVGDialog-YUFLYBYW.js → ExportSVGDialog-VP5LUY7X.js} +2 -2
- package/dist/chunks/{ExportSVGDialog-YUFLYBYW.js.map → ExportSVGDialog-VP5LUY7X.js.map} +1 -1
- package/dist/chunks/{FeatureDialog-NBDB5SWU.js → FeatureDialog-YEOUA5YS.js} +2 -2
- package/dist/chunks/{FeatureDialog-NBDB5SWU.js.map → FeatureDialog-YEOUA5YS.js.map} +3 -3
- package/dist/chunks/GapThresholdDialog-3MOBT6NY.js +2 -0
- package/dist/chunks/GapThresholdDialog-3MOBT6NY.js.map +7 -0
- package/dist/chunks/GoToDialog-2L4KUO6R.js +2 -0
- package/dist/chunks/GoToDialog-2L4KUO6R.js.map +7 -0
- package/dist/chunks/{HelpDialog-UCUYPCOI.js → HelpDialog-3KGMHUYG.js} +2 -2
- package/dist/chunks/{HelpDialog-UCUYPCOI.js.map → HelpDialog-3KGMHUYG.js.map} +1 -1
- package/dist/chunks/{LaunchMsaViewDialog-BG4MX2BW.js → LaunchMsaViewDialog-GR4BB3W2.js} +2 -2
- package/dist/chunks/{LaunchMsaViewDialog-BG4MX2BW.js.map → LaunchMsaViewDialog-GR4BB3W2.js.map} +1 -1
- package/dist/chunks/MetadataDialog-LAVES424.js +2 -0
- package/dist/chunks/MetadataDialog-LAVES424.js.map +7 -0
- package/dist/chunks/MsaViewPanel-3R4SLB6M.js +2 -0
- package/dist/chunks/{MsaViewPanel-XSXFJWWY.js.map → MsaViewPanel-3R4SLB6M.js.map} +1 -1
- package/dist/chunks/{TrackInfoDialog-YXCIGFYM.js → TrackInfoDialog-RJDJ6NVE.js} +2 -2
- package/dist/chunks/{TrackInfoDialog-YXCIGFYM.js.map → TrackInfoDialog-RJDJ6NVE.js.map} +1 -1
- package/dist/chunks/TreeNodeInfoDialog-IWH7HU7R.js +2 -0
- package/dist/chunks/{TreeNodeInfoDialog-QCWDJTM4.js.map → TreeNodeInfoDialog-IWH7HU7R.js.map} +2 -2
- package/dist/chunks/chunk-35FE7DCA.js +6 -0
- package/dist/chunks/chunk-35FE7DCA.js.map +7 -0
- package/dist/chunks/chunk-6GRHBYHB.js +6 -0
- package/dist/chunks/chunk-6GRHBYHB.js.map +7 -0
- package/dist/chunks/chunk-BVAC5762.js +164 -0
- package/dist/chunks/chunk-BVAC5762.js.map +7 -0
- package/dist/chunks/chunk-CMRWVG7E.js +2 -0
- package/dist/chunks/chunk-CMRWVG7E.js.map +7 -0
- package/dist/chunks/chunk-DFVHVWTM.js +2 -0
- package/dist/chunks/chunk-DFVHVWTM.js.map +7 -0
- package/dist/chunks/{chunk-4TEPHD3L.js → chunk-DYDEKAIN.js} +2 -2
- package/dist/chunks/{chunk-35FWLG3N.js → chunk-EJCJ3TTF.js} +1 -1
- package/dist/chunks/{chunk-35FWLG3N.js.map → chunk-EJCJ3TTF.js.map} +1 -1
- package/dist/chunks/{chunk-KSCGTF4R.js → chunk-EKTRLQV7.js} +2 -2
- package/dist/chunks/{chunk-666BV764.js → chunk-GEFXJOLW.js} +2 -2
- package/dist/chunks/{chunk-666BV764.js.map → chunk-GEFXJOLW.js.map} +1 -1
- package/dist/chunks/{chunk-GAY2PLS6.js → chunk-HO3AGOGX.js} +1 -1
- package/dist/chunks/{chunk-GAY2PLS6.js.map → chunk-HO3AGOGX.js.map} +1 -1
- package/dist/chunks/chunk-K55ZVN73.js +5 -0
- package/dist/chunks/chunk-K55ZVN73.js.map +7 -0
- package/dist/chunks/chunk-KYQ2SO7B.js +2 -0
- package/dist/chunks/{chunk-QQKPT6EL.js.map → chunk-KYQ2SO7B.js.map} +1 -1
- package/dist/chunks/chunk-L4YUAU73.js +8 -0
- package/dist/chunks/chunk-L4YUAU73.js.map +7 -0
- package/dist/chunks/{chunk-NLAW2OYS.js → chunk-M2AAIXY5.js} +2 -2
- package/dist/chunks/chunk-NGMLSBBJ.js +2 -0
- package/dist/chunks/chunk-NGMLSBBJ.js.map +7 -0
- package/dist/chunks/{chunk-5OSSOQH4.js → chunk-OG5MRAUS.js} +1 -1
- package/dist/chunks/{chunk-5OSSOQH4.js.map → chunk-OG5MRAUS.js.map} +1 -1
- package/dist/chunks/{chunk-AQ2THRTR.js → chunk-QWXSEUZI.js} +2 -2
- package/dist/chunks/chunk-TIHSPFDA.js +2 -0
- package/dist/chunks/{chunk-XTQQNBQ5.js.map → chunk-TIHSPFDA.js.map} +2 -2
- package/dist/chunks/chunk-UVY5VU6U.js +2 -0
- package/dist/chunks/chunk-UVY5VU6U.js.map +7 -0
- package/dist/chunks/dist-LYE6BRGC.js +2 -0
- package/dist/chunks/{dist-GXYZN4ZR.js → dist-S26YAMK2.js} +1 -1
- package/dist/chunks/{dist-GXYZN4ZR.js.map → dist-S26YAMK2.js.map} +1 -1
- package/dist/chunks/{model-7RBDANXP.js → model-IH7IQHGD.js} +6 -6
- package/dist/chunks/model-IH7IQHGD.js.map +7 -0
- package/dist/chunks/{renderToSvg-5DMIQ72S.js → renderToSvg-HKGHZ7XL.js} +2 -2
- package/dist/jbrowse-plugin-msaview.esm.js +2 -2
- package/dist/jbrowse-plugin-msaview.esm.js.map +1 -1
- package/dist/utils/domainCache.js +17 -9
- package/dist/utils/ncbiDomains.d.ts +4 -1
- package/dist/utils/ncbiDomains.js +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/src/MsaViewPanel/afterCreateAutoruns.ts +1 -1
- package/src/MsaViewPanel/connectedDomains.test.ts +67 -24
- package/src/MsaViewPanel/connectedDomains.ts +70 -26
- package/src/MsaViewPanel/domainTrack.test.ts +29 -27
- package/src/MsaViewPanel/domainTrack.ts +7 -20
- package/src/MsaViewPanel/loadProteinDomains.test.ts +2 -0
- package/src/MsaViewPanel/loadProteinDomains.ts +13 -11
- package/src/MsaViewPanel/model.test.ts +33 -21
- package/src/MsaViewPanel/model.ts +7 -7
- package/src/utils/domainCache.ts +17 -9
- package/src/utils/ncbiDomains.ts +5 -1
- package/src/version.ts +1 -1
- package/dist/chunks/AnnotationFileDialog-CPJ4X7XW.js +0 -2
- package/dist/chunks/AnnotationFileDialog-CPJ4X7XW.js.map +0 -7
- package/dist/chunks/MetadataDialog-DSA3545E.js +0 -2
- package/dist/chunks/MetadataDialog-DSA3545E.js.map +0 -7
- package/dist/chunks/MsaViewPanel-XSXFJWWY.js +0 -2
- package/dist/chunks/TreeNodeInfoDialog-QCWDJTM4.js +0 -2
- package/dist/chunks/chunk-ASUKJX5J.js +0 -2
- package/dist/chunks/chunk-ASUKJX5J.js.map +0 -7
- package/dist/chunks/chunk-F726IWCW.js +0 -2
- package/dist/chunks/chunk-F726IWCW.js.map +0 -7
- package/dist/chunks/chunk-FFHB7WP7.js +0 -18
- package/dist/chunks/chunk-FFHB7WP7.js.map +0 -7
- package/dist/chunks/chunk-JDQUBCHM.js +0 -2
- package/dist/chunks/chunk-JDQUBCHM.js.map +0 -7
- package/dist/chunks/chunk-QQKPT6EL.js +0 -2
- package/dist/chunks/chunk-WMDOEOAH.js +0 -6
- package/dist/chunks/chunk-WMDOEOAH.js.map +0 -7
- package/dist/chunks/chunk-XTQQNBQ5.js +0 -2
- package/dist/chunks/chunk-XXCNVFGP.js +0 -11
- package/dist/chunks/chunk-XXCNVFGP.js.map +0 -7
- package/dist/chunks/chunk-ZQSWX57C.js +0 -2
- package/dist/chunks/chunk-ZQSWX57C.js.map +0 -7
- package/dist/chunks/dist-GZKCGB2N.js +0 -2
- package/dist/chunks/model-7RBDANXP.js.map +0 -7
- /package/dist/chunks/{chunk-4TEPHD3L.js.map → chunk-DYDEKAIN.js.map} +0 -0
- /package/dist/chunks/{chunk-KSCGTF4R.js.map → chunk-EKTRLQV7.js.map} +0 -0
- /package/dist/chunks/{chunk-NLAW2OYS.js.map → chunk-M2AAIXY5.js.map} +0 -0
- /package/dist/chunks/{chunk-AQ2THRTR.js.map → chunk-QWXSEUZI.js.map} +0 -0
- /package/dist/chunks/{dist-GZKCGB2N.js.map → dist-LYE6BRGC.js.map} +0 -0
- /package/dist/chunks/{renderToSvg-5DMIQ72S.js.map → renderToSvg-HKGHZ7XL.js.map} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["global-externals:@jbrowse/core/ui/ErrorBoundary", "global-externals:@jbrowse/core/ui/BaseTooltip", "global-externals:@jbrowse/core/ui/theme", "global-externals:@jbrowse/core/util/useMeasure", "../../node_modules/.pnpm/react-is@19.3.1/node_modules/react-is/cjs/react-is.production.js", "../../node_modules/.pnpm/react-is@19.3.1/node_modules/react-is/index.js", "../../node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.js", "../../node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js", "../../node_modules/.pnpm/hoist-non-react-statics@3.3.2/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js", "global-externals:@jbrowse/core/ui/CascadingMenuButton", "global-externals:@mui/material/styles", "global-externals:@jbrowse/core/util/types/mst", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/headlessRenderEnv.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/expandSpec.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/Loading.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/MSAView.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/ResizeHandles.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/Track.tsx", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/ArrowDropDown.mjs", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/Close.mjs", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/useWheelScroll.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/wheelZoom.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/msa/msaKeys.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/tracks/TrackBlocks.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/darkReader.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/useCanvasAutorun.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/tracks/TrackTooltipContent.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/selectionDrag.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/useHoverAnchor.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/tracks/useTrackHover.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/VerticalScrollbar.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/header/Header.tsx", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/Tune.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/AppBar/AppBar.mjs", "../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs", "../../node_modules/.pnpm/@mui+utils@9.5.0_@types+react@19.3.0_react@19.3.1/node_modules/@mui/utils/composeClasses/composeClasses.mjs", "../../node_modules/.pnpm/@mui+utils@9.5.0_@types+react@19.3.0_react@19.3.1/node_modules/@mui/utils/fastDeepAssign/fastDeepAssign.mjs", "../../node_modules/.pnpm/@mui+utils@9.5.0_@types+react@19.3.0_react@19.3.1/node_modules/@mui/utils/formatMuiErrorMessage/formatMuiErrorMessage.mjs", "../../node_modules/.pnpm/@mui+utils@9.5.0_@types+react@19.3.0_react@19.3.1/node_modules/@mui/utils/capitalize/capitalize.mjs", "../../node_modules/.pnpm/@mui+utils@9.5.0_@types+react@19.3.0_react@19.3.1/node_modules/@mui/utils/isObjectEmpty/isObjectEmpty.mjs", "../../node_modules/.pnpm/@mui+utils@9.5.0_@types+react@19.3.0_react@19.3.1/node_modules/@mui/utils/deepmerge/deepmerge.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/cssContainerQueries/cssContainerQueries.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/createBreakpoints/createBreakpoints.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/breakpoints/breakpoints.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/style/style.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/spacing/spacing.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/compose/compose.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/borders/borders.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/cssGrid/cssGrid.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/palette/palette.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/sizing/sizing.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/styleFunctionSx/defaultSxConfig.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/styleFunctionSx/styleFunctionSx.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/styles/useTheme.mjs", "../../node_modules/.pnpm/@babel+runtime@7.29.10/node_modules/@babel/runtime/helpers/esm/extends.js", "../../node_modules/.pnpm/@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-color@7.2.0/node_modules/@emotion/react/dist/emotion-element-f0de968e.browser.esm.js", "../../node_modules/.pnpm/@emotion+sheet@1.4.0/node_modules/@emotion/sheet/dist/emotion-sheet.esm.js", "../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Enum.js", "../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Utility.js", "../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Tokenizer.js", "../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Parser.js", "../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Serializer.js", "../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Middleware.js", "../../node_modules/.pnpm/@emotion+memoize@0.9.0/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js", "../../node_modules/.pnpm/@emotion+cache@11.14.0/node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js", "../../node_modules/.pnpm/@emotion+utils@1.4.2/node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js", "../../node_modules/.pnpm/@emotion+hash@0.9.2/node_modules/@emotion/hash/dist/emotion-hash.esm.js", "../../node_modules/.pnpm/@emotion+unitless@0.10.0/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js", "../../node_modules/.pnpm/@emotion+serialize@1.3.3/node_modules/@emotion/serialize/dist/emotion-serialize.esm.js", "../../node_modules/.pnpm/@emotion+use-insertion-effect-with-fallbacks@1.2.0_react@19.3.1/node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js", "../../node_modules/.pnpm/@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-color@7.2.0/node_modules/@emotion/react/dist/emotion-react.browser.esm.js", "../../node_modules/.pnpm/@emotion+styled@11.14.1_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_support_96e6059dc34d61fb5723d6878bab7582/node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js", "../../node_modules/.pnpm/@emotion+is-prop-valid@1.4.0/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js", "../../node_modules/.pnpm/@emotion+styled@11.14.1_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_support_96e6059dc34d61fb5723d6878bab7582/node_modules/@emotion/styled/dist/emotion-styled.browser.esm.js", "../../node_modules/.pnpm/@mui+styled-engine@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_suppor_f45ec51b45e47bb36736d94f9432c5c0/node_modules/@mui/styled-engine/index.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/createTheme/shape.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/createTheme/createSpacing.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/createTheme/applyStyles.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/createTheme/createTheme.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/useThemeWithoutDefault/useThemeWithoutDefault.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/useTheme/useTheme.mjs", "../../node_modules/.pnpm/@mui+utils@9.5.0_@types+react@19.3.0_react@19.3.1/node_modules/@mui/utils/ClassNameGenerator/ClassNameGenerator.mjs", "../../node_modules/.pnpm/@mui+utils@9.5.0_@types+react@19.3.0_react@19.3.1/node_modules/@mui/utils/generateUtilityClass/generateUtilityClass.mjs", "../../node_modules/.pnpm/@mui+utils@9.5.0_@types+react@19.3.0_react@19.3.1/node_modules/@mui/utils/generateUtilityClasses/generateUtilityClasses.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/preprocessStyles.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/createStyled/createStyled.mjs", "../../node_modules/.pnpm/@mui+utils@9.5.0_@types+react@19.3.0_react@19.3.1/node_modules/@mui/utils/resolveProps/resolveProps.mjs", "../../node_modules/.pnpm/@mui+utils@9.5.0_@types+react@19.3.0_react@19.3.1/node_modules/@mui/utils/useEnhancedEffect/useEnhancedEffect.mjs", "../../node_modules/.pnpm/@mui+utils@9.5.0_@types+react@19.3.0_react@19.3.1/node_modules/@mui/utils/clamp/clamp.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/colorManipulator/colorManipulator.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/DefaultPropsProvider/DefaultPropsProvider.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/memoTheme.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/cssVars/createGetCssVar.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/cssVars/cssVarsParser.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/cssVars/prepareCssVars.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/cssVars/getColorSchemeSelector.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/colors/common.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/colors/grey.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/colors/purple.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/colors/red.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/colors/orange.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/colors/blue.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/colors/lightBlue.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/colors/green.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/styles/createPalette.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/styles/focusVisible.mjs", "../../node_modules/.pnpm/@mui+system@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-colo_332eaa5637e86870e06696a426018eb3/node_modules/@mui/system/cssVars/prepareTypographyVars.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/styles/createMixins.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/styles/createTypography.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/styles/shadows.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/styles/createTransitions.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/styles/createMotion.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/styles/zIndex.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/styles/stringifyTheme.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/styles/createThemeNoVars.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/styles/getOverlayAlpha.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/styles/createColorScheme.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/styles/shouldSkipGeneratingVar.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/styles/excludeVariablesFromRoot.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/styles/createGetSelector.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/styles/createThemeWithVars.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/styles/createTheme.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/styles/defaultTheme.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/styles/identifier.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/zero-styled/index.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/styles/slotShouldForwardProp.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/styles/rootShouldForwardProp.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/styles/styled.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/utils/memoTheme.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/DefaultPropsProvider/DefaultPropsProvider.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/utils/capitalize.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/utils/createSimplePaletteValueFilter.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/Paper/Paper.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/Paper/paperClasses.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/styles/reducedMotion.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/transitions/utils.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/AppBar/appBarClasses.mjs", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/StatusMessage.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/header/HeaderInfoArea.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/header/HiddenColumnsChip.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/header/LoadWarnings.tsx", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/Warning.mjs", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/header/MenuBar.tsx", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/Build.mjs", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/InsertDriveFile.mjs", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/Visibility.mjs", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/header/menuBarItems.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/header/ScrollZoomCheckbox.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/header/colorSchemeMenuItems.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/header/getAnnotationsMenu.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/header/MultiAlignmentSelector.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/header/SelectionMenu.tsx", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/Clear.mjs", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/ContentCopy.mjs", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/ZoomIn.mjs", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/header/UnshareableDataWarning.tsx", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/LinkOff.mjs", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/header/ZoomControls.tsx", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/FitScreen.mjs", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/RestartAlt.mjs", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/ZoomOut.mjs", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/minimap/Minimap.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/msa/MSAPanel.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/msa/AnnotationLegend.tsx", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/ExpandLess.mjs", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/msa/MSACanvas.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/calculateBlocks.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/zoomSnapshot.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/msa/Loading.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/msa/MSACanvasBlock.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/msa/useMsaBlockMouse.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/msa/WheelZoomHint.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/msa/MSAMouseoverCanvas.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/msa/renderMSAMouseover.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/rowpanels/RowPanelHeaders.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/rowpanels/RowPanels.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/rowpanels/RowPanelBlock.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/featureFields.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/settings/SettingsPanel.tsx", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/ArrowRight.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/ButtonBase/ButtonBase.mjs", "../../node_modules/.pnpm/@mui+utils@9.5.0_@types+react@19.3.0_react@19.3.1/node_modules/@mui/utils/isFocusVisible/isFocusVisible.mjs", "../../node_modules/.pnpm/@mui+utils@9.5.0_@types+react@19.3.0_react@19.3.1/node_modules/@mui/utils/useForkRef/useForkRef.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/utils/useForkRef.mjs", "../../node_modules/.pnpm/@mui+utils@9.5.0_@types+react@19.3.0_react@19.3.1/node_modules/@mui/utils/useEventCallback/useEventCallback.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/utils/useEventCallback.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/ButtonBase/useButtonBase.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/utils/useFocusableWhenDisabled.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/useLazyRipple/useLazyRipple.mjs", "../../node_modules/.pnpm/@mui+utils@9.5.0_@types+react@19.3.0_react@19.3.1/node_modules/@mui/utils/useLazyRef/useLazyRef.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/ButtonBase/TouchRipple.mjs", "../../node_modules/.pnpm/@mui+utils@9.5.0_@types+react@19.3.0_react@19.3.1/node_modules/@mui/utils/useOnMount/useOnMount.mjs", "../../node_modules/.pnpm/@mui+utils@9.5.0_@types+react@19.3.0_react@19.3.1/node_modules/@mui/utils/useTimeout/useTimeout.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/ButtonBase/Ripple.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/ButtonBase/touchRippleClasses.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/transitions/useReducedMotion.mjs", "../../node_modules/.pnpm/@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.1_supports-co_15295886322688c79ec4e666adb36661/node_modules/@mui/material/ButtonBase/buttonBaseClasses.mjs", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/settings/MenuItemsForm.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/settings/TrackList.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/tree/TreeOverview.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/tree/TreePanel.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/tree/TreeCanvas.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/tree/CladeLabels.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/tree/TreeCanvasBlock.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/tree/TreeMenu.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/tree/useTreeHover.ts", "../../node_modules/.pnpm/flatqueue@3.1.0/node_modules/flatqueue/index.js", "../../node_modules/.pnpm/flatbush@4.6.2/node_modules/flatbush/index.js", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/tree/clickMap.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/tree/renderTreeMouseover.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/tree/TreeRuler.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/import/ImportForm.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/import/ImportFormExamples.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/import/data/seq2.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/import/util.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/MSAViewer.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/model.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/blockFasta.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/clustalX.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/colorSchemes.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/columnStats.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/msa/packDomainLanes.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/components/tree/scaleBar.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/ggplotPalettes.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/createPaletteMap.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/exportFileName.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/featurePanels.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/featuresLayer.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/filehandleLoader.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/fetchUtils.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/model/DataModel.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/model/DialogQueue.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/model/msaModel.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/stripDefault.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/model/treeModel.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/blosum62.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/neighborJoining.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/propertyConservation.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/rerootTree.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/rowCoordinateCalculations.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/groupKeys.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/scales.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/seqPosToGlobalCol.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/similarityColors.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/tipLabels.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/flatToTree.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/parseAsn1.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/treeDisplay.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/writeNewick.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/wuss.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/viewerSnapshot.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/schemeResidueColor.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/mount.tsx", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/element.ts", "../../node_modules/.pnpm/react-msaview@9.3.0_a4121c98828e538e8b3708814bbfe622/node_modules/react-msaview/src/useMsaSvgFigure.ts"],
|
|
4
|
+
"sourcesContent": ["module.exports = JBrowseExports[\"@jbrowse/core/ui/ErrorBoundary\"];", "module.exports = JBrowseExports[\"@jbrowse/core/ui/BaseTooltip\"];", "module.exports = JBrowseExports[\"@jbrowse/core/ui/theme\"];", "module.exports = JBrowseExports[\"@jbrowse/core/util/useMeasure\"];", "/**\n * @license React\n * react-is.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_VIEW_TRANSITION_TYPE = Symbol.for(\"react.view_transition\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\");\nfunction typeOf(object) {\n if (\"object\" === typeof object && null !== object) {\n var $$typeof = object.$$typeof;\n switch ($$typeof) {\n case REACT_ELEMENT_TYPE:\n switch (((object = object.type), object)) {\n case REACT_FRAGMENT_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_SUSPENSE_TYPE:\n case REACT_SUSPENSE_LIST_TYPE:\n case REACT_VIEW_TRANSITION_TYPE:\n return object;\n default:\n switch (((object = object && object.$$typeof), object)) {\n case REACT_CONTEXT_TYPE:\n case REACT_FORWARD_REF_TYPE:\n case REACT_LAZY_TYPE:\n case REACT_MEMO_TYPE:\n return object;\n case REACT_CONSUMER_TYPE:\n return object;\n default:\n return $$typeof;\n }\n }\n case REACT_PORTAL_TYPE:\n return $$typeof;\n }\n }\n}\nexports.ContextConsumer = REACT_CONSUMER_TYPE;\nexports.ContextProvider = REACT_CONTEXT_TYPE;\nexports.Element = REACT_ELEMENT_TYPE;\nexports.ForwardRef = REACT_FORWARD_REF_TYPE;\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.Lazy = REACT_LAZY_TYPE;\nexports.Memo = REACT_MEMO_TYPE;\nexports.Portal = REACT_PORTAL_TYPE;\nexports.Profiler = REACT_PROFILER_TYPE;\nexports.StrictMode = REACT_STRICT_MODE_TYPE;\nexports.Suspense = REACT_SUSPENSE_TYPE;\nexports.SuspenseList = REACT_SUSPENSE_LIST_TYPE;\nexports.isContextConsumer = function (object) {\n return typeOf(object) === REACT_CONSUMER_TYPE;\n};\nexports.isContextProvider = function (object) {\n return typeOf(object) === REACT_CONTEXT_TYPE;\n};\nexports.isElement = function (object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n};\nexports.isForwardRef = function (object) {\n return typeOf(object) === REACT_FORWARD_REF_TYPE;\n};\nexports.isFragment = function (object) {\n return typeOf(object) === REACT_FRAGMENT_TYPE;\n};\nexports.isLazy = function (object) {\n return typeOf(object) === REACT_LAZY_TYPE;\n};\nexports.isMemo = function (object) {\n return typeOf(object) === REACT_MEMO_TYPE;\n};\nexports.isPortal = function (object) {\n return typeOf(object) === REACT_PORTAL_TYPE;\n};\nexports.isProfiler = function (object) {\n return typeOf(object) === REACT_PROFILER_TYPE;\n};\nexports.isStrictMode = function (object) {\n return typeOf(object) === REACT_STRICT_MODE_TYPE;\n};\nexports.isSuspense = function (object) {\n return typeOf(object) === REACT_SUSPENSE_TYPE;\n};\nexports.isSuspenseList = function (object) {\n return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;\n};\nexports.isValidElementType = function (type) {\n return \"string\" === typeof type ||\n \"function\" === typeof type ||\n type === REACT_FRAGMENT_TYPE ||\n type === REACT_PROFILER_TYPE ||\n type === REACT_STRICT_MODE_TYPE ||\n type === REACT_SUSPENSE_TYPE ||\n type === REACT_SUSPENSE_LIST_TYPE ||\n type === REACT_VIEW_TRANSITION_TYPE ||\n (\"object\" === typeof type &&\n null !== type &&\n (type.$$typeof === REACT_LAZY_TYPE ||\n type.$$typeof === REACT_MEMO_TYPE ||\n type.$$typeof === REACT_CONTEXT_TYPE ||\n type.$$typeof === REACT_CONSUMER_TYPE ||\n type.$$typeof === REACT_FORWARD_REF_TYPE ||\n type.$$typeof === REACT_CLIENT_REFERENCE ||\n void 0 !== type.getModuleId))\n ? !0\n : !1;\n};\nexports.typeOf = typeOf;\n", "'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n", "/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n", "'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n", "'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n", "module.exports = JBrowseExports[\"@jbrowse/core/ui/CascadingMenuButton\"];", "module.exports = JBrowseExports[\"@mui/material/styles\"];", "module.exports = JBrowseExports[\"@jbrowse/core/util/types/mst\"];", "/**\n * DOM shims for driving `renderToSvg` outside a browser -- the SVG-export\n * tests, the README figure generator, and react-msaview-cli all need them.\n *\n * jsdom implements neither DOMMatrix nor a canvas 2D context, and\n * `@jbrowse/svgcanvas` needs both: it tracks the current transform as a real\n * matrix, and the renderers ask a throwaway canvas to measure text.\n *\n * The matrix stub has to accept the ARRAY constructor. svgcanvas normalizes\n * every transform through `new DOMMatrix([a, b, c, d, e, f])`, so a stub that\n * only takes six positional arguments silently binds the whole array to `a` and\n * leaves the rest undefined -- every emitted transform then carries `NaN` in its\n * x components, which no assertion on a drawn x-position can survive.\n */\nimport { CHAR_WIDTH_RATIO } from './measureTextCanvas.ts'\n\nclass HeadlessDOMMatrix {\n a: number\n b: number\n c: number\n d: number\n e: number\n f: number\n\n constructor(init?: number[]) {\n const [a = 1, b = 0, c = 0, d = 1, e = 0, f = 0] = init ?? []\n this.a = a\n this.b = b\n this.c = c\n this.d = d\n this.e = e\n this.f = f\n }\n\n multiply(o: HeadlessDOMMatrix) {\n return new HeadlessDOMMatrix([\n this.a * o.a + this.c * o.b,\n this.b * o.a + this.d * o.b,\n this.a * o.c + this.c * o.d,\n this.b * o.c + this.d * o.d,\n this.a * o.e + this.c * o.f + this.e,\n this.b * o.e + this.d * o.f + this.f,\n ])\n }\n\n translate(x: number, y = 0) {\n return this.multiply(new HeadlessDOMMatrix([1, 0, 0, 1, x, y]))\n }\n\n scale(x: number, y = x) {\n return this.multiply(new HeadlessDOMMatrix([x, 0, 0, y, 0, 0]))\n }\n}\n\nclass HeadlessDOMPoint {\n constructor(\n public x = 0,\n public y = 0,\n ) {}\n\n matrixTransform(m: HeadlessDOMMatrix) {\n return new HeadlessDOMPoint(\n m.a * this.x + m.c * this.y + m.e,\n m.b * this.x + m.d * this.y + m.f,\n )\n }\n}\n\n/**\n * Install the shims, into `globalThis` by default. A Node caller that builds\n * its own jsdom passes that window instead, because Node has no global\n * HTMLCanvasElement to patch.\n *\n * Without `measureContext`, `measureText` reports 0.6em per character, close\n * enough to a real sans-serif average for layout and exactly predictable: a\n * test can compute the width a renderer will see. A caller with a real canvas,\n * such as react-msaview-cli with @napi-rs/canvas, passes one of its 2D\n * contexts as `measureContext` to measure with the installed fonts.\n *\n * `contextExtras` adds to the context a test hands out -- the raster test\n * supplies the ImageData methods that make the export take its image path.\n */\nexport function installHeadlessRenderEnv(\n win: unknown = globalThis,\n contextExtras: Partial<CanvasRenderingContext2D> = {},\n measureContext?: MeasureContext,\n) {\n const g = globalThis as Record<string, unknown>\n g.DOMMatrix = HeadlessDOMMatrix\n g.DOMPoint = HeadlessDOMPoint\n const canvas = (win as { HTMLCanvasElement: typeof HTMLCanvasElement })\n .HTMLCanvasElement\n canvas.prototype.getContext = function () {\n let font = '10px sans-serif'\n return Object.assign(\n {\n get font() {\n return font\n },\n set font(v: string) {\n font = v\n },\n measureText: (t: string) => {\n if (measureContext) {\n measureContext.font = font\n return { width: measureContext.measureText(t).width }\n }\n return {\n width:\n t.length * (Number.parseFloat(font) || 10) * CHAR_WIDTH_RATIO,\n }\n },\n },\n contextExtras,\n ) as unknown as CanvasRenderingContext2D\n } as unknown as typeof HTMLCanvasElement.prototype.getContext\n}\n\nexport interface MeasureContext {\n font: string\n measureText(text: string): { width: number }\n}\n", "import type { ColumnTrackSpec, Highlight, Region } from './types.ts'\n\n/**\n * `row: null` opts one entry out of the spec's `query` row, back to alignment\n * columns.\n */\ntype RowChoice = { row?: string | null }\n\nexport type HighlightShorthand =\n | number\n | string\n | (Omit<Highlight, 'row'> & RowChoice)\n\nexport type RegionShorthand = string | (Omit<Region, 'row'> & RowChoice)\n\nexport type ColumnTrackShorthand = Omit<\n ColumnTrackSpec,\n 'id' | 'kind' | 'row'\n> &\n RowChoice & {\n id?: string\n kind?: ColumnTrackSpec['kind']\n /** the 1-based position `values` or `data` begins at */\n start?: number\n }\n\n/**\n * The short forms a hand-written or generated link can use. Every long form\n * passes through unchanged, so a snapshot is also a valid spec.\n */\nexport interface MsaSpec {\n /**\n * The row the spec is about: sets `relativeTo`, and is the `row` of every\n * highlight, region and column track that names none\n */\n query?: string\n /** a url, or the alignment itself when it spans more than one line */\n msa?: string\n /** a url, or a newick string when it starts with \"(\" */\n tree?: string\n highlights?: HighlightShorthand[]\n region?: RegionShorthand\n columnTracks?: ColumnTrackShorthand[]\n [key: string]: unknown\n}\n\n/**\n * The label a single-residue shorthand highlight gets, filled in from the\n * sequence when drawn: `175` on a row reading R there becomes \"R175\".\n */\nexport const residueLabel = '{residue}{position}'\n\nconst span = /^(\\d+)(?:-(\\d+))?(?:\\s+(.+))?$/\n\nfunction parseSpan(text: string, what: string) {\n const match = span.exec(text.trim())\n if (!match) {\n throw new Error(\n `${what} \"${text}\" is not \"start\", \"start-end\" or either followed by a label`,\n )\n }\n const a = Number(match[1])\n const b = match[2] === undefined ? a : Number(match[2])\n return { start: Math.min(a, b), end: Math.max(a, b), label: match[3] }\n}\n\nfunction withRow<T extends RowChoice>(entry: T, query?: string) {\n const { row, ...rest } = entry\n const resolved = row === undefined ? query : (row ?? undefined)\n return resolved === undefined ? rest : { ...rest, row: resolved }\n}\n\nfunction expandHighlight(entry: HighlightShorthand, query?: string) {\n if (typeof entry === 'object') {\n return (\n entry.rows\n ? entry\n : withRow(entry, entry.start === undefined ? undefined : query)\n ) as Highlight\n }\n const { start, end, label } = parseSpan(String(entry), 'highlight')\n const single = start === end && query !== undefined\n return {\n ...(query === undefined ? {} : { row: query }),\n start,\n end,\n ...(label ? { label } : single ? { label: residueLabel } : {}),\n }\n}\n\nfunction expandRegion(region: RegionShorthand, query?: string) {\n if (typeof region === 'string') {\n const { start, end } = parseSpan(region, 'region')\n const parsed: Omit<Region, 'row'> & RowChoice = { start, end }\n return withRow(parsed, query) as Region\n }\n return withRow(region, query) as Region\n}\n\nfunction slug(name: string) {\n return name\n .toLowerCase()\n .replaceAll(/[^a-z0-9]+/g, '-')\n .replaceAll(/^-|-$/g, '')\n}\n\nfunction kindOf(track: ColumnTrackShorthand) {\n if (track.kind) {\n return track.kind\n }\n if (track.values) {\n return 'bar'\n }\n if (track.data !== undefined) {\n return 'text'\n }\n if (track.arcs) {\n return 'arc'\n }\n throw new Error(\n `column track \"${track.name}\" has no values, data or arcs to take its kind from`,\n )\n}\n\nfunction expandTrack(\n track: ColumnTrackShorthand,\n query: string | undefined,\n ids: Set<string>,\n): ColumnTrackSpec {\n const { start, ...rest } = track\n const pad = start && start > 1 ? start - 1 : 0\n let id = track.id ?? (slug(track.name) || 'track')\n for (let n = 2; !track.id && ids.has(id); n++) {\n id = `${slug(track.name) || 'track'}-${n}`\n }\n ids.add(id)\n return {\n ...(withRow(rest, query) as Omit<ColumnTrackSpec, 'id' | 'kind'>),\n id,\n kind: kindOf(track),\n ...(pad && track.values\n ? { values: [...Array<number>(pad).fill(0), ...track.values] }\n : {}),\n ...(pad && track.data !== undefined\n ? { data: ' '.repeat(pad) + track.data }\n : {}),\n }\n}\n\nfunction isInlineMsa(msa: string) {\n return msa.includes('\\n')\n}\n\nfunction isInlineTree(tree: string) {\n return tree.trimStart().startsWith('(')\n}\n\nfunction uri(location: string) {\n return { uri: location, locationType: 'UriLocation' as const }\n}\n\n/**\n * Expand the short forms of an MsaView spec into the snapshot the model takes.\n * Idempotent, and a no-op on a spec that uses none of them.\n */\nexport function expandSpec(spec: MsaSpec): Record<string, unknown> {\n const { query, msa, tree, highlights, region, columnTracks, ...rest } = spec\n const data = {\n ...(rest.data as Record<string, unknown> | undefined),\n ...(msa !== undefined && isInlineMsa(msa) ? { msa } : {}),\n ...(tree !== undefined && isInlineTree(tree) ? { tree } : {}),\n }\n const ids = new Set(\n (columnTracks ?? []).map(t => t.id).filter(id => id !== undefined),\n )\n return {\n ...rest,\n ...(msa !== undefined && !isInlineMsa(msa)\n ? { msaFilehandle: uri(msa) }\n : {}),\n ...(tree !== undefined && !isInlineTree(tree)\n ? { treeFilehandle: uri(tree) }\n : {}),\n ...(Object.keys(data).length > 0 ? { data } : {}),\n ...(query !== undefined && rest.relativeTo === undefined\n ? { relativeTo: query }\n : {}),\n ...(highlights\n ? { highlights: highlights.map(h => expandHighlight(h, query)) }\n : {}),\n ...(region === undefined ? {} : { region: expandRegion(region, query) }),\n ...(columnTracks\n ? { columnTracks: columnTracks.map(t => expandTrack(t, query, ids)) }\n : {}),\n }\n}\n", "import React from 'react'\n\nimport { ErrorMessage } from '@jbrowse/core/ui'\nimport { ErrorBoundary } from '@jbrowse/core/ui/ErrorBoundary'\nimport { Button } from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport MSAView from './MSAView.tsx'\nimport StatusMessage from './StatusMessage.tsx'\nimport ImportForm from './import/ImportForm.tsx'\n\nimport type { MsaViewModel } from '../model.ts'\nimport type { ToolbarSlots } from './header/Header.tsx'\n\nconst Reset = observer(function ({\n model,\n error,\n}: {\n model: MsaViewModel\n error: unknown\n}) {\n return (\n <div>\n <ErrorMessage error={error} />\n {model.importForm ? (\n <Button\n variant=\"contained\"\n color=\"primary\"\n onClick={() => {\n model.reset()\n }}\n >\n Return to import form\n </Button>\n ) : null}\n </div>\n )\n})\n\nconst Loading = observer(function ({\n model,\n ...slots\n}: { model: MsaViewModel } & ToolbarSlots) {\n const {\n isLoading,\n dataInitialized,\n data,\n error,\n resetCount,\n msaFilehandle,\n treeFilehandle,\n importForm,\n } = model\n const hasData = !!(data.msa || data.tree)\n // a failed load keeps its filehandle, so the error outranks the spinner\n const loading = !error && !!(msaFilehandle || treeFilehandle || isLoading)\n\n return (\n <div>\n {/* keyed on the reset counter: the boundary holds the error it caught\n until it is remounted, so without this \"Return to import form\" put\n the model back and left the error screen up */}\n <ErrorBoundary\n key={resetCount}\n FallbackComponent={e => <Reset model={model} error={e.error} />}\n >\n {dataInitialized ? (\n isLoading ? (\n <StatusMessage model={model} variant=\"page\" />\n ) : (\n <MSAView model={model} {...slots} />\n )\n ) : hasData ? (\n <Reset model={model} error={error} />\n ) : (\n <>\n {loading ? <StatusMessage model={model} variant=\"page\" /> : null}\n {importForm ? (\n <div style={{ display: loading ? 'none' : undefined }}>\n <ImportForm model={model} />\n </div>\n ) : error ? (\n <ErrorMessage error={error} />\n ) : null}\n </>\n )}\n </ErrorBoundary>\n </div>\n )\n})\n\nexport default Loading\n", "import React, { Suspense } from 'react'\n\nimport { observer } from 'mobx-react'\n\nimport {\n HorizontalResizeHandle,\n VerticalResizeHandle,\n} from './ResizeHandles.tsx'\nimport Track from './Track.tsx'\nimport VerticalScrollbar from './VerticalScrollbar.tsx'\nimport Header from './header/Header.tsx'\nimport Minimap from './minimap/Minimap.tsx'\nimport MSAPanel from './msa/MSAPanel.tsx'\nimport { clickColor, hoverColor, selectionFill } from './overlayColors.ts'\nimport RowPanelHeaders from './rowpanels/RowPanelHeaders.tsx'\nimport RowPanels from './rowpanels/RowPanels.tsx'\nimport SettingsPanel from './settings/SettingsPanel.tsx'\nimport TreeOverview from './tree/TreeOverview.tsx'\nimport TreePanel from './tree/TreePanel.tsx'\nimport TreeRuler from './tree/TreeRuler.tsx'\n\nimport type { MsaViewModel } from '../model.ts'\nimport type { ToolbarSlots } from './header/Header.tsx'\n\n// The band above the panels: the tree overview and scale bar, the strip\n// headers, and the minimap over the alignment. The spacer stands in for the\n// resize handle, so the minimap starts exactly where the alignment canvas does.\nconst TopArea = observer(function ({ model }: { model: MsaViewModel }) {\n const { showHorizontalScrollbar, showTreeOverview, resizeHandleWidth } = model\n return (\n <div style={{ display: 'flex' }}>\n <div style={{ flexShrink: 0 }}>\n {showTreeOverview ? <TreeOverview model={model} /> : null}\n <TreeRuler model={model} />\n </div>\n <RowPanelHeaders model={model} />\n <div style={{ width: resizeHandleWidth, flexShrink: 0 }} />\n {showHorizontalScrollbar ? <Minimap model={model} /> : null}\n </div>\n )\n})\n\nconst TrackColumnIndicator = observer(function ({\n model,\n}: {\n model: MsaViewModel\n}) {\n const {\n mouseCol,\n mouseClickCol,\n colWidth,\n scrollX,\n effectiveTreeAreaWidth,\n rowPanelsWidth,\n resizeHandleWidth,\n totalTrackAreaHeight,\n msaCanvasWidth,\n resolvedSelection,\n } = model\n\n // the selected columns, the hovered column, then the pinned one, matching\n // the alignment's own overlay\n const bands = [\n {\n start: resolvedSelection?.startCol,\n end: resolvedSelection?.endCol,\n color: selectionFill,\n },\n { start: mouseCol, end: mouseCol, color: hoverColor },\n { start: mouseClickCol, end: mouseClickCol, color: clickColor },\n ]\n\n return (\n <div\n style={{\n position: 'absolute',\n left: effectiveTreeAreaWidth + rowPanelsWidth + resizeHandleWidth,\n top: 0,\n width: msaCanvasWidth,\n height: totalTrackAreaHeight,\n overflow: 'hidden',\n pointerEvents: 'none',\n }}\n >\n {bands.map(({ start, end, color }) =>\n start === undefined || end === undefined ? null : (\n <div\n key={color}\n style={{\n position: 'absolute',\n left: start * colWidth + scrollX,\n top: 0,\n width: (end - start + 1) * colWidth,\n height: totalTrackAreaHeight,\n backgroundColor: color,\n zIndex: 100,\n }}\n />\n ),\n )}\n </div>\n )\n})\n\nconst TrackArea = observer(function ({ model }: { model: MsaViewModel }) {\n const { turnedOnTracks } = model\n if (turnedOnTracks.length === 0) {\n return null\n }\n return (\n <div style={{ position: 'relative' }}>\n <TrackColumnIndicator model={model} />\n {turnedOnTracks.map(track => (\n <Track key={track.model.id} model={model} track={track} />\n ))}\n </div>\n )\n})\n\nconst MainArea = observer(function ({ model }: { model: MsaViewModel }) {\n const { showVerticalScrollbar } = model\n\n return (\n <div style={{ display: 'flex' }}>\n <TreePanel model={model} />\n <RowPanels model={model} />\n <VerticalResizeHandle model={model} />\n <MSAPanel model={model} />\n {showVerticalScrollbar ? <VerticalScrollbar model={model} /> : null}\n </div>\n )\n})\n\nconst View = observer(function ({ model }: { model: MsaViewModel }) {\n return (\n <div style={{ position: 'relative' }}>\n <TopArea model={model} />\n <TrackArea model={model} />\n <MainArea model={model} />\n </div>\n )\n})\n\nconst MSAView = observer(function ({\n model,\n ...slots\n}: { model: MsaViewModel } & ToolbarSlots) {\n const {\n height,\n headerHeight,\n hideHeader,\n settingsOpen,\n viewInitialized,\n DialogComponent,\n DialogProps,\n } = model\n\n return (\n <div>\n {viewInitialized ? (\n <>\n <div style={{ height, overflow: 'clip' }}>\n {hideHeader ? null : <Header model={model} {...slots} />}\n <div style={{ display: 'flex' }}>\n <View model={model} />\n {settingsOpen ? (\n <SettingsPanel model={model} height={height - headerHeight} />\n ) : null}\n </div>\n </div>\n <HorizontalResizeHandle model={model} />\n\n {DialogComponent ? (\n <Suspense fallback={null}>\n <DialogComponent {...DialogProps} />\n </Suspense>\n ) : null}\n </>\n ) : null}\n </div>\n )\n})\n\nexport default MSAView\n", "import React, { useCallback } from 'react'\n\nimport { observer } from 'mobx-react'\n\nimport DragHandle from './DragHandle.tsx'\n\nimport type { MsaViewModel } from '../model.ts'\nimport type { BasicTrack } from '../types.ts'\n\nconst minViewHeight = 50\n\nexport const VerticalResizeHandle = observer(function ({\n model,\n}: {\n model: MsaViewModel\n}) {\n const onDrag = useCallback(\n (delta: number, startWidth: number) => {\n model.setTreeAreaWidth(\n Math.min(\n Math.max(0, startWidth + delta),\n model.width - model.resizeHandleWidth,\n ),\n )\n },\n [model],\n )\n return (\n <DragHandle\n axis=\"x\"\n variant=\"resizer\"\n getStart={() => model.effectiveTreeAreaWidth}\n onDrag={onDrag}\n style={{ width: model.resizeHandleWidth }}\n />\n )\n})\n\nexport const HorizontalResizeHandle = observer(function ({\n model,\n}: {\n model: MsaViewModel\n}) {\n const onDrag = useCallback(\n (delta: number, startHeight: number) => {\n model.setHeight(Math.max(minViewHeight, startHeight + delta))\n },\n [model],\n )\n return (\n <DragHandle\n axis=\"y\"\n variant=\"resizer\"\n getStart={() => model.height}\n onDrag={onDrag}\n style={{ width: '100%', height: model.resizeHandleWidth }}\n />\n )\n})\n\nexport const TrackResizeHandle = observer(function ({\n model,\n track,\n}: {\n model: MsaViewModel\n track: BasicTrack\n}) {\n const { id, heightKey, height } = track.model\n // tracks sharing a key resize together, so only the last turned-on one of\n // them carries the divider: a second between conservation and property\n // conservation would move the pair this one already moves. The drag divides\n // across the group, so its bottom edge follows the cursor rather than half\n const siblings = model.turnedOnTracks.filter(\n t => t.model.heightKey === heightKey,\n )\n const count = siblings.length\n const onDrag = useCallback(\n (delta: number, startHeight: number) => {\n if (heightKey) {\n model.setTrackHeight(\n heightKey,\n Math.max(10, startHeight + delta / count),\n )\n }\n },\n [model, heightKey, count],\n )\n return heightKey && siblings.at(-1)?.model.id === id ? (\n <DragHandle\n axis=\"y\"\n variant=\"resizer\"\n getStart={() => height}\n onDrag={onDrag}\n style={{\n position: 'absolute',\n bottom: 0,\n left: 0,\n width: '100%',\n height: model.resizeHandleWidth,\n zIndex: 1,\n }}\n />\n ) : null\n})\n", "import React, { lazy, useRef, useState } from 'react'\n\nimport BaseTooltip from '@jbrowse/core/ui/BaseTooltip'\nimport { makeStyles } from '@jbrowse/core/util/tss-react'\nimport ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown'\nimport CloseIcon from '@mui/icons-material/Close'\nimport { IconButton, Menu, MenuItem } from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport { useWheelScroll } from '../useWheelScroll.ts'\nimport { onMsaKey } from './msa/msaKeys.ts'\nimport TrackBlocks from './tracks/TrackBlocks.tsx'\nimport TrackTooltipContent from './tracks/TrackTooltipContent.tsx'\nimport { useTrackHover } from './tracks/useTrackHover.ts'\n\nimport type { MsaViewModel } from '../model.ts'\nimport type { BasicTrack } from '../types.ts'\n\nconst TrackInfoDialog = lazy(() => import('./dialogs/TrackInfoDialog.tsx'))\n\nconst useStyles = makeStyles()(theme => ({\n button: {\n padding: 0,\n },\n // a hairline under every track but the last, across the labels as well as\n // the alignment. The divider a track's resize handle draws covers only the\n // alignment, and tracks sharing a height have no handle between them. Inset,\n // so the line costs no layout height: totalTrackAreaHeight sums the model's\n // heights, and the column indicator is drawn against that sum\n row: {\n display: 'flex',\n '&:not(:last-child)': {\n boxShadow: `inset 0 -1px 0 ${theme.palette.divider}`,\n },\n },\n}))\n\nconst TrackLabel = observer(function TrackLabel({\n model,\n track,\n}: {\n model: MsaViewModel\n track: BasicTrack\n}) {\n const [anchorEl, setAnchorEl] = useState<HTMLButtonElement>()\n const closeMenu = () => {\n setAnchorEl(undefined)\n }\n const { drawLabels, fontSize, effectiveTreeAreaWidth: width } = model\n const {\n model: { name, height },\n } = track\n const { classes } = useStyles()\n const trackLabelHeight = Math.min(height, fontSize)\n const closeSize = Math.min(height, Math.max(fontSize, 16))\n\n return (\n // a flex row, not inline text: zooming in grows fontSize against a tree\n // area the leaf labels sized, and a name that wrapped took its menu button\n // onto a second line, under the next track's button\n <div\n style={{\n width,\n height,\n flexShrink: 0,\n display: 'flex',\n alignItems: 'flex-start',\n justifyContent: 'flex-end',\n gap: 2,\n fontSize: trackLabelHeight,\n }}\n >\n <span\n title={name}\n style={{\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n }}\n >\n {drawLabels ? name : ''}\n </span>\n <IconButton\n className={classes.button}\n aria-label={`Hide ${name} track`}\n title=\"Hide track\"\n style={{ width: closeSize, height: closeSize, flexShrink: 0 }}\n onClick={() => {\n model.toggleTrack(track.model.id)\n }}\n >\n <CloseIcon style={{ fontSize: closeSize * 0.8 }} />\n </IconButton>\n <IconButton\n className={classes.button}\n aria-label={`${name} track menu`}\n style={{\n width: trackLabelHeight,\n height: trackLabelHeight,\n flexShrink: 0,\n }}\n onClick={event => {\n setAnchorEl(event.currentTarget)\n }}\n >\n <ArrowDropDownIcon />\n </IconButton>\n {anchorEl ? (\n <Menu\n anchorEl={anchorEl}\n transitionDuration={0}\n open\n onClose={() => {\n closeMenu()\n }}\n >\n <MenuItem\n dense\n onClick={() => {\n model.toggleTrack(track.model.id)\n closeMenu()\n }}\n >\n Hide track\n </MenuItem>\n <MenuItem\n dense\n onClick={() => {\n model.queueDialog(onClose => [\n TrackInfoDialog,\n { onClose, model: track.model },\n ])\n closeMenu()\n }}\n >\n Get info\n </MenuItem>\n </Menu>\n ) : null}\n </div>\n )\n})\n\nconst Track = observer(function ({\n model,\n track,\n}: {\n model: MsaViewModel\n track: BasicTrack\n}) {\n const { resizeHandleWidth, rowPanelsWidth, showColumnStats } = model\n const {\n model: { height },\n } = track\n const ref = useRef<HTMLDivElement>(null)\n useWheelScroll({ ref, model, axes: 'x' })\n const { classes } = useStyles()\n const { anchor, onMouseMove, onMouseDown, onMouseLeave } = useTrackHover({\n model,\n tooltip: showColumnStats,\n })\n\n return (\n <div className={classes.row} style={{ height }}>\n <TrackLabel model={model} track={track} />\n {/* the row panels are row space, so a track leaves their column empty\n and starts where the alignment canvas does */}\n <div\n style={{ width: rowPanelsWidth + resizeHandleWidth, flexShrink: 0 }}\n />\n <div\n ref={ref}\n data-testid={`track_${track.model.id}`}\n tabIndex={-1}\n style={{ outline: 'none' }}\n onKeyDown={event => {\n if (onMsaKey(model, event)) {\n event.preventDefault()\n }\n }}\n onMouseMove={event => {\n if (ref.current) {\n onMouseMove(event, ref.current)\n }\n }}\n onMouseDown={event => {\n if (ref.current) {\n onMouseDown(event, ref.current)\n }\n }}\n onMouseLeave={() => {\n onMouseLeave()\n }}\n >\n <TrackBlocks model={model} track={track} />\n {anchor ? (\n <BaseTooltip clientPoint={anchor.clientPoint}>\n <TrackTooltipContent\n model={model}\n track={track}\n col={anchor.value}\n />\n </BaseTooltip>\n ) : null}\n </div>\n </div>\n )\n})\n\nexport default Track\n", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"m7 10 5 5 5-5z\"\n}), 'ArrowDropDown');", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n}), 'Close');", "import { useEffect, useRef, useState } from 'react'\n\nimport { WheelZoomSmoother } from './wheelZoom.ts'\n\nimport type { MsaViewModel } from './model.ts'\n\nconst zoomSettleMs = 150\n\n// a wheel event this soon after one the view took belongs to the same gesture,\n// so the view keeps it at an edge rather than handing the momentum to the page\nconst wheelLatchMs = 150\n\ntype Axes = 'x' | 'y' | 'xy'\n\n/**\n * Whether a vertical wheel `delta` moves a view at `scrollY`. At the top or\n * bottom, or when every row fits, the page scrolls instead, so an embedded\n * viewer never traps the reader scrolling past it.\n */\nexport function canScrollY(model: MsaViewModel, delta: number) {\n const { scrollY, maxScrollY } = model\n return delta > 0 ? scrollY > maxScrollY : delta < 0 && scrollY < 0\n}\n\n// Safari reads a touch-action holding pinch-zoom as invalid and falls back to\n// auto, which hands every swipe to the page\nconst pinchZoom =\n typeof CSS !== 'undefined' && CSS.supports('touch-action', 'pinch-zoom')\n ? 'pinch-zoom'\n : undefined\n\nfunction withPinch(pan: string) {\n return pinchZoom ? `${pan} ${pinchZoom}` : pan\n}\n\n/**\n * The CSS touch-action for a pannable area: the browser keeps a touch pan\n * along every axis the view cannot scroll, and pinch zoom on the page where it\n * supports that value.\n */\nexport function panTouchAction(model: MsaViewModel, axes: Axes) {\n const x = axes.includes('x') && model.maxScrollX < 0\n const y = axes.includes('y') && model.maxScrollY < 0\n return x && y\n ? (pinchZoom ?? 'none')\n : x\n ? withPinch('pan-y')\n : y\n ? withPinch('pan-x')\n : 'auto'\n}\n\n/**\n * Wheel scrolling, wheel zoom and pointer-drag panning of `model` over `ref`,\n * along `axes`. The returned `onPointerDown` starts a pan with a mouse, a pen\n * or a finger; put `touchAction` on the same element.\n */\nexport function useWheelScroll({\n ref,\n model,\n axes,\n zoom,\n onWheelScroll,\n}: {\n ref: React.RefObject<HTMLDivElement | null>\n model: MsaViewModel\n axes: Axes\n zoom?: boolean\n onWheelScroll?: (event: WheelEvent) => void\n}) {\n const scheduled = useRef(false)\n const zoomFrame = useRef<number | undefined>(undefined)\n const zoomSettle = useRef<ReturnType<typeof setTimeout> | undefined>(\n undefined,\n )\n const deltaX = useRef(0)\n const deltaY = useRef(0)\n const lastTaken = useRef(Number.NEGATIVE_INFINITY)\n const zoomSmoother = useRef(new WheelZoomSmoother())\n const zoomX = useRef(0)\n const zoomY = useRef(0)\n const lastZoomTime = useRef<number | null>(null)\n const prev = useRef({ x: 0, y: 0 })\n const latest = useRef({ x: 0, y: 0 })\n const panFrame = useRef(false)\n // the pointer that started the pan; a second finger neither moves nor ends it\n const [panPointer, setPanPointer] = useState<number>()\n const x = axes.includes('x')\n const y = axes.includes('y')\n\n useEffect(() => {\n const curr = ref.current\n if (!curr) {\n return\n }\n function onWheel(event: WheelEvent) {\n // ctrlKey is also set by trackpad pinch gestures on all platforms. when\n // scrollZoom is on, a plain vertical-dominant wheel zooms too; holding\n // shift is the escape hatch to pan instead.\n const isCtrlZoom = event.ctrlKey || event.metaKey\n const isScrollZoom =\n model.scrollZoom &&\n !event.shiftKey &&\n Math.abs(event.deltaY) >= Math.abs(event.deltaX)\n if (zoom && (isCtrlZoom || isScrollZoom)) {\n const rect = curr!.getBoundingClientRect()\n zoomSmoother.current.add(event.deltaY, event.deltaMode, isCtrlZoom)\n zoomX.current = event.clientX - rect.left\n zoomY.current = event.clientY - rect.top\n if (zoomFrame.current === undefined) {\n lastZoomTime.current = null\n const frame = (now: number) => {\n const elapsed =\n lastZoomTime.current === null ? 16.67 : now - lastZoomTime.current\n lastZoomTime.current = now\n model.wheelZoomToPos(\n zoomSmoother.current.step(Math.min(100, elapsed)),\n zoomX.current,\n zoomY.current,\n )\n clearTimeout(zoomSettle.current)\n zoomSettle.current = setTimeout(() => {\n model.endWheelZoom()\n }, zoomSettleMs)\n zoomFrame.current = zoomSmoother.current.idle\n ? undefined\n : requestAnimationFrame(frame)\n }\n zoomFrame.current = requestAnimationFrame(frame)\n }\n event.preventDefault()\n event.stopPropagation()\n return\n }\n // the dominant axis decides: a trackpad's vertical swipe carries a pixel\n // or two of deltaX, which must not hold the page at the bottom row. A\n // horizontal wheel stays taken at the edges, where the page would read\n // it as a swipe back through history.\n const { deltaX: dx, deltaY: dy } = event\n const vertical = Math.abs(dy) >= Math.abs(dx)\n const latched = event.timeStamp - lastTaken.current < wheelLatchMs\n const takeY =\n y && dy !== 0 && (latched || canScrollY(model, dy) || !vertical)\n const takeX = x && dx !== 0 && (!vertical || takeY)\n if (takeX || takeY) {\n if (takeY && vertical) {\n lastTaken.current = event.timeStamp\n }\n onWheelScroll?.(event)\n deltaX.current += takeX ? event.deltaX : 0\n deltaY.current += takeY ? event.deltaY : 0\n if (!scheduled.current) {\n scheduled.current = true\n requestAnimationFrame(() => {\n model.doScrollX(-deltaX.current)\n model.doScrollY(-deltaY.current)\n deltaX.current = 0\n deltaY.current = 0\n scheduled.current = false\n })\n }\n event.preventDefault()\n event.stopPropagation()\n }\n }\n curr.addEventListener('wheel', onWheel, { passive: false })\n return () => {\n curr.removeEventListener('wheel', onWheel)\n if (zoomFrame.current !== undefined) {\n cancelAnimationFrame(zoomFrame.current)\n zoomFrame.current = undefined\n }\n clearTimeout(zoomSettle.current)\n }\n }, [ref, model, x, y, zoom, onWheelScroll])\n\n useEffect(() => {\n if (panPointer === undefined) {\n return\n }\n // a frame applies the distance from the last applied position to the\n // newest one, so a move landing while a frame is pending is not dropped\n function onMove(event: PointerEvent) {\n if (event.pointerId !== panPointer) {\n return\n }\n event.preventDefault()\n latest.current = { x: event.clientX, y: event.clientY }\n if (!panFrame.current) {\n panFrame.current = true\n requestAnimationFrame(() => {\n const to = latest.current\n model.doScrollX(x ? to.x - prev.current.x : 0)\n model.doScrollY(y ? to.y - prev.current.y : 0)\n prev.current = to\n panFrame.current = false\n })\n }\n }\n function onUp(event: PointerEvent) {\n if (event.pointerId === panPointer) {\n setPanPointer(undefined)\n }\n }\n window.addEventListener('pointermove', onMove, true)\n window.addEventListener('pointerup', onUp, true)\n window.addEventListener('pointercancel', onUp, true)\n return () => {\n window.removeEventListener('pointermove', onMove, true)\n window.removeEventListener('pointerup', onUp, true)\n window.removeEventListener('pointercancel', onUp, true)\n }\n }, [panPointer, model, x, y])\n\n function onPointerDown(event: React.PointerEvent) {\n if (event.button === 0 && event.isPrimary && panPointer === undefined) {\n prev.current = { x: event.clientX, y: event.clientY }\n latest.current = prev.current\n setPanPointer(event.pointerId)\n }\n }\n\n return { onPointerDown, touchAction: panTouchAction(model, axes) }\n}\n", "// Chrome and Firefox encode a trackpad pinch as ctrl+wheel with\n// deltaY = -100 * ln(scale), so dividing by 100 tracks the fingers 1:1\nconst PINCH_PX_PER_LOG = 100\n\n// a plain scroll covers more pixels than a pinch for the same intent\nconst SCROLL_PX_PER_LOG = 400\n\n// a pixel delta at least this large counts as a wheel notch\nconst NOTCH_MIN_PX = 40\n\nexport const NOTCH_ZOOM = 1.25\n\n// the time constant a notch eases in over\nconst NOTCH_TAU_MS = 60\n\n// a burst of continuous events coalesced into one frame applies at most 2x\nconst MAX_FRAME_LOG = Math.log(2)\n\n// the queue holds at most four notches, which caps a fast spin\nconst MAX_PENDING_LOG = 4 * Math.log(NOTCH_ZOOM)\n\nexport function normalizeWheelDelta(delta: number, mode: number) {\n if (mode === 1) {\n return delta * 16\n }\n if (mode === 2) {\n return delta * 100\n }\n return delta\n}\n\nconst clampAbs = (x: number, max: number) => Math.max(-max, Math.min(max, x))\n\n// Positive log zooms in. Feed every wheel event to add() and call step() once\n// per animation frame with the time since the last frame; step() returns the\n// multiplier for colWidth/rowHeight.\nexport class WheelZoomSmoother {\n private continuous = 0\n private pending = 0\n\n add(deltaY: number, deltaMode: number, isPinch: boolean) {\n const px = normalizeWheelDelta(deltaY, deltaMode)\n if (deltaMode !== 0 || Math.abs(px) >= NOTCH_MIN_PX) {\n const notches =\n deltaMode !== 0 ? 1 : Math.min(Math.max(Math.abs(px) / 100, 1), 3)\n this.pending = clampAbs(\n this.pending - Math.sign(px) * notches * Math.log(NOTCH_ZOOM),\n MAX_PENDING_LOG,\n )\n } else {\n this.continuous -= px / (isPinch ? PINCH_PX_PER_LOG : SCROLL_PX_PER_LOG)\n }\n }\n\n get idle() {\n return this.continuous === 0 && this.pending === 0\n }\n\n step(elapsedMs: number) {\n let eased = this.pending * (1 - Math.exp(-elapsedMs / NOTCH_TAU_MS))\n if (Math.abs(this.pending - eased) < 0.005) {\n eased = this.pending\n }\n this.pending -= eased\n const log = clampAbs(this.continuous + eased, MAX_FRAME_LOG)\n this.continuous = 0\n return Math.exp(log)\n }\n}\n", "import type { MsaViewModel } from '../../model.ts'\n\nexport function onMsaKey(\n model: MsaViewModel,\n { key, shiftKey }: { key: string; shiftKey: boolean },\n) {\n const { colWidth, rowHeight, msaCanvasWidth, msaAreaHeight } = model\n const dx = shiftKey ? msaCanvasWidth : colWidth\n const dy = shiftKey ? msaAreaHeight : rowHeight\n switch (key) {\n case 'ArrowLeft':\n model.doScrollX(dx)\n return true\n case 'ArrowRight':\n model.doScrollX(-dx)\n return true\n case 'ArrowUp':\n model.doScrollY(dy)\n return true\n case 'ArrowDown':\n model.doScrollY(-dy)\n return true\n case '+':\n case '=':\n model.zoomIn()\n return true\n case '-':\n model.zoomOut()\n return true\n case '0':\n model.resetZoom()\n return true\n case 'Home':\n model.setScrollX(0)\n return true\n case 'End':\n model.setScrollX(model.maxScrollX)\n return true\n case 'Escape':\n if (model.selection) {\n model.clearSelection()\n return true\n }\n return false\n default:\n return false\n }\n}\n", "import React from 'react'\n\nimport { observer } from 'mobx-react'\n\nimport { useCanvasTheme } from '../../darkReader.ts'\nimport { useCanvasAutorun } from '../../useCanvasAutorun.ts'\nimport { TrackResizeHandle } from '../ResizeHandles.tsx'\nimport { drawTrackBlock } from './drawTracks.ts'\n\nimport type { MsaViewModel } from '../../model.ts'\nimport type { BasicTrack } from '../../types.ts'\n\nconst TrackBlock = observer(function ({\n model,\n track,\n offsetX,\n}: {\n model: MsaViewModel\n track: BasicTrack\n offsetX: number\n}) {\n const { blockSize, highResScaleFactor } = model\n const { height } = track.model\n const theme = useCanvasTheme()\n const canvasWidth = blockSize * highResScaleFactor\n const canvasHeight = height * highResScaleFactor\n\n const ref = useCanvasAutorun({\n draw: ctx => {\n ctx.resetTransform()\n ctx.clearRect(0, 0, canvasWidth, canvasHeight)\n drawTrackBlock({ model, ctx, track, offsetX, theme })\n },\n width: canvasWidth,\n height: canvasHeight,\n deps: [model, track, offsetX, theme],\n })\n\n return (\n <canvas\n ref={ref}\n width={canvasWidth}\n height={canvasHeight}\n style={{\n position: 'absolute',\n left: offsetX,\n width: blockSize,\n height,\n }}\n />\n )\n})\n\n/**\n * The canvas blocks covering one track's row of the alignment. Every track kind\n * shares this host: what differs between conservation, sequence logo and the\n * Stockholm text tracks is which draw function `drawTrackBlock` dispatches to,\n * not how the blocks are laid out or kept in sync with the horizontal scroll.\n */\nconst TrackBlocks = observer(function ({\n model,\n track,\n}: {\n model: MsaViewModel\n track: BasicTrack\n}) {\n // msaCanvasWidth, not msaAreaWidth: tracks stop where the alignment canvas\n // does, not 20px further under the vertical scrollbar, so their columns and\n // the hover indicator line up with the alignment\n const { blocksX, msaCanvasWidth, scrollX } = model\n const { kind, height, data, arcs } = track.model\n\n // a track with nothing to draw would still take up its vertical space\n if ((kind === 'text' && !data) || (kind === 'arc' && !arcs?.length)) {\n return null\n }\n\n return (\n <div\n style={{\n position: 'relative',\n height,\n width: msaCanvasWidth,\n overflow: 'hidden',\n }}\n >\n {/* one transform for the whole block set, matching MSACanvas */}\n <div\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n transform: `translateX(${scrollX}px)`,\n willChange: 'transform',\n }}\n >\n {blocksX.map(bx => (\n <TrackBlock key={bx} model={model} track={track} offsetX={bx} />\n ))}\n </div>\n <TrackResizeHandle model={model} track={track} />\n </div>\n )\n})\n\nexport default TrackBlocks\n", "import { useSyncExternalStore } from 'react'\n\nimport { createJBrowseTheme } from '@jbrowse/core/ui/theme'\nimport { useTheme } from '@mui/material'\n\nimport type { Theme } from '@mui/material'\n\n// Dark Reader's Dynamic mode rewrites the page's CSS and leaves canvas pixels\n// alone, so a light theme's black letters land on the dark page it paints.\n// Inlined from @jbrowse/core/util/systemColorScheme, which an older host core\n// lacks (see CLAUDE.md on externals).\nconst DARK_READER_ATTRIBUTE = 'data-darkreader-scheme'\n\nfunction darkReaderIsDark() {\n return (\n typeof document !== 'undefined' &&\n document.documentElement.getAttribute(DARK_READER_ATTRIBUTE) === 'dark'\n )\n}\n\nfunction onDarkReaderChange(listener: () => void) {\n if (\n typeof MutationObserver !== 'function' ||\n typeof document === 'undefined'\n ) {\n return () => {}\n }\n const observer = new MutationObserver(listener)\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [DARK_READER_ATTRIBUTE],\n })\n return () => {\n observer.disconnect()\n }\n}\n\nlet darkTheme: Theme | undefined\n\n/**\n * The theme a canvas draws in: the surrounding MUI theme, or a dark one while\n * Dark Reader darkens a light page. The DOM keeps the surrounding theme, which\n * Dark Reader restyles itself, and the SVG export keeps it too.\n */\nexport function useCanvasTheme() {\n const theme = useTheme()\n const darkReader = useSyncExternalStore(\n onDarkReaderChange,\n darkReaderIsDark,\n () => false,\n )\n if (darkReader && theme.palette.mode !== 'dark') {\n darkTheme ??= createJBrowseTheme({ palette: { mode: 'dark' } })\n return darkTheme\n }\n return theme\n}\n", "import { useEffect, useRef } from 'react'\n\nimport { autorun } from 'mobx'\n\nimport type React from 'react'\n\n/**\n * Wires a canvas ref to a mobx autorun: grabs the 2d context once the canvas\n * mounts and re-runs `draw` whenever any observable it reads changes.\n *\n * `width`/`height` are the canvas backing store size (logical size times the\n * high-res scale factor). Assigning either clears the bitmap, and React assigns\n * them after the mobx reaction has drawn at the old size, so the effect redraws\n * when they change.\n *\n * `deps` covers everything else the effect should re-subscribe on, matching a\n * normal useEffect dep array.\n */\nexport function useCanvasAutorun({\n draw,\n width,\n height,\n deps,\n}: {\n draw: (ctx: CanvasRenderingContext2D) => void\n width: number\n height: number\n deps: React.DependencyList\n}) {\n const ref = useRef<HTMLCanvasElement>(null)\n // the autorun tracks its own observable reads, so `draw` is intentionally not\n // a dependency; `deps` plus the canvas size control when it re-subscribes\n useEffect(() => {\n const ctx = ref.current?.getContext('2d')\n return ctx\n ? autorun(() => {\n draw(ctx)\n })\n : undefined\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [...deps, width, height])\n return ref\n}\n", "import React from 'react'\n\nimport { observer } from 'mobx-react'\n\nimport { columnLogoStack } from '../../sequenceLogo.ts'\nimport { barTrackValues } from './drawTracks.ts'\n\nimport type { MsaViewModel } from '../../model.ts'\nimport type { BasicTrack } from '../../types.ts'\n\nconst pct = (n: number) => `${Math.round(n * 100)}%`\n\nconst MAX_PARTNERS = 8\n\nfunction ColumnLabel({ model, col }: { model: MsaViewModel; col: number }) {\n const { relativeTo } = model\n const pos = relativeTo\n ? model.visibleColToSeqPosOneBased(relativeTo, col)\n : undefined\n return (\n <b>\n Column {col + 1}\n {pos === undefined ? null : ` (${relativeTo}:${pos})`}\n </b>\n )\n}\n\nfunction BarTooltip({\n model,\n track,\n col,\n}: {\n model: MsaViewModel\n track: BasicTrack\n col: number\n}) {\n const { id, name } = track.model\n const value = barTrackValues(model, id)[col]\n return value === undefined ? null : (\n <div>\n <ColumnLabel model={model} col={col} />\n <br />\n {name}: {value.toFixed(2)}\n </div>\n )\n}\n\nfunction LogoTooltip({ model, col }: { model: MsaViewModel; col: number }) {\n const stats = model.columnStatsAt(col)\n if (!stats) {\n return null\n }\n const { total, consensusLetter, consensusFraction, gapFraction } = stats\n const stack = columnLogoStack(model.colStats, col, model.alphabetMaxBits)\n const bits = stack.reduce((a, b) => a + b.bits, 0)\n return (\n <div>\n <ColumnLabel model={model} col={col} /> ({total} seqs)\n <br />\n Information: {bits.toFixed(2)} bits\n <br />\n Consensus: {consensusLetter || '-'} ({pct(consensusFraction)})\n <br />\n Gaps: {pct(gapFraction)}\n <br />\n {stats.distribution.slice(0, 6).map(([letter, count]) => (\n <span key={letter} style={{ marginRight: 8 }}>\n {letter} {pct(count / total)}\n </span>\n ))}\n </div>\n )\n}\n\nfunction TextTooltip({\n model,\n track,\n col,\n}: {\n model: MsaViewModel\n track: BasicTrack\n col: number\n}) {\n const { name, data } = track.model\n const letter = data?.[col]\n return letter === undefined ? null : (\n <div>\n <ColumnLabel model={model} col={col} />\n <br />\n {name}: {letter === ' ' ? 'blank' : letter}\n </div>\n )\n}\n\nfunction ArcTooltip({\n model,\n track,\n col,\n}: {\n model: MsaViewModel\n track: BasicTrack\n col: number\n}) {\n const { name, arcs } = track.model\n const partners = (arcs ?? [])\n .filter(arc => arc.start === col || arc.end === col)\n .map(arc => (arc.start === col ? arc.end : arc.start) + 1)\n return partners.length === 0 ? null : (\n <div>\n <ColumnLabel model={model} col={col} />\n <br />\n {name}: pairs with {partners.slice(0, MAX_PARTNERS).join(', ')}\n {partners.length > MAX_PARTNERS ? '...' : null}\n </div>\n )\n}\n\n/**\n * One track's reading at the hovered column: a bar track's value, the logo's\n * information content and composition, the columns an arc joins, the letter on a\n * text track. `drawTrackBlock` dispatches on the same `kind`, so a new kind\n * needs a case in both.\n */\nconst TrackTooltipContent = observer(function ({\n model,\n track,\n col,\n}: {\n model: MsaViewModel\n track: BasicTrack\n col: number\n}) {\n switch (track.model.kind) {\n case 'bar': {\n return <BarTooltip model={model} track={track} col={col} />\n }\n case 'logo': {\n return <LogoTooltip model={model} col={col} />\n }\n case 'text':\n case 'reference': {\n return <TextTooltip model={model} track={track} col={col} />\n }\n case 'arc': {\n return <ArcTooltip model={model} track={track} col={col} />\n }\n case 'ruler': {\n return (\n <div>\n <ColumnLabel model={model} col={col} />\n </div>\n )\n }\n }\n})\n\nexport default TrackTooltipContent\n", "import { isAlive } from '@jbrowse/mobx-state-tree'\n\nimport type { MsaViewModel } from '../model.ts'\n\n// a press that travels further than this, in px, is a drag and not a click\nexport const maxClickTravel = 3\n\nexport interface ClientPoint {\n clientX: number\n clientY: number\n}\n\n/**\n * Follows a press through the window until its release, selecting the block\n * between the cell it started on and the cell under the pointer. The selection\n * starts once the pointer travels past `maxClickTravel`, so a press that stays\n * put reaches the click handlers unchanged. `cellAt` maps a client point to a\n * visible column and row index, or a column alone to select across every row.\n */\nexport function dragSelection(\n model: MsaViewModel,\n start: ClientPoint,\n cellAt: (point: ClientPoint) => { col: number; row?: number },\n) {\n const anchor = cellAt(start)\n const { clientX, clientY } = start\n let dragging = false\n function onMove(event: MouseEvent) {\n dragging ||=\n Math.hypot(event.clientX - clientX, event.clientY - clientY) >\n maxClickTravel\n if (dragging && isAlive(model)) {\n model.selectBlock(anchor, cellAt(event))\n }\n }\n function onUp() {\n window.removeEventListener('mousemove', onMove)\n window.removeEventListener('mouseup', onUp)\n }\n window.addEventListener('mousemove', onMove)\n window.addEventListener('mouseup', onUp)\n}\n", "import { useState } from 'react'\n\nexport interface HoverAnchor<T> {\n clientPoint: { x: number; y: number }\n value: T\n}\n\n/**\n * The thing under the pointer and the point a tooltip about it hangs from,\n * 15px below the cursor so the tooltip clears it.\n */\nexport function useHoverAnchor<T>() {\n const [anchor, setAnchor] = useState<HoverAnchor<T>>()\n\n function hoverAt(\n event: { clientX: number; clientY: number },\n value: T | undefined,\n ) {\n setAnchor(\n value === undefined\n ? undefined\n : { value, clientPoint: { x: event.clientX, y: event.clientY + 15 } },\n )\n }\n\n function clearAnchor() {\n setAnchor(undefined)\n }\n\n return { anchor, hoverAt, clearAnchor }\n}\n", "import { dragSelection } from '../selectionDrag.ts'\nimport { useHoverAnchor } from '../useHoverAnchor.ts'\n\nimport type { MsaViewModel } from '../../model.ts'\nimport type React from 'react'\n\n/**\n * Translates pointer events over a track's row into the hovered column and a\n * tooltip anchor. The track shares the alignment's columns, so hovering it sets\n * the model's mouse column too and the alignment's hover band follows along. A\n * drag along the row selects the columns it covers across every row.\n *\n * `tooltip` off skips the anchor, so a track whose tooltip is turned off still\n * drives the hover band without re-rendering on every mouse move.\n */\nexport function useTrackHover({\n model,\n tooltip,\n}: {\n model: MsaViewModel\n tooltip: boolean\n}) {\n const { anchor, hoverAt, clearAnchor } = useHoverAnchor<number>()\n\n // the blocks are laid out in column space and scrolled by a transform on\n // their container, so the pointer's column comes off the untransformed row\n function colAt(clientX: number, left: number) {\n return Math.floor((clientX - left - model.scrollX) / model.colWidth)\n }\n\n function onMouseMove(event: React.MouseEvent, el: HTMLElement) {\n const col = colAt(event.clientX, el.getBoundingClientRect().left)\n const hit = col >= 0 && col < model.numColumns\n model.setMousePos(hit ? col : undefined, undefined)\n if (tooltip) {\n hoverAt(event, hit ? col : undefined)\n }\n }\n\n // a press on a track's canvas, which leaves out the resize divider under it.\n // The row takes the focus, so Escape reaches onMsaKey from there too\n function onMouseDown(event: React.MouseEvent, el: HTMLElement) {\n if (event.button === 0 && event.target instanceof HTMLCanvasElement) {\n event.preventDefault()\n el.focus({ preventScroll: true })\n const { left } = el.getBoundingClientRect()\n dragSelection(model, event, ({ clientX }) => ({\n col: colAt(clientX, left),\n }))\n }\n }\n\n function onMouseLeave() {\n clearAnchor()\n model.setMousePos(undefined, undefined)\n }\n\n return {\n anchor: tooltip ? anchor : undefined,\n onMouseMove,\n onMouseDown,\n onMouseLeave,\n }\n}\n", "import React, { useCallback } from 'react'\n\nimport { observer } from 'mobx-react'\n\nimport DragHandle from './DragHandle.tsx'\n\nimport type { MsaViewModel } from '../model.ts'\n\nconst width = 20\n\nconst VerticalScrollbar = observer(({ model }: { model: MsaViewModel }) => {\n const { msaAreaHeight, scrollY, totalHeight } = model\n const unit = msaAreaHeight / totalHeight\n const t = -scrollY * unit\n const b = (-scrollY + msaAreaHeight) * unit\n\n const onDrag = useCallback(\n (delta: number, startScroll: number) => {\n model.setScrollY(startScroll - delta / unit)\n },\n [model, unit],\n )\n\n return (\n <div\n onPointerDown={event => {\n if (event.button === 0 && event.target === event.currentTarget) {\n const y =\n event.clientY - event.currentTarget.getBoundingClientRect().top\n model.setScrollY(-y / unit + msaAreaHeight / 2)\n }\n }}\n style={{\n position: 'relative',\n width,\n height: msaAreaHeight,\n borderLeft: '1px solid #555',\n borderTop: '1px solid #555',\n boxSizing: 'border-box',\n }}\n >\n <DragHandle\n axis=\"y\"\n variant=\"thumb\"\n getStart={() => model.scrollY}\n onDrag={onDrag}\n style={{\n top: Math.max(0, t),\n left: 0,\n boxSizing: 'border-box',\n width,\n height: Math.max(b - t, 20),\n }}\n />\n </div>\n )\n})\nexport default VerticalScrollbar\n", "import React, { useEffect } from 'react'\n\nimport useMeasure from '@jbrowse/core/util/useMeasure'\nimport Tune from '@mui/icons-material/Tune'\nimport { Button, IconButton, Toolbar, Tooltip } from '@mui/material'\nimport AppBar from '@mui/material/AppBar'\nimport { observer } from 'mobx-react'\n\nimport StatusMessage from '../StatusMessage.tsx'\nimport HeaderInfoArea from './HeaderInfoArea.tsx'\nimport HiddenColumnsChip from './HiddenColumnsChip.tsx'\nimport LoadWarnings from './LoadWarnings.tsx'\nimport MenuBar from './MenuBar.tsx'\nimport MultiAlignmentSelector from './MultiAlignmentSelector.tsx'\nimport ScrollZoomCheckbox from './ScrollZoomCheckbox.tsx'\nimport SelectionMenu from './SelectionMenu.tsx'\nimport UnshareableDataWarning from './UnshareableDataWarning.tsx'\nimport ZoomControls from './ZoomControls.tsx'\n\nimport type { MsaViewModel } from '../../model.ts'\n\nexport interface ToolbarSlots {\n toolbarStart?: React.ReactNode\n toolbarEnd?: React.ReactNode\n}\n\nconst Header = observer(function ({\n model,\n toolbarStart,\n toolbarEnd,\n}: { model: MsaViewModel } & ToolbarSlots) {\n const [ref, { height }] = useMeasure()\n useEffect(() => {\n model.setHeaderHeight(height ?? 0)\n }, [model, height])\n useEffect(\n () => () => {\n model.setHeaderHeight(0)\n },\n [model],\n )\n return (\n <AppBar\n ref={ref}\n position=\"static\"\n color=\"default\"\n elevation={0}\n sx={{ borderBottom: 1, borderColor: 'divider' }}\n >\n <Toolbar\n variant=\"dense\"\n disableGutters\n sx={{ minHeight: 40, flexWrap: 'wrap', px: 0.5 }}\n >\n {toolbarStart}\n <MenuBar model={model} />\n {model.embeddedMode ? (\n <Tooltip title=\"Settings\">\n <IconButton\n data-testid=\"settings_button\"\n aria-label=\"Settings\"\n color={model.settingsOpen ? 'primary' : 'inherit'}\n onClick={() => {\n model.setSettingsOpen(!model.settingsOpen)\n }}\n >\n <Tune />\n </IconButton>\n </Tooltip>\n ) : (\n <Button\n data-testid=\"settings_button\"\n size=\"small\"\n startIcon={<Tune />}\n color={model.settingsOpen ? 'primary' : 'inherit'}\n variant={model.settingsOpen ? 'outlined' : 'text'}\n onClick={() => {\n model.setSettingsOpen(!model.settingsOpen)\n }}\n sx={{ mx: 0.5, flexShrink: 0 }}\n >\n Settings\n </Button>\n )}\n <ZoomControls model={model} />\n <ScrollZoomCheckbox model={model} />\n <HiddenColumnsChip model={model} />\n <div style={{ paddingLeft: 20, margin: 'auto' }}>\n <MultiAlignmentSelector model={model} />\n </div>\n {/* zero flex-basis, so what appears here on a selection or a hover\n shrinks into the header's spare width and never wraps it */}\n <div style={{ flex: '1 1 0', minWidth: 0, display: 'flex' }}>\n <SelectionMenu model={model} />\n <HeaderInfoArea model={model} />\n </div>\n <LoadWarnings model={model} />\n <UnshareableDataWarning model={model} />\n <StatusMessage model={model} variant=\"header\" />\n {toolbarEnd}\n </Toolbar>\n </AppBar>\n )\n})\n\nexport default Header\n", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z\"\n}), 'Tune');", "'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { styled } from \"../zero-styled/index.mjs\";\nimport memoTheme from \"../utils/memoTheme.mjs\";\nimport { useDefaultProps } from \"../DefaultPropsProvider/index.mjs\";\nimport { applyChildrenFocusVisible } from \"../styles/focusVisible.mjs\";\nimport capitalize from \"../utils/capitalize.mjs\";\nimport createSimplePaletteValueFilter from \"../utils/createSimplePaletteValueFilter.mjs\";\nimport Paper from \"../Paper/index.mjs\";\nimport { getAppBarUtilityClass } from \"./appBarClasses.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n color,\n position,\n classes\n } = ownerState;\n const slots = {\n root: ['root', `color${capitalize(color)}`, `position${capitalize(position)}`]\n };\n return composeClasses(slots, getAppBarUtilityClass, classes);\n};\n\n// var2 is the fallback.\n// Ex. var1: 'var(--a)', var2: 'var(--b)'; return: 'var(--a, var(--b))'\nconst joinVars = (var1, var2) => var1 ? `${var1.replace(')', '')}, ${var2})` : var2;\nconst AppBarRoot = styled(Paper, {\n name: 'MuiAppBar',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, styles[`position${capitalize(ownerState.position)}`], styles[`color${capitalize(ownerState.color)}`]];\n }\n})(memoTheme(({\n theme\n}) => ({\n display: 'flex',\n flexDirection: 'column',\n width: '100%',\n boxSizing: 'border-box',\n // Prevent padding issue with the Modal and fixed positioned AppBar.\n flexShrink: 0,\n variants: [{\n props: {\n position: 'fixed'\n },\n style: {\n position: 'fixed',\n zIndex: (theme.vars || theme).zIndex.appBar,\n top: 0,\n left: 'auto',\n right: 0,\n '@media print': {\n // Prevent the app bar to be visible on each printed page.\n position: 'absolute'\n }\n }\n }, {\n props: {\n position: 'absolute'\n },\n style: {\n position: 'absolute',\n zIndex: (theme.vars || theme).zIndex.appBar,\n top: 0,\n left: 'auto',\n right: 0\n }\n }, {\n props: {\n position: 'sticky'\n },\n style: {\n position: 'sticky',\n zIndex: (theme.vars || theme).zIndex.appBar,\n top: 0,\n left: 'auto',\n right: 0\n }\n }, {\n props: {\n position: 'static'\n },\n style: {\n position: 'static'\n }\n }, {\n props: {\n position: 'relative'\n },\n style: {\n position: 'relative'\n }\n }, {\n props: {\n color: 'inherit'\n },\n style: {\n '--AppBar-color': 'inherit',\n color: 'var(--AppBar-color)'\n }\n }, {\n props: {\n color: 'default'\n },\n style: {\n '--AppBar-background': theme.vars ? theme.vars.palette.AppBar.defaultBg : theme.palette.grey[100],\n '--AppBar-color': theme.vars ? theme.vars.palette.text.primary : theme.palette.getContrastText(theme.palette.grey[100]),\n ...theme.applyStyles('dark', {\n '--AppBar-background': theme.vars ? theme.vars.palette.AppBar.defaultBg : theme.palette.grey[900],\n '--AppBar-color': theme.vars ? theme.vars.palette.text.primary : theme.palette.getContrastText(theme.palette.grey[900])\n })\n }\n }, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter(['contrastText'])).map(([color]) => ({\n props: {\n color\n },\n style: {\n '--AppBar-background': (theme.vars ?? theme).palette[color].main,\n '--AppBar-color': (theme.vars ?? theme).palette[color].contrastText,\n ...(theme.focusVisible && applyChildrenFocusVisible(`0 0 0 4px ${(theme.vars || theme).palette.background.default}`))\n }\n })), {\n props: props => props.enableColorOnDark === true && !['inherit', 'transparent'].includes(props.color),\n style: {\n backgroundColor: 'var(--AppBar-background)',\n color: 'var(--AppBar-color)'\n }\n }, {\n props: props => props.enableColorOnDark === false && !['inherit', 'transparent'].includes(props.color),\n style: {\n backgroundColor: 'var(--AppBar-background)',\n color: 'var(--AppBar-color)',\n ...theme.applyStyles('dark', {\n backgroundColor: theme.vars ? joinVars(theme.vars.palette.AppBar.darkBg, 'var(--AppBar-background)') : null,\n color: theme.vars ? joinVars(theme.vars.palette.AppBar.darkColor, 'var(--AppBar-color)') : null\n })\n }\n }, {\n props: {\n color: 'transparent'\n },\n style: {\n '--AppBar-background': 'transparent',\n '--AppBar-color': 'inherit',\n backgroundColor: 'var(--AppBar-background)',\n color: 'var(--AppBar-color)',\n ...theme.applyStyles('dark', {\n backgroundImage: 'none'\n })\n }\n }]\n})));\nconst AppBar = /*#__PURE__*/React.forwardRef(function AppBar(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiAppBar'\n });\n const {\n className,\n color = 'primary',\n enableColorOnDark = false,\n position = 'fixed',\n ...other\n } = props;\n const ownerState = {\n ...props,\n color,\n position,\n enableColorOnDark\n };\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(AppBarRoot, {\n square: true,\n component: \"header\",\n ownerState: ownerState,\n elevation: 4,\n className: clsx(classes.root, className, position === 'fixed' && 'mui-fixed'),\n ref: ref,\n ...other\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? AppBar.propTypes /* remove-proptypes */ = {\n // \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Warning \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n // \u2502 These PropTypes are generated from the TypeScript type definitions. \u2502\n // \u2502 To update them, edit the d.ts file and run `pnpm proptypes`. \u2502\n // \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The color of the component.\n * It supports both default and custom theme colors, which can be added as shown in the\n * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).\n * @default 'primary'\n */\n color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['default', 'inherit', 'primary', 'secondary', 'transparent', 'error', 'info', 'success', 'warning']), PropTypes.string]),\n /**\n * Shadow depth, corresponds to `dp` in the spec.\n * It accepts values between 0 and 24 inclusive.\n * @default 4\n */\n elevation: PropTypes.number,\n /**\n * If true, the `color` prop is applied in dark mode.\n * @default false\n */\n enableColorOnDark: PropTypes.bool,\n /**\n * The positioning type. The behavior of the different options is described\n * [in the MDN web docs](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/position).\n * Note: `sticky` is not universally supported and will fall back to `static` when unavailable.\n * @default 'fixed'\n */\n position: PropTypes.oneOf(['absolute', 'fixed', 'relative', 'static', 'sticky']),\n /**\n * If `false`, rounded corners are enabled.\n * @default true\n */\n square: PropTypes.bool,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport default AppBar;", "function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;", "/* eslint no-restricted-syntax: 0, prefer-template: 0, guard-for-in: 0\n ---\n These rules are preventing the performance optimizations below.\n */\n\n/**\n * Compose classes from multiple sources.\n *\n * @example\n * ```tsx\n * const slots = {\n * root: ['root', 'primary'],\n * label: ['label'],\n * };\n *\n * const getUtilityClass = (slot) => `MuiButton-${slot}`;\n *\n * const classes = {\n * root: 'my-root-class',\n * };\n *\n * const output = composeClasses(slots, getUtilityClass, classes);\n * // {\n * // root: 'MuiButton-root MuiButton-primary my-root-class',\n * // label: 'MuiButton-label',\n * // }\n * ```\n *\n * @param slots a list of classes for each possible slot\n * @param getUtilityClass a function to resolve the class based on the slot name\n * @param classes the input classes from props\n * @returns the resolved classes for all slots\n */\nexport default function composeClasses(slots, getUtilityClass, classes = undefined) {\n const output = {};\n for (const slotName in slots) {\n const slot = slots[slotName];\n let buffer = '';\n let start = true;\n for (let i = 0; i < slot.length; i += 1) {\n const value = slot[i];\n if (value) {\n buffer += (start === true ? '' : ' ') + getUtilityClass(value);\n start = false;\n if (classes && classes[value]) {\n buffer += ' ' + classes[value];\n }\n }\n }\n output[slotName] = buffer;\n }\n return output;\n}", "// Based on https://github.com/TehShrike/deepmerge\n// Based on https://github.com/fastify/deepmerge\n// MIT License\n// Copyright (c) 2012 - 2022 James Halliday, Josh Duff, and other contributors of deepmerge\n\n/* eslint-disable no-else-return */\n\n/**\n * Assigns props from one object to another. Focused on performance, only normal objects with no\n * prototype are supported.\n */\nexport default function fastDeepAssign(target, source) {\n const sourceIsArray = Array.isArray(source);\n const targetIsArray = Array.isArray(target);\n if (isPrimitive(source)) {\n return source;\n } else if (isPrimitiveOrBuiltIn(target)) {\n return clone(source);\n } else if (sourceIsArray && targetIsArray) {\n return mergeArray(target, source);\n } else if (sourceIsArray !== targetIsArray) {\n return clone(source);\n } else {\n return mergeObject(target, source);\n }\n}\nfunction cloneArray(value) {\n let i = 0;\n const il = value.length;\n const result = new Array(il);\n for (i = 0; i < il; i += 1) {\n result[i] = clone(value[i]);\n }\n return result;\n}\nfunction cloneObject(target) {\n const result = {};\n for (const key in target) {\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n continue;\n }\n result[key] = clone(target[key]);\n }\n return result;\n}\nfunction mergeArray(target, source) {\n const tl = target.length;\n for (let i = 0; i < source.length; i += 1) {\n target[tl + i] = clone(source[i]);\n }\n return target;\n}\nfunction isMergeableObject(value) {\n return typeof value === 'object' && value !== null && !(value instanceof RegExp) && !(value instanceof Date);\n}\nfunction isPrimitive(value) {\n return typeof value !== 'object' || value === null;\n}\nfunction isPrimitiveOrBuiltIn(value) {\n return typeof value !== 'object' || value === null || value instanceof RegExp || value instanceof Date;\n}\nfunction clone(entry) {\n // eslint-disable-next-line no-nested-ternary\n return isMergeableObject(entry) ? Array.isArray(entry) ? cloneArray(entry) : cloneObject(entry) : entry;\n}\nfunction mergeObject(target, source) {\n for (const key in source) {\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n continue;\n }\n if (key in target) {\n target[key] = fastDeepAssign(target[key], source[key]);\n } else {\n target[key] = clone(source[key]);\n }\n }\n return target;\n}", "/**\n * WARNING: Don't import this directly. It's imported by the code generated by\n * `@mui/interal-babel-plugin-minify-errors`. Make sure to always use string literals in `Error`\n * constructors to ensure the plugin works as expected. Supported patterns include:\n * throw new Error('My message');\n * throw new Error(`My message: ${foo}`);\n * throw new Error(`My message: ${foo}` + 'another string');\n * ...\n * @param {number} code\n */\nexport default function formatMuiErrorMessage(code, ...args) {\n const url = new URL(`https://mui.com/production-error/?code=${code}`);\n args.forEach(arg => url.searchParams.append('args[]', arg));\n return `Minified MUI error #${code}; visit ${url} for the full message.`;\n}", "import _formatErrorMessage from \"@mui/utils/formatMuiErrorMessage\";\n// It should to be noted that this function isn't equivalent to `text-transform: capitalize`.\n//\n// A strict capitalization should uppercase the first letter of each word in the sentence.\n// We only handle the first word.\nexport default function capitalize(string) {\n if (typeof string !== 'string') {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'MUI: `capitalize(string)` expects a string argument.' : _formatErrorMessage(7));\n }\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "export default function isObjectEmpty(object) {\n if (object == null) {\n return true;\n }\n // eslint-disable-next-line\n for (const _ in object) {\n return false;\n }\n return true;\n}", "import * as React from 'react';\nimport { isValidElementType } from 'react-is';\n\n// https://github.com/sindresorhus/is-plain-obj/blob/main/index.js\nexport function isPlainObject(item) {\n if (typeof item !== 'object' || item === null) {\n return false;\n }\n const prototype = Object.getPrototypeOf(item);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in item) && !(Symbol.iterator in item);\n}\nfunction deepClone(source) {\n if (/*#__PURE__*/React.isValidElement(source) || isValidElementType(source) || !isPlainObject(source)) {\n return source;\n }\n const output = {};\n Object.keys(source).forEach(key => {\n output[key] = deepClone(source[key]);\n });\n return output;\n}\n\n/**\n * Merge objects deeply.\n * It will shallow copy React elements.\n *\n * If `options.clone` is set to `false` the source object will be merged directly into the target object.\n *\n * @example\n * ```ts\n * deepmerge({ a: { b: 1 }, d: 2 }, { a: { c: 2 }, d: 4 });\n * // => { a: { b: 1, c: 2 }, d: 4 }\n * ````\n *\n * @param target The target object.\n * @param source The source object.\n * @param options The merge options.\n * @param options.clone Set to `false` to merge the source object directly into the target object.\n * @returns The merged object.\n */\nexport default function deepmerge(target, source, options = {\n clone: true\n}) {\n const output = options.clone ? {\n ...target\n } : target;\n if (isPlainObject(target) && isPlainObject(source)) {\n Object.keys(source).forEach(key => {\n if (/*#__PURE__*/React.isValidElement(source[key]) || isValidElementType(source[key])) {\n output[key] = source[key];\n } else if (isPlainObject(source[key]) &&\n // Avoid prototype pollution\n Object.prototype.hasOwnProperty.call(target, key) && isPlainObject(target[key])) {\n // Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.\n output[key] = deepmerge(target[key], source[key], options);\n } else if (options.clone) {\n output[key] = isPlainObject(source[key]) ? deepClone(source[key]) : source[key];\n } else {\n output[key] = source[key];\n }\n });\n }\n return output;\n}", "const MIN_WIDTH_PATTERN = /min-width:\\s*([0-9.]+)/;\n\n/**\n * WARN: Mutably updates the `css` object.\n * For using in `sx` prop to sort the breakpoint from low to high.\n * Note: this function does not work and will not support multiple units.\n * e.g. input: { '@container (min-width:300px)': '1rem', '@container (min-width:40rem)': '2rem' }\n * output: { '@container (min-width:40rem)': '2rem', '@container (min-width:300px)': '1rem' } // since 40 < 300 even though 40rem > 300px\n */\nexport function sortContainerQueries(theme, css) {\n if (!theme.containerQueries || !hasContainerQuery(css)) {\n return css;\n }\n const keys = [];\n for (const key in css) {\n if (key.startsWith('@container')) {\n keys.push(key);\n }\n }\n keys.sort((a, b) => {\n return +(a.match(MIN_WIDTH_PATTERN)?.[1] || 0) - +(b.match(MIN_WIDTH_PATTERN)?.[1] || 0);\n });\n const result = css;\n for (let i = 0; i < keys.length; i += 1) {\n const key = keys[i];\n const value = result[key];\n delete result[key];\n result[key] = value;\n }\n return result;\n}\nfunction hasContainerQuery(css) {\n for (const key in css) {\n if (key.startsWith('@container')) {\n return true;\n }\n }\n return false;\n}\nexport function isCqShorthand(breakpointKeys, value) {\n return value === '@' || value.startsWith('@') && (breakpointKeys.some(key => value.startsWith(`@${key}`)) || !!value.match(/^@\\d/));\n}\nexport function getContainerQuery(theme, shorthand) {\n const matches = shorthand.match(/^@([^/]+)?\\/?(.+)?$/);\n if (!matches) {\n if (process.env.NODE_ENV !== 'production') {\n // TODO: avoid throwing during React render only in development.\n // eslint-disable-next-line mui/no-guarded-throw\n throw /* minify-error */new Error(`MUI: The provided shorthand ${`(${shorthand})`} is invalid. The format should be \\`@<breakpoint | number>\\` or \\`@<breakpoint | number>/<container>\\`.\\n` + 'For example, `@sm` or `@600` or `@40rem/sidebar`.');\n }\n return null;\n }\n const [, containerQuery, containerName] = matches;\n const value = Number.isNaN(+containerQuery) ? containerQuery || 0 : +containerQuery;\n return theme.containerQueries(containerName).up(value);\n}\nexport default function cssContainerQueries(themeInput) {\n const toContainerQuery = (mediaQuery, name) => mediaQuery.replace('@media', name ? `@container ${name}` : '@container');\n function attachCq(node, name) {\n node.up = (...args) => toContainerQuery(themeInput.breakpoints.up(...args), name);\n node.down = (...args) => toContainerQuery(themeInput.breakpoints.down(...args), name);\n node.between = (...args) => toContainerQuery(themeInput.breakpoints.between(...args), name);\n node.only = (...args) => toContainerQuery(themeInput.breakpoints.only(...args), name);\n node.not = (...args) => {\n const result = toContainerQuery(themeInput.breakpoints.not(...args), name);\n if (result.includes('not all and')) {\n // `@container` does not work with `not all and`, so need to invert the logic\n return result.replace('not all and ', '').replace('min-width:', 'width<').replace('max-width:', 'width>').replace('and', 'or');\n }\n return result;\n };\n }\n const node = {};\n const containerQueries = name => {\n attachCq(node, name);\n return node;\n };\n attachCq(containerQueries);\n return {\n ...themeInput,\n containerQueries\n };\n}", "// Sorted ASC by size. That's important.\n// It can't be configured as it's used statically for propTypes.\nexport const breakpointKeys = ['xs', 'sm', 'md', 'lg', 'xl'];\n\n// Keep in sync with docs/src/pages/customization/breakpoints/breakpoints.md\n// #host-reference\n\nconst sortBreakpointsValues = values => {\n const breakpointsAsArray = Object.keys(values).map(key => ({\n key,\n val: values[key]\n })) || [];\n // Sort in ascending order\n breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);\n return breakpointsAsArray.reduce((acc, obj) => {\n return {\n ...acc,\n [obj.key]: obj.val\n };\n }, {});\n};\n\n// Keep in mind that @media is inclusive by the CSS specification.\nexport default function createBreakpoints(breakpoints) {\n const {\n values = {\n xs: 0,\n sm: 600,\n md: 900,\n lg: 1200,\n xl: 1536\n },\n unit = 'px',\n step = 5,\n ...other\n } = breakpoints;\n const sortedValues = sortBreakpointsValues(values);\n const keys = Object.keys(sortedValues);\n function up(key) {\n const value = typeof values[key] === 'number' ? values[key] : key;\n return `@media (min-width:${value}${unit})`;\n }\n function down(key) {\n const value = typeof values[key] === 'number' ? values[key] : key;\n return `@media (max-width:${value - step / 100}${unit})`;\n }\n function between(start, end) {\n const endIndex = keys.indexOf(end);\n return `@media (min-width:${typeof values[start] === 'number' ? values[start] : start}${unit}) and ` + `(max-width:${(endIndex !== -1 && typeof values[keys[endIndex]] === 'number' ? values[keys[endIndex]] : end) - step / 100}${unit})`;\n }\n function only(key) {\n if (keys.indexOf(key) + 1 < keys.length) {\n return between(key, keys[keys.indexOf(key) + 1]);\n }\n return up(key);\n }\n function not(key) {\n // handle first and last key separately, for better readability\n const keyIndex = keys.indexOf(key);\n if (keyIndex === 0) {\n return up(keys[1]);\n }\n if (keyIndex === keys.length - 1) {\n return down(keys[keyIndex]);\n }\n return between(key, keys[keys.indexOf(key) + 1]).replace('@media', '@media not all and');\n }\n const mediaKeys = [];\n for (let i = 0; i < keys.length; i += 1) {\n mediaKeys.push(up(keys[i]));\n }\n return {\n keys: keys,\n values: sortedValues,\n up,\n down,\n between,\n only,\n not,\n unit,\n internal_mediaKeys: mediaKeys,\n ...other\n };\n}", "import PropTypes from 'prop-types';\nimport isObjectEmpty from '@mui/utils/isObjectEmpty';\nimport fastDeepAssign from '@mui/utils/fastDeepAssign';\nimport deepmerge from '@mui/utils/deepmerge';\nimport merge from \"../merge/index.mjs\";\nimport { isCqShorthand, getContainerQuery } from \"../cssContainerQueries/index.mjs\";\nimport createBreakpoints from \"../createBreakpoints/createBreakpoints.mjs\";\nconst EMPTY_THEME = {};\n\n// The breakpoint **start** at this value.\n// For instance with the first breakpoint xs: [xs, sm[.\n/** @internal */\nexport const values = {\n xs: 0,\n // phone\n sm: 600,\n // tablet\n md: 900,\n // small laptop\n lg: 1200,\n // desktop\n xl: 1536 // large screen\n};\nexport const DEFAULT_BREAKPOINTS = createBreakpoints({\n values: values\n});\nconst defaultContainerQueries = {\n containerQueries: containerName => ({\n up: key => {\n let result = typeof key === 'number' ? key : values[key] || key;\n if (typeof result === 'number') {\n result = `${result}px`;\n }\n return containerName ? `@container ${containerName} (min-width:${result})` : `@container (min-width:${result})`;\n }\n })\n};\nexport function handleBreakpoints(props, propValue, styleFromPropValue) {\n const result = {};\n return iterateBreakpoints(result, props.theme, propValue, (mediaKey, value, initialKey) => {\n const finalValue = styleFromPropValue(value, initialKey);\n if (mediaKey) {\n result[mediaKey] = finalValue;\n } else {\n fastDeepAssign(result, finalValue);\n }\n });\n}\nexport function iterateBreakpoints(target, theme, propValue, callback) {\n theme ??= EMPTY_THEME;\n if (Array.isArray(propValue)) {\n const breakpoints = theme.breakpoints ?? DEFAULT_BREAKPOINTS;\n for (let i = 0; i < propValue.length; i += 1) {\n buildBreakpoint(target, breakpoints.up(breakpoints.keys[i]), propValue[i], undefined, callback);\n }\n return target;\n }\n if (typeof propValue === 'object') {\n const breakpoints = theme.breakpoints ?? DEFAULT_BREAKPOINTS;\n const breakpointValues = breakpoints.values ?? values;\n for (const key in propValue) {\n if (isCqShorthand(breakpoints.keys, key)) {\n const containerKey = getContainerQuery(theme.containerQueries ? theme : defaultContainerQueries, key);\n if (containerKey) {\n buildBreakpoint(target, containerKey, propValue[key], key, callback);\n }\n } else if (key in breakpointValues) {\n const mediaKey = breakpoints.up(key);\n buildBreakpoint(target, mediaKey, propValue[key], key, callback);\n } else {\n const cssKey = key;\n target[cssKey] = propValue[cssKey];\n }\n }\n return target;\n }\n callback(undefined, propValue);\n return target;\n}\nfunction buildBreakpoint(target, mediaKey, value, initialKey, callback) {\n target[mediaKey] ??= {};\n callback(mediaKey, value, initialKey);\n}\nfunction setupBreakpoints(styleFunction) {\n const newStyleFunction = props => {\n const theme = props.theme || {};\n const base = styleFunction(props);\n const themeBreakpoints = theme.breakpoints || DEFAULT_BREAKPOINTS;\n const extended = themeBreakpoints.keys.reduce((acc, key) => {\n if (props[key]) {\n acc = acc || {};\n acc[themeBreakpoints.up(key)] = styleFunction({\n theme,\n ...props[key]\n });\n }\n return acc;\n }, null);\n return merge(base, extended);\n };\n newStyleFunction.propTypes = process.env.NODE_ENV !== 'production' ? {\n ...styleFunction.propTypes,\n xs: PropTypes.object,\n sm: PropTypes.object,\n md: PropTypes.object,\n lg: PropTypes.object,\n xl: PropTypes.object\n } : {};\n newStyleFunction.filterProps = ['xs', 'sm', 'md', 'lg', 'xl', ...styleFunction.filterProps];\n return newStyleFunction;\n}\n\n/** @internal */\nexport function createEmptyBreakpointObject(breakpoints = DEFAULT_BREAKPOINTS) {\n const {\n internal_mediaKeys: mediaKeys\n } = breakpoints;\n const result = {};\n for (let i = 0; i < mediaKeys.length; i += 1) {\n result[mediaKeys[i]] = {};\n }\n return result;\n}\n\n/** @internal */\nexport function removeUnusedBreakpoints(breakpoints, style) {\n const breakpointKeys = breakpoints.internal_mediaKeys;\n for (let i = 0; i < breakpointKeys.length; i += 1) {\n const key = breakpointKeys[i];\n if (isObjectEmpty(style[key])) {\n delete style[key];\n }\n }\n return style;\n}\nexport function mergeBreakpointsInOrder(breakpoints, ...styles) {\n const emptyBreakpoints = createEmptyBreakpointObject(breakpoints);\n const mergedOutput = [emptyBreakpoints, ...styles].reduce((prev, next) => deepmerge(prev, next), {});\n return removeUnusedBreakpoints(breakpoints, mergedOutput);\n}\n\n/** @internal */\nexport function computeBreakpointsBase(breakpointValues, themeBreakpoints) {\n if (typeof breakpointValues !== 'object') {\n return {};\n }\n const base = {};\n const breakpointsKeys = Object.keys(themeBreakpoints);\n if (Array.isArray(breakpointValues)) {\n breakpointsKeys.forEach((breakpoint, i) => {\n if (i < breakpointValues.length) {\n base[breakpoint] = true;\n }\n });\n } else {\n breakpointsKeys.forEach(breakpoint => {\n if (breakpointValues[breakpoint] != null) {\n base[breakpoint] = true;\n }\n });\n }\n return base;\n}\nexport function resolveBreakpointValues(options) {\n const {\n values: breakpointValues,\n breakpoints: themeBreakpoints,\n base: customBase\n } = options;\n const base = customBase || computeBreakpointsBase(breakpointValues, themeBreakpoints);\n const keys = Object.keys(base);\n if (keys.length === 0) {\n return breakpointValues;\n }\n let previous;\n return keys.reduce((acc, breakpoint, i) => {\n if (Array.isArray(breakpointValues)) {\n acc[breakpoint] = breakpointValues[i] != null ? breakpointValues[i] : breakpointValues[previous];\n previous = i;\n } else if (typeof breakpointValues === 'object' && breakpointValues) {\n const bv = breakpointValues;\n acc[breakpoint] = bv[breakpoint] != null ? bv[breakpoint] : bv[previous];\n previous = breakpoint;\n } else {\n acc[breakpoint] = breakpointValues;\n }\n return acc;\n }, {});\n}\nexport function hasBreakpoint(breakpoints, value) {\n if (Array.isArray(value)) {\n return true;\n }\n if (typeof value === 'object' && value !== null) {\n for (let i = 0; i < breakpoints.keys.length; i += 1) {\n if (breakpoints.keys[i] in value) {\n return true;\n }\n }\n const valueKeys = Object.keys(value);\n for (let i = 0; i < valueKeys.length; i += 1) {\n if (isCqShorthand(breakpoints.keys, valueKeys[i])) {\n return true;\n }\n }\n }\n return false;\n}\nexport default setupBreakpoints;", "import capitalize from '@mui/utils/capitalize';\nimport responsivePropType from \"../responsivePropType/index.mjs\";\nimport { handleBreakpoints } from \"../breakpoints/index.mjs\";\n/**\n * TODO(v7): Keep either this one or `getStyleValue2`\n */\nexport function getStyleValue(themeMapping, transform, valueFinal, userValue = valueFinal) {\n let value;\n if (typeof themeMapping === 'function') {\n value = themeMapping(valueFinal);\n } else if (Array.isArray(themeMapping)) {\n value = themeMapping[valueFinal] || userValue;\n } else if (typeof valueFinal === 'string') {\n value = getPath(themeMapping, valueFinal) || userValue;\n } else {\n value = userValue;\n }\n if (transform) {\n value = transform(value, userValue, themeMapping);\n }\n return value;\n}\n\n/**\n * HACK: The `alternateProp` logic is there because our theme looks like this:\n * {\n * typography: {\n * fontFamily: 'comic sans',\n * fontFamilyCode: 'courrier new',\n * }\n * }\n * And we support targetting:\n * - `typography.fontFamily` with `sx={{ fontFamily: 'default' }}`\n * - `typography.fontFamilyCode` with `sx={{ fontFamily: 'code' }}`\n *\n * TODO(v7): Refactor our theme to look like this and remove the horrendous logic:\n * {\n * typography: {\n * fontFamily: {\n * default: 'comic sans',\n * code: 'courrier new',\n * }\n * }\n * }\n */\nexport function getStyleValue2(themeMapping, transform, userValue, alternateProp) {\n let value;\n if (typeof themeMapping === 'function') {\n value = themeMapping(userValue);\n } else if (Array.isArray(themeMapping)) {\n value = themeMapping[userValue] || userValue;\n } else if (typeof userValue === 'string') {\n value = getPath(themeMapping, userValue, true, alternateProp) || userValue;\n } else {\n value = userValue;\n }\n if (transform) {\n value = transform(value, userValue, themeMapping);\n }\n return value;\n}\nexport function getPath(obj, pathInput, checkVars = true, alternateProp = undefined) {\n if (!obj || !pathInput) {\n return null;\n }\n const path = pathInput.split('.');\n\n // Check if CSS variables are used\n if (obj.vars && checkVars) {\n const val = getPathImpl(obj.vars, path, alternateProp);\n if (val != null) {\n return val;\n }\n }\n return getPathImpl(obj, path, alternateProp);\n}\nfunction getPathImpl(object, path, alternateProp = undefined) {\n let lastResult = undefined;\n let result = object;\n let index = 0;\n while (index < path.length) {\n if (result === null || result === undefined) {\n return result;\n }\n lastResult = result;\n result = result[path[index]];\n index += 1;\n }\n if (alternateProp && result === undefined) {\n const lastKey = path[path.length - 1];\n const alternateKey = `${alternateProp}${lastKey === 'default' ? '' : capitalize(lastKey)}`;\n return lastResult?.[alternateKey];\n }\n return result;\n}\nexport default function style(options) {\n const {\n prop,\n cssProperty = options.prop,\n themeKey,\n transform\n } = options;\n\n // eslint-disable-next-line react/function-component-definition\n const fn = props => {\n if (props[prop] == null) {\n return null;\n }\n const propValue = props[prop];\n const theme = props.theme;\n const themeMapping = getPath(theme, themeKey) || {};\n const styleFromPropValue = valueFinal => {\n const value = getStyleValue2(themeMapping, transform, valueFinal, prop);\n return cssProperty === false ? value : {\n [cssProperty]: value\n };\n };\n return handleBreakpoints(props, propValue, styleFromPropValue);\n };\n fn.propTypes = process.env.NODE_ENV !== 'production' ? {\n [prop]: responsivePropType\n } : {};\n fn.filterProps = [prop];\n return fn;\n}", "import responsivePropType from \"../responsivePropType/index.mjs\";\nimport { iterateBreakpoints } from \"../breakpoints/index.mjs\";\nimport { getPath } from \"../style/index.mjs\";\n\n/* eslint-disable guard-for-in */\n\nconst EMPTY_THEME = {\n internal_cache: {}\n};\nconst properties = {\n m: 'margin',\n p: 'padding'\n};\nconst directions = {\n t: 'Top',\n r: 'Right',\n b: 'Bottom',\n l: 'Left',\n x: ['Left', 'Right'],\n y: ['Top', 'Bottom']\n};\nconst aliases = {\n marginX: 'mx',\n marginY: 'my',\n paddingX: 'px',\n paddingY: 'py'\n};\nconst CSS_PROPERTIES = {};\nfor (const key in properties) {\n CSS_PROPERTIES[key] = [properties[key]];\n}\nfor (const keyProperty in properties) {\n for (const keyDirection in directions) {\n const property = properties[keyProperty];\n const direction = directions[keyDirection];\n const value = Array.isArray(direction) ? direction.map(dir => property + dir) : [property + direction];\n CSS_PROPERTIES[keyProperty + keyDirection] = value;\n }\n}\nfor (const key in aliases) {\n CSS_PROPERTIES[key] = CSS_PROPERTIES[aliases[key]];\n}\n\n/** @internal */\nexport const marginKeys = new Set(['m', 'mt', 'mr', 'mb', 'ml', 'mx', 'my', 'margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginX', 'marginY', 'marginInline', 'marginInlineStart', 'marginInlineEnd', 'marginBlock', 'marginBlockStart', 'marginBlockEnd']);\n\n/** @internal */\nexport const paddingKeys = new Set(['p', 'pt', 'pr', 'pb', 'pl', 'px', 'py', 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'paddingX', 'paddingY', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd']);\nconst spacingKeys = new Set([...marginKeys, ...paddingKeys]);\nexport function createUnaryUnit(theme, themeKey, defaultValue, propName) {\n const themeSpacing = getPath(theme, themeKey, true) ?? defaultValue;\n if (typeof themeSpacing === 'number' || typeof themeSpacing === 'string') {\n return val => {\n if (typeof val === 'string') {\n return val;\n }\n if (process.env.NODE_ENV !== 'production') {\n if (typeof val !== 'number') {\n console.error(`MUI: Expected ${propName} argument to be a number or a string, got ${val}.`);\n }\n }\n if (typeof themeSpacing === 'string') {\n if (themeSpacing.startsWith('var(') && val === 0) {\n return 0;\n }\n if (themeSpacing.startsWith('var(') && val === 1) {\n return themeSpacing;\n }\n return `calc(${val} * ${themeSpacing})`;\n }\n return themeSpacing * val;\n };\n }\n if (Array.isArray(themeSpacing)) {\n return val => {\n if (typeof val === 'string') {\n return val;\n }\n const abs = Math.abs(val);\n if (process.env.NODE_ENV !== 'production') {\n if (!Number.isInteger(abs)) {\n console.error([`MUI: The \\`theme.${themeKey}\\` array type cannot be combined with non integer values.` + `You should either use an integer value that can be used as index, or define the \\`theme.${themeKey}\\` as a number.`].join('\\n'));\n } else if (abs > themeSpacing.length - 1) {\n console.error([`MUI: The value provided (${abs}) overflows.`, `The supported values are: ${JSON.stringify(themeSpacing)}.`, `${abs} > ${themeSpacing.length - 1}, you need to add the missing values.`].join('\\n'));\n }\n }\n const transformed = themeSpacing[abs];\n if (val >= 0) {\n return transformed;\n }\n if (typeof transformed === 'number') {\n return -transformed;\n }\n if (typeof transformed === 'string' && transformed.startsWith('var(')) {\n return `calc(-1 * ${transformed})`;\n }\n return `-${transformed}`;\n };\n }\n if (typeof themeSpacing === 'function') {\n return themeSpacing;\n }\n if (process.env.NODE_ENV !== 'production') {\n console.error([`MUI: The \\`theme.${themeKey}\\` value (${themeSpacing}) is invalid.`, 'It should be a number, an array or a function.'].join('\\n'));\n }\n return () => undefined;\n}\nexport function createUnarySpacing(theme) {\n return createUnaryUnit(theme, 'spacing', 8, 'spacing');\n}\nexport function getValue(transformer, propValue) {\n if (typeof propValue === 'string' || propValue == null) {\n return propValue;\n }\n return transformer(propValue);\n}\n\n// Avoid allocations\nconst container = [''];\nfunction style(props, keys) {\n const theme = props.theme ?? EMPTY_THEME;\n const transformer = theme?.internal_cache?.unarySpacing ?? createUnarySpacing(theme);\n const result = {};\n for (const prop in props) {\n if (!keys.has(prop)) {\n continue;\n }\n const cssProperties = CSS_PROPERTIES[prop] ?? (container[0] = prop, container);\n const propValue = props[prop];\n iterateBreakpoints(result, props.theme, propValue, (mediaKey, value) => {\n const target = mediaKey ? result[mediaKey] : result;\n for (let i = 0; i < cssProperties.length; i += 1) {\n target[cssProperties[i]] = getValue(transformer, value);\n }\n });\n }\n return result;\n}\nfunction marginFn(props) {\n return style(props, marginKeys);\n}\nmarginFn.propTypes = process.env.NODE_ENV !== 'production' ? Array.from(marginKeys).reduce((obj, key) => {\n obj[key] = responsivePropType;\n return obj;\n}, {}) : {};\nmarginFn.filterProps = marginKeys;\nexport const margin = marginFn;\nfunction paddingFn(props) {\n return style(props, paddingKeys);\n}\npaddingFn.propTypes = process.env.NODE_ENV !== 'production' ? Array.from(paddingKeys).reduce((obj, key) => {\n obj[key] = responsivePropType;\n return obj;\n}, {}) : {};\npaddingFn.filterProps = paddingKeys;\nexport const padding = paddingFn;\nfunction spacingFn(props) {\n return style(props, spacingKeys);\n}\nspacingFn.propTypes = process.env.NODE_ENV !== 'production' ? Array.from(spacingKeys).reduce((obj, key) => {\n obj[key] = responsivePropType;\n return obj;\n}, {}) : {};\nspacingFn.filterProps = spacingKeys;\nconst spacing = spacingFn;\nexport default spacing;", "import fastDeepAssign from '@mui/utils/fastDeepAssign';\nfunction compose(...styles) {\n const handlers = styles.reduce((acc, style) => {\n style.filterProps.forEach(prop => {\n acc[prop] = style;\n });\n return acc;\n }, {});\n const fn = props => {\n const result = {};\n for (const prop in props) {\n if (handlers[prop]) {\n fastDeepAssign(result, handlers[prop](props));\n }\n }\n return result;\n };\n fn.propTypes = process.env.NODE_ENV !== 'production' ? styles.reduce((acc, style) => Object.assign(acc, style.propTypes), {}) : {};\n fn.filterProps = styles.reduce((acc, style) => acc.concat(style.filterProps), []);\n return fn;\n}\nexport default compose;", "import responsivePropType from \"../responsivePropType/index.mjs\";\nimport style from \"../style/index.mjs\";\nimport compose from \"../compose/index.mjs\";\nimport { createUnaryUnit, getValue } from \"../spacing/index.mjs\";\nimport { handleBreakpoints } from \"../breakpoints/index.mjs\";\n\n/** @internal */\nexport function borderTransform(value) {\n if (typeof value !== 'number') {\n return value;\n }\n return `${value}px solid`;\n}\nfunction createBorderStyle(prop, transform) {\n return style({\n prop,\n themeKey: 'borders',\n transform: transform\n });\n}\nexport const border = createBorderStyle('border', borderTransform);\nexport const borderTop = createBorderStyle('borderTop', borderTransform);\nexport const borderRight = createBorderStyle('borderRight', borderTransform);\nexport const borderBottom = createBorderStyle('borderBottom', borderTransform);\nexport const borderLeft = createBorderStyle('borderLeft', borderTransform);\nexport const borderColor = createBorderStyle('borderColor');\nexport const borderTopColor = createBorderStyle('borderTopColor');\nexport const borderRightColor = createBorderStyle('borderRightColor');\nexport const borderBottomColor = createBorderStyle('borderBottomColor');\nexport const borderLeftColor = createBorderStyle('borderLeftColor');\nexport const outline = createBorderStyle('outline', borderTransform);\nexport const outlineColor = createBorderStyle('outlineColor');\nexport const borderRadius = props => {\n if (props.borderRadius !== undefined && props.borderRadius !== null) {\n const transformer = createUnaryUnit(props.theme, 'shape.borderRadius', 4, 'borderRadius');\n const styleFromPropValue = propValue => ({\n borderRadius: getValue(transformer, propValue)\n });\n return handleBreakpoints(props, props.borderRadius, styleFromPropValue);\n }\n return null;\n};\nborderRadius.propTypes = process.env.NODE_ENV !== 'production' ? {\n borderRadius: responsivePropType\n} : {};\nborderRadius.filterProps = ['borderRadius'];\nconst borders = compose(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderRadius, outline, outlineColor);\nexport default borders;", "import style from \"../style/index.mjs\";\nimport compose from \"../compose/index.mjs\";\nimport { createUnaryUnit, getValue } from \"../spacing/index.mjs\";\nimport { handleBreakpoints } from \"../breakpoints/index.mjs\";\nimport responsivePropType from \"../responsivePropType/index.mjs\";\nexport const gap = props => {\n if (props.gap !== undefined && props.gap !== null) {\n const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'gap');\n const styleFromPropValue = propValue => ({\n gap: getValue(transformer, propValue)\n });\n return handleBreakpoints(props, props.gap, styleFromPropValue);\n }\n return null;\n};\ngap.propTypes = process.env.NODE_ENV !== 'production' ? {\n gap: responsivePropType\n} : {};\ngap.filterProps = ['gap'];\nexport const columnGap = props => {\n if (props.columnGap !== undefined && props.columnGap !== null) {\n const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'columnGap');\n const styleFromPropValue = propValue => ({\n columnGap: getValue(transformer, propValue)\n });\n return handleBreakpoints(props, props.columnGap, styleFromPropValue);\n }\n return null;\n};\ncolumnGap.propTypes = process.env.NODE_ENV !== 'production' ? {\n columnGap: responsivePropType\n} : {};\ncolumnGap.filterProps = ['columnGap'];\nexport const rowGap = props => {\n if (props.rowGap !== undefined && props.rowGap !== null) {\n const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'rowGap');\n const styleFromPropValue = propValue => ({\n rowGap: getValue(transformer, propValue)\n });\n return handleBreakpoints(props, props.rowGap, styleFromPropValue);\n }\n return null;\n};\nrowGap.propTypes = process.env.NODE_ENV !== 'production' ? {\n rowGap: responsivePropType\n} : {};\nrowGap.filterProps = ['rowGap'];\nexport const gridColumn = style({\n prop: 'gridColumn'\n});\nexport const gridRow = style({\n prop: 'gridRow'\n});\nexport const gridAutoFlow = style({\n prop: 'gridAutoFlow'\n});\nexport const gridAutoColumns = style({\n prop: 'gridAutoColumns'\n});\nexport const gridAutoRows = style({\n prop: 'gridAutoRows'\n});\nexport const gridTemplateColumns = style({\n prop: 'gridTemplateColumns'\n});\nexport const gridTemplateRows = style({\n prop: 'gridTemplateRows'\n});\nexport const gridTemplateAreas = style({\n prop: 'gridTemplateAreas'\n});\nexport const gridArea = style({\n prop: 'gridArea'\n});\nconst grid = compose(gap, columnGap, rowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea);\nexport default grid;", "import style from \"../style/index.mjs\";\nimport compose from \"../compose/index.mjs\";\n\n/** @internal */\nexport function paletteTransform(value, userValue) {\n if (userValue === 'grey') {\n return userValue;\n }\n return value;\n}\nexport const color = style({\n prop: 'color',\n themeKey: 'palette',\n transform: paletteTransform\n});\nexport const bgcolor = style({\n prop: 'bgcolor',\n cssProperty: 'backgroundColor',\n themeKey: 'palette',\n transform: paletteTransform\n});\nexport const backgroundColor = style({\n prop: 'backgroundColor',\n themeKey: 'palette',\n transform: paletteTransform\n});\nconst palette = compose(color, bgcolor, backgroundColor);\nexport default palette;", "import style from \"../style/index.mjs\";\nimport compose from \"../compose/index.mjs\";\nimport { handleBreakpoints } from \"../breakpoints/index.mjs\";\nimport * as breakpointsModule from \"../breakpoints/index.mjs\";\nconst breakpointsValues = breakpointsModule.values;\n\n/** @internal */\nexport function sizingTransform(value) {\n return value <= 1 && value !== 0 ? `${value * 100}%` : value;\n}\nexport const width = style({\n prop: 'width',\n transform: sizingTransform\n});\nexport const maxWidth = props => {\n if (props.maxWidth !== undefined && props.maxWidth !== null) {\n const styleFromPropValue = propValue => {\n const breakpoint = props.theme?.breakpoints?.values?.[propValue] || breakpointsValues[propValue];\n if (!breakpoint) {\n return {\n maxWidth: sizingTransform(propValue)\n };\n }\n if (props.theme?.breakpoints?.unit !== 'px') {\n return {\n maxWidth: `${breakpoint}${props.theme.breakpoints.unit}`\n };\n }\n return {\n maxWidth: breakpoint\n };\n };\n return handleBreakpoints(props, props.maxWidth, styleFromPropValue);\n }\n return null;\n};\nmaxWidth.filterProps = ['maxWidth'];\nexport const minWidth = style({\n prop: 'minWidth',\n transform: sizingTransform\n});\nexport const height = style({\n prop: 'height',\n transform: sizingTransform\n});\nexport const maxHeight = style({\n prop: 'maxHeight',\n transform: sizingTransform\n});\nexport const minHeight = style({\n prop: 'minHeight',\n transform: sizingTransform\n});\nexport const sizeWidth = style({\n prop: 'size',\n cssProperty: 'width',\n transform: sizingTransform\n});\nexport const sizeHeight = style({\n prop: 'size',\n cssProperty: 'height',\n transform: sizingTransform\n});\nexport const boxSizing = style({\n prop: 'boxSizing'\n});\nconst sizing = compose(width, maxWidth, minWidth, height, maxHeight, minHeight, boxSizing);\nexport default sizing;", "import { padding, margin } from \"../spacing/index.mjs\";\nimport { borderRadius, borderTransform } from \"../borders/index.mjs\";\nimport { gap, rowGap, columnGap } from \"../cssGrid/index.mjs\";\nimport { paletteTransform } from \"../palette/index.mjs\";\nimport { maxWidth, sizingTransform } from \"../sizing/index.mjs\";\nconst defaultSxConfig = {\n // borders\n border: {\n themeKey: 'borders',\n transform: borderTransform\n },\n borderTop: {\n themeKey: 'borders',\n transform: borderTransform\n },\n borderRight: {\n themeKey: 'borders',\n transform: borderTransform\n },\n borderBottom: {\n themeKey: 'borders',\n transform: borderTransform\n },\n borderLeft: {\n themeKey: 'borders',\n transform: borderTransform\n },\n borderColor: {\n themeKey: 'palette'\n },\n borderTopColor: {\n themeKey: 'palette'\n },\n borderRightColor: {\n themeKey: 'palette'\n },\n borderBottomColor: {\n themeKey: 'palette'\n },\n borderLeftColor: {\n themeKey: 'palette'\n },\n outline: {\n themeKey: 'borders',\n transform: borderTransform\n },\n outlineColor: {\n themeKey: 'palette'\n },\n borderRadius: {\n themeKey: 'shape.borderRadius',\n style: borderRadius\n },\n // palette\n color: {\n themeKey: 'palette',\n transform: paletteTransform\n },\n bgcolor: {\n themeKey: 'palette',\n cssProperty: 'backgroundColor',\n transform: paletteTransform\n },\n backgroundColor: {\n themeKey: 'palette',\n transform: paletteTransform\n },\n // spacing\n p: {\n style: padding\n },\n pt: {\n style: padding\n },\n pr: {\n style: padding\n },\n pb: {\n style: padding\n },\n pl: {\n style: padding\n },\n px: {\n style: padding\n },\n py: {\n style: padding\n },\n padding: {\n style: padding\n },\n paddingTop: {\n style: padding\n },\n paddingRight: {\n style: padding\n },\n paddingBottom: {\n style: padding\n },\n paddingLeft: {\n style: padding\n },\n paddingX: {\n style: padding\n },\n paddingY: {\n style: padding\n },\n paddingInline: {\n style: padding\n },\n paddingInlineStart: {\n style: padding\n },\n paddingInlineEnd: {\n style: padding\n },\n paddingBlock: {\n style: padding\n },\n paddingBlockStart: {\n style: padding\n },\n paddingBlockEnd: {\n style: padding\n },\n m: {\n style: margin\n },\n mt: {\n style: margin\n },\n mr: {\n style: margin\n },\n mb: {\n style: margin\n },\n ml: {\n style: margin\n },\n mx: {\n style: margin\n },\n my: {\n style: margin\n },\n margin: {\n style: margin\n },\n marginTop: {\n style: margin\n },\n marginRight: {\n style: margin\n },\n marginBottom: {\n style: margin\n },\n marginLeft: {\n style: margin\n },\n marginX: {\n style: margin\n },\n marginY: {\n style: margin\n },\n marginInline: {\n style: margin\n },\n marginInlineStart: {\n style: margin\n },\n marginInlineEnd: {\n style: margin\n },\n marginBlock: {\n style: margin\n },\n marginBlockStart: {\n style: margin\n },\n marginBlockEnd: {\n style: margin\n },\n // display\n displayPrint: {\n cssProperty: false,\n transform: value => ({\n '@media print': {\n display: value\n }\n })\n },\n display: {},\n overflow: {},\n textOverflow: {},\n visibility: {},\n whiteSpace: {},\n // flexbox\n flexBasis: {},\n flexDirection: {},\n flexWrap: {},\n justifyContent: {},\n alignItems: {},\n alignContent: {},\n order: {},\n flex: {},\n flexGrow: {},\n flexShrink: {},\n alignSelf: {},\n justifyItems: {},\n justifySelf: {},\n // grid\n gap: {\n style: gap\n },\n rowGap: {\n style: rowGap\n },\n columnGap: {\n style: columnGap\n },\n gridColumn: {},\n gridRow: {},\n gridAutoFlow: {},\n gridAutoColumns: {},\n gridAutoRows: {},\n gridTemplateColumns: {},\n gridTemplateRows: {},\n gridTemplateAreas: {},\n gridArea: {},\n // positions\n position: {},\n zIndex: {\n themeKey: 'zIndex'\n },\n top: {},\n right: {},\n bottom: {},\n left: {},\n // shadows\n boxShadow: {\n themeKey: 'shadows'\n },\n // sizing\n width: {\n transform: sizingTransform\n },\n maxWidth: {\n style: maxWidth\n },\n minWidth: {\n transform: sizingTransform\n },\n height: {\n transform: sizingTransform\n },\n maxHeight: {\n transform: sizingTransform\n },\n minHeight: {\n transform: sizingTransform\n },\n boxSizing: {},\n // typography\n font: {\n themeKey: 'font'\n },\n fontFamily: {\n themeKey: 'typography'\n },\n fontSize: {\n themeKey: 'typography'\n },\n fontStyle: {\n themeKey: 'typography'\n },\n fontWeight: {\n themeKey: 'typography'\n },\n letterSpacing: {},\n textTransform: {},\n lineHeight: {},\n textAlign: {},\n typography: {\n cssProperty: false,\n themeKey: 'typography'\n }\n};\nexport default defaultSxConfig;", "import merge from '@mui/utils/fastDeepAssign';\nimport { getPath, getStyleValue2 } from \"../style/index.mjs\";\nimport { hasBreakpoint, iterateBreakpoints, createEmptyBreakpointObject, removeUnusedBreakpoints, DEFAULT_BREAKPOINTS } from \"../breakpoints/index.mjs\";\nimport { sortContainerQueries } from \"../cssContainerQueries/index.mjs\";\nimport defaultSxConfig from \"./defaultSxConfig.mjs\";\n\n/**\n * The `css` function accepts arrays as values for mobile-first responsive styles.\n * Note that this extends to non-theme values also. For example `display=['none', 'block']`\n * will also works.\n */\n\n/**\n * Map of all CSS pseudo selectors (`:hover`, `:focus`, ...).\n */\n\n/**\n * Map all nested selectors.\n */\n\n/**\n * Map all nested selectors and CSS variables.\n */\n\n/**\n * Map of all available CSS properties (including aliases) and their raw value.\n * Only used internally to map CSS properties to input types (responsive value,\n * theme function or nested) in `SystemCssProperties`.\n */\n\n/**\n * The `SystemStyleObject` defines custom properties that will be transformed to\n * their corresponding values from the `Theme`. Other valid CSS properties are also allowed.\n */\n\n/**\n * The `SxProps` can be either object or function\n */\n\n/* eslint-disable guard-for-in */\n\nconst EMPTY_THEME = {};\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function unstable_createStyleFunctionSx() {\n function styleFunctionSx(props) {\n if (!props.sx) {\n return null;\n }\n const {\n sx,\n theme = EMPTY_THEME,\n nested\n } = props;\n const config = theme.unstable_sxConfig ?? defaultSxConfig;\n\n // Pass argument without loop allocations\n const wrapper = {\n sx: null,\n theme,\n nested: true\n };\n function process(sxInput) {\n let sxObject = sxInput;\n if (typeof sxInput === 'function') {\n sxObject = sxInput(theme);\n } else if (typeof sxInput !== 'object') {\n // value\n return sxInput;\n }\n if (!sxObject) {\n return null;\n }\n const breakpoints = theme.breakpoints ?? DEFAULT_BREAKPOINTS;\n const css = createEmptyBreakpointObject(breakpoints);\n for (const styleKey in sxObject) {\n const value = callIfFn(sxObject[styleKey], theme);\n if (value === null || value === undefined) {\n continue;\n }\n if (typeof value !== 'object') {\n setThemeValue(css, styleKey, value, theme, config);\n continue;\n }\n if (config[styleKey]) {\n setThemeValue(css, styleKey, value, theme, config);\n continue;\n }\n if (hasBreakpoint(breakpoints, value)) {\n iterateBreakpoints(css, props.theme, value, (mediaKey, finalValue) => {\n css[mediaKey][styleKey] = finalValue;\n });\n } else {\n wrapper.sx = value;\n css[styleKey] = styleFunctionSx(wrapper);\n }\n }\n if (!nested && theme.modularCssLayers) {\n return {\n '@layer sx': sortContainerQueries(theme, removeUnusedBreakpoints(breakpoints, css))\n };\n }\n return sortContainerQueries(theme, removeUnusedBreakpoints(breakpoints, css));\n }\n return Array.isArray(sx) ? sx.map(process) : process(sx);\n }\n styleFunctionSx.filterProps = ['sx'];\n return styleFunctionSx;\n}\nexport default unstable_createStyleFunctionSx();\nfunction setThemeValue(css, prop, value, theme, config) {\n const options = config[prop];\n if (!options) {\n css[prop] = value;\n return;\n }\n if (value == null) {\n return;\n }\n const {\n themeKey\n } = options;\n // TODO v6: remove, see https://github.com/mui/material-ui/pull/38123\n if (themeKey === 'typography' && value === 'inherit') {\n css[prop] = value;\n return;\n }\n const {\n style\n } = options;\n if (style) {\n merge(css, style({\n [prop]: value,\n theme\n }));\n return;\n }\n const {\n cssProperty = prop,\n transform\n } = options;\n const themeMapping = getPath(theme, themeKey);\n iterateBreakpoints(css, theme, value, (mediaKey, valueFinal) => {\n const finalValue = getStyleValue2(themeMapping, transform, valueFinal, prop);\n if (cssProperty === false) {\n if (mediaKey) {\n merge(css[mediaKey], finalValue);\n } else {\n merge(css, finalValue);\n }\n } else {\n // eslint-disable-next-line no-lonely-if\n if (mediaKey) {\n css[mediaKey][cssProperty] = finalValue;\n } else {\n css[cssProperty] = finalValue;\n }\n }\n });\n}\nfunction callIfFn(maybeFn, arg) {\n return typeof maybeFn === 'function' ? maybeFn(arg) : maybeFn;\n}", "'use client';\n\nimport * as React from 'react';\nimport { useTheme as useThemeSystem } from '@mui/system';\nimport defaultTheme from \"./defaultTheme.mjs\";\nimport THEME_ID from \"./identifier.mjs\";\nexport default function useTheme() {\n const theme = useThemeSystem(defaultTheme);\n if (process.env.NODE_ENV !== 'production') {\n // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useDebugValue(theme);\n }\n return theme[THEME_ID] || theme;\n}", "function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };", "import * as React from 'react';\nimport { useContext, forwardRef } from 'react';\nimport createCache from '@emotion/cache';\nimport _extends from '@babel/runtime/helpers/esm/extends';\nimport weakMemoize from '@emotion/weak-memoize';\nimport hoistNonReactStatics from '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';\nimport { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';\nimport { serializeStyles } from '@emotion/serialize';\nimport { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\n\nvar isDevelopment = false;\n\nvar EmotionCacheContext = /* #__PURE__ */React.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case\n// because this module is primarily intended for the browser and node\n// but it's also required in react native and similar environments sometimes\n// and we could have a special build just for that\n// but this is much easier and the native packages\n// might use a different theme context in the future anyway\ntypeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({\n key: 'css'\n}) : null);\n\nvar CacheProvider = EmotionCacheContext.Provider;\nvar __unsafe_useEmotionCache = function useEmotionCache() {\n return useContext(EmotionCacheContext);\n};\n\nvar withEmotionCache = function withEmotionCache(func) {\n return /*#__PURE__*/forwardRef(function (props, ref) {\n // the cache will never be null in the browser\n var cache = useContext(EmotionCacheContext);\n return func(props, cache, ref);\n });\n};\n\nvar ThemeContext = /* #__PURE__ */React.createContext({});\n\nvar useTheme = function useTheme() {\n return React.useContext(ThemeContext);\n};\n\nvar getTheme = function getTheme(outerTheme, theme) {\n if (typeof theme === 'function') {\n var mergedTheme = theme(outerTheme);\n\n return mergedTheme;\n }\n\n return _extends({}, outerTheme, theme);\n};\n\nvar createCacheWithTheme = /* #__PURE__ */weakMemoize(function (outerTheme) {\n return weakMemoize(function (theme) {\n return getTheme(outerTheme, theme);\n });\n});\nvar ThemeProvider = function ThemeProvider(props) {\n var theme = React.useContext(ThemeContext);\n\n if (props.theme !== theme) {\n theme = createCacheWithTheme(theme)(props.theme);\n }\n\n return /*#__PURE__*/React.createElement(ThemeContext.Provider, {\n value: theme\n }, props.children);\n};\nfunction withTheme(Component) {\n var componentName = Component.displayName || Component.name || 'Component';\n var WithTheme = /*#__PURE__*/React.forwardRef(function render(props, ref) {\n var theme = React.useContext(ThemeContext);\n return /*#__PURE__*/React.createElement(Component, _extends({\n theme: theme,\n ref: ref\n }, props));\n });\n WithTheme.displayName = \"WithTheme(\" + componentName + \")\";\n return hoistNonReactStatics(WithTheme, Component);\n}\n\nvar hasOwn = {}.hasOwnProperty;\n\nvar typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';\nvar createEmotionProps = function createEmotionProps(type, props) {\n\n var newProps = {};\n\n for (var _key in props) {\n if (hasOwn.call(props, _key)) {\n newProps[_key] = props[_key];\n }\n }\n\n newProps[typePropName] = type; // Runtime labeling is an opt-in feature because:\n\n return newProps;\n};\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serialized = _ref.serialized,\n isStringTag = _ref.isStringTag;\n registerStyles(cache, serialized, isStringTag);\n useInsertionEffectAlwaysWithSyncFallback(function () {\n return insertStyles(cache, serialized, isStringTag);\n });\n\n return null;\n};\n\nvar Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {\n var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works\n // not passing the registered cache to serializeStyles because it would\n // make certain babel optimisations not possible\n\n if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {\n cssProp = cache.registered[cssProp];\n }\n\n var WrappedComponent = props[typePropName];\n var registeredStyles = [cssProp];\n var className = '';\n\n if (typeof props.className === 'string') {\n className = getRegisteredStyles(cache.registered, registeredStyles, props.className);\n } else if (props.className != null) {\n className = props.className + \" \";\n }\n\n var serialized = serializeStyles(registeredStyles, undefined, React.useContext(ThemeContext));\n\n className += cache.key + \"-\" + serialized.name;\n var newProps = {};\n\n for (var _key2 in props) {\n if (hasOwn.call(props, _key2) && _key2 !== 'css' && _key2 !== typePropName && (!isDevelopment )) {\n newProps[_key2] = props[_key2];\n }\n }\n\n newProps.className = className;\n\n if (ref) {\n newProps.ref = ref;\n }\n\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {\n cache: cache,\n serialized: serialized,\n isStringTag: typeof WrappedComponent === 'string'\n }), /*#__PURE__*/React.createElement(WrappedComponent, newProps));\n});\n\nvar Emotion$1 = Emotion;\n\nexport { CacheProvider as C, Emotion$1 as E, ThemeContext as T, __unsafe_useEmotionCache as _, ThemeProvider as a, withTheme as b, createEmotionProps as c, hasOwn as h, isDevelopment as i, useTheme as u, withEmotionCache as w };\n", "var isDevelopment = false;\n\n/*\n\nBased off glamor's StyleSheet, thanks Sunil \u2764\uFE0F\n\nhigh performance StyleSheet for css-in-js systems\n\n- uses multiple style tags behind the scenes for millions of rules\n- uses `insertRule` for appending in production for *much* faster performance\n\n// usage\n\nimport { StyleSheet } from '@emotion/sheet'\n\nlet styleSheet = new StyleSheet({ key: '', container: document.head })\n\nstyleSheet.insert('#box { border: 1px solid red; }')\n- appends a css rule into the stylesheet\n\nstyleSheet.flush()\n- empties the stylesheet of all its contents\n\n*/\n\nfunction sheetForTag(tag) {\n if (tag.sheet) {\n return tag.sheet;\n } // this weirdness brought to you by firefox\n\n /* istanbul ignore next */\n\n\n for (var i = 0; i < document.styleSheets.length; i++) {\n if (document.styleSheets[i].ownerNode === tag) {\n return document.styleSheets[i];\n }\n } // this function should always return with a value\n // TS can't understand it though so we make it stop complaining here\n\n\n return undefined;\n}\n\nfunction createStyleElement(options) {\n var tag = document.createElement('style');\n tag.setAttribute('data-emotion', options.key);\n\n if (options.nonce !== undefined) {\n tag.setAttribute('nonce', options.nonce);\n }\n\n tag.appendChild(document.createTextNode(''));\n tag.setAttribute('data-s', '');\n return tag;\n}\n\nvar StyleSheet = /*#__PURE__*/function () {\n // Using Node instead of HTMLElement since container may be a ShadowRoot\n function StyleSheet(options) {\n var _this = this;\n\n this._insertTag = function (tag) {\n var before;\n\n if (_this.tags.length === 0) {\n if (_this.insertionPoint) {\n before = _this.insertionPoint.nextSibling;\n } else if (_this.prepend) {\n before = _this.container.firstChild;\n } else {\n before = _this.before;\n }\n } else {\n before = _this.tags[_this.tags.length - 1].nextSibling;\n }\n\n _this.container.insertBefore(tag, before);\n\n _this.tags.push(tag);\n };\n\n this.isSpeedy = options.speedy === undefined ? !isDevelopment : options.speedy;\n this.tags = [];\n this.ctr = 0;\n this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets\n\n this.key = options.key;\n this.container = options.container;\n this.prepend = options.prepend;\n this.insertionPoint = options.insertionPoint;\n this.before = null;\n }\n\n var _proto = StyleSheet.prototype;\n\n _proto.hydrate = function hydrate(nodes) {\n nodes.forEach(this._insertTag);\n };\n\n _proto.insert = function insert(rule) {\n // the max length is how many rules we have per style tag, it's 65000 in speedy mode\n // it's 1 in dev because we insert source maps that map a single rule to a location\n // and you can only have one source map per style tag\n if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {\n this._insertTag(createStyleElement(this));\n }\n\n var tag = this.tags[this.tags.length - 1];\n\n if (this.isSpeedy) {\n var sheet = sheetForTag(tag);\n\n try {\n // this is the ultrafast version, works across browsers\n // the big drawback is that the css won't be editable in devtools\n sheet.insertRule(rule, sheet.cssRules.length);\n } catch (e) {\n }\n } else {\n tag.appendChild(document.createTextNode(rule));\n }\n\n this.ctr++;\n };\n\n _proto.flush = function flush() {\n this.tags.forEach(function (tag) {\n var _tag$parentNode;\n\n return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag);\n });\n this.tags = [];\n this.ctr = 0;\n };\n\n return StyleSheet;\n}();\n\nexport { StyleSheet };\n", "export var MS = '-ms-'\nexport var MOZ = '-moz-'\nexport var WEBKIT = '-webkit-'\n\nexport var COMMENT = 'comm'\nexport var RULESET = 'rule'\nexport var DECLARATION = 'decl'\n\nexport var PAGE = '@page'\nexport var MEDIA = '@media'\nexport var IMPORT = '@import'\nexport var CHARSET = '@charset'\nexport var VIEWPORT = '@viewport'\nexport var SUPPORTS = '@supports'\nexport var DOCUMENT = '@document'\nexport var NAMESPACE = '@namespace'\nexport var KEYFRAMES = '@keyframes'\nexport var FONT_FACE = '@font-face'\nexport var COUNTER_STYLE = '@counter-style'\nexport var FONT_FEATURE_VALUES = '@font-feature-values'\nexport var LAYER = '@layer'\n", "/**\n * @param {number}\n * @return {number}\n */\nexport var abs = Math.abs\n\n/**\n * @param {number}\n * @return {string}\n */\nexport var from = String.fromCharCode\n\n/**\n * @param {object}\n * @return {object}\n */\nexport var assign = Object.assign\n\n/**\n * @param {string} value\n * @param {number} length\n * @return {number}\n */\nexport function hash (value, length) {\n\treturn charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0\n}\n\n/**\n * @param {string} value\n * @return {string}\n */\nexport function trim (value) {\n\treturn value.trim()\n}\n\n/**\n * @param {string} value\n * @param {RegExp} pattern\n * @return {string?}\n */\nexport function match (value, pattern) {\n\treturn (value = pattern.exec(value)) ? value[0] : value\n}\n\n/**\n * @param {string} value\n * @param {(string|RegExp)} pattern\n * @param {string} replacement\n * @return {string}\n */\nexport function replace (value, pattern, replacement) {\n\treturn value.replace(pattern, replacement)\n}\n\n/**\n * @param {string} value\n * @param {string} search\n * @return {number}\n */\nexport function indexof (value, search) {\n\treturn value.indexOf(search)\n}\n\n/**\n * @param {string} value\n * @param {number} index\n * @return {number}\n */\nexport function charat (value, index) {\n\treturn value.charCodeAt(index) | 0\n}\n\n/**\n * @param {string} value\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function substr (value, begin, end) {\n\treturn value.slice(begin, end)\n}\n\n/**\n * @param {string} value\n * @return {number}\n */\nexport function strlen (value) {\n\treturn value.length\n}\n\n/**\n * @param {any[]} value\n * @return {number}\n */\nexport function sizeof (value) {\n\treturn value.length\n}\n\n/**\n * @param {any} value\n * @param {any[]} array\n * @return {any}\n */\nexport function append (value, array) {\n\treturn array.push(value), value\n}\n\n/**\n * @param {string[]} array\n * @param {function} callback\n * @return {string}\n */\nexport function combine (array, callback) {\n\treturn array.map(callback).join('')\n}\n", "import {from, trim, charat, strlen, substr, append, assign} from './Utility.js'\n\nexport var line = 1\nexport var column = 1\nexport var length = 0\nexport var position = 0\nexport var character = 0\nexport var characters = ''\n\n/**\n * @param {string} value\n * @param {object | null} root\n * @param {object | null} parent\n * @param {string} type\n * @param {string[] | string} props\n * @param {object[] | string} children\n * @param {number} length\n */\nexport function node (value, root, parent, type, props, children, length) {\n\treturn {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}\n}\n\n/**\n * @param {object} root\n * @param {object} props\n * @return {object}\n */\nexport function copy (root, props) {\n\treturn assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)\n}\n\n/**\n * @return {number}\n */\nexport function char () {\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function prev () {\n\tcharacter = position > 0 ? charat(characters, --position) : 0\n\n\tif (column--, character === 10)\n\t\tcolumn = 1, line--\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function next () {\n\tcharacter = position < length ? charat(characters, position++) : 0\n\n\tif (column++, character === 10)\n\t\tcolumn = 1, line++\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function peek () {\n\treturn charat(characters, position)\n}\n\n/**\n * @return {number}\n */\nexport function caret () {\n\treturn position\n}\n\n/**\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function slice (begin, end) {\n\treturn substr(characters, begin, end)\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function token (type) {\n\tswitch (type) {\n\t\t// \\0 \\t \\n \\r \\s whitespace token\n\t\tcase 0: case 9: case 10: case 13: case 32:\n\t\t\treturn 5\n\t\t// ! + , / > @ ~ isolate token\n\t\tcase 33: case 43: case 44: case 47: case 62: case 64: case 126:\n\t\t// ; { } breakpoint token\n\t\tcase 59: case 123: case 125:\n\t\t\treturn 4\n\t\t// : accompanied token\n\t\tcase 58:\n\t\t\treturn 3\n\t\t// \" ' ( [ opening delimit token\n\t\tcase 34: case 39: case 40: case 91:\n\t\t\treturn 2\n\t\t// ) ] closing delimit token\n\t\tcase 41: case 93:\n\t\t\treturn 1\n\t}\n\n\treturn 0\n}\n\n/**\n * @param {string} value\n * @return {any[]}\n */\nexport function alloc (value) {\n\treturn line = column = 1, length = strlen(characters = value), position = 0, []\n}\n\n/**\n * @param {any} value\n * @return {any}\n */\nexport function dealloc (value) {\n\treturn characters = '', value\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function delimit (type) {\n\treturn trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))\n}\n\n/**\n * @param {string} value\n * @return {string[]}\n */\nexport function tokenize (value) {\n\treturn dealloc(tokenizer(alloc(value)))\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function whitespace (type) {\n\twhile (character = peek())\n\t\tif (character < 33)\n\t\t\tnext()\n\t\telse\n\t\t\tbreak\n\n\treturn token(type) > 2 || token(character) > 3 ? '' : ' '\n}\n\n/**\n * @param {string[]} children\n * @return {string[]}\n */\nexport function tokenizer (children) {\n\twhile (next())\n\t\tswitch (token(character)) {\n\t\t\tcase 0: append(identifier(position - 1), children)\n\t\t\t\tbreak\n\t\t\tcase 2: append(delimit(character), children)\n\t\t\t\tbreak\n\t\t\tdefault: append(from(character), children)\n\t\t}\n\n\treturn children\n}\n\n/**\n * @param {number} index\n * @param {number} count\n * @return {string}\n */\nexport function escaping (index, count) {\n\twhile (--count && next())\n\t\t// not 0-9 A-F a-f\n\t\tif (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))\n\t\t\tbreak\n\n\treturn slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function delimiter (type) {\n\twhile (next())\n\t\tswitch (character) {\n\t\t\t// ] ) \" '\n\t\t\tcase type:\n\t\t\t\treturn position\n\t\t\t// \" '\n\t\t\tcase 34: case 39:\n\t\t\t\tif (type !== 34 && type !== 39)\n\t\t\t\t\tdelimiter(character)\n\t\t\t\tbreak\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (type === 41)\n\t\t\t\t\tdelimiter(type)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tnext()\n\t\t\t\tbreak\n\t\t}\n\n\treturn position\n}\n\n/**\n * @param {number} type\n * @param {number} index\n * @return {number}\n */\nexport function commenter (type, index) {\n\twhile (next())\n\t\t// //\n\t\tif (type + character === 47 + 10)\n\t\t\tbreak\n\t\t// /*\n\t\telse if (type + character === 42 + 42 && peek() === 47)\n\t\t\tbreak\n\n\treturn '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())\n}\n\n/**\n * @param {number} index\n * @return {string}\n */\nexport function identifier (index) {\n\twhile (!token(peek()))\n\t\tnext()\n\n\treturn slice(index, position)\n}\n", "import {COMMENT, RULESET, DECLARATION} from './Enum.js'\nimport {abs, charat, trim, from, sizeof, strlen, substr, append, replace, indexof} from './Utility.js'\nimport {node, char, prev, next, peek, caret, alloc, dealloc, delimit, whitespace, escaping, identifier, commenter} from './Tokenizer.js'\n\n/**\n * @param {string} value\n * @return {object[]}\n */\nexport function compile (value) {\n\treturn dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {string[]} rule\n * @param {string[]} rules\n * @param {string[]} rulesets\n * @param {number[]} pseudo\n * @param {number[]} points\n * @param {string[]} declarations\n * @return {object}\n */\nexport function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {\n\tvar index = 0\n\tvar offset = 0\n\tvar length = pseudo\n\tvar atrule = 0\n\tvar property = 0\n\tvar previous = 0\n\tvar variable = 1\n\tvar scanning = 1\n\tvar ampersand = 1\n\tvar character = 0\n\tvar type = ''\n\tvar props = rules\n\tvar children = rulesets\n\tvar reference = rule\n\tvar characters = type\n\n\twhile (scanning)\n\t\tswitch (previous = character, character = next()) {\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (previous != 108 && charat(characters, length - 1) == 58) {\n\t\t\t\t\tif (indexof(characters += replace(delimit(character), '&', '&\\f'), '&\\f') != -1)\n\t\t\t\t\t\tampersand = -1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t// \" ' [\n\t\t\tcase 34: case 39: case 91:\n\t\t\t\tcharacters += delimit(character)\n\t\t\t\tbreak\n\t\t\t// \\t \\n \\r \\s\n\t\t\tcase 9: case 10: case 13: case 32:\n\t\t\t\tcharacters += whitespace(previous)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tcharacters += escaping(caret() - 1, 7)\n\t\t\t\tcontinue\n\t\t\t// /\n\t\t\tcase 47:\n\t\t\t\tswitch (peek()) {\n\t\t\t\t\tcase 42: case 47:\n\t\t\t\t\t\tappend(comment(commenter(next(), caret()), root, parent), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcharacters += '/'\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t// {\n\t\t\tcase 123 * variable:\n\t\t\t\tpoints[index++] = strlen(characters) * ampersand\n\t\t\t// } ; \\0\n\t\t\tcase 125 * variable: case 59: case 0:\n\t\t\t\tswitch (character) {\n\t\t\t\t\t// \\0 }\n\t\t\t\t\tcase 0: case 125: scanning = 0\n\t\t\t\t\t// ;\n\t\t\t\t\tcase 59 + offset: if (ampersand == -1) characters = replace(characters, /\\f/g, '')\n\t\t\t\t\t\tif (property > 0 && (strlen(characters) - length))\n\t\t\t\t\t\t\tappend(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @ ;\n\t\t\t\t\tcase 59: characters += ';'\n\t\t\t\t\t// { rule/at-rule\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tappend(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets)\n\n\t\t\t\t\t\tif (character === 123)\n\t\t\t\t\t\t\tif (offset === 0)\n\t\t\t\t\t\t\t\tparse(characters, root, reference, reference, props, rulesets, length, points, children)\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tswitch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {\n\t\t\t\t\t\t\t\t\t// d l m s\n\t\t\t\t\t\t\t\t\tcase 100: case 108: case 109: case 115:\n\t\t\t\t\t\t\t\t\t\tparse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children)\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\tparse(characters, reference, reference, reference, [''], children, 0, points, children)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tindex = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo\n\t\t\t\tbreak\n\t\t\t// :\n\t\t\tcase 58:\n\t\t\t\tlength = 1 + strlen(characters), property = previous\n\t\t\tdefault:\n\t\t\t\tif (variable < 1)\n\t\t\t\t\tif (character == 123)\n\t\t\t\t\t\t--variable\n\t\t\t\t\telse if (character == 125 && variable++ == 0 && prev() == 125)\n\t\t\t\t\t\tcontinue\n\n\t\t\t\tswitch (characters += from(character), character * variable) {\n\t\t\t\t\t// &\n\t\t\t\t\tcase 38:\n\t\t\t\t\t\tampersand = offset > 0 ? 1 : (characters += '\\f', -1)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// ,\n\t\t\t\t\tcase 44:\n\t\t\t\t\t\tpoints[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @\n\t\t\t\t\tcase 64:\n\t\t\t\t\t\t// -\n\t\t\t\t\t\tif (peek() === 45)\n\t\t\t\t\t\t\tcharacters += delimit(next())\n\n\t\t\t\t\t\tatrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// -\n\t\t\t\t\tcase 45:\n\t\t\t\t\t\tif (previous === 45 && strlen(characters) == 2)\n\t\t\t\t\t\t\tvariable = 0\n\t\t\t\t}\n\t\t}\n\n\treturn rulesets\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} index\n * @param {number} offset\n * @param {string[]} rules\n * @param {number[]} points\n * @param {string} type\n * @param {string[]} props\n * @param {string[]} children\n * @param {number} length\n * @return {object}\n */\nexport function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {\n\tvar post = offset - 1\n\tvar rule = offset === 0 ? rules : ['']\n\tvar size = sizeof(rule)\n\n\tfor (var i = 0, j = 0, k = 0; i < index; ++i)\n\t\tfor (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)\n\t\t\tif (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\\f/g, rule[x])))\n\t\t\t\tprops[k++] = z\n\n\treturn node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)\n}\n\n/**\n * @param {number} value\n * @param {object} root\n * @param {object?} parent\n * @return {object}\n */\nexport function comment (value, root, parent) {\n\treturn node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0)\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} length\n * @return {object}\n */\nexport function declaration (value, root, parent, length) {\n\treturn node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length)\n}\n", "import {IMPORT, LAYER, COMMENT, RULESET, DECLARATION, KEYFRAMES} from './Enum.js'\nimport {strlen, sizeof} from './Utility.js'\n\n/**\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function serialize (children, callback) {\n\tvar output = ''\n\tvar length = sizeof(children)\n\n\tfor (var i = 0; i < length; i++)\n\t\toutput += callback(children[i], i, children, callback) || ''\n\n\treturn output\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function stringify (element, index, children, callback) {\n\tswitch (element.type) {\n\t\tcase LAYER: if (element.children.length) break\n\t\tcase IMPORT: case DECLARATION: return element.return = element.return || element.value\n\t\tcase COMMENT: return ''\n\t\tcase KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'\n\t\tcase RULESET: element.value = element.props.join(',')\n\t}\n\n\treturn strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''\n}\n", "import {MS, MOZ, WEBKIT, RULESET, KEYFRAMES, DECLARATION} from './Enum.js'\nimport {match, charat, substr, strlen, sizeof, replace, combine} from './Utility.js'\nimport {copy, tokenize} from './Tokenizer.js'\nimport {serialize} from './Serializer.js'\nimport {prefix} from './Prefixer.js'\n\n/**\n * @param {function[]} collection\n * @return {function}\n */\nexport function middleware (collection) {\n\tvar length = sizeof(collection)\n\n\treturn function (element, index, children, callback) {\n\t\tvar output = ''\n\n\t\tfor (var i = 0; i < length; i++)\n\t\t\toutput += collection[i](element, index, children, callback) || ''\n\n\t\treturn output\n\t}\n}\n\n/**\n * @param {function} callback\n * @return {function}\n */\nexport function rulesheet (callback) {\n\treturn function (element) {\n\t\tif (!element.root)\n\t\t\tif (element = element.return)\n\t\t\t\tcallback(element)\n\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n */\nexport function prefixer (element, index, children, callback) {\n\tif (element.length > -1)\n\t\tif (!element.return)\n\t\t\tswitch (element.type) {\n\t\t\t\tcase DECLARATION: element.return = prefix(element.value, element.length, children)\n\t\t\t\t\treturn\n\t\t\t\tcase KEYFRAMES:\n\t\t\t\t\treturn serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)\n\t\t\t\tcase RULESET:\n\t\t\t\t\tif (element.length)\n\t\t\t\t\t\treturn combine(element.props, function (value) {\n\t\t\t\t\t\t\tswitch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n\t\t\t\t\t\t\t\t// :read-(only|write)\n\t\t\t\t\t\t\t\tcase ':read-only': case ':read-write':\n\t\t\t\t\t\t\t\t\treturn serialize([copy(element, {props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]})], callback)\n\t\t\t\t\t\t\t\t// :placeholder\n\t\t\t\t\t\t\t\tcase '::placeholder':\n\t\t\t\t\t\t\t\t\treturn serialize([\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]})\n\t\t\t\t\t\t\t\t\t], callback)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn ''\n\t\t\t\t\t\t})\n\t\t\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n */\nexport function namespace (element) {\n\tswitch (element.type) {\n\t\tcase RULESET:\n\t\t\telement.props = element.props.map(function (value) {\n\t\t\t\treturn combine(tokenize(value), function (value, index, children) {\n\t\t\t\t\tswitch (charat(value, 0)) {\n\t\t\t\t\t\t// \\f\n\t\t\t\t\t\tcase 12:\n\t\t\t\t\t\t\treturn substr(value, 1, strlen(value))\n\t\t\t\t\t\t// \\0 ( + > ~\n\t\t\t\t\t\tcase 0: case 40: case 43: case 62: case 126:\n\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t// :\n\t\t\t\t\t\tcase 58:\n\t\t\t\t\t\t\tif (children[++index] === 'global')\n\t\t\t\t\t\t\t\tchildren[index] = '', children[++index] = '\\f' + substr(children[index], index = 1, -1)\n\t\t\t\t\t\t// \\s\n\t\t\t\t\t\tcase 32:\n\t\t\t\t\t\t\treturn index === 1 ? '' : value\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tswitch (index) {\n\t\t\t\t\t\t\t\tcase 0: element = value\n\t\t\t\t\t\t\t\t\treturn sizeof(children) > 1 ? '' : value\n\t\t\t\t\t\t\t\tcase index = sizeof(children) - 1: case 2:\n\t\t\t\t\t\t\t\t\treturn index === 2 ? value + element + element : value + element\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t}\n}\n", "function memoize(fn) {\n var cache = Object.create(null);\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport { memoize as default };\n", "import { StyleSheet } from '@emotion/sheet';\nimport { dealloc, alloc, next, token, from, peek, delimit, slice, position, RULESET, combine, match, serialize, copy, replace, WEBKIT, MOZ, MS, KEYFRAMES, DECLARATION, hash, charat, strlen, indexof, stringify, rulesheet, middleware, compile } from 'stylis';\nimport '@emotion/weak-memoize';\nimport '@emotion/memoize';\n\nvar identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {\n var previous = 0;\n var character = 0;\n\n while (true) {\n previous = character;\n character = peek(); // &\\f\n\n if (previous === 38 && character === 12) {\n points[index] = 1;\n }\n\n if (token(character)) {\n break;\n }\n\n next();\n }\n\n return slice(begin, position);\n};\n\nvar toRules = function toRules(parsed, points) {\n // pretend we've started with a comma\n var index = -1;\n var character = 44;\n\n do {\n switch (token(character)) {\n case 0:\n // &\\f\n if (character === 38 && peek() === 12) {\n // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings\n // stylis inserts \\f after & to know when & where it should replace this sequence with the context selector\n // and when it should just concatenate the outer and inner selectors\n // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here\n points[index] = 1;\n }\n\n parsed[index] += identifierWithPointTracking(position - 1, points, index);\n break;\n\n case 2:\n parsed[index] += delimit(character);\n break;\n\n case 4:\n // comma\n if (character === 44) {\n // colon\n parsed[++index] = peek() === 58 ? '&\\f' : '';\n points[index] = parsed[index].length;\n break;\n }\n\n // fallthrough\n\n default:\n parsed[index] += from(character);\n }\n } while (character = next());\n\n return parsed;\n};\n\nvar getRules = function getRules(value, points) {\n return dealloc(toRules(alloc(value), points));\n}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11\n\n\nvar fixedElements = /* #__PURE__ */new WeakMap();\nvar compat = function compat(element) {\n if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo\n // negative .length indicates that this rule has been already prefixed\n element.length < 1) {\n return;\n }\n\n var value = element.value;\n var parent = element.parent;\n var isImplicitRule = element.column === parent.column && element.line === parent.line;\n\n while (parent.type !== 'rule') {\n parent = parent.parent;\n if (!parent) return;\n } // short-circuit for the simplest case\n\n\n if (element.props.length === 1 && value.charCodeAt(0) !== 58\n /* colon */\n && !fixedElements.get(parent)) {\n return;\n } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)\n // then the props has already been manipulated beforehand as they that array is shared between it and its \"rule parent\"\n\n\n if (isImplicitRule) {\n return;\n }\n\n fixedElements.set(element, true);\n var points = [];\n var rules = getRules(value, points);\n var parentRules = parent.props;\n\n for (var i = 0, k = 0; i < rules.length; i++) {\n for (var j = 0; j < parentRules.length; j++, k++) {\n element.props[k] = points[i] ? rules[i].replace(/&\\f/g, parentRules[j]) : parentRules[j] + \" \" + rules[i];\n }\n }\n};\nvar removeLabel = function removeLabel(element) {\n if (element.type === 'decl') {\n var value = element.value;\n\n if ( // charcode for l\n value.charCodeAt(0) === 108 && // charcode for b\n value.charCodeAt(2) === 98) {\n // this ignores label\n element[\"return\"] = '';\n element.value = '';\n }\n }\n};\n\n/* eslint-disable no-fallthrough */\n\nfunction prefix(value, length) {\n switch (hash(value, length)) {\n // color-adjust\n case 5103:\n return WEBKIT + 'print-' + value + value;\n // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)\n\n case 5737:\n case 4201:\n case 3177:\n case 3433:\n case 1641:\n case 4457:\n case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break\n\n case 5572:\n case 6356:\n case 5844:\n case 3191:\n case 6645:\n case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,\n\n case 6391:\n case 5879:\n case 5623:\n case 6135:\n case 4599:\n case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)\n\n case 4215:\n case 6389:\n case 5109:\n case 5365:\n case 5621:\n case 3829:\n return WEBKIT + value + value;\n // appearance, user-select, transform, hyphens, text-size-adjust\n\n case 5349:\n case 4246:\n case 4810:\n case 6968:\n case 2756:\n return WEBKIT + value + MOZ + value + MS + value + value;\n // flex, flex-direction\n\n case 6828:\n case 4268:\n return WEBKIT + value + MS + value + value;\n // order\n\n case 6165:\n return WEBKIT + value + MS + 'flex-' + value + value;\n // align-items\n\n case 5187:\n return WEBKIT + value + replace(value, /(\\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value;\n // align-self\n\n case 5443:\n return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value;\n // align-content\n\n case 4675:\n return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value;\n // flex-shrink\n\n case 5548:\n return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value;\n // flex-basis\n\n case 5292:\n return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value;\n // flex-grow\n\n case 6060:\n return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value;\n // transition\n\n case 4554:\n return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value;\n // cursor\n\n case 6187:\n return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value;\n // background, background-image\n\n case 5495:\n case 3959:\n return replace(value, /(image-set\\([^]*)/, WEBKIT + '$1' + '$`$1');\n // justify-content\n\n case 4968:\n return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value;\n // (margin|padding)-inline-(start|end)\n\n case 4095:\n case 3583:\n case 4068:\n case 2532:\n return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value;\n // (min|max)?(width|height|inline-size|block-size)\n\n case 8116:\n case 7059:\n case 5753:\n case 5535:\n case 5445:\n case 5701:\n case 4933:\n case 4677:\n case 5533:\n case 5789:\n case 5021:\n case 4765:\n // stretch, max-content, min-content, fill-available\n if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {\n // (m)ax-content, (m)in-content\n case 109:\n // -\n if (charat(value, length + 4) !== 45) break;\n // (f)ill-available, (f)it-content\n\n case 102:\n return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;\n // (s)tretch\n\n case 115:\n return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value;\n }\n break;\n // position: sticky\n\n case 4949:\n // (s)ticky?\n if (charat(value, length + 1) !== 115) break;\n // display: (flex|inline-flex)\n\n case 6444:\n switch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {\n // stic(k)y\n case 107:\n return replace(value, ':', ':' + WEBKIT) + value;\n // (inline-)?fl(e)x\n\n case 101:\n return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value;\n }\n\n break;\n // writing-mode\n\n case 5936:\n switch (charat(value, length + 11)) {\n // vertical-l(r)\n case 114:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb') + value;\n // vertical-r(l)\n\n case 108:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb-rl') + value;\n // horizontal(-)tb\n\n case 45:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'lr') + value;\n }\n\n return WEBKIT + value + MS + value + value;\n }\n\n return value;\n}\n\nvar prefixer = function prefixer(element, index, children, callback) {\n if (element.length > -1) if (!element[\"return\"]) switch (element.type) {\n case DECLARATION:\n element[\"return\"] = prefix(element.value, element.length);\n break;\n\n case KEYFRAMES:\n return serialize([copy(element, {\n value: replace(element.value, '@', '@' + WEBKIT)\n })], callback);\n\n case RULESET:\n if (element.length) return combine(element.props, function (value) {\n switch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n // :read-(only|write)\n case ':read-only':\n case ':read-write':\n return serialize([copy(element, {\n props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]\n })], callback);\n // :placeholder\n\n case '::placeholder':\n return serialize([copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]\n })], callback);\n }\n\n return '';\n });\n }\n};\n\nvar defaultStylisPlugins = [prefixer];\n\nvar createCache = function createCache(options) {\n var key = options.key;\n\n if (key === 'css') {\n var ssrStyles = document.querySelectorAll(\"style[data-emotion]:not([data-s])\"); // get SSRed styles out of the way of React's hydration\n // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)\n // note this very very intentionally targets all style elements regardless of the key to ensure\n // that creating a cache works inside of render of a React component\n\n Array.prototype.forEach.call(ssrStyles, function (node) {\n // we want to only move elements which have a space in the data-emotion attribute value\n // because that indicates that it is an Emotion 11 server-side rendered style elements\n // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector\n // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)\n // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles\n // will not result in the Emotion 10 styles being destroyed\n var dataEmotionAttribute = node.getAttribute('data-emotion');\n\n if (dataEmotionAttribute.indexOf(' ') === -1) {\n return;\n }\n\n document.head.appendChild(node);\n node.setAttribute('data-s', '');\n });\n }\n\n var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;\n\n var inserted = {};\n var container;\n var nodesToHydrate = [];\n\n {\n container = options.container || document.head;\n Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which\n // means that the style elements we're looking at are only Emotion 11 server-rendered style elements\n document.querySelectorAll(\"style[data-emotion^=\\\"\" + key + \" \\\"]\"), function (node) {\n var attrib = node.getAttribute(\"data-emotion\").split(' ');\n\n for (var i = 1; i < attrib.length; i++) {\n inserted[attrib[i]] = true;\n }\n\n nodesToHydrate.push(node);\n });\n }\n\n var _insert;\n\n var omnipresentPlugins = [compat, removeLabel];\n\n {\n var currentSheet;\n var finalizingPlugins = [stringify, rulesheet(function (rule) {\n currentSheet.insert(rule);\n })];\n var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));\n\n var stylis = function stylis(styles) {\n return serialize(compile(styles), serializer);\n };\n\n _insert = function insert(selector, serialized, sheet, shouldCache) {\n currentSheet = sheet;\n\n stylis(selector ? selector + \"{\" + serialized.styles + \"}\" : serialized.styles);\n\n if (shouldCache) {\n cache.inserted[serialized.name] = true;\n }\n };\n }\n\n var cache = {\n key: key,\n sheet: new StyleSheet({\n key: key,\n container: container,\n nonce: options.nonce,\n speedy: options.speedy,\n prepend: options.prepend,\n insertionPoint: options.insertionPoint\n }),\n nonce: options.nonce,\n inserted: inserted,\n registered: {},\n insert: _insert\n };\n cache.sheet.hydrate(nodesToHydrate);\n return cache;\n};\n\nexport { createCache as default };\n", "var isBrowser = true;\n\nfunction getRegisteredStyles(registered, registeredStyles, classNames) {\n var rawClassName = '';\n classNames.split(' ').forEach(function (className) {\n if (registered[className] !== undefined) {\n registeredStyles.push(registered[className] + \";\");\n } else if (className) {\n rawClassName += className + \" \";\n }\n });\n return rawClassName;\n}\nvar registerStyles = function registerStyles(cache, serialized, isStringTag) {\n var className = cache.key + \"-\" + serialized.name;\n\n if ( // we only need to add the styles to the registered cache if the\n // class name could be used further down\n // the tree but if it's a string tag, we know it won't\n // so we don't have to add it to registered cache.\n // this improves memory usage since we can avoid storing the whole style string\n (isStringTag === false || // we need to always store it if we're in compat mode and\n // in node since emotion-server relies on whether a style is in\n // the registered cache to know whether a style is global or not\n // also, note that this check will be dead code eliminated in the browser\n isBrowser === false ) && cache.registered[className] === undefined) {\n cache.registered[className] = serialized.styles;\n }\n};\nvar insertStyles = function insertStyles(cache, serialized, isStringTag) {\n registerStyles(cache, serialized, isStringTag);\n var className = cache.key + \"-\" + serialized.name;\n\n if (cache.inserted[serialized.name] === undefined) {\n var current = serialized;\n\n do {\n cache.insert(serialized === current ? \".\" + className : '', current, cache.sheet, true);\n\n current = current.next;\n } while (current !== undefined);\n }\n};\n\nexport { getRegisteredStyles, insertStyles, registerStyles };\n", "/* eslint-disable */\n// Inspired by https://github.com/garycourt/murmurhash-js\n// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86\nfunction murmur2(str) {\n // 'm' and 'r' are mixing constants generated offline.\n // They're not really 'magic', they just happen to work well.\n // const m = 0x5bd1e995;\n // const r = 24;\n // Initialize the hash\n var h = 0; // Mix 4 bytes at a time into the hash\n\n var k,\n i = 0,\n len = str.length;\n\n for (; len >= 4; ++i, len -= 4) {\n k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;\n k =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);\n k ^=\n /* k >>> r: */\n k >>> 24;\n h =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Handle the last few bytes of the input array\n\n\n switch (len) {\n case 3:\n h ^= (str.charCodeAt(i + 2) & 0xff) << 16;\n\n case 2:\n h ^= (str.charCodeAt(i + 1) & 0xff) << 8;\n\n case 1:\n h ^= str.charCodeAt(i) & 0xff;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Do a few final mixes of the hash to ensure the last few\n // bytes are well-incorporated.\n\n\n h ^= h >>> 13;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n return ((h ^ h >>> 15) >>> 0).toString(36);\n}\n\nexport { murmur2 as default };\n", "var unitlessKeys = {\n animationIterationCount: 1,\n aspectRatio: 1,\n borderImageOutset: 1,\n borderImageSlice: 1,\n borderImageWidth: 1,\n boxFlex: 1,\n boxFlexGroup: 1,\n boxOrdinalGroup: 1,\n columnCount: 1,\n columns: 1,\n flex: 1,\n flexGrow: 1,\n flexPositive: 1,\n flexShrink: 1,\n flexNegative: 1,\n flexOrder: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowSpan: 1,\n gridRowStart: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnSpan: 1,\n gridColumnStart: 1,\n msGridRow: 1,\n msGridRowSpan: 1,\n msGridColumn: 1,\n msGridColumnSpan: 1,\n fontWeight: 1,\n lineHeight: 1,\n opacity: 1,\n order: 1,\n orphans: 1,\n scale: 1,\n tabSize: 1,\n widows: 1,\n zIndex: 1,\n zoom: 1,\n WebkitLineClamp: 1,\n // SVG-related properties\n fillOpacity: 1,\n floodOpacity: 1,\n stopOpacity: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1,\n strokeMiterlimit: 1,\n strokeOpacity: 1,\n strokeWidth: 1\n};\n\nexport { unitlessKeys as default };\n", "import hashString from '@emotion/hash';\nimport unitless from '@emotion/unitless';\nimport memoize from '@emotion/memoize';\n\nvar isDevelopment = false;\n\nvar hyphenateRegex = /[A-Z]|^ms/g;\nvar animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;\n\nvar isCustomProperty = function isCustomProperty(property) {\n return property.charCodeAt(1) === 45;\n};\n\nvar isProcessableValue = function isProcessableValue(value) {\n return value != null && typeof value !== 'boolean';\n};\n\nvar processStyleName = /* #__PURE__ */memoize(function (styleName) {\n return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();\n});\n\nvar processStyleValue = function processStyleValue(key, value) {\n switch (key) {\n case 'animation':\n case 'animationName':\n {\n if (typeof value === 'string') {\n return value.replace(animationRegex, function (match, p1, p2) {\n cursor = {\n name: p1,\n styles: p2,\n next: cursor\n };\n return p1;\n });\n }\n }\n }\n\n if (unitless[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {\n return value + 'px';\n }\n\n return value;\n};\n\nvar noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';\n\nfunction handleInterpolation(mergedProps, registered, interpolation) {\n if (interpolation == null) {\n return '';\n }\n\n var componentSelector = interpolation;\n\n if (componentSelector.__emotion_styles !== undefined) {\n\n return componentSelector;\n }\n\n switch (typeof interpolation) {\n case 'boolean':\n {\n return '';\n }\n\n case 'object':\n {\n var keyframes = interpolation;\n\n if (keyframes.anim === 1) {\n cursor = {\n name: keyframes.name,\n styles: keyframes.styles,\n next: cursor\n };\n return keyframes.name;\n }\n\n var serializedStyles = interpolation;\n\n if (serializedStyles.styles !== undefined) {\n var next = serializedStyles.next;\n\n if (next !== undefined) {\n // not the most efficient thing ever but this is a pretty rare case\n // and there will be very few iterations of this generally\n while (next !== undefined) {\n cursor = {\n name: next.name,\n styles: next.styles,\n next: cursor\n };\n next = next.next;\n }\n }\n\n var styles = serializedStyles.styles + \";\";\n return styles;\n }\n\n return createStringFromObject(mergedProps, registered, interpolation);\n }\n\n case 'function':\n {\n if (mergedProps !== undefined) {\n var previousCursor = cursor;\n var result = interpolation(mergedProps);\n cursor = previousCursor;\n return handleInterpolation(mergedProps, registered, result);\n }\n\n break;\n }\n } // finalize string values (regular strings and functions interpolated into css calls)\n\n\n var asString = interpolation;\n\n if (registered == null) {\n return asString;\n }\n\n var cached = registered[asString];\n return cached !== undefined ? cached : asString;\n}\n\nfunction createStringFromObject(mergedProps, registered, obj) {\n var string = '';\n\n if (Array.isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n string += handleInterpolation(mergedProps, registered, obj[i]) + \";\";\n }\n } else {\n for (var key in obj) {\n var value = obj[key];\n\n if (typeof value !== 'object') {\n var asString = value;\n\n if (registered != null && registered[asString] !== undefined) {\n string += key + \"{\" + registered[asString] + \"}\";\n } else if (isProcessableValue(asString)) {\n string += processStyleName(key) + \":\" + processStyleValue(key, asString) + \";\";\n }\n } else {\n if (key === 'NO_COMPONENT_SELECTOR' && isDevelopment) {\n throw new Error(noComponentSelectorMessage);\n }\n\n if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {\n for (var _i = 0; _i < value.length; _i++) {\n if (isProcessableValue(value[_i])) {\n string += processStyleName(key) + \":\" + processStyleValue(key, value[_i]) + \";\";\n }\n }\n } else {\n var interpolated = handleInterpolation(mergedProps, registered, value);\n\n switch (key) {\n case 'animation':\n case 'animationName':\n {\n string += processStyleName(key) + \":\" + interpolated + \";\";\n break;\n }\n\n default:\n {\n\n string += key + \"{\" + interpolated + \"}\";\n }\n }\n }\n }\n }\n }\n\n return string;\n}\n\nvar labelPattern = /label:\\s*([^\\s;{]+)\\s*(;|$)/g; // this is the cursor for keyframes\n// keyframes are stored on the SerializedStyles object as a linked list\n\nvar cursor;\nfunction serializeStyles(args, registered, mergedProps) {\n if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {\n return args[0];\n }\n\n var stringMode = true;\n var styles = '';\n cursor = undefined;\n var strings = args[0];\n\n if (strings == null || strings.raw === undefined) {\n stringMode = false;\n styles += handleInterpolation(mergedProps, registered, strings);\n } else {\n var asTemplateStringsArr = strings;\n\n styles += asTemplateStringsArr[0];\n } // we start at 1 since we've already handled the first arg\n\n\n for (var i = 1; i < args.length; i++) {\n styles += handleInterpolation(mergedProps, registered, args[i]);\n\n if (stringMode) {\n var templateStringsArr = strings;\n\n styles += templateStringsArr[i];\n }\n } // using a global regex with .exec is stateful so lastIndex has to be reset each time\n\n\n labelPattern.lastIndex = 0;\n var identifierName = '';\n var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5\n\n while ((match = labelPattern.exec(styles)) !== null) {\n identifierName += '-' + match[1];\n }\n\n var name = hashString(styles) + identifierName;\n\n return {\n name: name,\n styles: styles,\n next: cursor\n };\n}\n\nexport { serializeStyles };\n", "import * as React from 'react';\n\nvar syncFallback = function syncFallback(create) {\n return create();\n};\n\nvar useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : false;\nvar useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;\nvar useInsertionEffectWithLayoutFallback = useInsertionEffect || React.useLayoutEffect;\n\nexport { useInsertionEffectAlwaysWithSyncFallback, useInsertionEffectWithLayoutFallback };\n", "import { h as hasOwn, E as Emotion, c as createEmotionProps, w as withEmotionCache, T as ThemeContext, i as isDevelopment } from './emotion-element-f0de968e.browser.esm.js';\nexport { C as CacheProvider, T as ThemeContext, a as ThemeProvider, _ as __unsafe_useEmotionCache, u as useTheme, w as withEmotionCache, b as withTheme } from './emotion-element-f0de968e.browser.esm.js';\nimport * as React from 'react';\nimport { insertStyles, registerStyles, getRegisteredStyles } from '@emotion/utils';\nimport { useInsertionEffectWithLayoutFallback, useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\nimport { serializeStyles } from '@emotion/serialize';\nimport '@emotion/cache';\nimport '@babel/runtime/helpers/extends';\nimport '@emotion/weak-memoize';\nimport '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';\nimport 'hoist-non-react-statics';\n\nvar jsx = function jsx(type, props) {\n // eslint-disable-next-line prefer-rest-params\n var args = arguments;\n\n if (props == null || !hasOwn.call(props, 'css')) {\n return React.createElement.apply(undefined, args);\n }\n\n var argsLength = args.length;\n var createElementArgArray = new Array(argsLength);\n createElementArgArray[0] = Emotion;\n createElementArgArray[1] = createEmotionProps(type, props);\n\n for (var i = 2; i < argsLength; i++) {\n createElementArgArray[i] = args[i];\n }\n\n return React.createElement.apply(null, createElementArgArray);\n};\n\n(function (_jsx) {\n var JSX;\n\n (function (_JSX) {})(JSX || (JSX = _jsx.JSX || (_jsx.JSX = {})));\n})(jsx || (jsx = {}));\n\n// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild\n// initial client-side render from SSR, use place of hydrating tag\n\nvar Global = /* #__PURE__ */withEmotionCache(function (props, cache) {\n\n var styles = props.styles;\n var serialized = serializeStyles([styles], undefined, React.useContext(ThemeContext));\n // but it is based on a constant that will never change at runtime\n // it's effectively like having two implementations and switching them out\n // so it's not actually breaking anything\n\n\n var sheetRef = React.useRef();\n useInsertionEffectWithLayoutFallback(function () {\n var key = cache.key + \"-global\"; // use case of https://github.com/emotion-js/emotion/issues/2675\n\n var sheet = new cache.sheet.constructor({\n key: key,\n nonce: cache.sheet.nonce,\n container: cache.sheet.container,\n speedy: cache.sheet.isSpeedy\n });\n var rehydrating = false;\n var node = document.querySelector(\"style[data-emotion=\\\"\" + key + \" \" + serialized.name + \"\\\"]\");\n\n if (cache.sheet.tags.length) {\n sheet.before = cache.sheet.tags[0];\n }\n\n if (node !== null) {\n rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other <Global/>s\n\n node.setAttribute('data-emotion', key);\n sheet.hydrate([node]);\n }\n\n sheetRef.current = [sheet, rehydrating];\n return function () {\n sheet.flush();\n };\n }, [cache]);\n useInsertionEffectWithLayoutFallback(function () {\n var sheetRefCurrent = sheetRef.current;\n var sheet = sheetRefCurrent[0],\n rehydrating = sheetRefCurrent[1];\n\n if (rehydrating) {\n sheetRefCurrent[1] = false;\n return;\n }\n\n if (serialized.next !== undefined) {\n // insert keyframes\n insertStyles(cache, serialized.next, true);\n }\n\n if (sheet.tags.length) {\n // if this doesn't exist then it will be null so the style element will be appended\n var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;\n sheet.before = element;\n sheet.flush();\n }\n\n cache.insert(\"\", serialized, sheet, false);\n }, [cache, serialized.name]);\n return null;\n});\n\nfunction css() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return serializeStyles(args);\n}\n\nfunction keyframes() {\n var insertable = css.apply(void 0, arguments);\n var name = \"animation-\" + insertable.name;\n return {\n name: name,\n styles: \"@keyframes \" + name + \"{\" + insertable.styles + \"}\",\n anim: 1,\n toString: function toString() {\n return \"_EMO_\" + this.name + \"_\" + this.styles + \"_EMO_\";\n }\n };\n}\n\nvar classnames = function classnames(args) {\n var len = args.length;\n var i = 0;\n var cls = '';\n\n for (; i < len; i++) {\n var arg = args[i];\n if (arg == null) continue;\n var toAdd = void 0;\n\n switch (typeof arg) {\n case 'boolean':\n break;\n\n case 'object':\n {\n if (Array.isArray(arg)) {\n toAdd = classnames(arg);\n } else {\n\n toAdd = '';\n\n for (var k in arg) {\n if (arg[k] && k) {\n toAdd && (toAdd += ' ');\n toAdd += k;\n }\n }\n }\n\n break;\n }\n\n default:\n {\n toAdd = arg;\n }\n }\n\n if (toAdd) {\n cls && (cls += ' ');\n cls += toAdd;\n }\n }\n\n return cls;\n};\n\nfunction merge(registered, css, className) {\n var registeredStyles = [];\n var rawClassName = getRegisteredStyles(registered, registeredStyles, className);\n\n if (registeredStyles.length < 2) {\n return className;\n }\n\n return rawClassName + css(registeredStyles);\n}\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serializedArr = _ref.serializedArr;\n useInsertionEffectAlwaysWithSyncFallback(function () {\n\n for (var i = 0; i < serializedArr.length; i++) {\n insertStyles(cache, serializedArr[i], false);\n }\n });\n\n return null;\n};\n\nvar ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {\n var hasRendered = false;\n var serializedArr = [];\n\n var css = function css() {\n if (hasRendered && isDevelopment) {\n throw new Error('css can only be used during render');\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var serialized = serializeStyles(args, cache.registered);\n serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx`\n\n registerStyles(cache, serialized, false);\n return cache.key + \"-\" + serialized.name;\n };\n\n var cx = function cx() {\n if (hasRendered && isDevelopment) {\n throw new Error('cx can only be used during render');\n }\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return merge(cache.registered, css, classnames(args));\n };\n\n var content = {\n css: css,\n cx: cx,\n theme: React.useContext(ThemeContext)\n };\n var ele = props.children(content);\n hasRendered = true;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {\n cache: cache,\n serializedArr: serializedArr\n }), ele);\n});\n\nexport { ClassNames, Global, jsx as createElement, css, jsx, keyframes };\n", "import _extends from '@babel/runtime/helpers/esm/extends';\nimport { withEmotionCache, ThemeContext } from '@emotion/react';\nimport { serializeStyles } from '@emotion/serialize';\nimport { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\nimport { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';\nimport * as React from 'react';\nimport isPropValid from '@emotion/is-prop-valid';\n\nvar isDevelopment = false;\n\nvar testOmitPropsOnStringTag = isPropValid;\n\nvar testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {\n return key !== 'theme';\n};\n\nvar getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {\n return typeof tag === 'string' && // 96 is one less than the char code\n // for \"a\" so this is checking that\n // it's a lowercase character\n tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;\n};\nvar composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) {\n var shouldForwardProp;\n\n if (options) {\n var optionsShouldForwardProp = options.shouldForwardProp;\n shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) {\n return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);\n } : optionsShouldForwardProp;\n }\n\n if (typeof shouldForwardProp !== 'function' && isReal) {\n shouldForwardProp = tag.__emotion_forwardProp;\n }\n\n return shouldForwardProp;\n};\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serialized = _ref.serialized,\n isStringTag = _ref.isStringTag;\n registerStyles(cache, serialized, isStringTag);\n useInsertionEffectAlwaysWithSyncFallback(function () {\n return insertStyles(cache, serialized, isStringTag);\n });\n\n return null;\n};\n\nvar createStyled = function createStyled(tag, options) {\n\n var isReal = tag.__emotion_real === tag;\n var baseTag = isReal && tag.__emotion_base || tag;\n var identifierName;\n var targetClassName;\n\n if (options !== undefined) {\n identifierName = options.label;\n targetClassName = options.target;\n }\n\n var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);\n var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);\n var shouldUseAs = !defaultShouldForwardProp('as');\n return function () {\n // eslint-disable-next-line prefer-rest-params\n var args = arguments;\n var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];\n\n if (identifierName !== undefined) {\n styles.push(\"label:\" + identifierName + \";\");\n }\n\n if (args[0] == null || args[0].raw === undefined) {\n // eslint-disable-next-line prefer-spread\n styles.push.apply(styles, args);\n } else {\n var templateStringsArr = args[0];\n\n styles.push(templateStringsArr[0]);\n var len = args.length;\n var i = 1;\n\n for (; i < len; i++) {\n\n styles.push(args[i], templateStringsArr[i]);\n }\n }\n\n var Styled = withEmotionCache(function (props, cache, ref) {\n var FinalTag = shouldUseAs && props.as || baseTag;\n var className = '';\n var classInterpolations = [];\n var mergedProps = props;\n\n if (props.theme == null) {\n mergedProps = {};\n\n for (var key in props) {\n mergedProps[key] = props[key];\n }\n\n mergedProps.theme = React.useContext(ThemeContext);\n }\n\n if (typeof props.className === 'string') {\n className = getRegisteredStyles(cache.registered, classInterpolations, props.className);\n } else if (props.className != null) {\n className = props.className + \" \";\n }\n\n var serialized = serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);\n className += cache.key + \"-\" + serialized.name;\n\n if (targetClassName !== undefined) {\n className += \" \" + targetClassName;\n }\n\n var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;\n var newProps = {};\n\n for (var _key in props) {\n if (shouldUseAs && _key === 'as') continue;\n\n if (finalShouldForwardProp(_key)) {\n newProps[_key] = props[_key];\n }\n }\n\n newProps.className = className;\n\n if (ref) {\n newProps.ref = ref;\n }\n\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {\n cache: cache,\n serialized: serialized,\n isStringTag: typeof FinalTag === 'string'\n }), /*#__PURE__*/React.createElement(FinalTag, newProps));\n });\n Styled.displayName = identifierName !== undefined ? identifierName : \"Styled(\" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + \")\";\n Styled.defaultProps = tag.defaultProps;\n Styled.__emotion_real = Styled;\n Styled.__emotion_base = baseTag;\n Styled.__emotion_styles = styles;\n Styled.__emotion_forwardProp = shouldForwardProp;\n Object.defineProperty(Styled, 'toString', {\n value: function value() {\n if (targetClassName === undefined && isDevelopment) {\n return 'NO_COMPONENT_SELECTOR';\n }\n\n return \".\" + targetClassName;\n }\n });\n\n Styled.withComponent = function (nextTag, nextOptions) {\n var newStyled = createStyled(nextTag, _extends({}, options, nextOptions, {\n shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)\n }));\n return newStyled.apply(void 0, styles);\n };\n\n return Styled;\n };\n};\n\nexport { createStyled as default };\n", "import memoize from '@emotion/memoize';\n\n// eslint-disable-next-line no-undef\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar isPropValid = /* #__PURE__ */memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport { isPropValid as default };\n", "import createStyled from '../base/dist/emotion-styled-base.browser.esm.js';\nimport '@babel/runtime/helpers/extends';\nimport '@emotion/react';\nimport '@emotion/serialize';\nimport '@emotion/use-insertion-effect-with-fallbacks';\nimport '@emotion/utils';\nimport 'react';\nimport '@emotion/is-prop-valid';\n\nvar tags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG\n'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];\n\n// bind it to avoid mutating the original function\nvar styled = createStyled.bind(null);\ntags.forEach(function (tagName) {\n styled[tagName] = styled(tagName);\n});\n\nexport { styled as default };\n", "/**\n * @mui/styled-engine v9.5.0\n *\n * @license MIT\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use client';\n\n/* eslint-disable no-underscore-dangle */\nimport emStyled from '@emotion/styled';\nimport { serializeStyles as emSerializeStyles } from '@emotion/serialize';\n\n// Re-export the public type surface of `@emotion/styled`. Explicit names rather\n// than `export type *`: an `export *` (even type-only) is disallowed by the\n// `'use client'` Next.js lint rule. Names locally redeclared below intentionally\n// shadow Emotion's and are not re-exported here.\n\nfunction styled(tag, options) {\n // Emotion's `styled` overloads each expect a specific tag/component shape;\n // none accept the broadened `React.ElementType` union, so cast the passthrough.\n const stylesFactory = emStyled(tag, options);\n if (process.env.NODE_ENV !== 'production') {\n return (...styles) => {\n const component = typeof tag === 'string' ? `\"${tag}\"` : 'component';\n if (styles.length === 0) {\n console.error([`MUI: Seems like you called \\`styled(${component})()\\` without a \\`style\\` argument.`, 'You must provide a `styles` argument: `styled(\"div\")(styleYouForgotToPass)`.'].join('\\n'));\n } else if (styles.some(style => style === undefined)) {\n console.error(`MUI: the styled(${component})(...args) API requires all its args to be defined.`);\n }\n return stylesFactory(...styles);\n };\n }\n return stylesFactory;\n}\nexport default styled;\n\n/**\n * For internal usage in `@mui/system` package\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function internal_mutateStyles(tag, processor) {\n // Emotion attaches all the styles as `__emotion_styles`.\n // Ref: https://github.com/emotion-js/emotion/blob/16d971d0da229596d6bcc39d282ba9753c9ee7cf/packages/styled/src/base.js#L186\n if (Array.isArray(tag.__emotion_styles)) {\n tag.__emotion_styles = processor(tag.__emotion_styles);\n }\n}\n\n// Emotion only accepts an array, but we want to avoid allocations\nconst wrapper = [];\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function internal_serializeStyles(styles) {\n wrapper[0] = styles;\n return emSerializeStyles(wrapper);\n}\nexport { ThemeContext, keyframes, css } from '@emotion/react';\nexport { default as StyledEngineProvider } from \"./StyledEngineProvider/index.mjs\";\nexport { default as GlobalStyles } from \"./GlobalStyles/index.mjs\";\n\n// TODO v6 - check if we can drop the unknown, as it breaks the autocomplete\n// For more info on why it was added, see https://github.com/mui/material-ui/pull/26228\n\n// TODO v6 - check if we can drop the unknown, as it breaks the autocomplete\n// For more info on why it was added, see https://github.com/mui/material-ui/pull/26228\n\n// Omit variants as a key, because we have a special handling for it\n\n/** Same as StyledOptions but shouldForwardProp must be a type guard */\n\n/**\n * @typeparam ComponentProps Props which will be included when withComponent is called\n * @typeparam SpecificComponentProps Props which will *not* be included when withComponent is called\n */", "const shape = {\n borderRadius: 4\n};\nexport default shape;", "import { createUnarySpacing } from \"../spacing/index.mjs\";\n\n// The different signatures imply different meaning for their arguments that can't be expressed structurally.\n// We express the difference with variable names.\n\nexport default function createSpacing(spacingInput = 8,\n// Material Design layouts are visually balanced. Most measurements align to an 8dp grid, which aligns both spacing and the overall layout.\n// Smaller components, such as icons, can align to a 4dp grid.\n// https://m2.material.io/design/layout/understanding-layout.html\ntransform = createUnarySpacing({\n spacing: spacingInput\n})) {\n // Already transformed.\n if (spacingInput.mui) {\n return spacingInput;\n }\n const spacing = (...argsInput) => {\n if (process.env.NODE_ENV !== 'production') {\n if (!(argsInput.length <= 4)) {\n console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${argsInput.length}`);\n }\n }\n const args = argsInput.length === 0 ? [1] : argsInput;\n return args.map(argument => {\n const output = transform(argument);\n return typeof output === 'number' ? `${output}px` : output;\n }).join(' ');\n };\n spacing.mui = true;\n return spacing;\n}", "/**\n * A universal utility to style components with multiple color modes. Always use it from the theme object.\n * It works with:\n * - [Basic theme](https://mui.com/material-ui/customization/dark-mode/)\n * - [CSS theme variables](https://mui.com/material-ui/customization/css-theme-variables/overview/)\n * - Zero-runtime engine\n *\n * Tips: Use an array over object spread and place `theme.applyStyles()` last.\n *\n * With the styled function:\n * \u2705 [{ background: '#e5e5e5' }, theme.applyStyles('dark', { background: '#1c1c1c' })]\n * \uD83D\uDEAB { background: '#e5e5e5', ...theme.applyStyles('dark', { background: '#1c1c1c' })}\n *\n * With the sx prop:\n * \u2705 [{ background: '#e5e5e5' }, theme => theme.applyStyles('dark', { background: '#1c1c1c' })]\n * \uD83D\uDEAB { background: '#e5e5e5', ...theme => theme.applyStyles('dark', { background: '#1c1c1c' })}\n *\n * @example\n * 1. using with `styled`:\n * ```jsx\n * const Component = styled('div')(({ theme }) => [\n * { background: '#e5e5e5' },\n * theme.applyStyles('dark', {\n * background: '#1c1c1c',\n * color: '#fff',\n * }),\n * ]);\n * ```\n *\n * @example\n * 2. using with `sx` prop:\n * ```jsx\n * <Box sx={[\n * { background: '#e5e5e5' },\n * theme => theme.applyStyles('dark', {\n * background: '#1c1c1c',\n * color: '#fff',\n * }),\n * ]}\n * />\n * ```\n *\n * @example\n * 3. theming a component:\n * ```jsx\n * extendTheme({\n * components: {\n * MuiButton: {\n * styleOverrides: {\n * root: ({ theme }) => [\n * { background: '#e5e5e5' },\n * theme.applyStyles('dark', {\n * background: '#1c1c1c',\n * color: '#fff',\n * }),\n * ],\n * },\n * }\n * }\n * })\n *```\n */\nexport default function applyStyles(key, styles) {\n // @ts-expect-error this is 'any' type\n const theme = this;\n if (theme.vars) {\n if (!theme.colorSchemes?.[key] || typeof theme.getColorSchemeSelector !== 'function') {\n return {};\n }\n // If CssVarsProvider is used as a provider, returns '*:where({selector}) &'\n let selector = theme.getColorSchemeSelector(key);\n if (selector === '&') {\n return styles;\n }\n if (selector.includes('data-') || selector.includes('.')) {\n // '*' is required as a workaround for Emotion issue (https://github.com/emotion-js/emotion/issues/2836)\n selector = `*:where(${selector.replace(/\\s*&$/, '')}) &`;\n }\n return {\n [selector]: styles\n };\n }\n if (theme.palette.mode === key) {\n return styles;\n }\n return {};\n}", "import deepmerge from '@mui/utils/deepmerge';\nimport createBreakpoints from \"../createBreakpoints/createBreakpoints.mjs\";\nimport cssContainerQueries from \"../cssContainerQueries/index.mjs\";\nimport shape from \"./shape.mjs\";\nimport createSpacing from \"./createSpacing.mjs\";\nimport styleFunctionSx from \"../styleFunctionSx/styleFunctionSx.mjs\";\nimport defaultSxConfig from \"../styleFunctionSx/defaultSxConfig.mjs\";\nimport applyStyles from \"./applyStyles.mjs\";\n/**\n * Generate a theme base on the options received.\n * @param options Takes an incomplete theme object and adds the missing parts.\n * @param args Deep merge the arguments with the about to be returned theme.\n * @returns A complete, ready-to-use theme object.\n */\nfunction createTheme(options = {}, ...args) {\n const {\n breakpoints: breakpointsInput = {},\n palette: paletteInput = {},\n spacing: spacingInput,\n shape: shapeInput = {},\n ...other\n } = options;\n const breakpoints = createBreakpoints(breakpointsInput);\n const spacing = createSpacing(spacingInput);\n let muiTheme = deepmerge({\n breakpoints,\n direction: 'ltr',\n components: {},\n // Inject component definitions.\n palette: {\n mode: 'light',\n ...paletteInput\n },\n spacing,\n shape: {\n ...shape,\n ...shapeInput\n }\n }, other);\n muiTheme = cssContainerQueries(muiTheme);\n muiTheme.applyStyles = applyStyles;\n muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);\n muiTheme.unstable_sxConfig = {\n ...defaultSxConfig,\n ...other?.unstable_sxConfig\n };\n muiTheme.unstable_sx = function sx(props) {\n return styleFunctionSx({\n sx: props,\n theme: this\n });\n };\n muiTheme.internal_cache = {};\n return muiTheme;\n}\nexport default createTheme;", "'use client';\n\nimport * as React from 'react';\nimport { ThemeContext } from '@mui/styled-engine';\nfunction isObjectEmpty(obj) {\n return Object.keys(obj).length === 0;\n}\nfunction useThemeWithoutDefault(defaultTheme = null) {\n const contextTheme = React.useContext(ThemeContext);\n return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme : contextTheme;\n}\nexport default useThemeWithoutDefault;", "'use client';\n\nimport createTheme from \"../createTheme/index.mjs\";\nimport useThemeWithoutDefault from \"../useThemeWithoutDefault/index.mjs\";\nexport const systemDefaultTheme = createTheme();\nfunction useTheme(defaultTheme = systemDefaultTheme) {\n return useThemeWithoutDefault(defaultTheme);\n}\nexport default useTheme;", "const defaultGenerator = componentName => componentName;\nconst createClassNameGenerator = () => {\n let generate = defaultGenerator;\n return {\n configure(generator) {\n generate = generator;\n },\n generate(componentName) {\n return generate(componentName);\n },\n reset() {\n generate = defaultGenerator;\n }\n };\n};\nconst ClassNameGenerator = createClassNameGenerator();\nexport default ClassNameGenerator;", "import ClassNameGenerator from \"../ClassNameGenerator/index.mjs\";\nexport const globalStateClasses = {\n active: 'active',\n checked: 'checked',\n completed: 'completed',\n disabled: 'disabled',\n error: 'error',\n expanded: 'expanded',\n focused: 'focused',\n focusVisible: 'focusVisible',\n open: 'open',\n readOnly: 'readOnly',\n required: 'required',\n selected: 'selected'\n};\nexport default function generateUtilityClass(componentName, slot, globalStatePrefix = 'Mui') {\n const globalStateClass = globalStateClasses[slot];\n return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${ClassNameGenerator.generate(componentName)}-${slot}`;\n}\nexport function isGlobalState(slot) {\n return globalStateClasses[slot] !== undefined;\n}", "import generateUtilityClass from \"../generateUtilityClass/index.mjs\";\nexport default function generateUtilityClasses(componentName, slots, globalStatePrefix = 'Mui') {\n const result = {};\n slots.forEach(slot => {\n result[slot] = generateUtilityClass(componentName, slot, globalStatePrefix);\n });\n return result;\n}", "import { internal_serializeStyles } from '@mui/styled-engine';\nexport default function preprocessStyles(input) {\n const {\n variants,\n ...style\n } = input;\n const result = {\n variants,\n style: internal_serializeStyles(style),\n isProcessed: true\n };\n\n // Not supported on styled-components\n if (result.style === style) {\n return result;\n }\n if (variants) {\n variants.forEach(variant => {\n if (typeof variant.style !== 'function') {\n variant.style = internal_serializeStyles(variant.style);\n }\n });\n }\n return result;\n}", "import styledEngineStyled, { internal_mutateStyles as mutateStyles, internal_serializeStyles as serializeStyles } from '@mui/styled-engine';\nimport isObjectEmpty from '@mui/utils/isObjectEmpty';\nimport { isPlainObject } from '@mui/utils/deepmerge';\nimport capitalize from '@mui/utils/capitalize';\nimport getDisplayName from '@mui/utils/getDisplayName';\nimport createTheme from \"../createTheme/index.mjs\";\nimport styleFunctionSx from \"../styleFunctionSx/index.mjs\";\nimport preprocessStyles from \"../preprocessStyles.mjs\";\n\n/* eslint-disable no-underscore-dangle */\n/* eslint-disable no-labels */\n/* eslint-disable no-lone-blocks */\n\nexport const systemDefaultTheme = createTheme();\n\n// Update /system/styled/#api in case if this changes\nexport function shouldForwardProp(prop) {\n return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';\n}\nfunction shallowLayer(serialized, layerName) {\n if (layerName && serialized && typeof serialized === 'object' && serialized.styles && !serialized.styles.startsWith('@layer') // only add the layer if it is not already there.\n ) {\n serialized.styles = `@layer ${layerName}{${String(serialized.styles)}}`;\n }\n return serialized;\n}\nfunction defaultOverridesResolver(slot) {\n if (!slot) {\n return null;\n }\n return (_props, styles) => styles[slot];\n}\nfunction attachTheme(props, themeId, defaultTheme) {\n props.theme = isObjectEmpty(props.theme) ? defaultTheme : props.theme[themeId] || props.theme;\n}\nfunction processStyle(props, style, layerName) {\n /*\n * Style types:\n * - null/undefined\n * - string\n * - CSS style object: { [cssKey]: [cssValue], variants }\n * - Processed style object: { style, variants, isProcessed: true }\n * - Array of any of the above\n */\n\n const resolvedStyle = typeof style === 'function' ? style(props) : style;\n if (Array.isArray(resolvedStyle)) {\n return resolvedStyle.flatMap(subStyle => processStyle(props, subStyle, layerName));\n }\n if (Array.isArray(resolvedStyle?.variants)) {\n let rootStyle;\n if (resolvedStyle.isProcessed) {\n rootStyle = layerName ? shallowLayer(resolvedStyle.style, layerName) : resolvedStyle.style;\n } else {\n const {\n variants,\n ...otherStyles\n } = resolvedStyle;\n rootStyle = layerName ? shallowLayer(serializeStyles(otherStyles), layerName) : otherStyles;\n }\n return processStyleVariants(props, resolvedStyle.variants, [rootStyle], layerName);\n }\n if (resolvedStyle?.isProcessed) {\n return layerName ? shallowLayer(serializeStyles(resolvedStyle.style), layerName) : resolvedStyle.style;\n }\n return layerName ? shallowLayer(serializeStyles(resolvedStyle), layerName) : resolvedStyle;\n}\nfunction processStyleVariants(props, variants, results = [], layerName = undefined) {\n let mergedState; // We might not need it, initialized lazily\n\n variantLoop: for (let i = 0; i < variants.length; i += 1) {\n const variant = variants[i];\n if (typeof variant.props === 'function') {\n mergedState ??= {\n ...props,\n ...props.ownerState,\n ownerState: props.ownerState\n };\n if (!variant.props(mergedState)) {\n continue;\n }\n } else {\n for (const key in variant.props) {\n if (props[key] !== variant.props[key] && props.ownerState?.[key] !== variant.props[key]) {\n continue variantLoop;\n }\n }\n }\n if (typeof variant.style === 'function') {\n mergedState ??= {\n ...props,\n ...props.ownerState,\n ownerState: props.ownerState\n };\n results.push(layerName ? shallowLayer(serializeStyles(variant.style(mergedState)), layerName) : variant.style(mergedState));\n } else {\n results.push(layerName ? shallowLayer(serializeStyles(variant.style), layerName) : variant.style);\n }\n }\n return results;\n}\nexport default function createStyled(input = {}) {\n const {\n themeId,\n defaultTheme = systemDefaultTheme,\n rootShouldForwardProp = shouldForwardProp,\n slotShouldForwardProp = shouldForwardProp\n } = input;\n function styleAttachTheme(props) {\n attachTheme(props, themeId, defaultTheme);\n }\n const styled = (tag, inputOptions = {}) => {\n // If `tag` is already a styled component, filter out the `sx` style function\n // to prevent unnecessary styles generated by the composite components.\n mutateStyles(tag, styles => styles.filter(style => style !== styleFunctionSx));\n const {\n name: componentName,\n slot: componentSlot,\n skipVariantsResolver: inputSkipVariantsResolver,\n skipSx: inputSkipSx,\n // TODO v6: remove `lowercaseFirstLetter()` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot)),\n ...options\n } = inputOptions;\n const layerName = componentName && componentName.startsWith('Mui') || !!componentSlot ? 'components' : 'custom';\n\n // if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.\n const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver :\n // TODO v6: remove `Root` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n componentSlot && componentSlot !== 'Root' && componentSlot !== 'root' || false;\n const skipSx = inputSkipSx || false;\n let shouldForwardPropOption = shouldForwardProp;\n\n // TODO v6: remove `Root` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n if (componentSlot === 'Root' || componentSlot === 'root') {\n shouldForwardPropOption = rootShouldForwardProp;\n } else if (componentSlot) {\n // any other slot specified\n shouldForwardPropOption = slotShouldForwardProp;\n } else if (isStringTag(tag)) {\n // for string (html) tag, preserve the behavior in emotion & styled-components.\n shouldForwardPropOption = undefined;\n }\n const defaultStyledResolver = styledEngineStyled(tag, {\n shouldForwardProp: shouldForwardPropOption,\n label: generateStyledLabel(componentName, componentSlot),\n ...options\n });\n const transformStyle = style => {\n // - On the server Emotion doesn't use React.forwardRef for creating components, so the created\n // component stays as a function. This condition makes sure that we do not interpolate functions\n // which are basically components used as a selectors.\n // - `style` could be a styled component from a babel plugin for component selectors, This condition\n // makes sure that we do not interpolate them.\n if (style.__emotion_real === style) {\n return style;\n }\n if (typeof style === 'function') {\n return function styleFunctionProcessor(props) {\n return processStyle(props, style, props.theme.modularCssLayers ? layerName : undefined);\n };\n }\n if (isPlainObject(style)) {\n const serialized = preprocessStyles(style);\n return function styleObjectProcessor(props) {\n if (!serialized.variants) {\n return props.theme.modularCssLayers ? shallowLayer(serialized.style, layerName) : serialized.style;\n }\n return processStyle(props, serialized, props.theme.modularCssLayers ? layerName : undefined);\n };\n }\n return style;\n };\n const muiStyledResolver = (...expressionsInput) => {\n const expressionsHead = [];\n const expressionsBody = expressionsInput.map(transformStyle);\n const expressionsTail = [];\n\n // Preprocess `props` to set the scoped theme value.\n // This must run before any other expression.\n expressionsHead.push(styleAttachTheme);\n if (componentName && overridesResolver) {\n expressionsTail.push(function styleThemeOverrides(props) {\n const theme = props.theme;\n const styleOverrides = theme.components?.[componentName]?.styleOverrides;\n if (!styleOverrides) {\n return null;\n }\n const resolvedStyleOverrides = {};\n\n // TODO: v7 remove iteration and use `resolveStyleArg(styleOverrides[slot])` directly\n // eslint-disable-next-line guard-for-in\n for (const slotKey in styleOverrides) {\n resolvedStyleOverrides[slotKey] = processStyle(props, styleOverrides[slotKey], props.theme.modularCssLayers ? 'theme' : undefined);\n }\n return overridesResolver(props, resolvedStyleOverrides);\n });\n }\n if (componentName && !skipVariantsResolver) {\n expressionsTail.push(function styleThemeVariants(props) {\n const theme = props.theme;\n const themeVariants = theme?.components?.[componentName]?.variants;\n if (!themeVariants) {\n return null;\n }\n return processStyleVariants(props, themeVariants, [], props.theme.modularCssLayers ? 'theme' : undefined);\n });\n }\n if (!skipSx) {\n expressionsTail.push(styleFunctionSx);\n }\n\n // This function can be called as a tagged template, so the first argument would contain\n // CSS `string[]` values.\n if (Array.isArray(expressionsBody[0])) {\n const inputStrings = expressionsBody.shift();\n\n // We need to add placeholders in the tagged template for the custom functions we have\n // possibly added (attachTheme, overrides, variants, and sx).\n const placeholdersHead = new Array(expressionsHead.length).fill('');\n const placeholdersTail = new Array(expressionsTail.length).fill('');\n let outputStrings;\n // prettier-ignore\n {\n outputStrings = [...placeholdersHead, ...inputStrings, ...placeholdersTail];\n outputStrings.raw = [...placeholdersHead, ...inputStrings.raw, ...placeholdersTail];\n }\n\n // The only case where we put something before `attachTheme`\n expressionsHead.unshift(outputStrings);\n }\n const expressions = [...expressionsHead, ...expressionsBody, ...expressionsTail];\n const Component = defaultStyledResolver(...expressions);\n if (tag.muiName) {\n Component.muiName = tag.muiName;\n }\n if (process.env.NODE_ENV !== 'production') {\n Component.displayName = generateDisplayName(componentName, componentSlot, tag);\n }\n return Component;\n };\n if (defaultStyledResolver.withConfig) {\n muiStyledResolver.withConfig = defaultStyledResolver.withConfig;\n }\n return muiStyledResolver;\n };\n return styled;\n}\nfunction generateDisplayName(componentName, componentSlot, tag) {\n if (componentName) {\n return `${componentName}${capitalize(componentSlot || '')}`;\n }\n return `Styled(${getDisplayName(tag)})`;\n}\nfunction generateStyledLabel(componentName, componentSlot) {\n let label;\n if (process.env.NODE_ENV !== 'production') {\n if (componentName) {\n // TODO v6: remove `lowercaseFirstLetter()` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n label = `${componentName}-${lowercaseFirstLetter(componentSlot || 'Root')}`;\n }\n }\n return label;\n}\n\n// https://github.com/emotion-js/emotion/blob/26ded6109fcd8ca9875cc2ce4564fee678a3f3c5/packages/styled/src/utils.js#L40\nfunction isStringTag(tag) {\n return typeof tag === 'string' &&\n // 96 is one less than the char code\n // for \"a\" so this is checking that\n // it's a lowercase character\n tag.charCodeAt(0) > 96;\n}\nfunction lowercaseFirstLetter(string) {\n if (!string) {\n return string;\n }\n return string.charAt(0).toLowerCase() + string.slice(1);\n}", "import clsx from 'clsx';\n\n/**\n * Add keys, values of `defaultProps` that does not exist in `props`\n * @param defaultProps\n * @param props\n * @param mergeClassNameAndStyle If `true`, merges `className` and `style` props instead of overriding them.\n * When `false` (default), props override defaultProps. When `true`, `className` values are concatenated\n * and `style` objects are merged with props taking precedence.\n * @returns resolved props\n */\nexport default function resolveProps(defaultProps, props, mergeClassNameAndStyle = false) {\n const output = {\n ...props\n };\n for (const key in defaultProps) {\n if (Object.prototype.hasOwnProperty.call(defaultProps, key)) {\n const propName = key;\n if (propName === 'components' || propName === 'slots') {\n output[propName] = {\n ...defaultProps[propName],\n ...output[propName]\n };\n } else if (propName === 'componentsProps' || propName === 'slotProps') {\n const defaultSlotProps = defaultProps[propName];\n const slotProps = props[propName];\n if (!slotProps) {\n output[propName] = defaultSlotProps || {};\n } else if (!defaultSlotProps) {\n output[propName] = slotProps;\n } else {\n output[propName] = {\n ...slotProps\n };\n for (const slotKey in defaultSlotProps) {\n if (Object.prototype.hasOwnProperty.call(defaultSlotProps, slotKey)) {\n const slotPropName = slotKey;\n const defaultSlotPropValue = defaultSlotProps[slotPropName];\n const slotPropValue = slotProps[slotPropName];\n if (typeof defaultSlotPropValue === 'function' || typeof slotPropValue === 'function') {\n // Function slot props are resolved later (with `ownerState`), so defer\n // the merge until then to avoid dropping either side.\n output[propName][slotPropName] = (...args) => resolveProps((typeof defaultSlotPropValue === 'function' ? defaultSlotPropValue(...args) : defaultSlotPropValue) ?? {}, (typeof slotPropValue === 'function' ? slotPropValue(...args) : slotPropValue) ?? {}, mergeClassNameAndStyle);\n } else {\n output[propName][slotPropName] = resolveProps(defaultSlotPropValue ?? {}, slotPropValue ?? {}, mergeClassNameAndStyle);\n }\n }\n }\n }\n } else if (propName === 'className' && mergeClassNameAndStyle && props.className !== undefined) {\n output.className = clsx(defaultProps?.className, props?.className);\n } else if (propName === 'style' && mergeClassNameAndStyle && props.style) {\n output.style = {\n ...defaultProps?.style,\n ...props?.style\n };\n } else if (output[propName] === undefined) {\n output[propName] = defaultProps[propName];\n }\n }\n }\n return output;\n}", "'use client';\n\nimport * as React from 'react';\n\n/**\n * A version of `React.useLayoutEffect` that does not show a warning when server-side rendering.\n * This is useful for effects that are only needed for client-side rendering but not for SSR.\n *\n * Before you use this hook, make sure to read https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85\n * and confirm it doesn't apply to your use-case.\n */\nconst useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\nexport default useEnhancedEffect;", "function clamp(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {\n return Math.max(min, Math.min(val, max));\n}\nexport default clamp;", "import _formatErrorMessage from \"@mui/utils/formatMuiErrorMessage\";\n/* eslint-disable @typescript-eslint/naming-convention */\nimport clamp from '@mui/utils/clamp';\n/**\n * Returns a number whose value is limited to the given range.\n * @param {number} value The value to be clamped\n * @param {number} min The lower boundary of the output range\n * @param {number} max The upper boundary of the output range\n * @returns {number} A number in the range [min, max]\n */\nfunction clampWrapper(value, min = 0, max = 1) {\n if (process.env.NODE_ENV !== 'production') {\n if (value < min || value > max) {\n console.error(`MUI: The value provided ${value} is out of range [${min}, ${max}].`);\n }\n }\n return clamp(value, min, max);\n}\n\n/**\n * Converts a color from CSS hex format to CSS rgb format.\n * @param {string} color - Hex color, i.e. #nnn or #nnnnnn\n * @returns {string} A CSS rgb color string\n */\nexport function hexToRgb(color) {\n color = color.slice(1);\n const re = new RegExp(`.{1,${color.length >= 6 ? 2 : 1}}`, 'g');\n let colors = color.match(re);\n if (colors && colors[0].length === 1) {\n colors = colors.map(n => n + n);\n }\n if (process.env.NODE_ENV !== 'production') {\n if (color.length !== color.trim().length) {\n console.error(`MUI: The color: \"${color}\" is invalid. Make sure the color input doesn't contain leading/trailing space.`);\n }\n }\n return colors ? `rgb${colors.length === 4 ? 'a' : ''}(${colors.map((n, index) => {\n return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1000) / 1000;\n }).join(', ')})` : '';\n}\nfunction intToHex(int) {\n const hex = int.toString(16);\n return hex.length === 1 ? `0${hex}` : hex;\n}\n\n/**\n * Returns an object with the type and values of a color.\n *\n * Note: Does not support rgb % values.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {object} - A MUI color object: {type: string, values: number[]}\n */\nexport function decomposeColor(color) {\n // Idempotent\n if (color.type) {\n return color;\n }\n if (color.charAt(0) === '#') {\n return decomposeColor(hexToRgb(color));\n }\n const marker = color.indexOf('(');\n const type = color.substring(0, marker);\n if (!['rgb', 'rgba', 'hsl', 'hsla', 'color'].includes(type)) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: Unsupported \\`${color}\\` color.\\n` + 'The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().' : _formatErrorMessage(9, color));\n }\n let values = color.substring(marker + 1, color.length - 1);\n let colorSpace;\n if (type === 'color') {\n values = values.split(' ');\n colorSpace = values.shift();\n if (values.length === 4 && values[3].charAt(0) === '/') {\n values[3] = values[3].slice(1);\n }\n if (!['srgb', 'display-p3', 'a98-rgb', 'prophoto-rgb', 'rec-2020'].includes(colorSpace)) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: unsupported \\`${colorSpace}\\` color space.\\n` + 'The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.' : _formatErrorMessage(10, colorSpace));\n }\n } else {\n values = values.split(',');\n }\n values = values.map(value => parseFloat(value));\n return {\n type,\n values,\n colorSpace\n };\n}\n\n/**\n * Returns a channel created from the input color.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {string} - The channel for the color, that can be used in rgba or hsla colors\n */\nexport const colorChannel = color => {\n const decomposedColor = decomposeColor(color);\n return decomposedColor.values.slice(0, 3).map((val, idx) => decomposedColor.type.includes('hsl') && idx !== 0 ? `${val}%` : val).join(' ');\n};\nexport const private_safeColorChannel = (color, warning) => {\n try {\n return colorChannel(color);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n};\n\n/**\n * Converts a color object with type and values to a string.\n * @param {object} color - Decomposed color\n * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla', 'color'\n * @param {array} color.values - [n,n,n] or [n,n,n,n]\n * @returns {string} A CSS color string\n */\nexport function recomposeColor(color) {\n const {\n type,\n colorSpace\n } = color;\n let {\n values\n } = color;\n if (type.includes('rgb')) {\n // Only convert the first 3 values to int (i.e. not alpha)\n values = values.map((n, i) => i < 3 ? parseInt(n, 10) : n);\n } else if (type.includes('hsl')) {\n values[1] = `${values[1]}%`;\n values[2] = `${values[2]}%`;\n }\n if (type.includes('color')) {\n values = `${colorSpace} ${values.join(' ')}`;\n } else {\n values = `${values.join(', ')}`;\n }\n return `${type}(${values})`;\n}\n\n/**\n * Converts a color from CSS rgb format to CSS hex format.\n * @param {string} color - RGB color, i.e. rgb(n, n, n)\n * @returns {string} A CSS rgb color string, i.e. #nnnnnn\n */\nexport function rgbToHex(color) {\n // Idempotent\n if (color.startsWith('#')) {\n return color;\n }\n const {\n values\n } = decomposeColor(color);\n return `#${values.map((n, i) => intToHex(i === 3 ? Math.round(255 * n) : n)).join('')}`;\n}\n\n/**\n * Converts a color from hsl format to rgb format.\n * @param {string} color - HSL color values\n * @returns {string} rgb color values\n */\nexport function hslToRgb(color) {\n color = decomposeColor(color);\n const {\n values\n } = color;\n const h = values[0];\n const s = values[1] / 100;\n const l = values[2] / 100;\n const a = s * Math.min(l, 1 - l);\n const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n let type = 'rgb';\n const rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];\n if (color.type === 'hsla') {\n type += 'a';\n rgb.push(values[3]);\n }\n return recomposeColor({\n type,\n values: rgb\n });\n}\n/**\n * The relative brightness of any point in a color space,\n * normalized to 0 for darkest black and 1 for lightest white.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {number} The relative brightness of the color in the range 0 - 1\n */\nexport function getLuminance(color) {\n color = decomposeColor(color);\n let rgb = color.type === 'hsl' || color.type === 'hsla' ? decomposeColor(hslToRgb(color)).values : color.values;\n rgb = rgb.map(val => {\n if (color.type !== 'color') {\n val /= 255; // normalized\n }\n return val <= 0.03928 ? val / 12.92 : ((val + 0.055) / 1.055) ** 2.4;\n });\n\n // Truncate at 3 digits\n return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));\n}\n\n/**\n * Calculates the contrast ratio between two colors.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n * @param {string} foreground - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {string} background - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @returns {number} A contrast ratio value in the range 0 - 21.\n */\nexport function getContrastRatio(foreground, background) {\n const lumA = getLuminance(foreground);\n const lumB = getLuminance(background);\n return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);\n}\n\n/**\n * Sets the absolute transparency of a color.\n * Any existing alpha values are overwritten.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} value - value to set the alpha channel to in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nexport function alpha(color, value) {\n color = decomposeColor(color);\n value = clampWrapper(value);\n if (color.type === 'rgb' || color.type === 'hsl') {\n color.type += 'a';\n }\n if (color.type === 'color') {\n color.values[3] = `/${value}`;\n } else {\n color.values[3] = value;\n }\n return recomposeColor(color);\n}\nexport function private_safeAlpha(color, value, warning) {\n try {\n return alpha(color, value);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Darkens a color.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nexport function darken(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clampWrapper(coefficient);\n if (color.type.includes('hsl')) {\n color.values[2] *= 1 - coefficient;\n } else if (color.type.includes('rgb') || color.type.includes('color')) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] *= 1 - coefficient;\n }\n }\n return recomposeColor(color);\n}\nexport function private_safeDarken(color, coefficient, warning) {\n try {\n return darken(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Lightens a color.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nexport function lighten(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clampWrapper(coefficient);\n if (color.type.includes('hsl')) {\n color.values[2] += (100 - color.values[2]) * coefficient;\n } else if (color.type.includes('rgb')) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] += (255 - color.values[i]) * coefficient;\n }\n } else if (color.type.includes('color')) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] += (1 - color.values[i]) * coefficient;\n }\n }\n return recomposeColor(color);\n}\nexport function private_safeLighten(color, coefficient, warning) {\n try {\n return lighten(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Darken or lighten a color, depending on its luminance.\n * Light colors are darkened, dark colors are lightened.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient=0.15 - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nexport function emphasize(color, coefficient = 0.15) {\n return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient);\n}\nexport function private_safeEmphasize(color, coefficient, warning) {\n try {\n return emphasize(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Blend a transparent overlay color with a background color, resulting in a single\n * RGB color.\n * @param {string} background - CSS color\n * @param {string} overlay - CSS color\n * @param {number} opacity - Opacity multiplier in the range 0 - 1\n * @param {number} [gamma=1.0] - Gamma correction factor. For gamma-correct blending, 2.2 is usual.\n */\nexport function blend(background, overlay, opacity, gamma = 1.0) {\n const blendChannel = (b, o) => Math.round((b ** (1 / gamma) * (1 - opacity) + o ** (1 / gamma) * opacity) ** gamma);\n const backgroundColor = decomposeColor(background);\n const overlayColor = decomposeColor(overlay);\n const rgb = [blendChannel(backgroundColor.values[0], overlayColor.values[0]), blendChannel(backgroundColor.values[1], overlayColor.values[1]), blendChannel(backgroundColor.values[2], overlayColor.values[2])];\n return recomposeColor({\n type: 'rgb',\n values: rgb\n });\n}", "'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport resolveProps from '@mui/utils/resolveProps';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst PropsContext = /*#__PURE__*/React.createContext(undefined);\nfunction DefaultPropsProvider({\n value,\n children\n}) {\n return /*#__PURE__*/_jsx(PropsContext.Provider, {\n value: value,\n children: children\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? DefaultPropsProvider.propTypes /* remove-proptypes */ = {\n // \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Warning \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n // \u2502 These PropTypes are generated from the TypeScript type definitions. \u2502\n // \u2502 To update them, edit the TypeScript types and run `pnpm proptypes`. \u2502\n // \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n /**\n * @ignore\n */\n children: PropTypes.node,\n /**\n * @ignore\n */\n value: PropTypes.object\n} : void 0;\nfunction getThemeProps(params) {\n const {\n theme,\n name,\n props\n } = params;\n if (!theme || !theme.components || !theme.components[name]) {\n return props;\n }\n const config = theme.components[name];\n if (config.defaultProps) {\n // compatible with v5 signature\n return resolveProps(config.defaultProps, props, theme.components.mergeClassNameAndStyle);\n }\n if (!config.styleOverrides && !config.variants) {\n // v6 signature, no property 'defaultProps'\n return resolveProps(config, props, theme.components.mergeClassNameAndStyle);\n }\n return props;\n}\nexport function useDefaultProps({\n props,\n name\n}) {\n const ctx = React.useContext(PropsContext);\n return getThemeProps({\n props,\n name,\n theme: {\n components: ctx\n }\n });\n}\nexport default DefaultPropsProvider;", "import preprocessStyles from \"./preprocessStyles.mjs\";\n\n/* eslint-disable @typescript-eslint/naming-convention */\n\n// We need to pass an argument as `{ theme }` for PigmentCSS, but we don't want to\n// allocate more objects.\nconst arg = {\n theme: undefined\n};\n\n/**\n * Memoize style function on theme.\n * Intended to be used in styled() calls that only need access to the theme.\n */\nexport default function unstable_memoTheme(styleFn) {\n let lastValue;\n let lastTheme;\n return function styleMemoized(props) {\n let value = lastValue;\n if (value === undefined || props.theme !== lastTheme) {\n arg.theme = props.theme;\n value = preprocessStyles(styleFn(arg));\n lastValue = value;\n lastTheme = props.theme;\n }\n return value;\n };\n}", "/**\n * The benefit of this function is to help developers get CSS var from theme without specifying the whole variable\n * and they does not need to remember the prefix (defined once).\n */\nexport default function createGetCssVar(prefix = '') {\n function appendVar(...vars) {\n if (!vars.length) {\n return '';\n }\n const value = vars[0];\n if (typeof value === 'string' && !value.match(/(#|\\(|\\)|(-?(\\d*\\.)?\\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\\d*\\.)?\\d+)$|(\\d+ \\d+ \\d+)/)) {\n return `, var(--${prefix ? `${prefix}-` : ''}${value}${appendVar(...vars.slice(1))})`;\n }\n return `, ${value}`;\n }\n\n // AdditionalVars makes `getCssVar` less strict, so it can be use like this `getCssVar('non-mui-variable')` without type error.\n const getCssVar = (field, ...fallbacks) => {\n return `var(--${prefix ? `${prefix}-` : ''}${field}${appendVar(...fallbacks)})`;\n };\n return getCssVar;\n}", "const prototypePollutingKeys = new Set(['__proto__', 'constructor', 'prototype']);\n\n/**\n * This function create an object from keys, value and then assign to target\n *\n * @param {Object} obj : the target object to be assigned\n * @param {string[]} keys\n * @param {string | number} value\n *\n * @example\n * const source = {}\n * assignNestedKeys(source, ['palette', 'primary'], 'var(--palette-primary)')\n * console.log(source) // { palette: { primary: 'var(--palette-primary)' } }\n *\n * @example\n * const source = { palette: { primary: 'var(--palette-primary)' } }\n * assignNestedKeys(source, ['palette', 'secondary'], 'var(--palette-secondary)')\n * console.log(source) // { palette: { primary: 'var(--palette-primary)', secondary: 'var(--palette-secondary)' } }\n */\nexport const assignNestedKeys = (obj, keys, value, arrayKeys = []) => {\n let temp = obj;\n for (let index = 0; index < keys.length; index += 1) {\n const k = keys[index];\n // Prevent prototype pollution: never traverse or write through\n // `__proto__` / `constructor` / `prototype` (e.g. a theme parsed from untrusted JSON).\n if (prototypePollutingKeys.has(k)) {\n break;\n }\n if (index === keys.length - 1) {\n if (Array.isArray(temp)) {\n temp[Number(k)] = value;\n } else if (temp && typeof temp === 'object') {\n temp[k] = value;\n }\n } else if (temp && typeof temp === 'object') {\n if (!temp[k]) {\n temp[k] = arrayKeys.includes(k) ? [] : {};\n }\n temp = temp[k];\n }\n }\n};\n\n/**\n *\n * @param {Object} obj : source object\n * @param {Function} callback : a function that will be called when\n * - the deepest key in source object is reached\n * - the value of the deepest key is NOT `undefined` | `null`\n *\n * @example\n * walkObjectDeep({ palette: { primary: { main: '#000000' } } }, console.log)\n * // ['palette', 'primary', 'main'] '#000000'\n */\nexport const walkObjectDeep = (obj, callback, shouldSkipPaths) => {\n function recurse(object, parentKeys = [], arrayKeys = []) {\n Object.entries(object).forEach(([key, value]) => {\n if (!shouldSkipPaths || shouldSkipPaths && !shouldSkipPaths([...parentKeys, key])) {\n if (value !== undefined && value !== null) {\n if (typeof value === 'object' && Object.keys(value).length > 0) {\n recurse(value, [...parentKeys, key], Array.isArray(value) ? [...arrayKeys, key] : arrayKeys);\n } else {\n callback([...parentKeys, key], value, arrayKeys);\n }\n }\n }\n });\n }\n recurse(obj);\n};\nconst getCssValue = (keys, value) => {\n if (typeof value === 'number') {\n if (['lineHeight', 'fontWeight', 'opacity', 'zIndex'].some(prop => keys.includes(prop))) {\n // CSS property that are unitless\n return value;\n }\n const lastKey = keys[keys.length - 1];\n if (lastKey.toLowerCase().includes('opacity')) {\n // opacity values are unitless\n return value;\n }\n return `${value}px`;\n }\n return value;\n};\n\n/**\n * a function that parse theme and return { css, vars }\n *\n * @param {Object} theme\n * @param {{\n * prefix?: string,\n * shouldSkipGeneratingVar?: (objectPathKeys: Array<string>, value: string | number) => boolean\n * }} options.\n * `prefix`: The prefix of the generated CSS variables. This function does not change the value.\n *\n * @returns {{ css: Object, vars: Object }} `css` is the stylesheet, `vars` is an object to get css variable (same structure as theme).\n *\n * @example\n * const { css, vars } = parser({\n * fontSize: 12,\n * lineHeight: 1.2,\n * palette: { primary: { 500: 'var(--color)' } }\n * }, { prefix: 'foo' })\n *\n * console.log(css) // { '--foo-fontSize': '12px', '--foo-lineHeight': 1.2, '--foo-palette-primary-500': 'var(--color)' }\n * console.log(vars) // { fontSize: 'var(--foo-fontSize)', lineHeight: 'var(--foo-lineHeight)', palette: { primary: { 500: 'var(--foo-palette-primary-500)' } } }\n */\nexport default function cssVarsParser(theme, options) {\n const {\n prefix,\n shouldSkipGeneratingVar\n } = options || {};\n const css = {};\n const vars = {};\n const varsWithDefaults = {};\n walkObjectDeep(theme, (keys, value, arrayKeys) => {\n if (typeof value === 'string' || typeof value === 'number') {\n if (!shouldSkipGeneratingVar || !shouldSkipGeneratingVar(keys, value)) {\n // only create css & var if `shouldSkipGeneratingVar` return false\n const cssVar = `--${prefix ? `${prefix}-` : ''}${keys.join('-')}`;\n const resolvedValue = getCssValue(keys, value);\n Object.assign(css, {\n [cssVar]: resolvedValue\n });\n assignNestedKeys(vars, keys, `var(${cssVar})`, arrayKeys);\n assignNestedKeys(varsWithDefaults, keys, `var(${cssVar}, ${resolvedValue})`, arrayKeys);\n }\n }\n }, keys => keys[0] === 'vars' // skip 'vars/*' paths\n );\n return {\n css,\n vars,\n varsWithDefaults\n };\n}", "import deepmerge from '@mui/utils/deepmerge';\nimport cssVarsParser from \"./cssVarsParser.mjs\";\nfunction prepareCssVars(theme, parserConfig = {}) {\n const {\n getSelector = defaultGetSelector,\n disableCssColorScheme,\n colorSchemeSelector: selector,\n enableContrastVars\n } = parserConfig;\n // @ts-expect-error - ignore components do not exist\n const {\n colorSchemes = {},\n components,\n defaultColorScheme = 'light',\n ...otherTheme\n } = theme;\n const {\n vars: rootVars,\n css: rootCss,\n varsWithDefaults: rootVarsWithDefaults\n } = cssVarsParser(otherTheme, parserConfig);\n let themeVars = rootVarsWithDefaults;\n const colorSchemesMap = {};\n const {\n [defaultColorScheme]: defaultScheme,\n ...otherColorSchemes\n } = colorSchemes;\n Object.entries(otherColorSchemes || {}).forEach(([key, scheme]) => {\n const {\n vars,\n css,\n varsWithDefaults\n } = cssVarsParser(scheme, parserConfig);\n themeVars = deepmerge(themeVars, varsWithDefaults);\n colorSchemesMap[key] = {\n css,\n vars\n };\n });\n if (defaultScheme) {\n // default color scheme vars should be merged last to set as default\n const {\n css,\n vars,\n varsWithDefaults\n } = cssVarsParser(defaultScheme, parserConfig);\n themeVars = deepmerge(themeVars, varsWithDefaults);\n colorSchemesMap[defaultColorScheme] = {\n css,\n vars\n };\n }\n function defaultGetSelector(colorScheme, cssObject) {\n let rule = selector;\n if (selector === 'class') {\n rule = '.%s';\n }\n if (selector === 'data') {\n rule = '[data-%s]';\n }\n if (selector?.startsWith('data-') && !selector.includes('%s')) {\n // 'data-joy-color-scheme' -> '[data-joy-color-scheme=\"%s\"]'\n rule = `[${selector}=\"%s\"]`;\n }\n if (colorScheme) {\n if (rule === 'media') {\n if (theme.defaultColorScheme === colorScheme) {\n return ':root';\n }\n const mode = colorSchemes[colorScheme]?.palette?.mode || colorScheme;\n return {\n [`@media (prefers-color-scheme: ${mode})`]: {\n ':root': cssObject\n }\n };\n }\n if (rule) {\n if (theme.defaultColorScheme === colorScheme) {\n return `:root, ${rule.replace('%s', String(colorScheme))}`;\n }\n return rule.replace('%s', String(colorScheme));\n }\n }\n return ':root';\n }\n const generateThemeVars = () => {\n let vars = {\n ...rootVars\n };\n Object.entries(colorSchemesMap).forEach(([, {\n vars: schemeVars\n }]) => {\n vars = deepmerge(vars, schemeVars);\n });\n return vars;\n };\n const generateStyleSheets = () => {\n const stylesheets = [];\n const colorScheme = theme.defaultColorScheme || 'light';\n function insertStyleSheet(key, css) {\n if (Object.keys(css).length) {\n stylesheets.push(typeof key === 'string' ? {\n [key]: {\n ...css\n }\n } : key);\n }\n }\n insertStyleSheet(getSelector(undefined, {\n ...rootCss\n }), rootCss);\n const {\n [colorScheme]: defaultSchemeVal,\n ...other\n } = colorSchemesMap;\n if (defaultSchemeVal) {\n // default color scheme has to come before other color schemes\n const {\n css\n } = defaultSchemeVal;\n const cssColorSheme = colorSchemes[colorScheme]?.palette?.mode;\n const finalCss = !disableCssColorScheme && cssColorSheme ? {\n colorScheme: cssColorSheme,\n ...css\n } : {\n ...css\n };\n insertStyleSheet(getSelector(colorScheme, {\n ...finalCss\n }), finalCss);\n }\n Object.entries(other).forEach(([key, {\n css\n }]) => {\n const cssColorSheme = colorSchemes[key]?.palette?.mode;\n const finalCss = !disableCssColorScheme && cssColorSheme ? {\n colorScheme: cssColorSheme,\n ...css\n } : {\n ...css\n };\n insertStyleSheet(getSelector(key, {\n ...finalCss\n }), finalCss);\n });\n if (enableContrastVars) {\n stylesheets.push({\n ':root': {\n // use double underscore to indicate that these are private variables\n '--__l-threshold': '0.7',\n '--__l': 'clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)',\n '--__a': 'clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)' // 0.87 is the default alpha value for black text.\n }\n });\n }\n return stylesheets;\n };\n return {\n vars: themeVars,\n generateThemeVars,\n generateStyleSheets\n };\n}\nexport default prepareCssVars;", "/* eslint-disable import/prefer-default-export */\nexport function createGetColorSchemeSelector(selector) {\n return function getColorSchemeSelector(colorScheme) {\n if (selector === 'media') {\n if (process.env.NODE_ENV !== 'production') {\n if (colorScheme !== 'light' && colorScheme !== 'dark') {\n console.error(`MUI: @media (prefers-color-scheme) supports only 'light' or 'dark', but receive '${colorScheme}'.`);\n }\n }\n return `@media (prefers-color-scheme: ${colorScheme})`;\n }\n if (selector) {\n if (selector.startsWith('data-') && !selector.includes('%s')) {\n return `[${selector}=\"${colorScheme}\"] &`;\n }\n if (selector === 'class') {\n return `.${colorScheme} &`;\n }\n if (selector === 'data') {\n return `[data-${colorScheme}] &`;\n }\n return `${selector.replace('%s', colorScheme)} &`;\n }\n return '&';\n };\n}", "/**\n *  \n */\nconst common = {\n /**\n * Preview: \n */\n black: '#000',\n /**\n * Preview: \n */\n white: '#fff'\n};\nexport default common;", "/**\n *              \n */\nconst grey = {\n /**\n * Preview: \n */\n 50: '#fafafa',\n /**\n * Preview: \n */\n 100: '#f5f5f5',\n /**\n * Preview: \n */\n 200: '#eeeeee',\n /**\n * Preview: \n */\n 300: '#e0e0e0',\n /**\n * Preview: \n */\n 400: '#bdbdbd',\n /**\n * Preview: \n */\n 500: '#9e9e9e',\n /**\n * Preview: \n */\n 600: '#757575',\n /**\n * Preview: \n */\n 700: '#616161',\n /**\n * Preview: \n */\n 800: '#424242',\n /**\n * Preview: \n */\n 900: '#212121',\n /**\n * Preview: \n */\n A100: '#f5f5f5',\n /**\n * Preview: \n */\n A200: '#eeeeee',\n /**\n * Preview: \n */\n A400: '#bdbdbd',\n /**\n * Preview: \n */\n A700: '#616161'\n};\nexport default grey;", "/**\n *              \n */\nconst purple = {\n /**\n * Preview: \n */\n 50: '#f3e5f5',\n /**\n * Preview: \n */\n 100: '#e1bee7',\n /**\n * Preview: \n */\n 200: '#ce93d8',\n /**\n * Preview: \n */\n 300: '#ba68c8',\n /**\n * Preview: \n */\n 400: '#ab47bc',\n /**\n * Preview: \n */\n 500: '#9c27b0',\n /**\n * Preview: \n */\n 600: '#8e24aa',\n /**\n * Preview: \n */\n 700: '#7b1fa2',\n /**\n * Preview: \n */\n 800: '#6a1b9a',\n /**\n * Preview: \n */\n 900: '#4a148c',\n /**\n * Preview: \n */\n A100: '#ea80fc',\n /**\n * Preview: \n */\n A200: '#e040fb',\n /**\n * Preview: \n */\n A400: '#d500f9',\n /**\n * Preview: \n */\n A700: '#aa00ff'\n};\nexport default purple;", "/**\n *              \n */\nconst red = {\n /**\n * Preview: \n */\n 50: '#ffebee',\n /**\n * Preview: \n */\n 100: '#ffcdd2',\n /**\n * Preview: \n */\n 200: '#ef9a9a',\n /**\n * Preview: \n */\n 300: '#e57373',\n /**\n * Preview: \n */\n 400: '#ef5350',\n /**\n * Preview: \n */\n 500: '#f44336',\n /**\n * Preview: \n */\n 600: '#e53935',\n /**\n * Preview: \n */\n 700: '#d32f2f',\n /**\n * Preview: \n */\n 800: '#c62828',\n /**\n * Preview: \n */\n 900: '#b71c1c',\n /**\n * Preview: \n */\n A100: '#ff8a80',\n /**\n * Preview: \n */\n A200: '#ff5252',\n /**\n * Preview: \n */\n A400: '#ff1744',\n /**\n * Preview: \n */\n A700: '#d50000'\n};\nexport default red;", "/**\n *              \n */\nconst orange = {\n /**\n * Preview: \n */\n 50: '#fff3e0',\n /**\n * Preview: \n */\n 100: '#ffe0b2',\n /**\n * Preview: \n */\n 200: '#ffcc80',\n /**\n * Preview: \n */\n 300: '#ffb74d',\n /**\n * Preview: \n */\n 400: '#ffa726',\n /**\n * Preview: \n */\n 500: '#ff9800',\n /**\n * Preview: \n */\n 600: '#fb8c00',\n /**\n * Preview: \n */\n 700: '#f57c00',\n /**\n * Preview: \n */\n 800: '#ef6c00',\n /**\n * Preview: \n */\n 900: '#e65100',\n /**\n * Preview: \n */\n A100: '#ffd180',\n /**\n * Preview: \n */\n A200: '#ffab40',\n /**\n * Preview: \n */\n A400: '#ff9100',\n /**\n * Preview: \n */\n A700: '#ff6d00'\n};\nexport default orange;", "/**\n *              \n */\nconst blue = {\n /**\n * Preview: \n */\n 50: '#e3f2fd',\n /**\n * Preview: \n */\n 100: '#bbdefb',\n /**\n * Preview: \n */\n 200: '#90caf9',\n /**\n * Preview: \n */\n 300: '#64b5f6',\n /**\n * Preview: \n */\n 400: '#42a5f5',\n /**\n * Preview: \n */\n 500: '#2196f3',\n /**\n * Preview: \n */\n 600: '#1e88e5',\n /**\n * Preview: \n */\n 700: '#1976d2',\n /**\n * Preview: \n */\n 800: '#1565c0',\n /**\n * Preview: \n */\n 900: '#0d47a1',\n /**\n * Preview: \n */\n A100: '#82b1ff',\n /**\n * Preview: \n */\n A200: '#448aff',\n /**\n * Preview: \n */\n A400: '#2979ff',\n /**\n * Preview: \n */\n A700: '#2962ff'\n};\nexport default blue;", "/**\n *              \n */\nconst lightBlue = {\n /**\n * Preview: \n */\n 50: '#e1f5fe',\n /**\n * Preview: \n */\n 100: '#b3e5fc',\n /**\n * Preview: \n */\n 200: '#81d4fa',\n /**\n * Preview: \n */\n 300: '#4fc3f7',\n /**\n * Preview: \n */\n 400: '#29b6f6',\n /**\n * Preview: \n */\n 500: '#03a9f4',\n /**\n * Preview: \n */\n 600: '#039be5',\n /**\n * Preview: \n */\n 700: '#0288d1',\n /**\n * Preview: \n */\n 800: '#0277bd',\n /**\n * Preview: \n */\n 900: '#01579b',\n /**\n * Preview: \n */\n A100: '#80d8ff',\n /**\n * Preview: \n */\n A200: '#40c4ff',\n /**\n * Preview: \n */\n A400: '#00b0ff',\n /**\n * Preview: \n */\n A700: '#0091ea'\n};\nexport default lightBlue;", "/**\n *              \n */\nconst green = {\n /**\n * Preview: \n */\n 50: '#e8f5e9',\n /**\n * Preview: \n */\n 100: '#c8e6c9',\n /**\n * Preview: \n */\n 200: '#a5d6a7',\n /**\n * Preview: \n */\n 300: '#81c784',\n /**\n * Preview: \n */\n 400: '#66bb6a',\n /**\n * Preview: \n */\n 500: '#4caf50',\n /**\n * Preview: \n */\n 600: '#43a047',\n /**\n * Preview: \n */\n 700: '#388e3c',\n /**\n * Preview: \n */\n 800: '#2e7d32',\n /**\n * Preview: \n */\n 900: '#1b5e20',\n /**\n * Preview: \n */\n A100: '#b9f6ca',\n /**\n * Preview: \n */\n A200: '#69f0ae',\n /**\n * Preview: \n */\n A400: '#00e676',\n /**\n * Preview: \n */\n A700: '#00c853'\n};\nexport default green;", "import _formatErrorMessage from \"@mui/utils/formatMuiErrorMessage\";\nimport deepmerge from '@mui/utils/deepmerge';\nimport { darken, getContrastRatio, lighten } from '@mui/system/colorManipulator';\nimport common from \"../colors/common.mjs\";\nimport grey from \"../colors/grey.mjs\";\nimport purple from \"../colors/purple.mjs\";\nimport red from \"../colors/red.mjs\";\nimport orange from \"../colors/orange.mjs\";\nimport blue from \"../colors/blue.mjs\";\nimport lightBlue from \"../colors/lightBlue.mjs\";\nimport green from \"../colors/green.mjs\";\nfunction getLight() {\n return {\n // The colors used to style the text.\n text: {\n // The most important text.\n primary: 'rgba(0, 0, 0, 0.87)',\n // Secondary text.\n secondary: 'rgba(0, 0, 0, 0.6)',\n // Disabled text have even lower visual prominence.\n disabled: 'rgba(0, 0, 0, 0.38)'\n },\n // The color used to divide different elements.\n divider: 'rgba(0, 0, 0, 0.12)',\n // The background colors used to style the surfaces.\n // Consistency between these values is important.\n background: {\n paper: common.white,\n default: common.white\n },\n // The colors used to style the action elements.\n action: {\n // The color of an active action like an icon button.\n active: 'rgba(0, 0, 0, 0.54)',\n // The color of an hovered action.\n hover: 'rgba(0, 0, 0, 0.04)',\n hoverOpacity: 0.04,\n // The color of a selected action.\n selected: 'rgba(0, 0, 0, 0.08)',\n selectedOpacity: 0.08,\n // The color of a disabled action.\n disabled: 'rgba(0, 0, 0, 0.26)',\n // The background color of a disabled action.\n disabledBackground: 'rgba(0, 0, 0, 0.12)',\n disabledOpacity: 0.38,\n focus: 'rgba(0, 0, 0, 0.12)',\n focusOpacity: 0.12,\n activatedOpacity: 0.12\n }\n };\n}\nexport const light = getLight();\nfunction getDark() {\n return {\n text: {\n primary: common.white,\n secondary: 'rgba(255, 255, 255, 0.7)',\n disabled: 'rgba(255, 255, 255, 0.5)',\n icon: 'rgba(255, 255, 255, 0.5)'\n },\n divider: 'rgba(255, 255, 255, 0.12)',\n background: {\n paper: '#121212',\n default: '#121212'\n },\n action: {\n active: common.white,\n hover: 'rgba(255, 255, 255, 0.08)',\n hoverOpacity: 0.08,\n selected: 'rgba(255, 255, 255, 0.16)',\n selectedOpacity: 0.16,\n disabled: 'rgba(255, 255, 255, 0.3)',\n disabledBackground: 'rgba(255, 255, 255, 0.12)',\n disabledOpacity: 0.38,\n focus: 'rgba(255, 255, 255, 0.12)',\n focusOpacity: 0.12,\n activatedOpacity: 0.24\n }\n };\n}\nexport const dark = getDark();\nfunction addLightOrDark(intent, direction, shade, tonalOffset) {\n const tonalOffsetLight = tonalOffset.light || tonalOffset;\n const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;\n if (!intent[direction]) {\n if (intent.hasOwnProperty(shade)) {\n intent[direction] = intent[shade];\n } else if (direction === 'light') {\n intent.light = lighten(intent.main, tonalOffsetLight);\n } else if (direction === 'dark') {\n intent.dark = darken(intent.main, tonalOffsetDark);\n }\n }\n}\nfunction mixLightOrDark(colorSpace, intent, direction, shade, tonalOffset) {\n const tonalOffsetLight = tonalOffset.light || tonalOffset;\n const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;\n if (!intent[direction]) {\n if (intent.hasOwnProperty(shade)) {\n intent[direction] = intent[shade];\n } else if (direction === 'light') {\n intent.light = `color-mix(in ${colorSpace}, ${intent.main}, #fff ${(tonalOffsetLight * 100).toFixed(0)}%)`;\n } else if (direction === 'dark') {\n intent.dark = `color-mix(in ${colorSpace}, ${intent.main}, #000 ${(tonalOffsetDark * 100).toFixed(0)}%)`;\n }\n }\n}\nfunction getDefaultPrimary(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: blue[200],\n light: blue[50],\n dark: blue[400]\n };\n }\n return {\n main: blue[700],\n light: blue[400],\n dark: blue[800]\n };\n}\nfunction getDefaultSecondary(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: purple[200],\n light: purple[50],\n dark: purple[400]\n };\n }\n return {\n main: purple[500],\n light: purple[300],\n dark: purple[700]\n };\n}\nfunction getDefaultError(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: red[500],\n light: red[300],\n dark: red[700]\n };\n }\n return {\n main: red[700],\n light: red[400],\n dark: red[800]\n };\n}\nfunction getDefaultInfo(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: lightBlue[400],\n light: lightBlue[300],\n dark: lightBlue[700]\n };\n }\n return {\n main: lightBlue[700],\n light: lightBlue[500],\n dark: lightBlue[900]\n };\n}\nfunction getDefaultSuccess(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: green[400],\n light: green[300],\n dark: green[700]\n };\n }\n return {\n main: green[800],\n light: green[500],\n dark: green[900]\n };\n}\nfunction getDefaultWarning(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: orange[400],\n light: orange[300],\n dark: orange[700]\n };\n }\n return {\n main: '#ed6c02',\n // closest to orange[800] that pass 3:1.\n light: orange[500],\n dark: orange[900]\n };\n}\n\n// Use the same name as the experimental CSS `contrast-color` function.\nexport function contrastColor(background) {\n return `oklch(from ${background} var(--__l) 0 h / var(--__a))`;\n}\nexport default function createPalette(palette) {\n const {\n mode = 'light',\n contrastThreshold = 3,\n tonalOffset = 0.2,\n colorSpace,\n ...other\n } = palette;\n const primary = palette.primary || getDefaultPrimary(mode);\n const secondary = palette.secondary || getDefaultSecondary(mode);\n const error = palette.error || getDefaultError(mode);\n const info = palette.info || getDefaultInfo(mode);\n const success = palette.success || getDefaultSuccess(mode);\n const warning = palette.warning || getDefaultWarning(mode);\n\n // Use the same logic as\n // Bootstrap: https://github.com/twbs/bootstrap/blob/1d6e3710dd447de1a200f29e8fa521f8a0908f70/scss/_functions.scss#L59\n // and material-components-web https://github.com/material-components/material-components-web/blob/ac46b8863c4dab9fc22c4c662dc6bd1b65dd652f/packages/mdc-theme/_functions.scss#L54\n function getContrastText(background) {\n if (colorSpace) {\n return contrastColor(background);\n }\n const contrastText = getContrastRatio(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary;\n if (process.env.NODE_ENV !== 'production') {\n const contrast = getContrastRatio(background, contrastText);\n if (contrast < 3) {\n console.error([`MUI: The contrast ratio of ${contrast}:1 for ${contrastText} on ${background}`, 'falls below the WCAG recommended absolute minimum contrast ratio of 3:1.', 'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast'].join('\\n'));\n }\n }\n return contrastText;\n }\n const augmentColor = ({\n color,\n name,\n mainShade = 500,\n lightShade = 300,\n darkShade = 700\n }) => {\n color = {\n ...color\n };\n if (!color.main && color[mainShade]) {\n color.main = color[mainShade];\n }\n if (!color.hasOwnProperty('main')) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\\n` + `The color object needs to have a \\`main\\` property or a \\`${mainShade}\\` property.` : _formatErrorMessage(11, name ? ` (${name})` : '', mainShade));\n }\n if (typeof color.main !== 'string') {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\\n` + `\\`color.main\\` should be a string, but \\`${JSON.stringify(color.main)}\\` was provided instead.\\n` + '\\n' + 'Did you intend to use one of the following approaches?\\n' + '\\n' + 'import { green } from \"@mui/material/colors\";\\n' + '\\n' + 'const theme1 = createTheme({ palette: {\\n' + ' primary: green,\\n' + '} });\\n' + '\\n' + 'const theme2 = createTheme({ palette: {\\n' + ' primary: { main: green[500] },\\n' + '} });' : _formatErrorMessage(12, name ? ` (${name})` : '', JSON.stringify(color.main)));\n }\n if (colorSpace) {\n mixLightOrDark(colorSpace, color, 'light', lightShade, tonalOffset);\n mixLightOrDark(colorSpace, color, 'dark', darkShade, tonalOffset);\n } else {\n addLightOrDark(color, 'light', lightShade, tonalOffset);\n addLightOrDark(color, 'dark', darkShade, tonalOffset);\n }\n if (!color.contrastText) {\n color.contrastText = getContrastText(color.main);\n }\n return color;\n };\n let modeHydrated;\n if (mode === 'light') {\n modeHydrated = getLight();\n } else if (mode === 'dark') {\n modeHydrated = getDark();\n }\n if (process.env.NODE_ENV !== 'production') {\n if (!modeHydrated) {\n console.error(`MUI: The palette mode \\`${mode}\\` is not supported.`);\n }\n }\n const paletteOutput = deepmerge({\n // A collection of common colors.\n common: {\n ...common\n },\n // prevent mutable object.\n // The palette mode, can be light or dark.\n mode,\n // The colors used to represent primary interface elements for a user.\n primary: augmentColor({\n color: primary,\n name: 'primary'\n }),\n // The colors used to represent secondary interface elements for a user.\n secondary: augmentColor({\n color: secondary,\n name: 'secondary',\n mainShade: 'A400',\n lightShade: 'A200',\n darkShade: 'A700'\n }),\n // The colors used to represent interface elements that the user should be made aware of.\n error: augmentColor({\n color: error,\n name: 'error'\n }),\n // The colors used to represent potentially dangerous actions or important messages.\n warning: augmentColor({\n color: warning,\n name: 'warning'\n }),\n // The colors used to present information to the user that is neutral and not necessarily important.\n info: augmentColor({\n color: info,\n name: 'info'\n }),\n // The colors used to indicate the successful completion of an action that user triggered.\n success: augmentColor({\n color: success,\n name: 'success'\n }),\n // The grey colors.\n grey,\n // Used by `getContrastText()` to maximize the contrast between\n // the background and the text.\n contrastThreshold,\n // Takes a background color and returns the text color that maximizes the contrast.\n getContrastText,\n // Generate a rich color object.\n augmentColor,\n // Used by the functions below to shift a color's luminance by approximately\n // two indexes within its tonal palette.\n // E.g., shift from Red 500 to Red 300 or Red 700.\n tonalOffset,\n // The light and dark mode object.\n ...modeHydrated\n }, other);\n return paletteOutput;\n}", "import deepmerge from '@mui/utils/deepmerge';\nconst focusVisibleOffsetVar = '--_focusVisible-offset';\nconst focusVisibleBehaviorVar = '--_focusVisible-behavior';\nconst focusVisibleShadowVar = '--_focusVisible-shadow';\nconst offsetValue = `var(${focusVisibleOffsetVar}, 1)`;\nconst behaviorValue = `var(${focusVisibleBehaviorVar}, )`;\n\n// Spread on a root whose ring must stay outset: the inset vars inherit, so a clip-prone ancestor\n// would otherwise inset a descendant's ring too.\nexport const outsetFocusRing = {\n [focusVisibleOffsetVar]: 1,\n [focusVisibleBehaviorVar]: 'initial' // reverts the var to guaranteed-invalid so `var(--_focusVisible-behavior, )` falls back to empty \u2014 there is no explicit `outset` keyword.\n};\n\n// Used by the colored-background surfaces (AppBar, Alert, SnackbarContent) to make the focus visible appear through box-shadow\nexport function applyChildrenFocusVisible(color) {\n return {\n [focusVisibleShadowVar]: color\n };\n}\n\n// Clip-prone components (Tab, MenuItem, \u2026) spread this on their root to inset the ring, so an\n// `overflow: hidden` ancestor cannot clip it \u2014 without the component knowing the ring width.\n// `offset` multiplies the ring's own outlineOffset, so 1 = mirror it inward.\nexport function applyInsetFocusVisible(offset) {\n return {\n [focusVisibleOffsetVar]: -offset,\n [focusVisibleBehaviorVar]: 'inset'\n };\n}\n// Merge the raw `focusVisible` input across `createTheme(options, ...args)` with the theme's own\n// deep-merge semantics. The single-key wrapper is load-bearing \u2014 a raw value hits deepmerge's\n// top-level plain-object guard (`deepmerge(true, obj)` drops the object).\nexport function mergeFocusVisibleInput(optionsFocusVisible, args) {\n return args.reduce((acc, arg) => arg && 'focusVisible' in arg ? deepmerge(acc, {\n focusVisible: arg.focusVisible\n }) : acc, {\n focusVisible: optionsFocusVisible\n }).focusVisible;\n}\n\n/**\n * Whether an input is this module's own output. Only `wireFocusVisibleVars` emits the offset calc,\n * so it identifies a ring fed back in by `createTheme(existingTheme, \u2026)`.\n */\nexport function isResolvedFocusVisible(input) {\n return input != null && typeof input === 'object' && typeof input.outlineOffset === 'string' && input.outlineOffset.includes(focusVisibleOffsetVar);\n}\n\n/**\n * Resolve the opt-in ring, wiring in the private inset vars. `outlineColor` is the caller's default\n * \u2014 a hex, the palette var, or a scheme's primary \u2014 overridden by a user-provided `outlineColor`.\n */\nexport function resolveFocusVisible(input, outlineColor) {\n return wireFocusVisibleVars({\n outlineStyle: 'solid',\n outlineColor,\n outlineWidth: 2,\n outlineOffset: 2,\n // invisible shadow for parent component with solid background (AppBar, Snackbar, Alert) can control the ring color.\n boxShadow: `var(${focusVisibleShadowVar}, 0 0)`,\n ...(input === true ? null : input)\n });\n}\n\n/**\n * Wire the private inset vars into a resolved `theme.focusVisible` so a custom `outlineOffset` or\n * `boxShadow` insets automatically on clip-prone components. Mutates and returns the object.\n */\nexport function wireFocusVisibleVars(resolved) {\n // Multiply the offset by the sign var so it flips to inset on clip-prone components. Skip if\n // already wired: re-composing a resolved theme must not wrap the calc twice and invert the sign.\n const offset = resolved.outlineOffset ?? 0;\n if (typeof offset !== 'string' || !offset.includes(focusVisibleOffsetVar)) {\n const offsetPx = typeof offset === 'number' ? `${offset}px` : offset;\n resolved.outlineOffset = `calc(${offsetValue} * ${offsetPx})`;\n }\n // Prefix a box-shadow with the behavior var so it insets there too, unless it already opts in.\n // Standalone keywords are complete values \u2014 prefixing would produce an invalid `inset none`.\n const standaloneBoxShadows = new Set(['none', 'initial', 'inherit', 'unset', 'revert', 'revert-layer']);\n if (typeof resolved.boxShadow === 'string' && !standaloneBoxShadows.has(resolved.boxShadow.trim().toLowerCase()) && !/\\binset\\b/.test(resolved.boxShadow) && !resolved.boxShadow.includes(focusVisibleBehaviorVar)) {\n resolved.boxShadow = `${behaviorValue} ${resolved.boxShadow}`;\n }\n return resolved;\n}", "export default function prepareTypographyVars(typography) {\n const vars = {};\n const entries = Object.entries(typography);\n entries.forEach(entry => {\n const [key, value] = entry;\n if (typeof value === 'object') {\n vars[key] = `${value.fontStyle ? `${value.fontStyle} ` : ''}${value.fontVariant ? `${value.fontVariant} ` : ''}${value.fontWeight ? `${value.fontWeight} ` : ''}${value.fontStretch ? `${value.fontStretch} ` : ''}${value.fontSize || ''}${value.lineHeight ? `/${value.lineHeight} ` : ''}${value.fontFamily || ''}`;\n }\n });\n return vars;\n}", "export default function createMixins(breakpoints, mixins) {\n return {\n toolbar: {\n minHeight: 56,\n [breakpoints.up('xs')]: {\n '@media (orientation: landscape)': {\n minHeight: 48\n }\n },\n [breakpoints.up('sm')]: {\n minHeight: 64\n }\n },\n ...mixins\n };\n}", "import deepmerge from '@mui/utils/deepmerge';\nfunction round(value) {\n return Math.round(value * 1e5) / 1e5;\n}\nconst caseAllCaps = {\n textTransform: 'uppercase'\n};\nconst defaultFontFamily = '\"Roboto\", \"Helvetica\", \"Arial\", sans-serif';\n\n/**\n * @see @link{https://m2.material.io/design/typography/the-type-system.html}\n * @see @link{https://m2.material.io/design/typography/understanding-typography.html}\n */\nexport default function createTypography(palette, typography) {\n const {\n fontFamily = defaultFontFamily,\n // The default font size of the Material Specification.\n fontSize = 14,\n // px\n fontWeightLight = 300,\n fontWeightRegular = 400,\n fontWeightMedium = 500,\n fontWeightBold = 700,\n // Tell MUI what's the font-size on the html element.\n // 16px is the default font-size used by browsers.\n htmlFontSize = 16,\n // Apply the CSS properties to all the variants.\n allVariants,\n pxToRem: pxToRem2,\n ...other\n } = typeof typography === 'function' ? typography(palette) : typography;\n if (process.env.NODE_ENV !== 'production') {\n if (typeof fontSize !== 'number') {\n console.error('MUI: `fontSize` is required to be a number.');\n }\n if (typeof htmlFontSize !== 'number') {\n console.error('MUI: `htmlFontSize` is required to be a number.');\n }\n }\n const coef = fontSize / 14;\n const pxToRem = pxToRem2 || (size => `${size / htmlFontSize * coef}rem`);\n const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => ({\n fontFamily,\n fontWeight,\n fontSize: pxToRem(size),\n // Unitless following https://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/\n lineHeight,\n // The letter spacing was designed for the Roboto font-family. Using the same letter-spacing\n // across font-families can cause issues with the kerning.\n ...(fontFamily === defaultFontFamily ? {\n letterSpacing: `${round(letterSpacing / size)}em`\n } : {}),\n ...casing,\n ...allVariants\n });\n const variants = {\n h1: buildVariant(fontWeightLight, 96, 1.167, -1.5),\n h2: buildVariant(fontWeightLight, 60, 1.2, -0.5),\n h3: buildVariant(fontWeightRegular, 48, 1.167, 0),\n h4: buildVariant(fontWeightRegular, 34, 1.235, 0.25),\n h5: buildVariant(fontWeightRegular, 24, 1.334, 0),\n h6: buildVariant(fontWeightMedium, 20, 1.6, 0.15),\n subtitle1: buildVariant(fontWeightRegular, 16, 1.75, 0.15),\n subtitle2: buildVariant(fontWeightMedium, 14, 1.57, 0.1),\n body1: buildVariant(fontWeightRegular, 16, 1.5, 0.15),\n body2: buildVariant(fontWeightRegular, 14, 1.43, 0.15),\n button: buildVariant(fontWeightMedium, 14, 1.75, 0.4, caseAllCaps),\n caption: buildVariant(fontWeightRegular, 12, 1.66, 0.4),\n overline: buildVariant(fontWeightRegular, 12, 2.66, 1, caseAllCaps),\n // TODO v6: Remove handling of 'inherit' variant from the theme as it is already handled in Material UI's Typography component. Also, remember to remove the associated types.\n inherit: {\n fontFamily: 'inherit',\n fontWeight: 'inherit',\n fontSize: 'inherit',\n lineHeight: 'inherit',\n letterSpacing: 'inherit'\n }\n };\n return deepmerge({\n htmlFontSize,\n pxToRem,\n fontFamily,\n fontSize,\n fontWeightLight,\n fontWeightRegular,\n fontWeightMedium,\n fontWeightBold,\n ...variants\n }, other, {\n clone: false // No need to clone deep\n });\n}", "const shadowKeyUmbraOpacity = 0.2;\nconst shadowKeyPenumbraOpacity = 0.14;\nconst shadowAmbientShadowOpacity = 0.12;\nfunction createShadow(...px) {\n return [`${px[0]}px ${px[1]}px ${px[2]}px ${px[3]}px rgba(0,0,0,${shadowKeyUmbraOpacity})`, `${px[4]}px ${px[5]}px ${px[6]}px ${px[7]}px rgba(0,0,0,${shadowKeyPenumbraOpacity})`, `${px[8]}px ${px[9]}px ${px[10]}px ${px[11]}px rgba(0,0,0,${shadowAmbientShadowOpacity})`].join(',');\n}\n\n// Values from https://github.com/material-components/material-components-web/blob/be8747f94574669cb5e7add1a7c54fa41a89cec7/packages/mdc-elevation/_variables.scss\nconst shadows = ['none', createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];\nexport default shadows;", "const DEFAULT_TRANSITION_PROPS = ['all'];\nconst EMPTY_OPTIONS = {};\n\n// Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves\n// to learn the context in which each easing should be used.\nexport const easing = {\n // This is the most common easing curve.\n easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)',\n // Objects enter the screen at full velocity from off-screen and\n // slowly decelerate to a resting point.\n easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)',\n // Objects leave the screen at full velocity. They do not decelerate when off-screen.\n easeIn: 'cubic-bezier(0.4, 0, 1, 1)',\n // The sharp curve is used by objects that may return to the screen at any time.\n sharp: 'cubic-bezier(0.4, 0, 0.6, 1)'\n};\n\n// Follow https://m2.material.io/guidelines/motion/duration-easing.html#duration-easing-common-durations\n// to learn when use what timing\nexport const duration = {\n shortest: 150,\n shorter: 200,\n short: 250,\n // most basic recommended timing\n standard: 300,\n // this is to be used in complex animations\n complex: 375,\n // recommended when something is entering screen\n enteringScreen: 225,\n // recommended when something is leaving screen\n leavingScreen: 195\n};\nfunction formatMs(milliseconds) {\n return `${Math.round(milliseconds)}ms`;\n}\nfunction getAutoHeightDuration(height) {\n if (!height) {\n return 0;\n }\n const constant = height / 36;\n\n // https://www.desmos.com/calculator/vbrp3ggqet\n return Math.min(Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10), 3000);\n}\nexport default function createTransitions(inputTransitions) {\n const transitions = {\n ...inputTransitions\n };\n delete transitions.reducedMotion;\n const mergedEasing = {\n ...easing,\n ...transitions.easing\n };\n const mergedDuration = {\n ...duration,\n ...transitions.duration\n };\n const createTransitionValue = (props = DEFAULT_TRANSITION_PROPS, options = EMPTY_OPTIONS) => {\n const {\n duration: durationOption = mergedDuration.standard,\n easing: easingOption = mergedEasing.easeInOut,\n delay = 0,\n ...other\n } = options;\n if (process.env.NODE_ENV !== 'production') {\n const isString = value => typeof value === 'string';\n const isNumber = value => !Number.isNaN(parseFloat(value));\n if (!isString(props) && !Array.isArray(props)) {\n console.error('MUI: Argument \"props\" must be a string or Array.');\n }\n if (!isNumber(durationOption) && !isString(durationOption)) {\n console.error(`MUI: Argument \"duration\" must be a number or a string but found ${durationOption}.`);\n }\n if (!isString(easingOption)) {\n console.error('MUI: Argument \"easing\" must be a string.');\n }\n if (!isNumber(delay) && !isString(delay)) {\n console.error('MUI: Argument \"delay\" must be a number or a string.');\n }\n if (typeof options !== 'object') {\n console.error(['MUI: Secong argument of transition.create must be an object.', \"Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`\"].join('\\n'));\n }\n if (Object.keys(other).length !== 0) {\n console.error(`MUI: Unrecognized argument(s) [${Object.keys(other).join(',')}].`);\n }\n }\n return (Array.isArray(props) ? props : [props]).map(animatedProp => `${animatedProp} ${typeof durationOption === 'string' ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === 'string' ? delay : formatMs(delay)}`).join(',');\n };\n const create = transitions.create ?? createTransitionValue;\n return {\n getAutoHeightDuration,\n create,\n ...transitions,\n easing: mergedEasing,\n duration: mergedDuration\n };\n}", "const EMPTY_MOTION = {};\nexport default function createMotion(inputMotion = EMPTY_MOTION) {\n return {\n reducedMotion: 'never',\n ...inputMotion\n };\n}", "// We need to centralize the zIndex definitions as they work\n// like global values in the browser.\nconst zIndex = {\n mobileStepper: 1000,\n fab: 1050,\n speedDial: 1050,\n appBar: 1100,\n drawer: 1200,\n modal: 1300,\n snackbar: 1400,\n tooltip: 1500\n};\nexport default zIndex;", "/* eslint-disable import/prefer-default-export */\nimport { isPlainObject } from '@mui/utils/deepmerge';\nfunction isSerializable(val) {\n return isPlainObject(val) || typeof val === 'undefined' || typeof val === 'string' || typeof val === 'boolean' || typeof val === 'number' || Array.isArray(val);\n}\n\n/**\n * `baseTheme` usually comes from `createTheme()` or `extendTheme()`.\n *\n * This function is intended to be used with zero-runtime CSS-in-JS like Pigment CSS\n * For example, in a Next.js project:\n *\n * ```js\n * // next.config.js\n * const { extendTheme } = require('@mui/material/styles');\n *\n * const theme = extendTheme();\n * // `.toRuntimeSource` is Pigment CSS specific to create a theme that is available at runtime.\n * theme.toRuntimeSource = stringifyTheme;\n *\n * module.exports = withPigment({\n * theme,\n * });\n * ```\n */\nexport function stringifyTheme(baseTheme = {}) {\n const serializableTheme = {\n ...baseTheme\n };\n function serializeTheme(object) {\n const array = Object.entries(object);\n // eslint-disable-next-line no-plusplus\n for (let index = 0; index < array.length; index++) {\n const [key, value] = array[index];\n if (!isSerializable(value) || key.startsWith('unstable_') || key.startsWith('internal_')) {\n delete object[key];\n } else if (isPlainObject(value)) {\n object[key] = {\n ...value\n };\n serializeTheme(object[key]);\n }\n }\n }\n serializeTheme(serializableTheme);\n return `import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';\n\nconst theme = ${JSON.stringify(serializableTheme, null, 2)};\n\ntheme.breakpoints = createBreakpoints(theme.breakpoints || {});\ntheme.motion = { reducedMotion: 'never', ...theme.motion };\ntheme.transitions = createTransitions(theme.transitions || {});\n\nexport default theme;`;\n}", "import _formatErrorMessage from \"@mui/utils/formatMuiErrorMessage\";\nimport deepmerge from '@mui/utils/deepmerge';\nimport styleFunctionSx, { unstable_defaultSxConfig as defaultSxConfig } from '@mui/system/styleFunctionSx';\nimport systemCreateTheme from '@mui/system/createTheme';\nimport { alpha as systemAlpha, lighten as systemLighten, darken as systemDarken, colorChannel, private_safeColorChannel as safeColorChannel, hslToRgb } from '@mui/system/colorManipulator';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nimport createMixins from \"./createMixins.mjs\";\nimport createPalette from \"./createPalette.mjs\";\nimport createTypography from \"./createTypography.mjs\";\nimport shadows from \"./shadows.mjs\";\nimport createTransitions from \"./createTransitions.mjs\";\nimport createMotion from \"./createMotion.mjs\";\nimport zIndex from \"./zIndex.mjs\";\nimport { stringifyTheme } from \"./stringifyTheme.mjs\";\nimport { resolveFocusVisible } from \"./focusVisible.mjs\";\nfunction coefficientToPercentage(coefficient) {\n if (typeof coefficient === 'number') {\n return `${(coefficient * 100).toFixed(0)}%`;\n }\n return `calc((${coefficient}) * 100%)`;\n}\n\n// This can be removed when moved to `color-mix()` entirely.\nconst parseAddition = str => {\n if (!Number.isNaN(+str)) {\n return +str;\n }\n const numbers = str.match(/\\d*\\.?\\d+/g);\n if (!numbers) {\n return 0;\n }\n let sum = 0;\n for (let i = 0; i < numbers.length; i += 1) {\n sum += +numbers[i];\n }\n return sum;\n};\n\n// `rgba()` takes rgb channels, so `hsl()` is converted like the theme's `*Channel` tokens.\nfunction toRgb(color) {\n return color.startsWith('hsl') ? hslToRgb(color) : color;\n}\n\n// Replaces the `var()` matches in `alpha()`: `var(--x, #1976d2)` -> `var(--xChannel, 25 118 210)`.\n// The fallback keeps the color valid when the CSS variables aren't defined (no `ThemeProvider`).\n// It's dropped when it isn't a color `colorChannel()` parses, for example `currentColor` or a nested `var()`,\n// or when it's a `color()`, whose channels aren't sRGB.\n// More than one level of nested parentheses isn't supported: the match ends at the first run of `)`,\n// so the rest of the fallback stays in the output.\nfunction toChannelVar(match, name, fallback = '') {\n const color = fallback.trim();\n if (color && !color.startsWith('color(')) {\n try {\n const channel = colorChannel(toRgb(color));\n // Space-separated syntax like `rgb(0 0 0)` doesn't throw but gives a single value, or `NaN`s for `hsl()`.\n if (channel.split(' ').length === 3 && !channel.includes('NaN')) {\n return `var(--${name}Channel, ${channel})`;\n }\n } catch {\n // Not a supported color.\n }\n }\n return `var(--${name}Channel)`;\n}\nfunction attachColorManipulators(theme) {\n Object.assign(theme, {\n alpha(color, coefficient) {\n const obj = this || theme;\n if (obj.colorSpace) {\n return `oklch(from ${color} l c h / ${typeof coefficient === 'string' ? `calc(${coefficient})` : coefficient})`;\n }\n if (obj.vars) {\n // To preserve the behavior of the CSS theme variables\n // In the future, this could be replaced by `color-mix` (when https://caniuse.com/?search=color-mix reaches 95%).\n // Raw colors (for example, `theme.palette.*`) have no channel tokens,\n // so they are converted to channels the same way the theme generates `*Channel` tokens,\n // which keeps a CSS coefficient (for example, `theme.vars.palette.action.hoverOpacity`) in `calc()`.\n const alphaValue = typeof coefficient === 'string' ? `calc(${coefficient})` : coefficient;\n // `color()` channels are not sRGB, so only the alpha is replaced to keep any color space and unit.\n if (color.startsWith('color(')) {\n return color.replace(/\\s*(?:\\/[^)]*)?\\)$/, ` / ${alphaValue})`);\n }\n const channels = color.includes('var(') ? color.replace(/var\\(--([^,\\s)]+)(?:,((?:[^()]|\\([^()]*\\))+)\\)|(?:,[^)]+)?\\)+)/g, toChannelVar) : safeColorChannel(toRgb(color));\n return `rgba(${channels} / ${alphaValue})`;\n }\n return systemAlpha(color, parseAddition(coefficient));\n },\n lighten(color, coefficient) {\n const obj = this || theme;\n if (obj.colorSpace) {\n return `color-mix(in ${obj.colorSpace}, ${color}, #fff ${coefficientToPercentage(coefficient)})`;\n }\n return systemLighten(color, coefficient);\n },\n darken(color, coefficient) {\n const obj = this || theme;\n if (obj.colorSpace) {\n return `color-mix(in ${obj.colorSpace}, ${color}, #000 ${coefficientToPercentage(coefficient)})`;\n }\n return systemDarken(color, coefficient);\n }\n });\n}\nfunction createThemeNoVars(options = {}, ...args) {\n const {\n breakpoints: breakpointsInput,\n mixins: mixinsInput = {},\n spacing: spacingInput,\n palette: paletteInput = {},\n motion: motionInput = {},\n transitions: transitionsInput = {},\n typography: typographyInput = {},\n shape: shapeInput,\n colorSpace,\n ...other\n } = options;\n if (options.vars &&\n // The error should throw only for the root theme creation because user is not allowed to use a custom node `vars`.\n // `generateThemeVars` is the closest identifier for checking that the `options` is a result of `createTheme` with CSS variables so that user can create new theme for nested ThemeProvider.\n options.generateThemeVars === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'MUI: `vars` is a private field used for CSS variables support.\\n' +\n // #host-reference\n 'Please use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.' : _formatErrorMessage(22));\n }\n const palette = createPalette({\n ...paletteInput,\n colorSpace\n });\n const systemTheme = systemCreateTheme(options);\n let muiTheme = deepmerge(systemTheme, {\n mixins: createMixins(systemTheme.breakpoints, mixinsInput),\n palette,\n // Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol.\n shadows: shadows.slice(),\n typography: createTypography(palette, typographyInput),\n motion: createMotion(motionInput),\n transitions: createTransitions(transitionsInput),\n zIndex: {\n ...zIndex\n }\n });\n muiTheme = deepmerge(muiTheme, other);\n muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);\n // `reducedMotion` is owned by `theme.motion`; remove stale values preserved by systemCreateTheme.\n delete muiTheme.transitions.reducedMotion;\n\n // Normalize once so components read a resolved object, never the boolean. The color is a hex off\n // this (default) scheme; `createTheme` attaches a per-scheme copy so dark mode stays reactive.\n // Read the palette off `muiTheme` \u2014 a merge argument may have recolored it after `palette` was built.\n if (muiTheme.focusVisible != null && muiTheme.focusVisible !== false) {\n muiTheme.focusVisible = resolveFocusVisible(muiTheme.focusVisible, muiTheme.palette.primary.main);\n }\n if (process.env.NODE_ENV !== 'production') {\n // TODO v6: Refactor to use globalStateClassesMapping from @mui/utils once `readOnly` state class is used in Rating component.\n const stateClasses = ['active', 'checked', 'completed', 'disabled', 'error', 'expanded', 'focused', 'focusVisible', 'required', 'selected'];\n const traverse = (node, component) => {\n let key;\n\n // eslint-disable-next-line guard-for-in\n for (key in node) {\n const child = node[key];\n if (stateClasses.includes(key) && Object.keys(child).length > 0) {\n if (process.env.NODE_ENV !== 'production') {\n const stateClass = generateUtilityClass('', key);\n console.error([`MUI: The \\`${component}\\` component increases ` + `the CSS specificity of the \\`${key}\\` internal state.`, 'You can not override it like this: ', JSON.stringify(node, null, 2), '', `Instead, you need to use the '&.${stateClass}' syntax:`, JSON.stringify({\n root: {\n [`&.${stateClass}`]: child\n }\n }, null, 2), '', 'https://mui.com/r/state-classes-guide'].join('\\n'));\n }\n // Remove the style to prevent global conflicts.\n node[key] = {};\n }\n }\n };\n Object.keys(muiTheme.components).forEach(component => {\n const styleOverrides = muiTheme.components[component].styleOverrides;\n if (styleOverrides && component.startsWith('Mui')) {\n traverse(styleOverrides, component);\n }\n });\n }\n muiTheme.unstable_sxConfig = {\n ...defaultSxConfig,\n ...other?.unstable_sxConfig\n };\n muiTheme.unstable_sx = function sx(props) {\n return styleFunctionSx({\n sx: props,\n theme: this\n });\n };\n muiTheme.toRuntimeSource = stringifyTheme; // for Pigment CSS integration\n\n attachColorManipulators(muiTheme);\n return muiTheme;\n}\nexport default createThemeNoVars;", "// Inspired by https://github.com/material-components/material-components-ios/blob/bca36107405594d5b7b16265a5b0ed698f85a5ee/components/Elevation/src/UIColor%2BMaterialElevation.m#L61\nexport default function getOverlayAlpha(elevation) {\n let alphaValue;\n if (elevation < 1) {\n alphaValue = 5.11916 * elevation ** 2;\n } else {\n alphaValue = 4.5 * Math.log(elevation + 1) + 2;\n }\n return Math.round(alphaValue * 10) / 1000;\n}", "import createPalette from \"./createPalette.mjs\";\nimport getOverlayAlpha from \"./getOverlayAlpha.mjs\";\nconst defaultDarkOverlays = [...Array(25)].map((_, index) => {\n if (index === 0) {\n return 'none';\n }\n const overlay = getOverlayAlpha(index);\n return `linear-gradient(rgba(255 255 255 / ${overlay}), rgba(255 255 255 / ${overlay}))`;\n});\nexport function getOpacity(mode) {\n return {\n inputPlaceholder: mode === 'dark' ? 0.5 : 0.42,\n inputUnderline: mode === 'dark' ? 0.7 : 0.42,\n switchTrackDisabled: mode === 'dark' ? 0.2 : 0.12,\n switchTrack: mode === 'dark' ? 0.3 : 0.38\n };\n}\nexport function getOverlays(mode) {\n return mode === 'dark' ? defaultDarkOverlays : [];\n}\nexport default function createColorScheme(options) {\n const {\n palette: paletteInput = {\n mode: 'light'\n },\n // need to cast to avoid module augmentation test\n opacity,\n overlays,\n colorSpace,\n ...other\n } = options;\n // need to cast because `colorSpace` is considered internal at the moment.\n const palette = createPalette({\n ...paletteInput,\n colorSpace\n });\n return {\n palette,\n opacity: {\n ...getOpacity(palette.mode),\n ...opacity\n },\n overlays: overlays || getOverlays(palette.mode),\n ...other\n };\n}", "export default function shouldSkipGeneratingVar(keys) {\n return keys[0] === 'motion' ||\n // Keep `focusVisible` inline: its values reference the per-component private vars\n // (`--_focusVisible-offset`/`-behavior`). Hoisted to a `:root` var they resolve where those\n // vars are unset, silently breaking the inner-ring inset.\n keys[0] === 'focusVisible' || !!keys[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/) || !!keys[0].match(/sxConfig$/) ||\n // ends with sxConfig\n keys[0] === 'palette' && !!keys[1]?.match(/(mode|contrastThreshold|tonalOffset)/);\n}", "/**\n * @internal These variables should not appear in the :root stylesheet when the `defaultColorScheme=\"dark\"`\n */\nconst excludeVariablesFromRoot = cssVarPrefix => [...[...Array(25)].map((_, index) => `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}overlays-${index}`), `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}palette-AppBar-darkBg`, `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}palette-AppBar-darkColor`];\nexport default excludeVariablesFromRoot;", "import excludeVariablesFromRoot from \"./excludeVariablesFromRoot.mjs\";\nexport default theme => (colorScheme, css) => {\n const root = theme.rootSelector || ':root';\n const selector = theme.colorSchemeSelector;\n let rule = selector;\n if (selector === 'class') {\n rule = '.%s';\n }\n if (selector === 'data') {\n rule = '[data-%s]';\n }\n if (selector?.startsWith('data-') && !selector.includes('%s')) {\n // 'data-mui-color-scheme' -> '[data-mui-color-scheme=\"%s\"]'\n rule = `[${selector}=\"%s\"]`;\n }\n if (theme.defaultColorScheme === colorScheme) {\n if (colorScheme === 'dark') {\n const excludedVariables = {};\n excludeVariablesFromRoot(theme.cssVarPrefix).forEach(cssVar => {\n excludedVariables[cssVar] = css[cssVar];\n delete css[cssVar];\n });\n if (rule === 'media') {\n return {\n [root]: css,\n [`@media (prefers-color-scheme: dark)`]: {\n [root]: excludedVariables\n }\n };\n }\n if (rule) {\n return {\n [rule.replace('%s', colorScheme)]: excludedVariables,\n [`${root}, ${rule.replace('%s', colorScheme)}`]: css\n };\n }\n return {\n [root]: {\n ...css,\n ...excludedVariables\n }\n };\n }\n if (rule && rule !== 'media') {\n return `${root}, ${rule.replace('%s', String(colorScheme))}`;\n }\n } else if (colorScheme) {\n if (rule === 'media') {\n return {\n [`@media (prefers-color-scheme: ${String(colorScheme)})`]: {\n [root]: css\n }\n };\n }\n if (rule) {\n return rule.replace('%s', String(colorScheme));\n }\n }\n return root;\n};", "import _formatErrorMessage from \"@mui/utils/formatMuiErrorMessage\";\nimport deepmerge from '@mui/utils/deepmerge';\nimport { unstable_createGetCssVar as systemCreateGetCssVar, createSpacing } from '@mui/system';\nimport { createUnarySpacing } from '@mui/system/spacing';\nimport { prepareCssVars, prepareTypographyVars, createGetColorSchemeSelector } from '@mui/system/cssVars';\nimport styleFunctionSx, { unstable_defaultSxConfig as defaultSxConfig } from '@mui/system/styleFunctionSx';\nimport { private_safeColorChannel as safeColorChannel, private_safeAlpha as safeAlpha, private_safeDarken as safeDarken, private_safeLighten as safeLighten, private_safeEmphasize as safeEmphasize, hslToRgb } from '@mui/system/colorManipulator';\nimport createThemeNoVars from \"./createThemeNoVars.mjs\";\nimport createColorScheme, { getOpacity, getOverlays } from \"./createColorScheme.mjs\";\nimport defaultShouldSkipGeneratingVar from \"./shouldSkipGeneratingVar.mjs\";\nimport defaultGetSelector from \"./createGetSelector.mjs\";\nimport { stringifyTheme } from \"./stringifyTheme.mjs\";\nimport { light, dark } from \"./createPalette.mjs\";\nimport { resolveFocusVisible, mergeFocusVisibleInput } from \"./focusVisible.mjs\";\nfunction assignNode(obj, keys) {\n keys.forEach(k => {\n if (!obj[k]) {\n obj[k] = {};\n }\n });\n}\nfunction setColor(obj, key, defaultValue) {\n if (!obj[key] && defaultValue) {\n obj[key] = defaultValue;\n }\n}\nfunction toRgb(color) {\n if (typeof color !== 'string' || !color.startsWith('hsl')) {\n return color;\n }\n return hslToRgb(color);\n}\nfunction setColorChannel(obj, key) {\n if (!(`${key}Channel` in obj)) {\n // custom channel token is not provided, generate one.\n // if channel token can't be generated, show a warning.\n obj[`${key}Channel`] = safeColorChannel(toRgb(obj[key]), `MUI: Can't create \\`palette.${key}Channel\\` because \\`palette.${key}\\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` + '\\n' + `To suppress this warning, you need to explicitly provide the \\`palette.${key}Channel\\` as a string (in rgb format, for example \"12 12 12\") or undefined if you want to remove the channel token.`);\n }\n}\nfunction getSpacingVal(spacingInput) {\n if (typeof spacingInput === 'number') {\n return `${spacingInput}px`;\n }\n if (typeof spacingInput === 'string' || typeof spacingInput === 'function' || Array.isArray(spacingInput)) {\n return spacingInput;\n }\n return '8px';\n}\nconst silent = fn => {\n try {\n return fn();\n } catch (error) {\n // ignore error\n }\n return undefined;\n};\nexport const createGetCssVar = (cssVarPrefix = 'mui') => systemCreateGetCssVar(cssVarPrefix);\nfunction attachColorScheme(colorSpace, colorSchemes, scheme, restTheme, colorScheme) {\n if (!scheme) {\n return undefined;\n }\n scheme = scheme === true ? {} : scheme;\n const mode = colorScheme === 'dark' ? 'dark' : 'light';\n if (!restTheme) {\n colorSchemes[colorScheme] = createColorScheme({\n ...scheme,\n palette: {\n mode,\n ...scheme?.palette\n },\n colorSpace\n });\n return undefined;\n }\n const {\n palette,\n ...muiTheme\n } = createThemeNoVars({\n ...restTheme,\n palette: {\n mode,\n ...scheme?.palette\n },\n colorSpace\n });\n colorSchemes[colorScheme] = {\n ...scheme,\n palette,\n opacity: {\n ...getOpacity(mode),\n ...scheme?.opacity\n },\n overlays: scheme?.overlays || getOverlays(mode)\n };\n return muiTheme;\n}\n\n/**\n * A default `createThemeWithVars` comes with a single color scheme, either `light` or `dark` based on the `defaultColorScheme`.\n * This is better suited for apps that only need a single color scheme.\n *\n * To enable built-in `light` and `dark` color schemes, either:\n * 1. provide a `colorSchemeSelector` to define how the color schemes will change.\n * 2. provide `colorSchemes.dark` will set `colorSchemeSelector: 'media'` by default.\n */\nexport default function createThemeWithVars(options = {}, ...args) {\n const {\n colorSchemes: colorSchemesInput = {\n light: true\n },\n defaultColorScheme: defaultColorSchemeInput,\n disableCssColorScheme = false,\n cssVarPrefix = 'mui',\n nativeColor = false,\n shouldSkipGeneratingVar = defaultShouldSkipGeneratingVar,\n colorSchemeSelector: selector = colorSchemesInput.light && colorSchemesInput.dark ? 'media' : undefined,\n rootSelector = ':root',\n ...input\n } = options;\n const firstColorScheme = Object.keys(colorSchemesInput)[0];\n const defaultColorScheme = defaultColorSchemeInput || (colorSchemesInput.light && firstColorScheme !== 'light' ? 'light' : firstColorScheme);\n const getCssVar = createGetCssVar(cssVarPrefix);\n const {\n [defaultColorScheme]: defaultSchemeInput,\n light: builtInLight,\n dark: builtInDark,\n ...customColorSchemes\n } = colorSchemesInput;\n const colorSchemes = {\n ...customColorSchemes\n };\n let defaultScheme = defaultSchemeInput;\n\n // For built-in light and dark color schemes, ensure that the value is valid if they are the default color scheme.\n if (defaultColorScheme === 'dark' && !('dark' in colorSchemesInput) || defaultColorScheme === 'light' && !('light' in colorSchemesInput)) {\n defaultScheme = true;\n }\n if (!defaultScheme) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: The \\`colorSchemes.${defaultColorScheme}\\` option is either missing or invalid.` : _formatErrorMessage(21, defaultColorScheme));\n }\n\n // The reason to use `oklch` is that it is the most perceptually uniform color space and widely supported.\n let colorSpace;\n if (nativeColor) {\n colorSpace = 'oklch';\n }\n\n // Create the palette for the default color scheme, either `light`, `dark`, or custom color scheme.\n const muiTheme = attachColorScheme(colorSpace, colorSchemes, defaultScheme, input, defaultColorScheme);\n if (builtInLight && !colorSchemes.light) {\n attachColorScheme(colorSpace, colorSchemes, builtInLight, undefined, 'light');\n }\n if (builtInDark && !colorSchemes.dark) {\n attachColorScheme(colorSpace, colorSchemes, builtInDark, undefined, 'dark');\n }\n let theme = {\n defaultColorScheme,\n ...muiTheme,\n cssVarPrefix,\n colorSchemeSelector: selector,\n rootSelector,\n getCssVar,\n colorSchemes,\n font: {\n ...prepareTypographyVars(muiTheme.typography),\n ...muiTheme.font\n },\n spacing: getSpacingVal(input.spacing)\n };\n Object.keys(theme.colorSchemes).forEach(key => {\n const palette = theme.colorSchemes[key].palette;\n const setCssVarColor = cssVar => {\n const tokens = cssVar.split('-');\n const color = tokens[1];\n const colorToken = tokens[2];\n return getCssVar(cssVar, palette[color][colorToken]);\n };\n\n // attach black & white channels to common node\n if (palette.mode === 'light') {\n setColor(palette.common, 'background', '#fff');\n setColor(palette.common, 'onBackground', '#000');\n }\n if (palette.mode === 'dark') {\n setColor(palette.common, 'background', '#000');\n setColor(palette.common, 'onBackground', '#fff');\n }\n\n // Generate `text.primaryChannel` before the component tokens:\n // `palette.Skeleton.bg` uses it as its CSS variable fallback.\n if (!nativeColor) {\n setColorChannel(palette.text, 'primary');\n }\n function colorMix(method, color, coefficient) {\n if (colorSpace) {\n let mixer;\n if (method === safeAlpha) {\n mixer = `transparent ${((1 - coefficient) * 100).toFixed(0)}%`;\n }\n if (method === safeDarken) {\n mixer = `#000 ${(coefficient * 100).toFixed(0)}%`;\n }\n if (method === safeLighten) {\n mixer = `#fff ${(coefficient * 100).toFixed(0)}%`;\n }\n return `color-mix(in ${colorSpace}, ${color}, ${mixer})`;\n }\n return method(color, coefficient);\n }\n\n // assign component variables\n assignNode(palette, ['Alert', 'AppBar', 'Avatar', 'Button', 'Chip', 'FilledInput', 'Input', 'LinearProgress', 'Skeleton', 'Slider', 'SnackbarContent', 'SpeedDialAction', 'StepConnector', 'StepContent', 'Switch', 'TableCell', 'Tooltip']);\n if (palette.mode === 'light') {\n setColor(palette.Alert, 'errorColor', colorMix(safeDarken, nativeColor ? getCssVar('palette-error-light') : palette.error.light, 0.6));\n setColor(palette.Alert, 'infoColor', colorMix(safeDarken, nativeColor ? getCssVar('palette-info-light') : palette.info.light, 0.6));\n setColor(palette.Alert, 'successColor', colorMix(safeDarken, nativeColor ? getCssVar('palette-success-light') : palette.success.light, 0.6));\n setColor(palette.Alert, 'warningColor', colorMix(safeDarken, nativeColor ? getCssVar('palette-warning-light') : palette.warning.light, 0.6));\n setColor(palette.Alert, 'errorFilledBg', setCssVarColor('palette-error-main'));\n setColor(palette.Alert, 'infoFilledBg', setCssVarColor('palette-info-main'));\n setColor(palette.Alert, 'successFilledBg', setCssVarColor('palette-success-main'));\n setColor(palette.Alert, 'warningFilledBg', setCssVarColor('palette-warning-main'));\n setColor(palette.Alert, 'errorFilledColor', silent(() => palette.getContrastText(palette.error.main)));\n setColor(palette.Alert, 'infoFilledColor', silent(() => palette.getContrastText(palette.info.main)));\n setColor(palette.Alert, 'successFilledColor', silent(() => palette.getContrastText(palette.success.main)));\n setColor(palette.Alert, 'warningFilledColor', silent(() => palette.getContrastText(palette.warning.main)));\n setColor(palette.Alert, 'errorStandardBg', colorMix(safeLighten, nativeColor ? getCssVar('palette-error-light') : palette.error.light, 0.9));\n setColor(palette.Alert, 'infoStandardBg', colorMix(safeLighten, nativeColor ? getCssVar('palette-info-light') : palette.info.light, 0.9));\n setColor(palette.Alert, 'successStandardBg', colorMix(safeLighten, nativeColor ? getCssVar('palette-success-light') : palette.success.light, 0.9));\n setColor(palette.Alert, 'warningStandardBg', colorMix(safeLighten, nativeColor ? getCssVar('palette-warning-light') : palette.warning.light, 0.9));\n setColor(palette.Alert, 'errorIconColor', setCssVarColor('palette-error-main'));\n setColor(palette.Alert, 'infoIconColor', setCssVarColor('palette-info-main'));\n setColor(palette.Alert, 'successIconColor', setCssVarColor('palette-success-main'));\n setColor(palette.Alert, 'warningIconColor', setCssVarColor('palette-warning-main'));\n setColor(palette.AppBar, 'defaultBg', setCssVarColor('palette-grey-100'));\n setColor(palette.Avatar, 'defaultBg', setCssVarColor('palette-grey-400'));\n setColor(palette.Button, 'inheritContainedBg', setCssVarColor('palette-grey-300'));\n setColor(palette.Button, 'inheritContainedHoverBg', setCssVarColor('palette-grey-A100'));\n setColor(palette.Chip, 'defaultBorder', setCssVarColor('palette-grey-400'));\n setColor(palette.Chip, 'defaultAvatarColor', setCssVarColor('palette-grey-700'));\n setColor(palette.Chip, 'defaultIconColor', setCssVarColor('palette-grey-700'));\n setColor(palette.FilledInput, 'bg', 'rgba(0, 0, 0, 0.06)');\n setColor(palette.FilledInput, 'hoverBg', 'rgba(0, 0, 0, 0.09)');\n setColor(palette.FilledInput, 'disabledBg', 'rgba(0, 0, 0, 0.12)');\n setColor(palette.Input, 'autofillWebkitBoxShadow', 'none');\n setColor(palette.LinearProgress, 'primaryBg', colorMix(safeLighten, nativeColor ? getCssVar('palette-primary-main') : palette.primary.main, 0.62));\n setColor(palette.LinearProgress, 'secondaryBg', colorMix(safeLighten, nativeColor ? getCssVar('palette-secondary-main') : palette.secondary.main, 0.62));\n setColor(palette.LinearProgress, 'errorBg', colorMix(safeLighten, nativeColor ? getCssVar('palette-error-main') : palette.error.main, 0.62));\n setColor(palette.LinearProgress, 'infoBg', colorMix(safeLighten, nativeColor ? getCssVar('palette-info-main') : palette.info.main, 0.62));\n setColor(palette.LinearProgress, 'successBg', colorMix(safeLighten, nativeColor ? getCssVar('palette-success-main') : palette.success.main, 0.62));\n setColor(palette.LinearProgress, 'warningBg', colorMix(safeLighten, nativeColor ? getCssVar('palette-warning-light') : palette.warning.main, 0.62));\n setColor(palette.Skeleton, 'bg', colorSpace ? colorMix(safeAlpha, nativeColor ? getCssVar('palette-text-primary') : palette.text.primary, 0.11) : `rgba(${setCssVarColor('palette-text-primaryChannel')} / 0.11)`);\n setColor(palette.Slider, 'primaryTrack', colorMix(safeLighten, nativeColor ? getCssVar('palette-primary-main') : palette.primary.main, 0.62));\n setColor(palette.Slider, 'secondaryTrack', colorMix(safeLighten, nativeColor ? getCssVar('palette-secondary-main') : palette.secondary.main, 0.62));\n setColor(palette.Slider, 'errorTrack', colorMix(safeLighten, nativeColor ? getCssVar('palette-error-main') : palette.error.main, 0.62));\n setColor(palette.Slider, 'infoTrack', colorMix(safeLighten, nativeColor ? getCssVar('palette-info-main') : palette.info.main, 0.62));\n setColor(palette.Slider, 'successTrack', colorMix(safeLighten, nativeColor ? getCssVar('palette-success-main') : palette.success.main, 0.62));\n setColor(palette.Slider, 'warningTrack', colorMix(safeLighten, nativeColor ? getCssVar('palette-warning-main') : palette.warning.main, 0.62));\n const snackbarContentBackground = colorSpace ? colorMix(safeDarken, nativeColor ? getCssVar('palette-background-default') : palette.background.default, 0.6825) // use `0.6825` instead of `0.8` to match the contrast ratio of JS implementation\n : safeEmphasize(palette.background.default, 0.8);\n setColor(palette.SnackbarContent, 'bg', snackbarContentBackground);\n setColor(palette.SnackbarContent, 'color', silent(() => colorSpace ? dark.text.primary : palette.getContrastText(snackbarContentBackground)));\n setColor(palette.SpeedDialAction, 'fabHoverBg', safeEmphasize(palette.background.paper, 0.15));\n setColor(palette.StepConnector, 'border', setCssVarColor('palette-grey-400'));\n setColor(palette.StepContent, 'border', setCssVarColor('palette-grey-400'));\n setColor(palette.Switch, 'defaultColor', setCssVarColor('palette-common-white'));\n setColor(palette.Switch, 'defaultDisabledColor', setCssVarColor('palette-grey-100'));\n setColor(palette.Switch, 'primaryDisabledColor', colorMix(safeLighten, nativeColor ? getCssVar('palette-primary-main') : palette.primary.main, 0.62));\n setColor(palette.Switch, 'secondaryDisabledColor', colorMix(safeLighten, nativeColor ? getCssVar('palette-secondary-main') : palette.secondary.main, 0.62));\n setColor(palette.Switch, 'errorDisabledColor', colorMix(safeLighten, nativeColor ? getCssVar('palette-error-main') : palette.error.main, 0.62));\n setColor(palette.Switch, 'infoDisabledColor', colorMix(safeLighten, nativeColor ? getCssVar('palette-info-main') : palette.info.main, 0.62));\n setColor(palette.Switch, 'successDisabledColor', colorMix(safeLighten, nativeColor ? getCssVar('palette-success-main') : palette.success.main, 0.62));\n setColor(palette.Switch, 'warningDisabledColor', colorMix(safeLighten, nativeColor ? getCssVar('palette-warning-main') : palette.warning.main, 0.62));\n setColor(palette.TableCell, 'border', colorMix(safeLighten, safeAlpha(nativeColor ? getCssVar('palette-divider') : palette.divider, 1), 0.88));\n setColor(palette.Tooltip, 'bg', colorMix(safeAlpha, nativeColor ? getCssVar('palette-grey-700') : palette.grey[700], 0.92));\n }\n if (palette.mode === 'dark') {\n setColor(palette.Alert, 'errorColor', colorMix(safeLighten, nativeColor ? getCssVar('palette-error-light') : palette.error.light, 0.6));\n setColor(palette.Alert, 'infoColor', colorMix(safeLighten, nativeColor ? getCssVar('palette-info-light') : palette.info.light, 0.6));\n setColor(palette.Alert, 'successColor', colorMix(safeLighten, nativeColor ? getCssVar('palette-success-light') : palette.success.light, 0.6));\n setColor(palette.Alert, 'warningColor', colorMix(safeLighten, nativeColor ? getCssVar('palette-warning-light') : palette.warning.light, 0.6));\n setColor(palette.Alert, 'errorFilledBg', setCssVarColor('palette-error-dark'));\n setColor(palette.Alert, 'infoFilledBg', setCssVarColor('palette-info-dark'));\n setColor(palette.Alert, 'successFilledBg', setCssVarColor('palette-success-dark'));\n setColor(palette.Alert, 'warningFilledBg', setCssVarColor('palette-warning-dark'));\n setColor(palette.Alert, 'errorFilledColor', silent(() => palette.getContrastText(palette.error.dark)));\n setColor(palette.Alert, 'infoFilledColor', silent(() => palette.getContrastText(palette.info.dark)));\n setColor(palette.Alert, 'successFilledColor', silent(() => palette.getContrastText(palette.success.dark)));\n setColor(palette.Alert, 'warningFilledColor', silent(() => palette.getContrastText(palette.warning.dark)));\n setColor(palette.Alert, 'errorStandardBg', colorMix(safeDarken, nativeColor ? getCssVar('palette-error-light') : palette.error.light, 0.9));\n setColor(palette.Alert, 'infoStandardBg', colorMix(safeDarken, nativeColor ? getCssVar('palette-info-light') : palette.info.light, 0.9));\n setColor(palette.Alert, 'successStandardBg', colorMix(safeDarken, nativeColor ? getCssVar('palette-success-light') : palette.success.light, 0.9));\n setColor(palette.Alert, 'warningStandardBg', colorMix(safeDarken, nativeColor ? getCssVar('palette-warning-light') : palette.warning.light, 0.9));\n setColor(palette.Alert, 'errorIconColor', setCssVarColor('palette-error-main'));\n setColor(palette.Alert, 'infoIconColor', setCssVarColor('palette-info-main'));\n setColor(palette.Alert, 'successIconColor', setCssVarColor('palette-success-main'));\n setColor(palette.Alert, 'warningIconColor', setCssVarColor('palette-warning-main'));\n setColor(palette.AppBar, 'defaultBg', setCssVarColor('palette-grey-900'));\n setColor(palette.AppBar, 'darkBg', setCssVarColor('palette-background-paper')); // specific for dark mode\n setColor(palette.AppBar, 'darkColor', setCssVarColor('palette-text-primary')); // specific for dark mode\n setColor(palette.Avatar, 'defaultBg', setCssVarColor('palette-grey-600'));\n setColor(palette.Button, 'inheritContainedBg', setCssVarColor('palette-grey-800'));\n setColor(palette.Button, 'inheritContainedHoverBg', setCssVarColor('palette-grey-700'));\n setColor(palette.Chip, 'defaultBorder', setCssVarColor('palette-grey-700'));\n setColor(palette.Chip, 'defaultAvatarColor', setCssVarColor('palette-grey-300'));\n setColor(palette.Chip, 'defaultIconColor', setCssVarColor('palette-grey-300'));\n setColor(palette.FilledInput, 'bg', 'rgba(255, 255, 255, 0.09)');\n setColor(palette.FilledInput, 'hoverBg', 'rgba(255, 255, 255, 0.13)');\n setColor(palette.FilledInput, 'disabledBg', 'rgba(255, 255, 255, 0.12)');\n setColor(palette.Input, 'autofillWebkitBoxShadow', '0 0 0 100px #266798 inset');\n setColor(palette.LinearProgress, 'primaryBg', colorMix(safeDarken, nativeColor ? getCssVar('palette-primary-main') : palette.primary.main, 0.5));\n setColor(palette.LinearProgress, 'secondaryBg', colorMix(safeDarken, nativeColor ? getCssVar('palette-secondary-main') : palette.secondary.main, 0.5));\n setColor(palette.LinearProgress, 'errorBg', colorMix(safeDarken, nativeColor ? getCssVar('palette-error-main') : palette.error.main, 0.5));\n setColor(palette.LinearProgress, 'infoBg', colorMix(safeDarken, nativeColor ? getCssVar('palette-info-main') : palette.info.main, 0.5));\n setColor(palette.LinearProgress, 'successBg', colorMix(safeDarken, nativeColor ? getCssVar('palette-success-main') : palette.success.main, 0.5));\n setColor(palette.LinearProgress, 'warningBg', colorMix(safeDarken, nativeColor ? getCssVar('palette-warning-main') : palette.warning.main, 0.5));\n setColor(palette.Skeleton, 'bg', colorSpace ? colorMix(safeAlpha, nativeColor ? getCssVar('palette-text-primary') : palette.text.primary, 0.13) : `rgba(${setCssVarColor('palette-text-primaryChannel')} / 0.13)`);\n setColor(palette.Slider, 'primaryTrack', colorMix(safeDarken, nativeColor ? getCssVar('palette-primary-main') : palette.primary.main, 0.5));\n setColor(palette.Slider, 'secondaryTrack', colorMix(safeDarken, nativeColor ? getCssVar('palette-secondary-main') : palette.secondary.main, 0.5));\n setColor(palette.Slider, 'errorTrack', colorMix(safeDarken, nativeColor ? getCssVar('palette-error-main') : palette.error.main, 0.5));\n setColor(palette.Slider, 'infoTrack', colorMix(safeDarken, nativeColor ? getCssVar('palette-info-main') : palette.info.main, 0.5));\n setColor(palette.Slider, 'successTrack', colorMix(safeDarken, nativeColor ? getCssVar('palette-success-main') : palette.success.main, 0.5));\n setColor(palette.Slider, 'warningTrack', colorMix(safeDarken, nativeColor ? getCssVar('palette-warning-light') : palette.warning.main, 0.5));\n const snackbarContentBackground = colorSpace ? colorMix(safeLighten, nativeColor ? getCssVar('palette-background-default') : palette.background.default, 0.985) // use `0.985` instead of `0.98` to match the contrast ratio of JS implementation\n : safeEmphasize(palette.background.default, 0.98);\n setColor(palette.SnackbarContent, 'bg', snackbarContentBackground);\n setColor(palette.SnackbarContent, 'color', silent(() => colorSpace ? light.text.primary : palette.getContrastText(snackbarContentBackground)));\n setColor(palette.SpeedDialAction, 'fabHoverBg', safeEmphasize(palette.background.paper, 0.15));\n setColor(palette.StepConnector, 'border', setCssVarColor('palette-grey-600'));\n setColor(palette.StepContent, 'border', setCssVarColor('palette-grey-600'));\n setColor(palette.Switch, 'defaultColor', setCssVarColor('palette-grey-300'));\n setColor(palette.Switch, 'defaultDisabledColor', setCssVarColor('palette-grey-600'));\n setColor(palette.Switch, 'primaryDisabledColor', colorMix(safeDarken, nativeColor ? getCssVar('palette-primary-main') : palette.primary.main, 0.55));\n setColor(palette.Switch, 'secondaryDisabledColor', colorMix(safeDarken, nativeColor ? getCssVar('palette-secondary-main') : palette.secondary.main, 0.55));\n setColor(palette.Switch, 'errorDisabledColor', colorMix(safeDarken, nativeColor ? getCssVar('palette-error-main') : palette.error.main, 0.55));\n setColor(palette.Switch, 'infoDisabledColor', colorMix(safeDarken, nativeColor ? getCssVar('palette-info-main') : palette.info.main, 0.55));\n setColor(palette.Switch, 'successDisabledColor', colorMix(safeDarken, nativeColor ? getCssVar('palette-success-main') : palette.success.main, 0.55));\n setColor(palette.Switch, 'warningDisabledColor', colorMix(safeDarken, nativeColor ? getCssVar('palette-warning-light') : palette.warning.main, 0.55));\n setColor(palette.TableCell, 'border', colorMix(safeDarken, safeAlpha(nativeColor ? getCssVar('palette-divider') : palette.divider, 1), 0.68));\n setColor(palette.Tooltip, 'bg', colorMix(safeAlpha, nativeColor ? getCssVar('palette-grey-700') : palette.grey[700], 0.92));\n }\n if (!nativeColor) {\n setColorChannel(palette.background, 'default');\n\n // added for consistency with the `background.default` token\n setColorChannel(palette.background, 'paper');\n setColorChannel(palette.common, 'background');\n setColorChannel(palette.common, 'onBackground');\n setColorChannel(palette, 'divider');\n }\n Object.keys(palette).forEach(color => {\n const colors = palette[color];\n\n // The default palettes (primary, secondary, error, info, success, and warning) errors are handled by the above `createTheme(...)`.\n\n if (color !== 'tonalOffset' && !nativeColor && colors && typeof colors === 'object') {\n // Silent the error for custom palettes.\n if (colors.main) {\n setColor(palette[color], 'mainChannel', safeColorChannel(toRgb(colors.main)));\n }\n if (colors.light) {\n setColor(palette[color], 'lightChannel', safeColorChannel(toRgb(colors.light)));\n }\n if (colors.dark) {\n setColor(palette[color], 'darkChannel', safeColorChannel(toRgb(colors.dark)));\n }\n if (colors.contrastText) {\n setColor(palette[color], 'contrastTextChannel', safeColorChannel(toRgb(colors.contrastText)));\n }\n if (color === 'text') {\n // Text colors: text.primary, text.secondary\n setColorChannel(palette[color], 'primary');\n setColorChannel(palette[color], 'secondary');\n }\n if (color === 'action') {\n // Action colors: action.active, action.selected\n if (colors.active) {\n setColorChannel(palette[color], 'active');\n }\n if (colors.selected) {\n setColorChannel(palette[color], 'selected');\n }\n }\n }\n });\n });\n theme = args.reduce((acc, argument) => deepmerge(acc, argument), theme);\n\n // Default color is the palette var, not a hex: `focusVisible` is spread inline (skipped from var\n // generation, see `shouldSkipGeneratingVar`), so the var adapts per scheme at the CSS level \u2014 no\n // per-scheme copy needed here, unlike the no-vars path in `createTheme`.\n const focusVisibleInput = mergeFocusVisibleInput(options.focusVisible, args);\n if (focusVisibleInput != null && focusVisibleInput !== false) {\n theme.focusVisible = resolveFocusVisible(focusVisibleInput, getCssVar('palette-primary-main'));\n }\n const parserConfig = {\n prefix: cssVarPrefix,\n disableCssColorScheme,\n shouldSkipGeneratingVar,\n getSelector: defaultGetSelector(theme),\n enableContrastVars: nativeColor\n };\n const {\n vars,\n generateThemeVars,\n generateStyleSheets\n } = prepareCssVars(theme, parserConfig);\n theme.vars = vars;\n Object.entries(theme.colorSchemes[theme.defaultColorScheme]).forEach(([key, value]) => {\n theme[key] = value;\n });\n theme.generateThemeVars = generateThemeVars;\n theme.generateStyleSheets = generateStyleSheets;\n theme.generateSpacing = function generateSpacing() {\n return createSpacing(input.spacing, createUnarySpacing(this));\n };\n theme.getColorSchemeSelector = createGetColorSchemeSelector(selector);\n theme.spacing = theme.generateSpacing();\n theme.shouldSkipGeneratingVar = shouldSkipGeneratingVar;\n theme.unstable_sxConfig = {\n ...defaultSxConfig,\n ...input?.unstable_sxConfig\n };\n theme.unstable_sx = function sx(props) {\n return styleFunctionSx({\n sx: props,\n theme: this\n });\n };\n theme.internal_cache = {};\n theme.toRuntimeSource = stringifyTheme; // for Pigment CSS integration\n\n return theme;\n}", "import createPalette from \"./createPalette.mjs\";\nimport { resolveFocusVisible, mergeFocusVisibleInput, isResolvedFocusVisible } from \"./focusVisible.mjs\";\nimport createThemeWithVars from \"./createThemeWithVars.mjs\";\nimport createThemeNoVars from \"./createThemeNoVars.mjs\";\n// eslint-disable-next-line consistent-return\nfunction attachColorScheme(theme, scheme, colorScheme) {\n if (!theme.colorSchemes) {\n return undefined;\n }\n if (colorScheme) {\n theme.colorSchemes[scheme] = {\n ...(colorScheme !== true && colorScheme),\n palette: createPalette({\n ...(colorScheme === true ? {} : colorScheme.palette),\n mode: scheme\n }) // cast type to skip module augmentation test\n };\n }\n}\n\n/**\n * Generate a theme base on the options received.\n * @param options Takes an incomplete theme object and adds the missing parts.\n * @param args Deep merge the arguments with the about to be returned theme.\n * @returns A complete, ready-to-use theme object.\n */\nexport default function createTheme(options = {},\n// cast type to skip module augmentation test\n...args) {\n const {\n palette,\n cssVariables = false,\n colorSchemes: initialColorSchemes = !palette ? {\n light: true\n } : undefined,\n defaultColorScheme: initialDefaultColorScheme = palette?.mode,\n ...other\n } = options;\n const defaultColorSchemeInput = initialDefaultColorScheme || 'light';\n const defaultScheme = initialColorSchemes?.[defaultColorSchemeInput];\n const colorSchemesInput = {\n ...initialColorSchemes,\n ...(palette ? {\n [defaultColorSchemeInput]: {\n ...(typeof defaultScheme !== 'boolean' && defaultScheme),\n palette\n }\n } : undefined)\n };\n if (cssVariables === false) {\n if (!('colorSchemes' in options)) {\n // Behaves exactly as v5\n return createThemeNoVars(options, ...args);\n }\n let paletteOptions = palette;\n if (!('palette' in options)) {\n if (colorSchemesInput[defaultColorSchemeInput]) {\n if (colorSchemesInput[defaultColorSchemeInput] !== true) {\n paletteOptions = colorSchemesInput[defaultColorSchemeInput].palette;\n } else if (defaultColorSchemeInput === 'dark') {\n // @ts-ignore to prevent the module augmentation test from failing\n paletteOptions = {\n mode: 'dark'\n };\n }\n }\n }\n const theme = createThemeNoVars({\n ...options,\n palette: paletteOptions\n }, ...args);\n theme.defaultColorScheme = defaultColorSchemeInput;\n theme.colorSchemes = colorSchemesInput;\n if (theme.palette.mode === 'light') {\n theme.colorSchemes.light = {\n ...(colorSchemesInput.light !== true && colorSchemesInput.light),\n palette: theme.palette\n };\n attachColorScheme(theme, 'dark', colorSchemesInput.dark);\n }\n if (theme.palette.mode === 'dark') {\n theme.colorSchemes.dark = {\n ...(colorSchemesInput.dark !== true && colorSchemesInput.dark),\n palette: theme.palette\n };\n attachColorScheme(theme, 'light', colorSchemesInput.light);\n }\n if (theme.focusVisible != null && theme.focusVisible !== false) {\n let focusVisibleInput = theme.focusVisible;\n const rawFocusVisible = mergeFocusVisibleInput(options.focusVisible, args);\n const authoredColor = rawFocusVisible && typeof rawFocusVisible === 'object' ? rawFocusVisible.outlineColor : undefined;\n // A re-composed theme carries a baked default that looks authored, so it falls back to value\n // equality \u2014 the one case where a pinned `primary.main` is indistinguishable and gets reset.\n if (!authoredColor || isResolvedFocusVisible(rawFocusVisible) && authoredColor === theme.palette.primary.main) {\n const {\n outlineColor,\n ...rest\n } = focusVisibleInput;\n focusVisibleInput = rest;\n }\n Object.keys(theme.colorSchemes).forEach(scheme => {\n const schemePalette = theme.colorSchemes?.[scheme]?.palette;\n if (schemePalette?.primary) {\n theme.colorSchemes[scheme].focusVisible = resolveFocusVisible(focusVisibleInput, schemePalette.primary.main);\n }\n });\n }\n return theme;\n }\n if (!palette && !('light' in colorSchemesInput) && defaultColorSchemeInput === 'light') {\n colorSchemesInput.light = true;\n }\n return createThemeWithVars({\n ...other,\n colorSchemes: colorSchemesInput,\n defaultColorScheme: defaultColorSchemeInput,\n ...(typeof cssVariables !== 'boolean' && cssVariables)\n }, ...args);\n}", "'use client';\n\nimport createTheme from \"./createTheme.mjs\";\nconst defaultTheme = createTheme();\nexport default defaultTheme;", "export default '$$material';", "import { extendSxProp } from '@mui/system/styleFunctionSx';\nimport useTheme from \"../styles/useTheme.mjs\";\nimport GlobalStyles from \"../GlobalStyles/index.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport { css, keyframes } from '@mui/system';\nexport { default as styled } from \"../styles/styled.mjs\";\nexport function globalCss(styles) {\n return function GlobalStylesWrapper(props) {\n return (\n /*#__PURE__*/\n // Pigment CSS `globalCss` support callback with theme inside an object but `GlobalStyles` support theme as a callback value.\n _jsx(GlobalStyles, {\n styles: typeof styles === 'function' ? theme => styles({\n theme,\n ...props\n }) : styles\n })\n );\n };\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function internal_createExtendSxProp() {\n return extendSxProp;\n}\nexport { useTheme };", "// copied from @mui/system/createStyled\nfunction slotShouldForwardProp(prop) {\n return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';\n}\nexport default slotShouldForwardProp;", "import slotShouldForwardProp from \"./slotShouldForwardProp.mjs\";\nconst rootShouldForwardProp = prop => slotShouldForwardProp(prop) && prop !== 'classes';\nexport default rootShouldForwardProp;", "'use client';\n\nimport createStyled from '@mui/system/createStyled';\nimport defaultTheme from \"./defaultTheme.mjs\";\nimport THEME_ID from \"./identifier.mjs\";\nimport rootShouldForwardProp from \"./rootShouldForwardProp.mjs\";\nexport { default as slotShouldForwardProp } from \"./slotShouldForwardProp.mjs\";\nexport { default as rootShouldForwardProp } from \"./rootShouldForwardProp.mjs\";\nconst styled = createStyled({\n themeId: THEME_ID,\n defaultTheme,\n rootShouldForwardProp\n});\nexport default styled;", "import { unstable_memoTheme } from '@mui/system';\nconst memoTheme = unstable_memoTheme;\nexport default memoTheme;", "'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport SystemDefaultPropsProvider, { useDefaultProps as useSystemDefaultProps } from '@mui/system/DefaultPropsProvider';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction DefaultPropsProvider(props) {\n return /*#__PURE__*/_jsx(SystemDefaultPropsProvider, {\n ...props\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? DefaultPropsProvider.propTypes /* remove-proptypes */ = {\n // \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Warning \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n // \u2502 These PropTypes are generated from the TypeScript type definitions. \u2502\n // \u2502 To update them, edit the TypeScript types and run `pnpm proptypes`. \u2502\n // \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n /**\n * @ignore\n */\n children: PropTypes.node,\n /**\n * @ignore\n */\n value: PropTypes.object.isRequired\n} : void 0;\nexport default DefaultPropsProvider;\nexport function useDefaultProps(params) {\n return useSystemDefaultProps(params);\n}", "import capitalize from '@mui/utils/capitalize';\nexport default capitalize;", "/**\n * Type guard to check if the object has a \"main\" property of type string.\n *\n * @param obj - the object to check\n * @returns boolean\n */\nfunction hasCorrectMainProperty(obj) {\n return typeof obj.main === 'string';\n}\n/**\n * Checks if the object conforms to the SimplePaletteColorOptions type.\n * The minimum requirement is that the object has a \"main\" property of type string, this is always checked.\n * Optionally, you can pass additional properties to check.\n *\n * @param obj - The object to check\n * @param additionalPropertiesToCheck - Array containing \"light\", \"dark\", and/or \"contrastText\"\n * @returns boolean\n */\nfunction checkSimplePaletteColorValues(obj, additionalPropertiesToCheck = []) {\n if (!hasCorrectMainProperty(obj)) {\n return false;\n }\n for (const value of additionalPropertiesToCheck) {\n if (!obj.hasOwnProperty(value) || typeof obj[value] !== 'string') {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Creates a filter function used to filter simple palette color options.\n * The minimum requirement is that the object has a \"main\" property of type string, this is always checked.\n * Optionally, you can pass additional properties to check.\n *\n * @param additionalPropertiesToCheck - Array containing \"light\", \"dark\", and/or \"contrastText\"\n * @returns ([, value]: [any, PaletteColorOptions]) => boolean\n */\nexport default function createSimplePaletteValueFilter(additionalPropertiesToCheck = []) {\n return ([, value]) => value && checkSimplePaletteColorValues(value, additionalPropertiesToCheck);\n}", "'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport integerPropType from '@mui/utils/integerPropType';\nimport chainPropTypes from '@mui/utils/chainPropTypes';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { alpha } from '@mui/system/colorManipulator';\nimport { styled, useTheme } from \"../zero-styled/index.mjs\";\nimport memoTheme from \"../utils/memoTheme.mjs\";\nimport { useDefaultProps } from \"../DefaultPropsProvider/index.mjs\";\nimport getOverlayAlpha from \"../styles/getOverlayAlpha.mjs\";\nimport { getPaperUtilityClass } from \"./paperClasses.mjs\";\nimport { getTransitionStyles } from \"../transitions/utils.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n square,\n elevation,\n variant,\n classes\n } = ownerState;\n const slots = {\n root: ['root', variant, !square && 'rounded', variant === 'elevation' && `elevation${elevation}`]\n };\n return composeClasses(slots, getPaperUtilityClass, classes);\n};\nconst PaperRoot = styled('div', {\n name: 'MuiPaper',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, styles[ownerState.variant], !ownerState.square && styles.rounded, ownerState.variant === 'elevation' && styles[`elevation${ownerState.elevation}`]];\n }\n})(memoTheme(({\n theme\n}) => ({\n backgroundColor: (theme.vars || theme).palette.background.paper,\n color: (theme.vars || theme).palette.text.primary,\n ...getTransitionStyles(theme, 'box-shadow'),\n variants: [{\n props: ({\n ownerState\n }) => !ownerState.square,\n style: {\n borderRadius: (theme.vars || theme).shape.borderRadius\n }\n }, {\n props: {\n variant: 'outlined'\n },\n style: {\n border: `1px solid ${(theme.vars || theme).palette.divider}`\n }\n }, {\n props: {\n variant: 'elevation'\n },\n style: {\n boxShadow: 'var(--Paper-shadow)',\n backgroundImage: 'var(--Paper-overlay)'\n }\n }]\n})));\nconst Paper = /*#__PURE__*/React.forwardRef(function Paper(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiPaper'\n });\n const theme = useTheme();\n const {\n className,\n component = 'div',\n elevation = 1,\n square = false,\n variant = 'elevation',\n ...other\n } = props;\n const ownerState = {\n ...props,\n component,\n elevation,\n square,\n variant\n };\n const classes = useUtilityClasses(ownerState);\n if (process.env.NODE_ENV !== 'production') {\n if (theme.shadows[elevation] === undefined) {\n console.error([`MUI: The elevation provided <Paper elevation={${elevation}}> is not available in the theme.`, `Please make sure that \\`theme.shadows[${elevation}]\\` is defined.`].join('\\n'));\n }\n }\n return /*#__PURE__*/_jsx(PaperRoot, {\n as: component,\n ownerState: ownerState,\n className: clsx(classes.root, className),\n ref: ref,\n ...other,\n style: {\n ...(variant === 'elevation' && {\n '--Paper-shadow': (theme.vars || theme).shadows[elevation],\n ...(theme.vars && {\n '--Paper-overlay': theme.vars.overlays?.[elevation]\n }),\n ...(!theme.vars && theme.palette.mode === 'dark' && {\n '--Paper-overlay': `linear-gradient(${alpha('#fff', getOverlayAlpha(elevation))}, ${alpha('#fff', getOverlayAlpha(elevation))})`\n })\n }),\n ...other.style\n }\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? Paper.propTypes /* remove-proptypes */ = {\n // \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Warning \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n // \u2502 These PropTypes are generated from the TypeScript type definitions. \u2502\n // \u2502 To update them, edit the d.ts file and run `pnpm proptypes`. \u2502\n // \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * Shadow depth, corresponds to `dp` in the spec.\n * It accepts values between 0 and 24 inclusive.\n * @default 1\n */\n elevation: chainPropTypes(integerPropType, props => {\n const {\n elevation,\n variant\n } = props;\n if (elevation > 0 && variant === 'outlined') {\n return new Error(`MUI: Combining \\`elevation={${elevation}}\\` with \\`variant=\"${variant}\"\\` has no effect. Either use \\`elevation={0}\\` or use a different \\`variant\\`.`);\n }\n return null;\n }),\n /**\n * If `true`, rounded corners are disabled.\n * @default false\n */\n square: PropTypes.bool,\n /**\n * @ignore\n */\n style: PropTypes.object,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * The variant to use.\n * @default 'elevation'\n */\n variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['elevation', 'outlined']), PropTypes.string])\n} : void 0;\nexport default Paper;", "import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getPaperUtilityClass(slot) {\n return generateUtilityClass('MuiPaper', slot);\n}\nconst paperClasses = generateUtilityClasses('MuiPaper', ['root', 'rounded', 'outlined', 'elevation', 'elevation0', 'elevation1', 'elevation2', 'elevation3', 'elevation4', 'elevation5', 'elevation6', 'elevation7', 'elevation8', 'elevation9', 'elevation10', 'elevation11', 'elevation12', 'elevation13', 'elevation14', 'elevation15', 'elevation16', 'elevation17', 'elevation18', 'elevation19', 'elevation20', 'elevation21', 'elevation22', 'elevation23', 'elevation24']);\nexport default paperClasses;", "export const defaultStyles = {\n transition: 'none'\n};\nexport function resolveReducedMotionStyles(reducedMotion, styles) {\n if (reducedMotion === 'always') {\n return styles;\n }\n if (reducedMotion === 'system') {\n return {\n '@media (prefers-reduced-motion: reduce)': styles\n };\n }\n return null;\n}", "import { defaultStyles, resolveReducedMotionStyles } from \"../styles/reducedMotion.mjs\";\nexport const reflow = node => node.scrollTop;\nconst DEFAULT_TRANSLATE_OFFSET = {\n offsetX: 0,\n offsetY: 0\n};\nconst EMPTY_STYLE = {};\nconst DEFAULT_TRANSITION_PROPS = ['all'];\nconst EMPTY_OPTIONS = {};\nconst transformOffsetIndexes = {\n matrix: [4, 5],\n matrix3d: [12, 13],\n translate: [0, 1],\n translate3d: [0, 1],\n translateX: [0, null],\n translateY: [null, 0]\n};\nfunction parseTranslateValue(value) {\n const parsedValue = parseFloat(value ?? '');\n return Number.isNaN(parsedValue) ? 0 : parsedValue;\n}\nfunction parseTransform(transform) {\n const match = transform.match(/^(matrix|matrix3d|translate|translate3d|translateX|translateY)\\((.+)\\)$/);\n if (!match) {\n return null;\n }\n return {\n type: match[1],\n values: match[2].split(',').map(parseTranslateValue)\n };\n}\nfunction getTranslateOffsetValue(values, index) {\n return index === null ? 0 : values[index] || 0;\n}\n\n/**\n * Extracts the x/y translation from a CSS transform string.\n *\n * Transition components use these offsets when calculating off-screen positions:\n * if an element is already translated, the distance needed to hide it must start\n * from that visual position instead of its untransformed layout position.\n *\n * CSSOM commonly serializes translations as matrix() or matrix3d(), while inline\n * gesture styles may use translate(), translate3d(), translateX(), or\n * translateY(). This helper normalizes those supported forms into numeric pixel\n * offsets and returns zero offsets for empty, none, or unsupported transforms.\n */\nexport function getTranslateOffsets(transform) {\n if (!transform || transform === 'none') {\n return DEFAULT_TRANSLATE_OFFSET;\n }\n const parsedTransform = parseTransform(transform);\n if (!parsedTransform) {\n return DEFAULT_TRANSLATE_OFFSET;\n }\n const {\n type,\n values\n } = parsedTransform;\n const offsetIndexes = transformOffsetIndexes[type];\n if (!offsetIndexes) {\n return DEFAULT_TRANSLATE_OFFSET;\n }\n return {\n offsetX: getTranslateOffsetValue(values, offsetIndexes[0]),\n offsetY: getTranslateOffsetValue(values, offsetIndexes[1])\n };\n}\nexport function normalizedTransitionCallback(nodeRef, callback) {\n return maybeIsAppearing => {\n if (callback) {\n const node = nodeRef.current;\n // Enter callbacks receive isAppearing; exit callbacks do not.\n if (maybeIsAppearing === undefined) {\n callback(node);\n } else {\n callback(node, maybeIsAppearing);\n }\n }\n };\n}\n/**\n * Return the child style for a transition. Reuse predefined style objects when\n * no custom styles are present so memoized children see the same object.\n */\nexport function getTransitionChildStyle(state, inProp, baseStyles, hiddenStyles, styleProp, childStyle) {\n const base = state === 'exited' && !inProp ? hiddenStyles : baseStyles[state] || baseStyles.exited;\n return styleProp || childStyle ? {\n ...base,\n ...styleProp,\n ...childStyle\n } : base;\n}\nexport function getTransitionProps(props, options) {\n const {\n timeout,\n easing,\n style = EMPTY_STYLE\n } = props;\n return {\n duration: style.transitionDuration ?? (typeof timeout === 'number' ? timeout : timeout[options.mode] || 0),\n easing: style.transitionTimingFunction ?? (typeof easing === 'object' ? easing[options.mode] : easing),\n delay: style.transitionDelay\n };\n}\n\n/**\n * Returns CSS that disables component-owned transitions when reduced motion is active.\n * Pass custom styles only when the default `transition: none` reset is not enough.\n */\nexport function getReducedMotionStyles(theme, styles) {\n const resolvedStyles = styles ?? defaultStyles;\n return resolveReducedMotionStyles(theme.motion?.reducedMotion, resolvedStyles);\n}\nexport function getTransitionStyles(theme, props = DEFAULT_TRANSITION_PROPS, options = EMPTY_OPTIONS) {\n const transition = theme.transitions?.create?.(props, options);\n const reducedMotionStyles = getReducedMotionStyles(theme);\n if (transition === undefined) {\n return reducedMotionStyles ?? EMPTY_STYLE;\n }\n const transitionStyles = {\n transition\n };\n return reducedMotionStyles ? {\n ...transitionStyles,\n ...reducedMotionStyles\n } : transitionStyles;\n}", "import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getAppBarUtilityClass(slot) {\n return generateUtilityClass('MuiAppBar', slot);\n}\nconst appBarClasses = generateUtilityClasses('MuiAppBar', ['root', 'positionFixed', 'positionAbsolute', 'positionSticky', 'positionStatic', 'positionRelative', 'colorDefault', 'colorPrimary', 'colorSecondary', 'colorInherit', 'colorTransparent', 'colorError', 'colorInfo', 'colorSuccess', 'colorWarning']);\nexport default appBarClasses;", "import React from 'react'\n\nimport { LoadingEllipses } from '@jbrowse/core/ui'\nimport { makeStyles } from '@jbrowse/core/util/tss-react'\nimport { Button, CircularProgress, Typography } from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport type { MsaViewModel } from '../model.ts'\n\nconst useStyles = makeStyles()({\n page: {\n display: 'flex',\n alignItems: 'center',\n gap: 12,\n padding: 20,\n },\n header: {\n display: 'flex',\n alignItems: 'center',\n gap: 4,\n margin: 'auto',\n marginLeft: 10,\n },\n})\n\n/**\n * The model's status line with its Cancel button: a spinner and a heading in\n * place of the view while it loads, or a line in the header afterwards, which\n * disappears when there is no status.\n */\nconst StatusMessage = observer(function ({\n model,\n variant,\n}: {\n model: MsaViewModel\n variant: 'page' | 'header'\n}) {\n const { status } = model\n const { classes } = useStyles()\n if (variant === 'header' && !status) {\n return null\n }\n const message = status?.msg ?? 'Loading...'\n const onCancel = status?.onCancel\n return (\n <div className={classes[variant]}>\n {variant === 'page' ? (\n <>\n <CircularProgress size={24} />\n <Typography variant=\"h6\">{message}</Typography>\n </>\n ) : (\n <LoadingEllipses message={message} component=\"span\" />\n )}\n {onCancel ? (\n <Button\n variant={variant === 'page' ? 'outlined' : 'text'}\n size=\"small\"\n onClick={() => {\n onCancel()\n }}\n >\n Cancel\n </Button>\n ) : null}\n </div>\n )\n})\n\nexport default StatusMessage\n", "import React from 'react'\n\nimport { makeStyles } from '@jbrowse/core/util/tss-react'\nimport { Typography } from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport type { MsaViewModel } from '../../model.ts'\n\nconst useStyles = makeStyles()({\n container: {\n display: 'flex',\n overflow: 'hidden',\n margin: 'auto',\n marginLeft: 10,\n },\n nameFirst: {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n minWidth: 0,\n },\n nameRest: {\n whiteSpace: 'nowrap',\n flexShrink: 0,\n },\n})\n\nconst HeaderInfoArea = observer(function ({ model }: { model: MsaViewModel }) {\n const { mouseOverRowName, mouseCol } = model\n const { classes } = useStyles()\n if (!mouseOverRowName || mouseCol === undefined) {\n return null\n }\n const mid = Math.floor(mouseOverRowName.length / 2)\n const pos = model.visibleColToSeqPosOneBased(mouseOverRowName, mouseCol)\n const letter = model.visibleColToRowLetter(mouseOverRowName, mouseCol)\n return (\n <Typography\n component=\"div\"\n className={classes.container}\n title={mouseOverRowName}\n >\n <span className={classes.nameFirst}>\n {mouseOverRowName.slice(0, mid)}\n </span>\n <span className={classes.nameRest}>\n {mouseOverRowName.slice(mid)}:{pos} ({letter})\n </span>\n </Typography>\n )\n})\n\nexport default HeaderInfoArea\n", "import React, { lazy } from 'react'\n\nimport { Chip, Tooltip } from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport type { MsaViewModel } from '../../model.ts'\n\nconst GapThresholdDialog = lazy(\n () => import('../dialogs/GapThresholdDialog.tsx'),\n)\n\nconst HiddenColumnsChip = observer(function ({\n model,\n}: {\n model: MsaViewModel\n}) {\n const n = model.blanks.length\n return n > 0 ? (\n <Tooltip\n title={`Hiding columns with \u2265${model.allowedGappyness}% gaps. Click to change the threshold, \u00D7 to show every column`}\n >\n <Chip\n data-testid=\"hidden_columns_chip\"\n size=\"small\"\n variant=\"outlined\"\n label={`${n.toLocaleString('en-US')} gappy column${n === 1 ? '' : 's'} hidden`}\n style={{ margin: 'auto 8px', flexShrink: 0 }}\n onClick={() => {\n model.queueDialog(onClose => [GapThresholdDialog, { model, onClose }])\n }}\n onDelete={() => {\n model.setHideGaps(false)\n }}\n />\n </Tooltip>\n ) : null\n})\n\nexport default HiddenColumnsChip\n", "import React from 'react'\n\nimport Warning from '@mui/icons-material/Warning'\nimport { Button, Tooltip } from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport type { MsaViewModel } from '../../model.ts'\n\n// A failed optional layer, such as a 404 on the annotations or row metadata\n// that is not JSON, shows here as a dismissible warning. Setting `error` would\n// clear dataInitialized and hide the loaded alignment.\nconst LoadWarnings = observer(function ({ model }: { model: MsaViewModel }) {\n const { warnings } = model\n if (warnings.length === 0) {\n return null\n }\n return (\n <Tooltip title={`${warnings.join(' ')} (click to dismiss)`}>\n <Button\n aria-label=\"Dismiss warnings\"\n color=\"warning\"\n size=\"small\"\n startIcon={<Warning fontSize=\"small\" />}\n style={{ margin: 'auto', marginLeft: 10, whiteSpace: 'nowrap' }}\n onClick={() => {\n model.clearWarnings()\n }}\n >\n {warnings.length > 1 ? `${warnings.length} warnings` : 'Warning'}\n </Button>\n </Tooltip>\n )\n})\n\nexport default LoadWarnings\n", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z\"\n}), 'Warning');", "import React from 'react'\n\nimport CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton'\nimport Build from '@mui/icons-material/Build'\nimport Help from '@mui/icons-material/Help'\nimport InsertDriveFile from '@mui/icons-material/InsertDriveFile'\nimport Visibility from '@mui/icons-material/Visibility'\nimport { Tooltip } from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport {\n fileMenuItems,\n helpMenuItems,\n toolsMenuItems,\n viewMenuItems,\n} from './menuBarItems.ts'\n\nimport type { MsaViewModel } from '../../model.ts'\nimport type { MenuItem } from '@jbrowse/core/ui/Menu'\nimport type { SxProps, Theme } from '@mui/material'\n\n// CascadingMenuButton renders an IconButton on every core a host may ship, so\n// these styles give it the look of a small text Button\nconst menuButtonSx: SxProps<Theme> = {\n borderRadius: 1,\n typography: 'button',\n color: 'text.primary',\n px: 1,\n py: 0.5,\n}\n\nconst menus: [string, (model: MsaViewModel) => MenuItem[], React.ReactNode][] =\n [\n ['File', fileMenuItems, <InsertDriveFile key=\"file\" />],\n ['View', viewMenuItems, <Visibility key=\"view\" />],\n ['Tools', toolsMenuItems, <Build key=\"tools\" />],\n ['Help', helpMenuItems, <Help key=\"help\" />],\n ]\n\nconst MenuBar = observer(function ({ model }: { model: MsaViewModel }) {\n const { embeddedMode } = model\n return menus.map(([name, items, icon]) => {\n const button = (\n <CascadingMenuButton\n key={name}\n data-testid={`${name.toLowerCase()}_menu`}\n aria-label={name}\n menuItems={items(model)}\n sx={menuButtonSx}\n >\n {embeddedMode ? icon : name}\n </CascadingMenuButton>\n )\n return embeddedMode ? (\n <Tooltip key={name} title={name}>\n {button}\n </Tooltip>\n ) : (\n button\n )\n })\n})\n\nexport default MenuBar\n", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"m22.7 19-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4\"\n}), 'Build');", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm7 7V3.5L18.5 9z\"\n}), 'InsertDriveFile');", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3\"\n}), 'Visibility');", "import { lazy } from 'react'\n\nimport { maxNeighborJoiningRows, treeOrders } from '../../constants.ts'\nimport { canGoTo } from '../dialogs/GoToBox.tsx'\nimport { scrollZoomLabel } from './ScrollZoomCheckbox.tsx'\nimport { colorSchemeMenuItems } from './colorSchemeMenuItems.ts'\nimport { openAnnotationFileItem } from './getAnnotationsMenu.ts'\n\nimport type { MsaViewModel } from '../../model.ts'\nimport type { TreeOrder } from '../../types.ts'\nimport type { ChoiceDisplay } from '../settings/MenuItemsForm.tsx'\nimport type { MenuItem } from '@jbrowse/core/ui/Menu'\n\nconst AboutDialog = lazy(() => import('../dialogs/AboutDialog.tsx'))\nconst ExportSVGDialog = lazy(() => import('../dialogs/ExportSVGDialog.tsx'))\nconst GapThresholdDialog = lazy(\n () => import('../dialogs/GapThresholdDialog.tsx'),\n)\nconst GoToDialog = lazy(() => import('../dialogs/GoToDialog.tsx'))\nconst HelpDialog = lazy(() => import('../dialogs/HelpDialog.tsx'))\nconst MetadataDialog = lazy(() => import('../dialogs/MetadataDialog.tsx'))\n\nconst tutorialsUrl = 'https://gmod.org/JBrowseMSA/tutorials/'\n\nfunction radio(label: string, checked: boolean, onClick: () => void) {\n return { label, type: 'radio' as const, checked, onClick }\n}\n\nfunction toggle(label: string, checked: boolean, set: (arg: boolean) => void) {\n return {\n label,\n type: 'checkbox' as const,\n checked,\n onClick: () => {\n set(!checked)\n },\n }\n}\n\nfunction action(label: string, onClick: () => void, disabled = false) {\n return { label, onClick, disabled }\n}\n\nfunction subMenu(label: string, items: MenuItem[], display?: ChoiceDisplay) {\n return { label, type: 'subMenu' as const, subMenu: items, display }\n}\n\nfunction when<T>(cond: boolean, items: T[]) {\n return cond ? items : []\n}\n\nexport function fileMenuItems(model: MsaViewModel): MenuItem[] {\n return [\n ...when(!!model.importForm, [\n action('Open alignment\u2026', () => {\n model.reset()\n }),\n ]),\n openAnnotationFileItem(model),\n action('Export as SVG\u2026', () => {\n model.queueDialog(onClose => [ExportSVGDialog, { onClose, model }])\n }),\n ...when(!model.tree.noTree, [\n action('Export tree as Newick', () => {\n model.exportNewick()\n }),\n ]),\n action('Alignment info\u2026', () => {\n model.queueDialog(onClose => [MetadataDialog, { model, onClose }])\n }),\n ]\n}\n\nfunction zoomSubMenu(model: MsaViewModel): MenuItem[] {\n return [\n action('Zoom in', () => {\n model.zoomIn()\n }),\n action('Zoom out', () => {\n model.zoomOut()\n }),\n action('Fit to window', () => {\n model.fit()\n }),\n action('Fit width', () => {\n model.fitHorizontally()\n }),\n action('Fit height', () => {\n model.fitVertically()\n }),\n action('Reset zoom', () => {\n model.resetZoom()\n }),\n toggle(scrollZoomLabel, model.scrollZoom, arg => {\n model.setScrollZoom(arg)\n }),\n ]\n}\n\nconst gapPresets = [100, 90, 50]\n\nexport function gapsSubMenu(model: MsaViewModel): MenuItem[] {\n const { hideGaps, allowedGappyness } = model\n const custom = hideGaps && !gapPresets.includes(allowedGappyness)\n return [\n subMenu(\n 'Gappy columns',\n [\n radio('Show all columns', !hideGaps, () => {\n model.setHideGaps(false)\n }),\n ...gapPresets.map(pct =>\n radio(\n pct === 100 ? 'Hide columns of only gaps' : `Hide \u2265${pct}% gaps`,\n hideGaps && allowedGappyness === pct,\n () => {\n model.setHideGaps(true)\n model.setAllowedGappyness(pct)\n },\n ),\n ),\n {\n ...radio(\n custom ? `Hide \u2265${allowedGappyness}% gaps\u2026` : 'Custom threshold\u2026',\n custom,\n () => {\n model.setHideGaps(true)\n model.queueDialog(onClose => [\n GapThresholdDialog,\n { model, onClose },\n ])\n },\n ),\n keepMenuOpen: false,\n },\n ],\n 'select',\n ),\n ]\n}\n\nconst treeOrderLabels: Record<TreeOrder, string> = {\n branchLength: 'By branch length',\n input: 'Input order',\n ladderize: 'Ladderize, small clades first',\n ladderizeReverse: 'Ladderize, large clades first',\n}\n\nfunction outgroupLabel(outgroup: string[]) {\n const [first, ...rest] = outgroup\n return rest.length === 0\n ? `Outgroup ${first}`\n : `Outgroup ${first} \u2026 ${rest.at(-1)}`\n}\n\nexport function treeSubMenu(model: MsaViewModel): MenuItem[] {\n const {\n drawTree,\n showBranchLen,\n labelsAlignRight,\n drawNodeLabels,\n drawLabels,\n treeAreaWidth,\n showTreeOverview,\n showTreeScaleBar,\n treeOrder,\n treeRoot,\n rotated,\n } = model\n return [\n subMenu(\n 'Layout',\n [\n radio('Phylogram', drawTree && showBranchLen, () => {\n model.setDrawTree(true)\n model.setShowBranchLen(true)\n }),\n radio('Cladogram', drawTree && !showBranchLen, () => {\n model.setDrawTree(true)\n model.setShowBranchLen(false)\n }),\n radio('Labels only', !drawTree, () => {\n model.setDrawTree(false)\n }),\n ],\n 'segmented',\n ),\n toggle('Tree overview', showTreeOverview, arg => {\n model.setShowTreeOverview(arg)\n }),\n toggle('Scale bar', showTreeScaleBar, arg => {\n model.setShowTreeScaleBar(arg)\n }),\n subMenu(\n 'Order',\n [\n ...treeOrders.map(order =>\n radio(treeOrderLabels[order], treeOrder === order, () => {\n model.setTreeOrder(order)\n }),\n ),\n ...when(rotated.length > 0, [\n action('Undo rotations', () => {\n model.clearRotated()\n }),\n ]),\n ],\n 'select',\n ),\n subMenu(\n 'Root',\n [\n radio('Input root', treeRoot === undefined, () => {\n model.setTreeRoot(undefined)\n }),\n radio('Midpoint', treeRoot === 'midpoint', () => {\n model.setTreeRoot('midpoint')\n }),\n // \"Reroot here\" in a node's menu sets the outgroup, so this only\n // reports it\n ...when(typeof treeRoot === 'object', [\n {\n ...radio(\n typeof treeRoot === 'object'\n ? outgroupLabel(treeRoot.outgroup)\n : '',\n true,\n () => {},\n ),\n disabled: true,\n },\n ]),\n ],\n 'select',\n ),\n subMenu('Labels', [\n toggle('Tip labels', drawLabels, arg => {\n model.setDrawLabels(arg)\n }),\n toggle('Internal node labels', drawNodeLabels, arg => {\n model.setDrawNodeLabels(arg)\n }),\n toggle('Align right', labelsAlignRight, arg => {\n model.setLabelsAlignRight(arg)\n }),\n ]),\n ...when(treeAreaWidth !== undefined, [\n action('Reset tree width', () => {\n model.setTreeAreaWidth(undefined)\n }),\n ]),\n ]\n}\n\nexport function viewMenuItems(model: MsaViewModel): MenuItem[] {\n return [\n ...when(canGoTo(model), [\n action('Find row or column\u2026', () => {\n model.queueDialog(onClose => [GoToDialog, { model, onClose }])\n }),\n ]),\n subMenu('Zoom', zoomSubMenu(model)),\n ]\n}\n\nexport function trackSettingsItems(model: MsaViewModel): MenuItem[] {\n return [\n toggle('Show track values on hover', model.showColumnStats, arg => {\n model.setShowColumnStats(arg)\n }),\n ]\n}\n\n// the settings panel's toggles for how the alignment draws\nexport function alignmentSettingsItems(model: MsaViewModel): MenuItem[] {\n return [\n toggle('Show letters', model.drawMsaLetters, arg => {\n model.setDrawMsaLetters(arg)\n }),\n ]\n}\n\n// who colors the cells comes first, since a scheme picked while the domains\n// fill them would otherwise change nothing on screen\nexport function colorSettingsItems(model: MsaViewModel): MenuItem[] {\n const { cellFill, filteredAnnotations } = model\n return [\n subMenu(\n 'Fill cells with',\n [\n radio('Residues', cellFill === 'residue', () => {\n model.setCellFill('residue')\n }),\n ...when(filteredAnnotations.length > 0, [\n radio('Domains', cellFill === 'domain', () => {\n model.setShowDomains(true)\n model.setCellFill('domain')\n }),\n ]),\n {\n ...radio('Nothing', cellFill === 'none', () => {\n model.setCellFill('none')\n }),\n helpText: 'Color the letters instead',\n },\n ],\n 'segmented',\n ),\n {\n type: 'subHeader',\n label:\n cellFill === 'domain'\n ? 'Residue scheme: picking one takes the cells back from the domains'\n : 'Residue scheme',\n },\n ...colorSchemeMenuItems(model),\n ]\n}\n\nfunction neighborJoiningItem(model: MsaViewModel): MenuItem {\n const rows = model.rowMap.size\n const tooManyRows = rows > maxNeighborJoiningRows\n return action(\n tooManyRows\n ? `Build neighbor joining tree (over ${maxNeighborJoiningRows} rows, use FastTree)`\n : model.noTree\n ? 'Build neighbor joining tree'\n : 'Replace with neighbor joining tree',\n () => {\n try {\n model.calculateNeighborJoiningTreeFromMSA()\n } catch (e) {\n console.error('Failed to calculate NJ tree:', e)\n model.addWarning(e instanceof Error ? e.message : String(e))\n }\n },\n tooManyRows || rows < 2,\n )\n}\n\nexport function toolsMenuItems(model: MsaViewModel): MenuItem[] {\n return [neighborJoiningItem(model)]\n}\n\nexport function helpMenuItems(model: MsaViewModel): MenuItem[] {\n return [\n action('Mouse & keyboard\u2026', () => {\n model.queueDialog(onClose => [HelpDialog, { model, onClose }])\n }),\n action('Tutorials', () => {\n window.open(tutorialsUrl, '_blank', 'noopener,noreferrer')\n }),\n action('About & credits\u2026', () => {\n model.queueDialog(onClose => [AboutDialog, { onClose }])\n }),\n ]\n}\n", "import React from 'react'\n\nimport { Checkbox, FormControlLabel, Tooltip } from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport type { MsaViewModel } from '../../model.ts'\n\n// the label and the control jbrowse-components' ScrollZoomToggle uses, kept\n// local because a host's older core lacks that export\nexport const scrollZoomLabel = 'Zoom on scroll'\n\nconst scrollZoomHelp =\n 'The mouse wheel zooms the alignment instead of scrolling it; shift+scroll still scrolls. ctrl+scroll (\u2318+scroll on a Mac) zooms either way.'\n\nconst ScrollZoomCheckbox = observer(function ({\n model,\n}: {\n model: MsaViewModel\n}) {\n return (\n <Tooltip title={scrollZoomHelp} describeChild>\n <FormControlLabel\n data-testid=\"scroll-zoom-toggle\"\n style={{\n marginLeft: 4,\n marginRight: model.embeddedMode ? 0 : 8,\n whiteSpace: 'nowrap',\n }}\n control={\n <Checkbox\n size=\"small\"\n checked={model.scrollZoom}\n onChange={() => {\n model.setScrollZoom(!model.scrollZoom)\n }}\n style={{ padding: 6 }}\n />\n }\n label={model.embeddedMode ? '' : scrollZoomLabel}\n slotProps={{ typography: { variant: 'body2' } }}\n />\n </Tooltip>\n )\n})\n\nexport default ScrollZoomCheckbox\n", "import type { MsaViewModel } from '../../model.ts'\nimport type { MenuItem } from '@jbrowse/core/ui/Menu'\n\ntype Alphabet = 'any' | 'nucleotide' | 'protein'\n\ninterface SchemeEntry {\n name: string\n label: string\n alphabet: Alphabet\n // shown at the top level for its alphabet, the rest under More schemes\n featured?: boolean\n}\n\nconst schemes: SchemeEntry[] = [\n { name: 'maeditor', label: 'MAEditor', alphabet: 'protein', featured: true },\n {\n name: 'clustalx_protein',\n label: 'Clustal X',\n alphabet: 'protein',\n featured: true,\n },\n {\n name: 'clustalx_protein_dynamic',\n label: 'Clustal X, by column conservation',\n alphabet: 'protein',\n featured: true,\n },\n {\n name: 'blosum62_dynamic',\n label: 'BLOSUM62 similarity',\n alphabet: 'protein',\n featured: true,\n },\n {\n name: 'jalview_hydrophobicity',\n label: 'Hydrophobicity',\n alphabet: 'protein',\n featured: true,\n },\n {\n name: 'nucleotide',\n label: 'Nucleotide',\n alphabet: 'nucleotide',\n featured: true,\n },\n {\n name: 'rainbow_dna',\n label: 'Rainbow',\n alphabet: 'nucleotide',\n featured: true,\n },\n {\n name: 'percent_identity_dynamic',\n label: 'Percent identity',\n alphabet: 'any',\n featured: true,\n },\n { name: 'none', label: 'None', alphabet: 'any', featured: true },\n { name: 'clustal', label: 'Clustal', alphabet: 'protein' },\n { name: 'lesk', label: 'Lesk', alphabet: 'protein' },\n { name: 'flower', label: 'Flower', alphabet: 'protein' },\n { name: 'cinema', label: 'Cinema', alphabet: 'protein' },\n { name: 'jalview_zappo', label: 'Zappo', alphabet: 'protein' },\n { name: 'jalview_taylor', label: 'Taylor', alphabet: 'protein' },\n { name: 'jalview_buried', label: 'Buried index', alphabet: 'protein' },\n { name: 'jalview_prophelix', label: 'Helix propensity', alphabet: 'protein' },\n {\n name: 'jalview_propstrand',\n label: 'Strand propensity',\n alphabet: 'protein',\n },\n { name: 'jalview_propturn', label: 'Turn propensity', alphabet: 'protein' },\n { name: 'clustalx_dna', label: 'Clustal X (DNA)', alphabet: 'nucleotide' },\n { name: 'jbrowse_dna', label: 'JBrowse (DNA)', alphabet: 'nucleotide' },\n]\n\nexport const catalogedSchemeNames = schemes.map(s => s.name)\n\n// While a `customColorScheme` map is set, a checked Custom entry stands for it\n// and no named scheme is checked. Picking a named scheme clears the map. The\n// active scheme always shows at the top level.\nexport function colorSchemeMenuItems(model: MsaViewModel): MenuItem[] {\n const { colorSchemeName, customColorScheme, sequenceType } = model\n const alphabet = sequenceType === 'amino' ? 'protein' : 'nucleotide'\n function radio(entry: SchemeEntry) {\n return {\n label: entry.label,\n type: 'radio',\n checked: !customColorScheme && colorSchemeName === entry.name,\n onClick: () => {\n model.setColorSchemeName(entry.name)\n // a scheme picked while the domains fill the cells would color\n // nothing, so the pick hands the cells back to the residues\n if (model.cellFill === 'domain') {\n model.setCellFill('residue')\n }\n },\n } as const\n }\n const top = (e: SchemeEntry) =>\n (e.featured && (e.alphabet === 'any' || e.alphabet === alphabet)) ||\n (!customColorScheme && e.name === colorSchemeName)\n return [\n ...(customColorScheme\n ? [\n {\n label: 'Custom',\n type: 'radio',\n checked: true,\n onClick: () => {},\n } as const,\n ]\n : []),\n ...schemes.filter(top).map(radio),\n {\n label: 'More schemes',\n type: 'subMenu',\n subMenu: schemes.filter(e => !top(e)).map(radio),\n },\n ]\n}\n", "import { lazy } from 'react'\n\nimport type { MsaViewModel } from '../../model.ts'\nimport type { MenuItem } from '@jbrowse/core/ui/Menu'\n\nconst FeatureFilterDialog = lazy(() => import('../dialogs/FeatureDialog.tsx'))\nconst AnnotationFileDialog = lazy(\n () => import('../dialogs/AnnotationFileDialog.tsx'),\n)\n\nexport function openAnnotationFileItem(model: MsaViewModel): MenuItem {\n return {\n label: 'Open annotation file\u2026',\n onClick: () => {\n model.queueDialog(handleClose => [\n AnnotationFileDialog,\n { handleClose, model },\n ])\n },\n }\n}\n\nexport function annotationsSubMenu(model: MsaViewModel): MenuItem[] {\n const { showDomains, actuallyShowDomains, subFeatureRows } = model\n return [\n {\n label: 'Show annotations',\n type: 'checkbox',\n checked: actuallyShowDomains,\n onClick: () => {\n model.setShowDomains(!showDomains)\n },\n },\n {\n label: 'Sub-row layout',\n type: 'checkbox',\n disabled: !actuallyShowDomains,\n checked: actuallyShowDomains && subFeatureRows,\n onClick: () => {\n model.setSubFeatureRows(!subFeatureRows)\n },\n },\n ...typeItems(model),\n ]\n}\n\n// up to this many types list inline, one checkbox each; past it the filter\n// dialog, which searches and counts them, takes over\nconst inlineTypes = 12\n\nfunction typeItems(model: MsaViewModel): MenuItem[] {\n const types = [...model.annotationTypes.values()]\n return types.length <= inlineTypes\n ? [\n { type: 'subHeader', label: 'Types' },\n ...types.map(({ accession, name }) => ({\n label: name || accession,\n type: 'checkbox' as const,\n checked: !model.featureOff(accession),\n onClick: () => {\n model.setFilter(accession, model.featureOff(accession))\n },\n })),\n ]\n : [\n {\n label: 'Filter annotations\u2026',\n onClick: () => {\n model.queueDialog(onClose => [\n FeatureFilterDialog,\n { onClose, model },\n ])\n },\n },\n ]\n}\n", "import React from 'react'\n\nimport { MenuItem, TextField } from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport type { MsaViewModel } from '../../model.ts'\n\nconst MultiAlignmentSelector = observer(function ({\n model,\n}: {\n model: MsaViewModel\n}) {\n const { currentAlignment, alignmentNames } = model\n // names (gf.DE) can repeat, so disambiguate duplicates by occurrence to get a\n // collision-free key tied to content rather than position: this survives the\n // list being replaced (new file) without React reusing stale MenuItem DOM.\n // value stays the index because selection is positional in the model.\n const seen = new Map<string, number>()\n return alignmentNames.length > 0 ? (\n <TextField\n select\n variant=\"outlined\"\n value={currentAlignment}\n size=\"small\"\n onChange={event => {\n model.setCurrentAlignment(+event.target.value)\n }}\n >\n {alignmentNames.map((option, index) => {\n const n = seen.get(option) ?? 0\n seen.set(option, n + 1)\n return (\n <MenuItem key={n === 0 ? option : `${option}\u0000${n}`} value={index}>\n {option}\n </MenuItem>\n )\n })}\n </TextField>\n ) : null\n})\nexport default MultiAlignmentSelector\n", "import React, { useState } from 'react'\n\nimport ArrowDropDown from '@mui/icons-material/ArrowDropDown'\nimport Clear from '@mui/icons-material/Clear'\nimport ContentCopy from '@mui/icons-material/ContentCopy'\nimport ZoomIn from '@mui/icons-material/ZoomIn'\nimport {\n Button,\n ListItemIcon,\n ListItemText,\n Menu,\n MenuItem,\n Tooltip,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport copy from '../../vendor/copyToClipboard.ts'\n\nimport type { MsaViewModel } from '../../model.ts'\n\nfunction count(n: number, noun: string) {\n return `${n.toLocaleString('en-US')} ${noun}${n === 1 ? '' : 's'}`\n}\n\n/**\n * The selected block's size, as a button opening what to do with it. It\n * renders only while there is a selection. Header.tsx puts it in the slot\n * with no width of its own, so the label ellipsizes before it could wrap the\n * header onto a second line.\n */\nconst SelectionMenu = observer(function ({ model }: { model: MsaViewModel }) {\n const [anchorEl, setAnchorEl] = useState<HTMLElement>()\n const { selectionSize, selectionFileSpan } = model\n if (!selectionSize || !selectionFileSpan) {\n return null\n }\n const label = `${count(selectionSize.columns, 'column')} \u00D7 ${count(selectionSize.rows, 'row')}`\n const items = [\n {\n text: 'Copy as FASTA',\n Icon: ContentCopy,\n act: () => {\n copy(model.selectionFasta)\n },\n },\n {\n text: 'Zoom to selection',\n Icon: ZoomIn,\n act: () => {\n model.zoomToSelection()\n },\n },\n {\n text: 'Clear selection',\n Icon: Clear,\n act: () => {\n model.clearSelection()\n },\n },\n ]\n return (\n <>\n <Tooltip\n title={`Columns ${selectionFileSpan.start}-${selectionFileSpan.end} selected. Shift-drag the alignment to select, Escape to clear`}\n >\n <Button\n size=\"small\"\n aria-label={`Selection: ${label}`}\n endIcon={<ArrowDropDown />}\n onClick={event => {\n setAnchorEl(event.currentTarget)\n }}\n style={{\n margin: 'auto 0 auto 8px',\n flexShrink: 0,\n maxWidth: '100%',\n minWidth: 0,\n textTransform: 'none',\n whiteSpace: 'nowrap',\n }}\n >\n <span style={{ overflow: 'hidden', textOverflow: 'ellipsis' }}>\n {label}\n </span>\n </Button>\n </Tooltip>\n {anchorEl ? (\n <Menu\n anchorEl={anchorEl}\n open\n transitionDuration={0}\n onClose={() => {\n setAnchorEl(undefined)\n }}\n >\n {items.map(({ text, Icon, act }) => (\n <MenuItem\n key={text}\n dense\n onClick={() => {\n act()\n setAnchorEl(undefined)\n }}\n >\n <ListItemIcon>\n <Icon fontSize=\"small\" />\n </ListItemIcon>\n <ListItemText>{text}</ListItemText>\n </MenuItem>\n ))}\n </Menu>\n ) : null}\n </>\n )\n})\n\nexport default SelectionMenu\n", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n}), 'Clear');", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z\"\n}), 'ContentCopy');", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon([/*#__PURE__*/_jsx(\"path\", {\n d: \"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14\"\n}, \"0\"), /*#__PURE__*/_jsx(\"path\", {\n d: \"M12 10h-2v2H9v-2H7V9h2V7h1v2h2z\"\n}, \"1\")], 'ZoomIn');", "import React from 'react'\n\nimport { makeStyles } from '@jbrowse/core/util/tss-react'\nimport LinkOff from '@mui/icons-material/LinkOff'\nimport { Tooltip, Typography } from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport type { MsaViewModel } from '../../model.ts'\n\nconst useStyles = makeStyles()(theme => ({\n warning: {\n display: 'flex',\n alignItems: 'center',\n gap: 4,\n margin: 'auto',\n marginLeft: 10,\n whiteSpace: 'nowrap',\n color: theme.palette.warning.main,\n cursor: 'help',\n },\n}))\n\nfunction size(bytes: number) {\n return bytes < 1_000_000\n ? `${Math.round(bytes / 1000)} kB`\n : `${(bytes / 1_000_000).toFixed(1)} MB`\n}\n\n// Lists loaded documents the snapshot, and so a shared URL, omits. See\n// `unshareableData` on the model.\nconst UnshareableDataWarning = observer(function ({\n model,\n}: {\n model: MsaViewModel\n}) {\n const { unshareableData } = model\n const { classes } = useStyles()\n if (unshareableData.length === 0) {\n return null\n }\n const what = unshareableData\n .map(({ what, bytes }) => `${what} (${size(bytes)})`)\n .join(' and the ')\n return (\n <Tooltip\n title={`The ${what} came from this computer and is too large to travel in a URL, so a link to this page opens without it. Serve the file over HTTP and open it by URL to share the view.`}\n >\n <Typography component=\"div\" className={classes.warning}>\n <LinkOff fontSize=\"small\" />\n Not in the link\n </Typography>\n </Tooltip>\n )\n})\n\nexport default UnshareableDataWarning\n", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M17 7h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1 0 1.43-.98 2.63-2.31 2.98l1.46 1.46C20.88 15.61 22 13.95 22 12c0-2.76-2.24-5-5-5m-1 4h-2.19l2 2H16zM2 4.27l3.11 3.11C3.29 8.12 2 9.91 2 12c0 2.76 2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1 0-1.59 1.21-2.9 2.76-3.07L8.73 11H8v2h2.73L13 15.27V17h1.73l4.01 4L20 19.74 3.27 3z\"\n}), 'LinkOff');", "import React from 'react'\n\nimport FitScreen from '@mui/icons-material/FitScreen'\nimport RestartAlt from '@mui/icons-material/RestartAlt'\nimport ZoomIn from '@mui/icons-material/ZoomIn'\nimport ZoomOut from '@mui/icons-material/ZoomOut'\nimport { IconButton, Tooltip } from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport type { MsaViewModel } from '../../model.ts'\n\nconst ZoomControls = observer(function ZoomControls({\n model,\n}: {\n model: MsaViewModel\n}) {\n return (\n <>\n <Tooltip title=\"Zoom in\">\n <IconButton\n aria-label=\"Zoom in\"\n onClick={() => {\n model.zoomIn()\n }}\n >\n <ZoomIn />\n </IconButton>\n </Tooltip>\n <Tooltip title=\"Zoom out\">\n <IconButton\n aria-label=\"Zoom out\"\n onClick={() => {\n model.zoomOut()\n }}\n >\n <ZoomOut />\n </IconButton>\n </Tooltip>\n <Tooltip title=\"Fit the whole alignment in the window\">\n <IconButton\n aria-label=\"Fit to window\"\n onClick={() => {\n model.fit()\n }}\n >\n <FitScreen />\n </IconButton>\n </Tooltip>\n <Tooltip title=\"Reset zoom to the default cell size (0)\">\n <IconButton\n aria-label=\"Reset zoom\"\n onClick={() => {\n model.resetZoom()\n }}\n >\n <RestartAlt />\n </IconButton>\n </Tooltip>\n </>\n )\n})\n\nexport default ZoomControls\n", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M17 4h3c1.1 0 2 .9 2 2v2h-2V6h-3zM4 8V6h3V4H4c-1.1 0-2 .9-2 2v2zm16 8v2h-3v2h3c1.1 0 2-.9 2-2v-2zM7 18H4v-2H2v2c0 1.1.9 2 2 2h3zM18 8H6v8h12z\"\n}), 'FitScreen');", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M12 5V2L8 6l4 4V7c3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93 0-4.42-3.58-8-8-8m-6 8c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91\"\n}), 'RestartAlt');", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14M7 9h5v1H7z\"\n}), 'ZoomOut');", "import React, { useCallback } from 'react'\n\nimport { observer } from 'mobx-react'\n\nimport { useCanvasTheme } from '../../darkReader.ts'\nimport { useCanvasAutorun } from '../../useCanvasAutorun.ts'\nimport DragHandle, { scrollbarThumbFill } from '../DragHandle.tsx'\nimport { msaThumbnail } from '../msa/msaRaster.ts'\nimport {\n MINIMAP_BAR_HEIGHT,\n getMinimapLayout,\n minimapDomainRects,\n} from './minimapLayout.ts'\n\nimport type { MsaViewModel } from '../../model.ts'\n\nconst Minimap = observer(function ({ model }: { model: MsaViewModel }) {\n const { minimapHeight, msaCanvasWidth, highResScaleFactor } = model\n const theme = useCanvasTheme()\n const { unit, s, w, polygonHeight, polygonPoints } = getMinimapLayout(model)\n\n // the whole alignment, sampled down to the bar\n const barWidth = Math.round(msaCanvasWidth * highResScaleFactor)\n const barHeight = Math.round(MINIMAP_BAR_HEIGHT * highResScaleFactor)\n const ref = useCanvasAutorun({\n draw: ctx => {\n ctx.resetTransform()\n ctx.clearRect(0, 0, barWidth, barHeight)\n const thumbnail = msaThumbnail({\n model,\n theme,\n height: MINIMAP_BAR_HEIGHT,\n })\n if (thumbnail) {\n ctx.imageSmoothingEnabled = true\n ctx.drawImage(\n thumbnail,\n 0,\n 0,\n thumbnail.width,\n thumbnail.height,\n 0,\n 0,\n barWidth,\n barHeight,\n )\n }\n for (const r of minimapDomainRects(model, barWidth, barHeight)) {\n ctx.fillStyle = r.fill\n ctx.fillRect(r.x, r.y, r.w, r.h)\n }\n },\n width: barWidth,\n height: barHeight,\n deps: [model, theme],\n })\n\n const onDrag = useCallback(\n (delta: number, startScroll: number) => {\n model.setScrollX(startScroll - delta / unit)\n },\n [model, unit],\n )\n\n return (\n // sized and placed to match the alignment canvas exactly: a minimap that\n // spans a different width than the columns it maps puts its viewport\n // rectangle over the wrong ones\n <div\n style={{\n position: 'relative',\n height: minimapHeight,\n width: msaCanvasWidth,\n flexShrink: 0,\n }}\n >\n <canvas\n ref={ref}\n width={barWidth}\n height={barHeight}\n onPointerDown={event => {\n if (event.button === 0 && unit > 0) {\n const x =\n event.clientX - event.currentTarget.getBoundingClientRect().left\n model.setScrollX(-x / unit + msaCanvasWidth / 2)\n }\n }}\n style={{\n display: 'block',\n width: msaCanvasWidth,\n height: MINIMAP_BAR_HEIGHT,\n boxSizing: 'border-box',\n border: `1px solid ${theme.palette.text.secondary}`,\n }}\n />\n <DragHandle\n axis=\"x\"\n variant=\"thumb\"\n getStart={() => model.scrollX}\n onDrag={onDrag}\n style={{\n top: 0,\n left: Math.max(0, s),\n height: MINIMAP_BAR_HEIGHT,\n width: w,\n }}\n />\n\n <svg height={polygonHeight} width={msaCanvasWidth}>\n <polygon fill={scrollbarThumbFill} points={polygonPoints} />\n </svg>\n </div>\n )\n})\n\nexport default Minimap\n", "import React from 'react'\n\nimport { observer } from 'mobx-react'\n\nimport AnnotationLegend from './AnnotationLegend.tsx'\nimport MSACanvas from './MSACanvas.tsx'\nimport MSAMouseoverCanvas from './MSAMouseoverCanvas.tsx'\n\n// types\nimport type { MsaViewModel } from '../../model.ts'\n\nconst MSAPanel = observer(function ({ model }: { model: MsaViewModel }) {\n return (\n <div style={{ position: 'relative' }}>\n <MSACanvas model={model} />\n <MSAMouseoverCanvas model={model} />\n <AnnotationLegend model={model} />\n </div>\n )\n})\n\nexport default MSAPanel\n", "import React from 'react'\n\nimport ExpandLess from '@mui/icons-material/ExpandLess'\nimport ExpandMore from '@mui/icons-material/ExpandMore'\nimport { IconButton, Paper, Typography } from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport { legendZIndex } from '../../constants.ts'\nimport { legendRows } from './legendRows.ts'\n\nimport type { MsaViewModel } from '../../model.ts'\n\nconst AnnotationLegend = observer(function ({\n model,\n}: {\n model: MsaViewModel\n}) {\n const { legends, showDomainLegend: expanded } = model\n const rows = legendRows(legends)\n const ExpandIcon = expanded ? ExpandLess : ExpandMore\n\n return rows.length > 0 ? (\n <Paper\n elevation={3}\n style={{\n position: 'absolute',\n top: 4,\n right: 4,\n zIndex: legendZIndex,\n maxWidth: 220,\n maxHeight: '60%',\n display: 'flex',\n flexDirection: 'column',\n opacity: 0.95,\n pointerEvents: 'none',\n }}\n >\n <IconButton\n size=\"small\"\n title={expanded ? 'Collapse key' : 'Expand key'}\n style={{\n padding: 1,\n pointerEvents: 'auto',\n ...(expanded && { position: 'absolute', top: 0, right: 0 }),\n }}\n onClick={() => {\n model.setShowDomainLegend(!expanded)\n }}\n >\n <ExpandIcon style={{ fontSize: 14 }} />\n </IconButton>\n {expanded ? (\n <div style={{ overflow: 'auto', padding: '2px 6px 4px' }}>\n {rows.map((row, i) => (\n <div\n key={row.key}\n style={{\n display: 'flex',\n alignItems: 'center',\n gap: 4,\n marginRight: i === 0 ? 18 : 0,\n }}\n >\n {row.color ? (\n <div\n style={{\n width: 9,\n height: 9,\n flexShrink: 0,\n background: row.color,\n }}\n />\n ) : null}\n <Typography\n variant=\"caption\"\n noWrap\n title={\n row.hint && row.hint !== row.label\n ? `${row.label} (${row.hint})`\n : row.label\n }\n style={{\n fontSize: 10,\n lineHeight: 1.4,\n fontWeight: row.color ? undefined : 'bold',\n pointerEvents: 'auto',\n }}\n >\n {row.label}\n </Typography>\n </div>\n ))}\n </div>\n ) : null}\n </Paper>\n ) : null\n})\n\nexport default AnnotationLegend\n", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z\"\n}), 'ExpandLess');", "import React, { useRef } from 'react'\n\nimport { observer } from 'mobx-react'\n\nimport { useWheelScroll } from '../../useWheelScroll.ts'\nimport { zoomSnapshotScale } from '../../zoomSnapshot.ts'\nimport { alignmentAriaLabel } from '../controls.ts'\nimport Loading from './Loading.tsx'\nimport MSACanvasBlock from './MSACanvasBlock.tsx'\nimport { WheelZoomHint, useWheelZoomHint } from './WheelZoomHint.tsx'\nimport { onMsaKey } from './msaKeys.ts'\n\nimport type { MsaViewModel } from '../../model.ts'\n\nconst MSACanvas = observer(function ({ model }: { model: MsaViewModel }) {\n const {\n MSA,\n msaFilehandle,\n height,\n msaCanvasWidth,\n blocks2d,\n scrollX,\n scrollY,\n zoomSnapshot,\n } = model\n const blocks = zoomSnapshot\n ? zoomSnapshot.blocksY.flatMap(by =>\n zoomSnapshot.blocksX.map(bx => [bx, by] as const),\n )\n : blocks2d\n const scale = zoomSnapshot\n ? zoomSnapshotScale(model, zoomSnapshot)\n : undefined\n const ref = useRef<HTMLDivElement>(null)\n const hint = useWheelZoomHint(model)\n const { onPointerDown, touchAction } = useWheelScroll({\n ref,\n model,\n axes: 'xy',\n zoom: true,\n onWheelScroll: hint.onWheelScroll,\n })\n\n return (\n <div\n ref={ref}\n // screenshot callouts anchor to columns from this rect's origin:\n // col*colWidth + scrollX, row*rowHeight + scrollY\n data-testid=\"msa_canvas\"\n tabIndex={0}\n aria-label={alignmentAriaLabel}\n onKeyDown={event => {\n if (onMsaKey(model, event)) {\n event.preventDefault()\n }\n }}\n // a shifted press selects cells (useMsaBlockMouse), so it takes the\n // focus Escape clears from, and leaves out the pan and the page's own\n // text selection\n onMouseDown={event => {\n if (event.shiftKey) {\n event.preventDefault()\n ref.current?.focus({ preventScroll: true })\n }\n }}\n onPointerDown={event => {\n if (!event.shiftKey) {\n onPointerDown(event)\n }\n }}\n style={{\n position: 'relative',\n touchAction,\n height,\n width: msaCanvasWidth,\n overflow: 'hidden',\n }}\n >\n {!MSA && !msaFilehandle ? null : MSA ? (\n // one transform for the whole block set, so a scroll frame is a\n // compositor move rather than a style write per block\n <div\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n transform: `translate(${scrollX}px, ${scrollY}px)${scale ? ` scale(${scale.sx}, ${scale.sy})` : ''}`,\n transformOrigin: '0 0',\n willChange: 'transform',\n }}\n >\n {blocks.map(([bx, by]) => (\n <MSACanvasBlock\n key={`${bx}_${by}`}\n model={model}\n offsetX={bx}\n offsetY={by}\n />\n ))}\n </div>\n ) : (\n <Loading />\n )}\n {hint.visible ? <WheelZoomHint /> : null}\n </div>\n )\n})\n\nexport default MSACanvas\n", "// Returns the block offsets (in pixels) needed to cover the viewport along one\n// axis. mapSize/viewportPos/viewportSize are all in pixels. The clamp pins the\n// block set to the content edge, so an over-scroll past the end still fills\n// the viewport, and content smaller than the viewport mounts only the blocks\n// it covers: none for a tree-only figure with zero columns.\nexport function calculateBlocks({\n mapSize,\n blockSize,\n viewportPos,\n viewportSize,\n}: {\n mapSize: number\n blockSize: number\n viewportPos: number\n viewportSize: number\n}) {\n const clamped = Math.max(0, Math.min(viewportPos, mapSize - viewportSize))\n const end = Math.min(clamped + viewportSize, mapSize)\n const minTile = Math.floor(clamped / blockSize)\n const maxTile = Math.ceil(end / blockSize) - 1\n\n const blocks = []\n for (let tile = minTile; tile <= maxTile; tile++) {\n blocks.push(tile * blockSize)\n }\n return blocks\n}\n", "import { calculateBlocks } from './calculateBlocks.ts'\n\nexport interface ZoomSnapshot {\n colWidth: number\n rowHeight: number\n blocksX: number[]\n blocksY: number[]\n}\n\ninterface Viewport {\n colWidth: number\n rowHeight: number\n scrollX: number\n scrollY: number\n msaAreaWidth: number\n msaAreaHeight: number\n totalWidth: number\n totalHeight: number\n blockSize: number\n}\n\n// past this stretch the scaled letters blur enough to redraw\nconst maxStretch = 2\n\n// a redraw covers this fraction of the viewport again on each side, so a zoom\n// out shrinks it for a few frames before it runs out of picture\nconst margin = 0.2\n\nfunction blocksAt(\n view: Viewport,\n axis: 'x' | 'y',\n scale: number,\n marginFraction: number,\n) {\n const size = axis === 'x' ? view.msaAreaWidth : view.msaAreaHeight\n const pos = -(axis === 'x' ? view.scrollX : view.scrollY)\n const map = axis === 'x' ? view.totalWidth : view.totalHeight\n const pad = size * marginFraction\n return calculateBlocks({\n viewportSize: (size + 2 * pad) / scale,\n viewportPos: (pos - pad) / scale,\n mapSize: map / scale,\n blockSize: view.blockSize,\n })\n}\n\nconst within = (need: number[], have: number[]) =>\n need.length === 0 ||\n (have.length > 0 && need[0]! >= have[0]! && need.at(-1)! <= have.at(-1)!)\n\n// a gesture starts from the blocks already drawn, and each redraw during it\n// adds the margin\nexport function takeZoomSnapshot(view: Viewport, withMargin: boolean) {\n const m = withMargin ? margin : 0\n return {\n colWidth: view.colWidth,\n rowHeight: view.rowHeight,\n blocksX: blocksAt(view, 'x', 1, m),\n blocksY: blocksAt(view, 'y', 1, m),\n } satisfies ZoomSnapshot\n}\n\nexport function zoomSnapshotScale(view: Viewport, snap: ZoomSnapshot) {\n return {\n sx: view.colWidth / snap.colWidth,\n sy: view.rowHeight / snap.rowHeight,\n }\n}\n\n// whether the blocks drawn at the snapshot, stretched to the current cell\n// size, still fill the viewport sharply enough\nexport function zoomSnapshotCovers(view: Viewport, snap: ZoomSnapshot) {\n const { sx, sy } = zoomSnapshotScale(view, snap)\n return (\n sx <= maxStretch &&\n sy <= maxStretch &&\n within(blocksAt(view, 'x', sx, 0), snap.blocksX) &&\n within(blocksAt(view, 'y', sy, 0), snap.blocksY)\n )\n}\n", "import React from 'react'\n\nimport { CircularProgress, Typography } from '@mui/material'\nexport default function Loading() {\n return (\n <div\n style={{\n position: 'absolute',\n left: '50%',\n top: '50%',\n }}\n >\n <CircularProgress />\n <Typography>Loading...</Typography>\n </div>\n )\n}\n", "import React, { useRef } from 'react'\n\nimport BaseTooltip from '@jbrowse/core/ui/BaseTooltip'\nimport { observer } from 'mobx-react'\n\nimport { useCanvasTheme } from '../../darkReader.ts'\nimport { useCanvasAutorun } from '../../useCanvasAutorun.ts'\nimport { drawMsaRaster, rasterApplies } from './msaRaster.ts'\nimport { renderMSABlock } from './renderMSABlock.ts'\nimport { useMsaBlockMouse } from './useMsaBlockMouse.ts'\n\nimport type { MsaViewModel } from '../../model.ts'\nimport type { ZoomSnapshot } from '../../zoomSnapshot.ts'\n\nconst MSACanvasBlock = observer(function ({\n model,\n offsetX,\n offsetY,\n}: {\n model: MsaViewModel\n offsetX: number\n offsetY: number\n}) {\n const { blockSize, highResScaleFactor } = model\n const theme = useCanvasTheme()\n const { anchor, onMouseMove, onMouseDown, onClick, onMouseLeave } =\n useMsaBlockMouse({ model, offsetX, offsetY })\n\n const canvasSize = blockSize * highResScaleFactor\n const drawnAt = useRef<ZoomSnapshot>(undefined)\n const ref = useCanvasAutorun({\n draw: ctx => {\n // during a wheel zoom MSACanvas scales what this block drew at the\n // snapshot, so the block redraws only when a new snapshot is taken\n const snap = model.zoomSnapshot\n if (\n snap &&\n (snap === drawnAt.current ||\n snap.colWidth !== model.colWidth ||\n snap.rowHeight !== model.rowHeight)\n ) {\n return\n }\n drawnAt.current = snap\n ctx.resetTransform()\n ctx.clearRect(0, 0, canvasSize, canvasSize)\n const rasterTiles = rasterApplies(model)\n if (rasterTiles) {\n drawMsaRaster({ ctx, model, theme, offsetX, offsetY })\n }\n renderMSABlock({\n ctx,\n theme,\n offsetX,\n offsetY,\n model,\n rasterTiles,\n domains: true,\n })\n },\n width: canvasSize,\n height: canvasSize,\n deps: [model, offsetX, offsetY, theme],\n })\n\n const { hoveredInsertion, mouseOverDomains } = model\n\n return (\n <>\n <canvas\n ref={ref}\n onMouseMove={event => {\n if (ref.current) {\n onMouseMove(event, ref.current)\n }\n }}\n onMouseDown={event => {\n if (ref.current) {\n onMouseDown(event, ref.current)\n }\n }}\n onClick={event => {\n if (ref.current) {\n onClick(event, ref.current)\n }\n }}\n onMouseLeave={() => {\n onMouseLeave()\n }}\n width={canvasSize}\n height={canvasSize}\n style={{\n position: 'absolute',\n top: offsetY,\n left: offsetX,\n width: blockSize,\n height: blockSize,\n }}\n />\n {anchor ? (\n <BaseTooltip clientPoint={anchor.clientPoint}>\n {hoveredInsertion ? (\n <>\n Insertion ({hoveredInsertion.letters.length}\n {model.sequenceType === 'amino' ? 'aa' : 'bp'}):{' '}\n {hoveredInsertion.letters.length > 20\n ? `${hoveredInsertion.letters.slice(0, 20)}...`\n : hoveredInsertion.letters}\n </>\n ) : (\n mouseOverDomains.map(d => (\n <div key={`${d.accession}-${d.start}-${d.end}`}>\n <b>{d.name}</b> ({d.accession}) {d.start}-{d.end}\n {d.description ? (\n <>\n <br />\n {d.description}\n </>\n ) : null}\n </div>\n ))\n )}\n </BaseTooltip>\n ) : null}\n </>\n )\n})\n\nexport default MSACanvasBlock\n", "import { useRef } from 'react'\n\nimport { dragSelection, maxClickTravel } from '../selectionDrag.ts'\nimport { useHoverAnchor } from '../useHoverAnchor.ts'\n\nimport type { MsaViewModel } from '../../model.ts'\nimport type { ClientPoint } from '../selectionDrag.ts'\nimport type React from 'react'\n\n/**\n * Translates pointer events over one MSA block into model column/row hover and\n * click state, and reports where a tooltip should be anchored.\n *\n * The anchor is only tracked when there is something to show (an insertion or a\n * domain under the cursor), so plain mouse movement over the alignment updates\n * the canvas overlay without re-rendering this component. Each track tooltips\n * its own column statistics, and the header reads out the hovered row, residue\n * and position.\n */\nexport function useMsaBlockMouse({\n model,\n offsetX,\n offsetY,\n}: {\n model: MsaViewModel\n offsetX: number\n offsetY: number\n}) {\n const { anchor, hoverAt, clearAnchor } = useHoverAnchor<true>()\n const downAt = useRef<{ x: number; y: number }>(undefined)\n\n // The block's rect places its cells on the page. A drag keeps the mapping\n // it started with, so each point subtracts the scroll since then.\n function cellMapper(el: HTMLElement) {\n const { left, top } = el.getBoundingClientRect()\n const { scrollX, scrollY } = model\n return ({ clientX, clientY }: ClientPoint) => ({\n col: Math.floor(\n (clientX - left + offsetX - (model.scrollX - scrollX)) / model.colWidth,\n ),\n row: Math.floor(\n (clientY - top + offsetY - (model.scrollY - scrollY)) / model.rowHeight,\n ),\n })\n }\n\n function colRow(event: React.MouseEvent, el: HTMLElement) {\n return cellMapper(el)(event)\n }\n\n // a block can extend past the alignment (the last block is a full tile wide,\n // and the panel is taller than the rows when there are few of them), so a\n // pointer inside the block is not necessarily over a cell\n function inBounds({ col, row }: { col: number; row: number }) {\n return col >= 0 && col < model.numColumns && row >= 0 && row < model.numRows\n }\n\n function onMouseMove(event: React.MouseEvent, el: HTMLElement) {\n const pos = colRow(event, el)\n const hit = inBounds(pos)\n model.setMousePos(hit ? pos.col : undefined, hit ? pos.row : undefined)\n\n const hasTooltip =\n !!model.hoveredInsertion || model.mouseOverDomains.length > 0\n hoverAt(event, hasTooltip || undefined)\n }\n\n // shift+drag selects a block; MSACanvas leaves a shifted press out of its\n // pan\n function onMouseDown(event: React.MouseEvent, el: HTMLElement) {\n downAt.current = { x: event.clientX, y: event.clientY }\n if (event.shiftKey && event.button === 0) {\n dragSelection(model, event, cellMapper(el))\n }\n }\n\n function onClick(event: React.MouseEvent, el: HTMLElement) {\n const down = downAt.current\n downAt.current = undefined\n if (\n down &&\n Math.hypot(event.clientX - down.x, event.clientY - down.y) >\n maxClickTravel\n ) {\n return\n }\n const pos = colRow(event, el)\n const { col, row } = pos\n const { mouseClickCol, mouseClickRow } = model\n // clicking the same cell again clears the pinned crosshair, and so does\n // clicking past the end of the alignment -- there is no cell to pin there\n const same = col === mouseClickCol && row === mouseClickRow\n const keep = inBounds(pos) && !same\n model.setMouseClickPos(keep ? col : undefined, keep ? row : undefined)\n }\n\n function onMouseLeave() {\n model.setMousePos()\n clearAnchor()\n }\n\n return { anchor, onMouseMove, onMouseDown, onClick, onMouseLeave }\n}\n", "import React, { useCallback, useRef, useState } from 'react'\n\nimport { Paper, Typography } from '@mui/material'\n\nimport type { MsaViewModel } from '../../model.ts'\n\nconst hinted = new WeakSet<MsaViewModel>()\n\nconst zoomKey =\n typeof navigator !== 'undefined' && navigator.platform.startsWith('Mac')\n ? '\u2318'\n : 'Ctrl'\n\nexport function useWheelZoomHint(model: MsaViewModel) {\n const [visible, setVisible] = useState(false)\n const timer = useRef<ReturnType<typeof setTimeout>>(undefined)\n const onWheelScroll = useCallback(\n (event: WheelEvent) => {\n if (\n !model.scrollZoom &&\n Math.abs(event.deltaY) > Math.abs(event.deltaX) &&\n !hinted.has(model)\n ) {\n hinted.add(model)\n setVisible(true)\n clearTimeout(timer.current)\n timer.current = setTimeout(() => {\n setVisible(false)\n }, 2500)\n }\n },\n [model],\n )\n return { visible, onWheelScroll }\n}\n\nexport function WheelZoomHint() {\n return (\n <Paper\n elevation={3}\n style={{\n position: 'absolute',\n top: 12,\n left: '50%',\n transform: 'translateX(-50%)',\n padding: '4px 12px',\n pointerEvents: 'none',\n zIndex: 2,\n }}\n >\n <Typography variant=\"body2\">\n {zoomKey} + scroll to zoom, or check Zoom on scroll\n </Typography>\n </Paper>\n )\n}\n", "import React from 'react'\n\nimport { isAlive } from '@jbrowse/mobx-state-tree'\nimport { observer } from 'mobx-react'\n\nimport { msaOverlayZIndex } from '../../constants.ts'\nimport { useCanvasTheme } from '../../darkReader.ts'\nimport { useCanvasAutorun } from '../../useCanvasAutorun.ts'\nimport { renderMouseover } from './renderMSAMouseover.ts'\n\nimport type { MsaViewModel } from '../../model.ts'\n\nconst MSAMouseoverCanvas = observer(function ({\n model,\n}: {\n model: MsaViewModel\n}) {\n const { height, msaCanvasWidth: width, highResScaleFactor } = model\n const theme = useCanvasTheme()\n const canvasWidth = width * highResScaleFactor\n const canvasHeight = height * highResScaleFactor\n const ref = useCanvasAutorun({\n draw: ctx => {\n if (isAlive(model)) {\n renderMouseover({ ctx, model, theme })\n }\n },\n width: canvasWidth,\n height: canvasHeight,\n deps: [model, theme],\n })\n\n return (\n <canvas\n ref={ref}\n id=\"mouseover\"\n width={canvasWidth}\n height={canvasHeight}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n width,\n height,\n zIndex: msaOverlayZIndex,\n pointerEvents: 'none',\n }}\n />\n )\n})\n\nexport default MSAMouseoverCanvas\n", "import { clickColor, hoverColor, multiRowHoverColor } from '../overlayColors.ts'\nimport {\n renderPersistentHighlights,\n renderSelection,\n} from './renderHighlights.ts'\n\nimport type { MsaViewModel } from '../../model.ts'\nimport type { Theme } from '@mui/material'\n\nexport function renderMouseover({\n ctx,\n model,\n theme,\n}: {\n ctx: CanvasRenderingContext2D\n model: MsaViewModel\n theme: Theme\n}) {\n const {\n mouseCol,\n colWidth,\n msaCanvasWidth: width,\n height,\n rowHeight,\n scrollX,\n scrollY,\n mouseRow,\n mouseClickRow,\n mouseClickCol,\n highResScaleFactor,\n hoveredRowIndices,\n } = model\n ctx.resetTransform()\n ctx.clearRect(0, 0, width * highResScaleFactor, height * highResScaleFactor)\n ctx.scale(highResScaleFactor, highResScaleFactor)\n\n // rows and columns sit at a fixed pitch, so an index is all it takes to place\n // a full-width or full-height band (matching fillRow in TreeCanvas)\n const rowBand = (index: number) => {\n ctx.fillRect(0, index * rowHeight + scrollY, width, rowHeight)\n }\n const colBand = (index: number) => {\n ctx.fillRect(index * colWidth + scrollX, 0, colWidth, height)\n }\n\n renderPersistentHighlights({\n ctx,\n model,\n theme,\n offsetX: -scrollX,\n offsetY: -scrollY,\n width,\n height,\n })\n renderSelection({ ctx, model, offsetX: -scrollX, offsetY: -scrollY, height })\n\n // every tip under a hovered tree node stays lit\n ctx.fillStyle = multiRowHoverColor\n for (const rowIndex of hoveredRowIndices) {\n rowBand(rowIndex)\n }\n\n ctx.fillStyle = hoverColor\n if (mouseCol !== undefined) {\n colBand(mouseCol)\n }\n if (mouseRow !== undefined) {\n rowBand(mouseRow)\n }\n ctx.fillStyle = clickColor\n if (mouseClickCol !== undefined) {\n colBand(mouseClickCol)\n }\n if (mouseClickRow !== undefined) {\n rowBand(mouseClickRow)\n }\n}\n", "import React from 'react'\n\nimport { observer } from 'mobx-react'\n\nimport { headerRunsAcross } from './headerLayout.ts'\n\nimport type { MsaViewModel } from '../../model.ts'\n\n/**\n * The row panel headers, in a band above the panels beside the tree ruler and\n * the minimap. A narrow strip's name is DOM text turned on its side, since the\n * canvas layer has no rotation, and the SVG export draws it with a\n * `rotate(-90)`. A panel wider than the band is tall writes its name across.\n */\nconst RowPanelHeaders = observer(function ({ model }: { model: MsaViewModel }) {\n const { resolvedRowPanels, rowPanelsHeaderHeight, fontSize } = model\n return resolvedRowPanels.length > 0 ? (\n <div\n style={{\n display: 'flex',\n flexShrink: 0,\n height: rowPanelsHeaderHeight,\n alignItems: 'flex-end',\n }}\n >\n {resolvedRowPanels.map(panel => {\n const across = headerRunsAcross(panel.width)\n return (\n <div\n key={panel.id}\n title={panel.header}\n style={{\n width: panel.width,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n ...(across\n ? { fontSize, textAlign: 'center' }\n : {\n height: rowPanelsHeaderHeight,\n fontSize: Math.min(fontSize, panel.width),\n // vertical-rl reads top to bottom, and the half turn makes\n // it read upwards from the strip, as rotate(-90) exports\n writingMode: 'vertical-rl',\n transform: 'rotate(180deg)',\n }),\n }}\n >\n {panel.header}\n </div>\n )\n })}\n </div>\n ) : null\n})\n\nexport default RowPanelHeaders\n", "import React, { useRef } from 'react'\n\nimport { observer } from 'mobx-react'\n\nimport { useWheelScroll } from '../../useWheelScroll.ts'\nimport RowPanelBlock from './RowPanelBlock.tsx'\n\nimport type { MsaViewModel } from '../../model.ts'\nimport type { ResolvedRowPanel } from '../../types.ts'\n\nconst RowPanel = observer(function ({\n model,\n panel,\n}: {\n model: MsaViewModel\n panel: ResolvedRowPanel\n}) {\n const ref = useRef<HTMLDivElement>(null)\n const { height, blocksY, scrollY } = model\n const { onPointerDown, touchAction } = useWheelScroll({\n ref,\n model,\n axes: 'y',\n })\n\n return (\n <div\n ref={ref}\n data-testid={`rowpanel_${panel.id}`}\n onPointerDown={onPointerDown}\n style={{\n touchAction,\n height,\n width: panel.width,\n flexShrink: 0,\n overflow: 'hidden',\n position: 'relative',\n }}\n >\n {/* one transform for the whole block set, matching TreeCanvas: the\n strips scroll in lockstep with the tree and the alignment */}\n <div\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n transform: `translateY(${scrollY}px)`,\n willChange: 'transform',\n }}\n >\n {blocksY.map(block => (\n <RowPanelBlock\n key={block}\n model={model}\n panel={panel}\n offsetY={block}\n />\n ))}\n </div>\n </div>\n )\n})\n\nconst RowPanels = observer(function ({ model }: { model: MsaViewModel }) {\n const { resolvedRowPanels } = model\n return resolvedRowPanels.length > 0 ? (\n <div style={{ display: 'flex', flexShrink: 0 }}>\n {resolvedRowPanels.map(panel => (\n <RowPanel key={panel.id} model={model} panel={panel} />\n ))}\n </div>\n ) : null\n})\n\nexport default RowPanels\n", "import React from 'react'\n\nimport BaseTooltip from '@jbrowse/core/ui/BaseTooltip'\nimport { observer } from 'mobx-react'\n\nimport { useCanvasTheme } from '../../darkReader.ts'\nimport { featureField, featureName } from '../../featureFields.ts'\nimport { useCanvasAutorun } from '../../useCanvasAutorun.ts'\nimport { useHoverAnchor } from '../useHoverAnchor.ts'\nimport { renderRowPanel } from './renderRowPanel.ts'\n\nimport type { MsaViewModel } from '../../model.ts'\nimport type { ResolvedRowPanel } from '../../types.ts'\n\n// what the cell or span under the pointer reads, which is the field a strip\n// colors by, and a span's name, its coordinates and its encoded field\nfunction hoverLines({\n model,\n panel,\n name,\n x,\n}: {\n model: MsaViewModel\n panel: ResolvedRowPanel\n name: string\n x: number\n}) {\n if (panel.kind === 'strip') {\n return [\n `${panel.header}: ${model.rowDataOf(name)?.[panel.field] ?? '(none)'}`,\n ]\n }\n const span = panel.spans\n .get(name)\n ?.findLast(s => x >= s.xStart && x <= s.xEnd)\n if (!span) {\n return []\n }\n const { annotation } = span\n const strand =\n annotation.strand === undefined\n ? ''\n : annotation.strand < 0\n ? ' (-)'\n : ' (+)'\n const value = panel.field ? featureField(annotation, panel.field) : undefined\n return [\n featureName(annotation) ?? annotation.accession,\n `${annotation.start}-${annotation.end}${strand}`,\n ...(value === undefined ? [] : [`${panel.field}: ${value}`]),\n ]\n}\n\nconst RowPanelBlock = observer(function ({\n model,\n panel,\n offsetY,\n}: {\n model: MsaViewModel\n panel: ResolvedRowPanel\n offsetY: number\n}) {\n const { anchor, hoverAt, clearAnchor } = useHoverAnchor<{\n name: string\n lines: string[]\n }>()\n const theme = useCanvasTheme()\n const { blockSize, highResScaleFactor, rowHeight } = model\n const width = panel.width\n const height = blockSize\n const canvasWidth = width * highResScaleFactor\n const canvasHeight = height * highResScaleFactor\n\n const ref = useCanvasAutorun({\n draw: ctx => {\n ctx.resetTransform()\n ctx.clearRect(0, 0, canvasWidth, canvasHeight)\n renderRowPanel({ ctx, model, theme, panel, x: 0, offsetY })\n },\n width: canvasWidth,\n height: canvasHeight,\n deps: [model, theme, panel, offsetY],\n })\n\n return (\n <>\n <canvas\n ref={ref}\n width={canvasWidth}\n height={canvasHeight}\n style={{ position: 'absolute', top: offsetY, left: 0, width, height }}\n onMouseMove={event => {\n // the blocks are laid out in row space and scrolled by a transform\n // on their container, so the pointer's row comes off the canvas box\n const { left, top } = event.currentTarget.getBoundingClientRect()\n const row = Math.floor((event.clientY - top + offsetY) / rowHeight)\n const name = model.leaves[row]?.data.name\n const lines =\n name === undefined\n ? []\n : hoverLines({\n model,\n panel,\n name,\n x: event.clientX - left,\n })\n hoverAt(\n event,\n name === undefined || lines.length === 0\n ? undefined\n : { name, lines },\n )\n model.setMousePos(undefined, name === undefined ? undefined : row)\n }}\n onMouseLeave={() => {\n clearAnchor()\n model.setMousePos(undefined, undefined)\n }}\n />\n {anchor ? (\n <BaseTooltip clientPoint={anchor.clientPoint}>\n <div>{anchor.value.name}</div>\n {anchor.value.lines.map(line => (\n <div key={line}>{line}</div>\n ))}\n </BaseTooltip>\n ) : null}\n </>\n )\n})\n\nexport default RowPanelBlock\n", "import type { Annotation } from './types.ts'\n\n/**\n * The value a feature gives an encoded field: an Annotation property, else one\n * of the GFF attributes the parser kept.\n */\nexport function featureField(annotation: Annotation, field: string) {\n const own = (annotation as unknown as Record<string, unknown>)[field]\n const value = own ?? annotation.attributes?.[field]\n return typeof value === 'string' ? value : undefined\n}\n\n/**\n * The name a feature answers to in a transform: its GFF `Name` attribute, else\n * the name the parser gave it.\n */\nexport function featureName(annotation: Annotation) {\n return featureField(annotation, 'Name') ?? featureField(annotation, 'name')\n}\n", "import React, { useState } from 'react'\n\nimport ArrowDropDown from '@mui/icons-material/ArrowDropDown'\nimport ArrowRight from '@mui/icons-material/ArrowRight'\nimport Close from '@mui/icons-material/Close'\nimport { Box, IconButton, Typography } from '@mui/material'\nimport ButtonBase from '@mui/material/ButtonBase'\nimport { observer } from 'mobx-react'\n\nimport { settingsPanelWidth } from '../../constants.ts'\nimport { annotationsSubMenu } from '../header/getAnnotationsMenu.ts'\nimport {\n alignmentSettingsItems,\n colorSettingsItems,\n gapsSubMenu,\n trackSettingsItems,\n treeSubMenu,\n} from '../header/menuBarItems.ts'\nimport MenuItemsForm from './MenuItemsForm.tsx'\nimport TrackList from './TrackList.tsx'\n\nimport type { MsaViewModel } from '../../model.ts'\n\nconst collapsedKey = 'msaview-settings-collapsed'\n\nfunction readCollapsed() {\n try {\n const parsed: unknown = JSON.parse(\n localStorage.getItem(collapsedKey) ?? '[]',\n )\n return new Set(Array.isArray(parsed) ? parsed.map(String) : [])\n } catch {\n return new Set<string>()\n }\n}\n\nfunction writeCollapsed(collapsed: Set<string>) {\n try {\n localStorage.setItem(collapsedKey, JSON.stringify([...collapsed]))\n } catch {}\n}\n\nfunction Section({\n title,\n collapsed,\n onToggle,\n children,\n}: {\n title: string\n collapsed: boolean\n onToggle: () => void\n children: React.ReactNode\n}) {\n const Arrow = collapsed ? ArrowRight : ArrowDropDown\n return (\n <Box sx={{ px: 1.5, py: 1, borderBottom: 1, borderColor: 'divider' }}>\n <ButtonBase\n aria-expanded={!collapsed}\n onClick={onToggle}\n sx={{ width: '100%', justifyContent: 'flex-start', ml: -0.75 }}\n >\n <Arrow fontSize=\"small\" color=\"action\" />\n <Typography variant=\"overline\" color=\"text.secondary\">\n {title}\n </Typography>\n </ButtonBase>\n {collapsed ? null : children}\n </Box>\n )\n}\n\n/**\n * The settings whose effect the user watches as they change them, docked to\n * the right of the alignment so nothing it opens covers the tree or the rows.\n * Each section folds, and the browser remembers which ones the user folded.\n */\nconst SettingsPanel = observer(function ({\n model,\n height,\n}: {\n model: MsaViewModel\n height: number\n}) {\n const { noTree, noDomains } = model\n const [collapsed, setCollapsed] = useState(readCollapsed)\n const section = (title: string) => ({\n title,\n collapsed: collapsed.has(title),\n onToggle: () => {\n const next = new Set(collapsed)\n if (!next.delete(title)) {\n next.add(title)\n }\n writeCollapsed(next)\n setCollapsed(next)\n },\n })\n return (\n <Box\n data-testid=\"settings_panel\"\n sx={{\n width: settingsPanelWidth,\n height,\n flexShrink: 0,\n overflowY: 'auto',\n borderLeft: 1,\n borderColor: 'divider',\n bgcolor: 'background.paper',\n }}\n >\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n px: 1.5,\n pt: 0.5,\n }}\n >\n <Typography variant=\"subtitle1\">Settings</Typography>\n <IconButton\n aria-label=\"Close settings\"\n onClick={() => {\n model.setSettingsOpen(false)\n }}\n >\n <Close fontSize=\"small\" />\n </IconButton>\n </Box>\n <Section {...section('Color')}>\n <MenuItemsForm items={colorSettingsItems(model)} />\n </Section>\n {noTree ? null : (\n <Section {...section('Tree')}>\n <MenuItemsForm items={treeSubMenu(model)} />\n </Section>\n )}\n <Section {...section('Alignment')}>\n <MenuItemsForm items={alignmentSettingsItems(model)} />\n <MenuItemsForm items={gapsSubMenu(model)} />\n </Section>\n {noDomains ? null : (\n <Section {...section('Annotations')}>\n <MenuItemsForm items={annotationsSubMenu(model)} />\n </Section>\n )}\n <Section {...section('Tracks')}>\n <TrackList model={model} />\n <Box sx={{ mt: 1, pt: 0.5, borderTop: 1, borderColor: 'divider' }}>\n <MenuItemsForm items={trackSettingsItems(model)} />\n </Box>\n </Section>\n </Box>\n )\n})\n\nexport default SettingsPanel\n", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"m10 17 5-5-5-5z\"\n}), 'ArrowRight');", "'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport refType from '@mui/utils/refType';\nimport elementTypeAcceptingRef from '@mui/utils/elementTypeAcceptingRef';\nimport composeClasses from '@mui/utils/composeClasses';\nimport isFocusVisible from '@mui/utils/isFocusVisible';\nimport { styled } from \"../zero-styled/index.mjs\";\nimport memoTheme from \"../utils/memoTheme.mjs\";\nimport { useDefaultProps } from \"../DefaultPropsProvider/index.mjs\";\nimport useForkRef from \"../utils/useForkRef.mjs\";\nimport useEventCallback from \"../utils/useEventCallback.mjs\";\nimport useButtonBase from \"./useButtonBase.mjs\";\nimport useLazyRipple from \"../useLazyRipple/index.mjs\";\nimport TouchRipple from \"./TouchRipple.mjs\";\nimport buttonBaseClasses, { getButtonBaseUtilityClass } from \"./buttonBaseClasses.mjs\";\nimport { outsetFocusRing } from \"../styles/focusVisible.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n disabled,\n focusVisible,\n focusVisibleClassName,\n suppressFocusVisible,\n classes\n } = ownerState;\n const slots = {\n root: ['root', disabled && 'disabled', focusVisible && !suppressFocusVisible && 'focusVisible']\n };\n const composedClasses = composeClasses(slots, getButtonBaseUtilityClass, classes);\n if (focusVisible && !suppressFocusVisible && focusVisibleClassName) {\n composedClasses.root += ` ${focusVisibleClassName}`;\n }\n return composedClasses;\n};\nexport const ButtonBaseRoot = styled('button', {\n name: 'MuiButtonBase',\n slot: 'Root'\n})(memoTheme(({\n theme\n}) => ({\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'relative',\n boxSizing: 'border-box',\n WebkitTapHighlightColor: 'transparent',\n backgroundColor: 'transparent',\n // Reset default value\n // We disable the focus ring for mouse, touch and keyboard users.\n outline: 0,\n border: 0,\n margin: 0,\n // Remove the margin in Safari\n borderRadius: 0,\n padding: 0,\n // Remove the padding in Firefox\n cursor: 'pointer',\n userSelect: 'none',\n verticalAlign: 'middle',\n MozAppearance: 'none',\n // Reset\n WebkitAppearance: 'none',\n // Reset\n textDecoration: 'none',\n // So we take precedent over the style of a native <a /> element.\n color: 'inherit',\n '&::-moz-focus-inner': {\n borderStyle: 'none' // Remove Firefox dotted outline.\n },\n [`&.${buttonBaseClasses.disabled}`]: {\n pointerEvents: 'none',\n // Disable link interactions\n cursor: 'default'\n },\n '@media print': {\n colorAdjust: 'exact'\n },\n variants: [{\n props: {\n internalDisabledThemeFocusVisible: false\n },\n style: theme.focusVisible && {\n ...outsetFocusRing,\n [`&.${buttonBaseClasses.focusVisible}`]: theme.focusVisible\n }\n }]\n})));\n\n/**\n * `ButtonBase` contains as few styles as possible.\n * It aims to be a simple building block for creating a button.\n * It contains a load of style reset and some focus/ripple logic.\n */\nconst ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiButtonBase'\n });\n const {\n action,\n centerRipple = false,\n children,\n className,\n component = 'button',\n disabled = false,\n disableRipple = false,\n disableTouchRipple = false,\n focusRipple = false,\n focusVisibleClassName,\n /* eslint-disable react/prop-types */\n // replaces internal handling in Chip, other components can opt-in individually to use this in the future\n focusableWhenDisabled,\n // escape hatch to suppress the focusVisible state and callback\n // used by anchored <Menu>s to to suppress focus visible styling when opened with a pointer\n suppressFocusVisible = false,\n // private prop to allow native vs non-native button props to be resolved before mount\n internalNativeButton: internalNativeButtonProp,\n // private prop to let a parent (like SwitchBase) control its own focus visible style\n internalDisabledThemeFocusVisible = false,\n /* eslint-enable react/prop-types */\n LinkComponent = 'a',\n nativeButton: nativeButtonProp,\n onBlur,\n onClick: onClickProp,\n onContextMenu,\n onDragLeave,\n onFocus,\n onFocusVisible,\n onKeyDown: onKeyDownProp,\n onKeyUp: onKeyUpProp,\n onMouseDown,\n onMouseLeave,\n onMouseUp,\n onTouchEnd,\n onTouchMove,\n onTouchStart,\n tabIndex = 0,\n TouchRippleProps,\n touchRippleRef,\n type,\n ...other\n } = props;\n const isLink = Boolean(other.href || other.to);\n const hasFormAction = Boolean(other.formAction);\n let ComponentProp = component;\n if (ComponentProp === 'button' && isLink) {\n ComponentProp = LinkComponent;\n }\n const internalNativeButton = typeof ComponentProp === 'string' ? ComponentProp === 'button' : internalNativeButtonProp ?? false;\n const nativeButton = nativeButtonProp ?? internalNativeButton;\n const ripple = useLazyRipple();\n const handleRippleRef = useForkRef(ripple.ref, touchRippleRef);\n const [focusVisible, setFocusVisible] = React.useState(false);\n if ((disabled || suppressFocusVisible) && focusVisible) {\n setFocusVisible(false);\n }\n const handleBeforeKeyDown = useEventCallback(event => {\n // Check if key is already down to avoid repeats being counted as multiple activations\n if (focusRipple && !event.repeat && focusVisible && event.key === ' ') {\n ripple.stop(event, () => {\n ripple.start(event);\n });\n }\n });\n const handleBeforeKeyUp = useEventCallback(event => {\n // calling preventDefault in keyUp on a <button> will not dispatch a click event if Space is pressed\n // https://codesandbox.io/p/sandbox/button-keyup-preventdefault-dn7f0\n if (focusRipple && event.key === ' ' && focusVisible && !event.defaultPrevented) {\n ripple.stop(event, () => {\n ripple.pulsate(event);\n });\n }\n });\n const {\n getButtonProps,\n rootRef: buttonRef\n } = useButtonBase({\n nativeButton,\n nativeButtonProp,\n internalNativeButton,\n allowInferredHostMismatch: isLink || typeof ComponentProp === 'string',\n disabled,\n type,\n hasFormAction,\n tabIndex,\n onBeforeKeyDown: handleBeforeKeyDown,\n onBeforeKeyUp: handleBeforeKeyUp\n });\n const {\n onClick,\n onKeyDown,\n onKeyUp,\n ...buttonProps\n } = getButtonProps({\n onClick: onClickProp,\n onKeyDown: onKeyDownProp,\n onKeyUp: onKeyUpProp\n });\n React.useImperativeHandle(action, () => ({\n focusVisible: () => {\n setFocusVisible(true);\n buttonRef.current.focus();\n }\n }), [buttonRef]);\n const enableTouchRipple = ripple.shouldMount && !disableRipple && !disabled;\n React.useEffect(() => {\n if (focusVisible && focusRipple && !disableRipple) {\n ripple.pulsate();\n }\n }, [disableRipple, focusRipple, focusVisible, ripple]);\n const handleMouseDown = useRippleHandler(ripple, 'start', onMouseDown, disableTouchRipple);\n const handleContextMenu = useRippleHandler(ripple, 'stop', onContextMenu, disableTouchRipple);\n const handleDragLeave = useRippleHandler(ripple, 'stop', onDragLeave, disableTouchRipple);\n const handleMouseUp = useRippleHandler(ripple, 'stop', onMouseUp, disableTouchRipple);\n const handleMouseLeave = useRippleHandler(ripple, 'stop', event => {\n if (focusVisible) {\n event.preventDefault();\n }\n if (onMouseLeave) {\n onMouseLeave(event);\n }\n }, disableTouchRipple);\n const handleTouchStart = useRippleHandler(ripple, 'start', onTouchStart, disableTouchRipple);\n const handleTouchEnd = useRippleHandler(ripple, 'stop', onTouchEnd, disableTouchRipple);\n const handleTouchMove = useRippleHandler(ripple, 'stop', onTouchMove, disableTouchRipple);\n const handleBlur = useRippleHandler(ripple, 'stop', event => {\n if (!isFocusVisible(event.target)) {\n setFocusVisible(false);\n }\n if (onBlur) {\n onBlur(event);\n }\n }, false);\n const handleFocus = useEventCallback(event => {\n // Fix for https://github.com/react/react/issues/7769\n if (!buttonRef.current) {\n buttonRef.current = event.currentTarget;\n }\n if (!suppressFocusVisible && isFocusVisible(event.target)) {\n setFocusVisible(true);\n if (onFocusVisible) {\n onFocusVisible(event);\n }\n }\n if (onFocus) {\n onFocus(event);\n }\n });\n const linkProps = {};\n if (isLink) {\n linkProps.tabIndex = disabled ? -1 : tabIndex;\n if (disabled) {\n linkProps['aria-disabled'] = disabled;\n }\n linkProps.type = type;\n }\n const handleRef = useForkRef(ref, buttonRef);\n const ownerState = {\n ...props,\n centerRipple,\n component,\n disabled,\n disableRipple,\n disableTouchRipple,\n focusRipple,\n suppressFocusVisible,\n tabIndex,\n focusVisible,\n internalDisabledThemeFocusVisible\n };\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsxs(ButtonBaseRoot, {\n as: ComponentProp,\n className: clsx(classes.root, className),\n ownerState: ownerState,\n onBlur: handleBlur,\n onClick: onClick,\n onContextMenu: handleContextMenu,\n onFocus: handleFocus,\n onKeyDown: onKeyDown,\n onKeyUp: onKeyUp,\n onMouseDown: handleMouseDown,\n onMouseLeave: handleMouseLeave,\n onMouseUp: handleMouseUp,\n onDragLeave: handleDragLeave,\n onTouchEnd: handleTouchEnd,\n onTouchMove: handleTouchMove,\n onTouchStart: handleTouchStart,\n ref: handleRef,\n ...(isLink ? linkProps : buttonProps),\n ...other,\n children: [children, enableTouchRipple ? /*#__PURE__*/_jsx(TouchRipple, {\n ref: handleRippleRef,\n center: centerRipple,\n ...TouchRippleProps\n }) : null]\n });\n});\nfunction useRippleHandler(ripple, rippleAction, eventCallback, skipRippleAction = false) {\n return useEventCallback(event => {\n if (eventCallback) {\n eventCallback(event);\n }\n if (!skipRippleAction) {\n ripple[rippleAction](event);\n }\n return true;\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? ButtonBase.propTypes /* remove-proptypes */ = {\n // \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Warning \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n // \u2502 These PropTypes are generated from the TypeScript type definitions. \u2502\n // \u2502 To update them, edit the d.ts file and run `pnpm proptypes`. \u2502\n // \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n /**\n * A ref for imperative actions.\n * It currently only supports `focusVisible()` action.\n */\n action: refType,\n /**\n * If `true`, the ripples are centered.\n * They won't start at the cursor interaction position.\n * @default false\n */\n centerRipple: PropTypes.bool,\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: elementTypeAcceptingRef,\n /**\n * If `true`, the component is disabled.\n * @default false\n */\n disabled: PropTypes.bool,\n /**\n * If `true`, the ripple effect is disabled.\n *\n * \u26A0\uFE0F Without a ripple there is no styling for :focus-visible by default. Be sure\n * to highlight the element by applying separate styles with the `.Mui-focusVisible` class.\n * @default false\n */\n disableRipple: PropTypes.bool,\n /**\n * If `true`, the touch ripple effect is disabled.\n * @default false\n */\n disableTouchRipple: PropTypes.bool,\n /**\n * If `true`, the base button will have a keyboard focus ripple.\n * @default false\n */\n focusRipple: PropTypes.bool,\n /**\n * This prop can help identify which element has keyboard focus.\n * The class name will be applied when the element gains the focus through keyboard interaction.\n * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).\n * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).\n * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components\n * if needed.\n */\n focusVisibleClassName: PropTypes.string,\n /**\n * @ignore\n */\n formAction: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),\n /**\n * @ignore\n */\n href: PropTypes /* @typescript-to-proptypes-ignore */.any,\n /**\n * The component used to render a link when the `href` prop is provided.\n * @default 'a'\n */\n LinkComponent: PropTypes.elementType,\n /**\n * Whether the custom component is expected to render a native `<button>` element\n * when passing a React component to the `component` or `slots` prop.\n */\n nativeButton: PropTypes.bool,\n /**\n * @ignore\n */\n onBlur: PropTypes.func,\n /**\n * @ignore\n */\n onClick: PropTypes.func,\n /**\n * @ignore\n */\n onContextMenu: PropTypes.func,\n /**\n * @ignore\n */\n onDragLeave: PropTypes.func,\n /**\n * @ignore\n */\n onFocus: PropTypes.func,\n /**\n * Callback fired when the component is focused with a keyboard.\n * We trigger a `onFocus` callback too.\n */\n onFocusVisible: PropTypes.func,\n /**\n * @ignore\n */\n onKeyDown: PropTypes.func,\n /**\n * @ignore\n */\n onKeyUp: PropTypes.func,\n /**\n * @ignore\n */\n onMouseDown: PropTypes.func,\n /**\n * @ignore\n */\n onMouseLeave: PropTypes.func,\n /**\n * @ignore\n */\n onMouseUp: PropTypes.func,\n /**\n * @ignore\n */\n onTouchEnd: PropTypes.func,\n /**\n * @ignore\n */\n onTouchMove: PropTypes.func,\n /**\n * @ignore\n */\n onTouchStart: PropTypes.func,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * @default 0\n */\n tabIndex: PropTypes.number,\n /**\n * Props applied to the `TouchRipple` element.\n */\n TouchRippleProps: PropTypes.object,\n /**\n * A ref that points to the `TouchRipple` element.\n */\n touchRippleRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({\n current: PropTypes.shape({\n pulsate: PropTypes.func.isRequired,\n start: PropTypes.func.isRequired,\n stop: PropTypes.func.isRequired\n })\n })]),\n /**\n * The HTML [`type`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button#type)\n * attribute applied to `button` and `a` elements.\n * Ignored when rendering non-native buttons.\n * @default 'button'\n */\n type: PropTypes.string\n} : void 0;\nexport default ButtonBase;", "/**\n * Returns a boolean indicating if the event's target has :focus-visible\n */\nexport default function isFocusVisible(element) {\n try {\n return element.matches(':focus-visible');\n } catch (error) {\n // Do not warn on jsdom tests, otherwise all tests that rely on focus have to be skipped\n // Tests that rely on `:focus-visible` will still have to be skipped in jsdom\n if (process.env.NODE_ENV !== 'production' && !window.navigator.userAgent.includes('jsdom')) {\n console.warn(['MUI: The `:focus-visible` pseudo class is not supported in this browser.', 'Some components rely on this feature to work properly.'].join('\\n'));\n }\n }\n return false;\n}", "'use client';\n\nimport * as React from 'react';\n\n/**\n * Merges refs into a single memoized callback ref or `null`.\n *\n * ```tsx\n * const rootRef = React.useRef<Instance>(null);\n * const refFork = useForkRef(rootRef, props.ref);\n *\n * return (\n * <Root {...props} ref={refFork} />\n * );\n * ```\n *\n * @param {Array<React.Ref<Instance> | undefined>} refs The ref array.\n * @returns {React.RefCallback<Instance> | null} The new ref callback.\n */\nexport default function useForkRef(...refs) {\n const cleanupRef = React.useRef(undefined);\n const refEffect = React.useCallback(instance => {\n const cleanups = refs.map(ref => {\n if (ref == null) {\n return null;\n }\n if (typeof ref === 'function') {\n const refCallback = ref;\n const refCleanup = refCallback(instance);\n return typeof refCleanup === 'function' ? refCleanup : () => {\n refCallback(null);\n };\n }\n ref.current = instance;\n return () => {\n ref.current = null;\n };\n });\n return () => {\n cleanups.forEach(refCleanup => refCleanup?.());\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps, react-hooks/use-memo\n }, refs);\n return React.useMemo(() => {\n if (refs.every(ref => ref == null)) {\n return null;\n }\n return value => {\n if (cleanupRef.current) {\n cleanupRef.current();\n cleanupRef.current = undefined;\n }\n if (value != null) {\n cleanupRef.current = refEffect(value);\n }\n };\n // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- intentionally ignoring that the dependency array must be an array literal\n // eslint-disable-next-line react-hooks/exhaustive-deps, react-hooks/use-memo\n }, refs);\n}", "'use client';\n\nimport useForkRef from '@mui/utils/useForkRef';\nexport default useForkRef;", "'use client';\n\nimport * as React from 'react';\nimport useEnhancedEffect from \"../useEnhancedEffect/index.mjs\";\n\n/**\n * Inspired by https://github.com/react/react/issues/14099#issuecomment-440013892\n * See RFC in https://github.com/reactjs/rfcs/pull/220\n */\n\nfunction useEventCallback(fn) {\n const ref = React.useRef(fn);\n useEnhancedEffect(() => {\n ref.current = fn;\n });\n return React.useRef((...args) =>\n // @ts-expect-error hide `this`\n (0, ref.current)(...args)).current;\n}\nexport default useEventCallback;", "'use client';\n\nimport useEventCallback from '@mui/utils/useEventCallback';\nexport default useEventCallback;", "'use client';\n\nimport * as React from 'react';\nimport useFocusableWhenDisabled from \"../utils/useFocusableWhenDisabled.mjs\";\nconst EMPTY = {};\nexport default function useButtonBase(parameters) {\n const {\n nativeButton,\n nativeButtonProp,\n internalNativeButton = nativeButton,\n allowInferredHostMismatch = false,\n disabled,\n type,\n hasFormAction = false,\n tabIndex = 0,\n focusableWhenDisabled: focusableWhenDisabledParam,\n stopEventPropagation = false,\n onBeforeKeyDown,\n onBeforeKeyUp\n } = parameters;\n const rootRef = React.useRef(null);\n const focusableWhenDisabled = focusableWhenDisabledParam === true;\n const focusableWhenDisabledProps = useFocusableWhenDisabled({\n focusableWhenDisabled,\n disabled,\n isNativeButton: nativeButton,\n tabIndex\n });\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n const root = rootRef.current;\n if (root == null) {\n return;\n }\n const isButtonTag = root.tagName === 'BUTTON';\n if (nativeButtonProp !== undefined) {\n if (nativeButtonProp && !isButtonTag) {\n const message = 'MUI: A component that acts as a button expected a native <button> because the ' + '`nativeButton` prop is true. Rendering a non-<button> removes native button ' + 'semantics, which can impact forms and accessibility. Render a real <button> ' + 'or set `nativeButton` to `false`.';\n console.error(message);\n }\n if (!nativeButtonProp && isButtonTag) {\n const message = 'MUI: A component that acts as a button expected a non-<button> because the `nativeButton` ' + 'prop is false. Rendering a <button> keeps native behavior while additionally applies ' + 'non-native attributes and handlers, which can add unintended extra attributes (such ' + 'as `role` or `aria-disabled`). Render a non-<button> such as <div>, or set ' + '`nativeButton` to `true`.';\n console.error(message);\n }\n return;\n }\n if (allowInferredHostMismatch) {\n return;\n }\n\n // warn when expecting a native <button> element but a non-string `component` prop resolved to a non-button element\n if (internalNativeButton && !isButtonTag) {\n const message = 'MUI: A component rendering a native <button> resolved to a non-<button> element, ' + 'but `nativeButton={false}` was not specified and the resolved root is a non-<button>. ' + 'When rendering a custom component, set `nativeButton={false}` explicitly or render a <button> element.';\n console.error(message);\n }\n\n // warn when expecting a non-button but a non-string `component` prop resolved to a native <button> element\n if (!internalNativeButton && isButtonTag) {\n const message = 'MUI: A component that acts as a non-native button resolved to a native <button> element, ' + 'but `nativeButton={true}` was not specified. ' + 'When rendering a custom component, set `nativeButton={true}` explicitly or render a non-<button> element.';\n console.error(message);\n }\n }, [allowInferredHostMismatch, internalNativeButton, nativeButtonProp]);\n }\n\n // A helper for event handlers to determine whether to use browser-defined keyboard activation\n // for native elements like <button> and <a href>, or synthesize Enter/Space clicks for non-native\n // elements like `<div role=\"button\">`.\n // This is UNSAFE TO USE outside of event handers, e.g. in render.\n const hasNativeKeyboardActivation = React.useCallback(() => {\n const root = rootRef.current;\n if (root == null) {\n return nativeButton;\n }\n if (root.tagName === 'BUTTON') {\n return true;\n }\n\n // Although this hook is not intended for links, this check is for\n // backward compatibility with `<ButtonBase href=\"#\" />` since ButtonBase\n // uses the returned event handlers.\n return Boolean(root.tagName === 'A' && root.href);\n }, [nativeButton]);\n const buttonProps = React.useMemo(() => {\n const resolvedButtonProps = focusableWhenDisabled ? {} : {\n tabIndex: disabled ? -1 : tabIndex\n };\n if (nativeButton) {\n resolvedButtonProps.type = type === undefined && !hasFormAction ? 'button' : type;\n if (!focusableWhenDisabled) {\n resolvedButtonProps.disabled = disabled;\n }\n } else {\n resolvedButtonProps.role = 'button';\n if (!focusableWhenDisabled && disabled) {\n resolvedButtonProps['aria-disabled'] = disabled;\n }\n }\n if (focusableWhenDisabled) {\n return {\n ...resolvedButtonProps,\n ...focusableWhenDisabledProps\n };\n }\n return resolvedButtonProps;\n }, [disabled, focusableWhenDisabled, focusableWhenDisabledProps, hasFormAction, nativeButton, tabIndex, type]);\n const getButtonProps = React.useCallback((externalProps = EMPTY) => {\n const {\n onClick: externalOnClick,\n onKeyDown: externalOnKeyDown,\n onKeyUp: externalOnKeyUp,\n ...otherExternalProps\n } = externalProps;\n const handleClick = event => {\n if (stopEventPropagation) {\n event.stopPropagation();\n }\n if (disabled) {\n event.preventDefault();\n return;\n }\n externalOnClick?.(event);\n };\n const handleKeyDown = event => {\n if (focusableWhenDisabled) {\n focusableWhenDisabledProps.onKeyDown(event);\n }\n if (disabled) {\n return;\n }\n onBeforeKeyDown?.(event);\n externalOnKeyDown?.(event);\n if (event.target !== event.currentTarget || hasNativeKeyboardActivation()) {\n return;\n }\n if (event.key === ' ') {\n event.preventDefault();\n return;\n }\n if (event.key === 'Enter') {\n event.preventDefault();\n event.currentTarget.click();\n }\n };\n const handleKeyUp = event => {\n if (disabled) {\n return;\n }\n onBeforeKeyUp?.(event);\n externalOnKeyUp?.(event);\n if (event.target === event.currentTarget && !hasNativeKeyboardActivation() && event.key === ' ' && !event.defaultPrevented) {\n event.currentTarget.click();\n }\n };\n return {\n ...buttonProps,\n ...otherExternalProps,\n onClick: handleClick,\n onKeyDown: handleKeyDown,\n onKeyUp: handleKeyUp\n };\n }, [buttonProps, disabled, focusableWhenDisabled, focusableWhenDisabledProps, hasNativeKeyboardActivation, onBeforeKeyDown, onBeforeKeyUp, stopEventPropagation]);\n return {\n getButtonProps,\n rootRef\n };\n}", "'use client';\n\nimport * as React from 'react';\nexport default function useFocusableWhenDisabled(parameters) {\n const {\n focusableWhenDisabled,\n disabled,\n composite = false,\n tabIndex: tabIndexProp = 0,\n isNativeButton\n } = parameters;\n const isFocusableComposite = composite && focusableWhenDisabled !== false;\n const isNonFocusableComposite = composite && focusableWhenDisabled === false;\n\n // we can't explicitly assign `undefined` to any of these props because it\n // would otherwise prevent subsequently merged props from setting them\n const props = React.useMemo(() => {\n const additionalProps = {\n // allow Tabbing away from focusableWhenDisabled elements\n onKeyDown(event) {\n if (disabled && focusableWhenDisabled && event.key !== 'Tab') {\n event.preventDefault();\n }\n }\n };\n if (!composite) {\n additionalProps.tabIndex = tabIndexProp;\n if (!isNativeButton && disabled) {\n additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1;\n }\n }\n if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled) {\n additionalProps['aria-disabled'] = disabled;\n }\n if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) {\n additionalProps.disabled = disabled;\n }\n return additionalProps;\n }, [composite, disabled, focusableWhenDisabled, isFocusableComposite, isNonFocusableComposite, isNativeButton, tabIndexProp]);\n return props;\n}", "'use client';\n\nimport * as React from 'react';\nimport useLazyRef from '@mui/utils/useLazyRef';\n/**\n * Lazy initialization container for the Ripple instance. This improves\n * performance by delaying mounting the ripple until it's needed.\n */\nexport class LazyRipple {\n /** React ref to the ripple instance */\n ref = {\n current: null\n };\n\n /** If the ripple component should be mounted */\n shouldMount = false;\n\n /** Promise that resolves when the ripple component is mounted */\n mounted = null;\n\n /** If the ripple component has been mounted */\n didMount = false;\n\n /** React state hook setter */\n setShouldMount = null;\n static create() {\n return new LazyRipple();\n }\n static use() {\n /* eslint-disable */\n const ripple = useLazyRef(LazyRipple.create).current;\n const [shouldMount, setShouldMount] = React.useState(false);\n ripple.shouldMount = shouldMount;\n ripple.setShouldMount = setShouldMount;\n React.useEffect(ripple.mountEffect, [shouldMount]);\n /* eslint-enable */\n\n return ripple;\n }\n mount() {\n if (!this.mounted) {\n this.mounted = createControlledPromise();\n this.shouldMount = true;\n this.setShouldMount(this.shouldMount);\n }\n return this.mounted;\n }\n mountEffect = () => {\n if (this.shouldMount && !this.didMount) {\n if (this.ref.current !== null) {\n this.didMount = true;\n }\n this.mounted.resolve();\n }\n };\n\n /* Ripple API */\n\n start(...args) {\n this.mount().then(() => this.ref.current?.start(...args));\n }\n stop(...args) {\n this.mount().then(() => this.ref.current?.stop(...args));\n }\n pulsate(...args) {\n this.mount().then(() => this.ref.current?.pulsate(...args));\n }\n}\nexport default function useLazyRipple() {\n return LazyRipple.use();\n}\nfunction createControlledPromise() {\n let resolve;\n let reject;\n const p = new Promise((resolveFn, rejectFn) => {\n resolve = resolveFn;\n reject = rejectFn;\n });\n p.resolve = resolve;\n p.reject = reject;\n return p;\n}", "'use client';\n\nimport * as React from 'react';\nconst UNINITIALIZED = {};\n\n/**\n * A React.useRef() that is initialized lazily with a function. Note that it accepts an optional\n * initialization argument, so the initialization function doesn't need to be an inline closure.\n *\n * @usage\n * const ref = useLazyRef(sortColumns, columns)\n */\nexport default function useLazyRef(init, initArg) {\n const ref = React.useRef(UNINITIALIZED);\n if (ref.current === UNINITIALIZED) {\n ref.current = init(initArg);\n }\n return ref;\n}", "'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport useOnMount from '@mui/utils/useOnMount';\nimport useTimeout from '@mui/utils/useTimeout';\nimport { keyframes, css, styled, useTheme } from \"../zero-styled/index.mjs\";\nimport { useDefaultProps } from \"../DefaultPropsProvider/index.mjs\";\nimport Ripple from \"./Ripple.mjs\";\nimport touchRippleClasses from \"./touchRippleClasses.mjs\";\nimport useEventCallback from \"../utils/useEventCallback.mjs\";\nimport useReducedMotion from \"../transitions/useReducedMotion.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst DURATION = 550;\nexport const DELAY_RIPPLE = 80;\nconst EMPTY_OBJ = {};\nconst EMPTY_ARRAY = [];\nconst NOOP = () => {};\n\n/**\n * Keep the same DOM order TouchRipple had when it used react-transition-group:\n * exiting ripples stay in place, and new ripples are inserted before the final\n * group of ripples that are waiting for their exit animation to finish.\n *\n * @param {number[]} prevOrder The previous DOM order, including ripples that may be exiting.\n * @param {number[]} nextActiveKeys The ripples that should still be treated as active.\n * @returns {number[]} The next DOM order, preserving the position of exiting ripples where possible.\n */\nfunction mergeRippleOrder(prevOrder, nextActiveKeys) {\n const nextKeySet = new Set(nextActiveKeys);\n const nextKeysPending = new Map();\n let pendingKeys = [];\n for (const prevKey of prevOrder) {\n if (nextKeySet.has(prevKey)) {\n if (pendingKeys.length > 0) {\n nextKeysPending.set(prevKey, pendingKeys);\n pendingKeys = [];\n }\n } else {\n pendingKeys.push(prevKey);\n }\n }\n const nextOrder = [];\n for (const nextKey of nextActiveKeys) {\n const pendingBefore = nextKeysPending.get(nextKey);\n if (pendingBefore) {\n nextOrder.push(...pendingBefore);\n }\n nextOrder.push(nextKey);\n }\n nextOrder.push(...pendingKeys);\n return nextOrder;\n}\n\n/**\n * Calculate where the ripple should start and how large it must be to cover the host element.\n *\n * @param {object} params\n * @param {object} params.event The mouse or touch event that started the ripple.\n * @param {HTMLElement | null} params.element The host element used for measurements. Tests pass `null`.\n * @param {boolean} params.center If `true`, start the ripple from the center of the host element.\n * @returns {{ rippleX: number, rippleY: number, rippleSize: number }} The ripple position and size.\n */\nfunction computeRippleState({\n event,\n element,\n center\n}) {\n const rect = element ? element.getBoundingClientRect() : {\n width: 0,\n height: 0,\n left: 0,\n top: 0\n };\n let rippleX;\n let rippleY;\n if (center || event === undefined || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) {\n rippleX = Math.round(rect.width / 2);\n rippleY = Math.round(rect.height / 2);\n } else {\n const {\n clientX,\n clientY\n } = event.touches && event.touches.length > 0 ? event.touches[0] : event;\n rippleX = Math.round(clientX - rect.left);\n rippleY = Math.round(clientY - rect.top);\n }\n let rippleSize;\n if (center) {\n rippleSize = Math.sqrt((2 * rect.width ** 2 + rect.height ** 2) / 3);\n\n // Mobile Chrome can skip this animation for even pixel sizes.\n if (rippleSize % 2 === 0) {\n rippleSize += 1;\n }\n } else {\n const sizeX = Math.max(Math.abs((element ? element.clientWidth : 0) - rippleX), rippleX) * 2 + 2;\n const sizeY = Math.max(Math.abs((element ? element.clientHeight : 0) - rippleY), rippleY) * 2 + 2;\n rippleSize = Math.sqrt(sizeX ** 2 + sizeY ** 2);\n }\n return {\n rippleX,\n rippleY,\n rippleSize\n };\n}\nconst enterKeyframe = keyframes`\n 0% {\n transform: scale(0);\n opacity: 0.1;\n }\n\n 100% {\n transform: scale(1);\n opacity: 0.3;\n }\n`;\nconst exitKeyframe = keyframes`\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n`;\nconst pulsateKeyframe = keyframes`\n 0% {\n transform: scale(1);\n }\n\n 50% {\n transform: scale(0.92);\n }\n\n 100% {\n transform: scale(1);\n }\n`;\nfunction getAnimationStyles(theme) {\n if (theme.motion.reducedMotion === 'always') {\n return null;\n }\n const styles = css`\n &.${touchRippleClasses.rippleVisible} {\n animation-name: ${enterKeyframe};\n animation-duration: ${DURATION}ms;\n animation-timing-function: ${theme.transitions.easing.easeInOut};\n }\n\n &.${touchRippleClasses.ripplePulsate} {\n animation-duration: ${theme.transitions.duration.shorter}ms;\n }\n\n & .${touchRippleClasses.childLeaving} {\n animation-name: ${exitKeyframe};\n animation-duration: ${DURATION}ms;\n animation-timing-function: ${theme.transitions.easing.easeInOut};\n }\n\n & .${touchRippleClasses.childPulsate} {\n animation-name: ${pulsateKeyframe};\n animation-duration: 2500ms;\n animation-timing-function: ${theme.transitions.easing.easeInOut};\n animation-iteration-count: infinite;\n animation-delay: 200ms;\n }\n `;\n if (theme.motion.reducedMotion === 'system') {\n return css`\n @media (prefers-reduced-motion: no-preference) {\n ${styles}\n }\n `;\n }\n return styles;\n}\nexport const TouchRippleRoot = styled('span', {\n name: 'MuiTouchRipple',\n slot: 'Root'\n})({\n overflow: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n zIndex: 0,\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n borderRadius: 'inherit'\n});\n\n// This `styled()` call uses keyframes. styled-components only supports keyframes\n// in template strings, so do not convert these styles to a JS object.\nexport const TouchRippleRipple = styled(Ripple, {\n name: 'MuiTouchRipple',\n slot: 'Ripple'\n})`\n opacity: 0;\n position: absolute;\n\n &.${touchRippleClasses.rippleVisible} {\n opacity: 0.3;\n transform: scale(1);\n }\n\n /*\n * Order matters: 'child', 'childLeaving' and 'childPulsate' apply to the same\n * element with equal specificity, so the later rule wins. 'child' must come\n * before 'childLeaving' so the leaving 'opacity: 0' takes precedence. A focus\n * (pulsate) ripple keeps 'pulsateKeyframe' (no opacity animation) on exit, so\n * it relies on this static 'opacity: 0' to disappear on blur instead of\n * lingering until removal.\n */\n & .${touchRippleClasses.child} {\n opacity: 1;\n display: block;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: currentColor;\n }\n\n & .${touchRippleClasses.childLeaving} {\n opacity: 0;\n }\n\n & .${touchRippleClasses.childPulsate} {\n position: absolute;\n /* @noflip */\n left: 0px;\n top: 0;\n }\n\n ${({\n theme\n}) => getAnimationStyles(theme)}\n`;\n\n/**\n * @ignore - internal component.\n */\nconst TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiTouchRipple'\n });\n const theme = useTheme();\n const reducedMotion = useReducedMotion(theme.motion.reducedMotion, false);\n const {\n center: centerProp = false,\n classes = EMPTY_OBJ,\n className,\n ...other\n } = props;\n // Store ripples as data so we can keep exiting ripples mounted until their\n // exit animation ends. Ripple calls onExited when it is safe to remove one.\n const [rippleState, setRippleState] = React.useState({\n items: EMPTY_ARRAY,\n order: EMPTY_ARRAY\n });\n const ripples = rippleState.items;\n const nextKey = React.useRef(0);\n const rippleCallback = React.useRef(null);\n const mountedRef = React.useRef(false);\n useOnMount(() => {\n mountedRef.current = true;\n return () => {\n mountedRef.current = false;\n };\n });\n React.useEffect(() => {\n if (rippleCallback.current) {\n rippleCallback.current();\n rippleCallback.current = null;\n }\n }, [ripples]);\n\n // Used to filter out mouse emulated events on mobile.\n const ignoringMouseDown = React.useRef(false);\n // We use a timer in order to only show the ripples for touch \"click\" like events.\n // We don't want to display the ripple for touch scroll events.\n const startTimer = useTimeout();\n\n // Holds delayed touch-start work until the delay expires or touchend forces it to run.\n const startTimerCommit = React.useRef(null);\n const container = React.useRef(null);\n const handleExited = useEventCallback(key => {\n if (!mountedRef.current) {\n return;\n }\n setRippleState(prevState => {\n const nextItems = prevState.items.filter(ripple => ripple.key !== key);\n const nextOrder = mergeRippleOrder(prevState.order.filter(rippleKey => rippleKey !== key), nextItems.filter(ripple => !ripple.exiting).map(ripple => ripple.key));\n return {\n items: nextItems,\n order: nextOrder\n };\n });\n });\n const startCommit = useEventCallback(params => {\n const {\n pulsate,\n rippleX,\n rippleY,\n rippleSize,\n cb\n } = params;\n const key = nextKey.current;\n nextKey.current += 1;\n setRippleState(prevState => {\n const nextItems = [...prevState.items, {\n key,\n pulsate,\n rippleX,\n rippleY,\n rippleSize,\n exiting: false\n }];\n return {\n items: nextItems,\n order: mergeRippleOrder(prevState.order, nextItems.filter(ripple => !ripple.exiting).map(ripple => ripple.key))\n };\n });\n rippleCallback.current = cb;\n });\n const start = useEventCallback((event = EMPTY_OBJ, options = EMPTY_OBJ, cb = NOOP) => {\n const {\n pulsate = false,\n center = centerProp || options.pulsate,\n fakeElement = false // Used only by tests.\n } = options;\n if (event?.type === 'mousedown' && ignoringMouseDown.current) {\n ignoringMouseDown.current = false;\n return;\n }\n if (event?.type === 'touchstart') {\n ignoringMouseDown.current = true;\n }\n const element = fakeElement ? null : container.current;\n const {\n rippleX,\n rippleY,\n rippleSize\n } = computeRippleState({\n event,\n element,\n center\n });\n\n // Delay touch ripples so scroll gestures do not flash a ripple.\n if (event?.touches) {\n // Ignore extra touchstart events from multi-touch. There is only one\n // delayed start callback to clear on unmount.\n if (startTimerCommit.current === null) {\n startTimerCommit.current = () => {\n startCommit({\n pulsate,\n rippleX,\n rippleY,\n rippleSize,\n cb\n });\n };\n startTimer.start(DELAY_RIPPLE, () => {\n if (startTimerCommit.current) {\n startTimerCommit.current();\n startTimerCommit.current = null;\n }\n });\n }\n } else {\n startCommit({\n pulsate,\n rippleX,\n rippleY,\n rippleSize,\n cb\n });\n }\n });\n const pulsate = useEventCallback(() => {\n start(EMPTY_OBJ, {\n pulsate: true\n });\n });\n const stop = useEventCallback((event, cb) => {\n startTimer.clear();\n\n // If touch ends before the delay finishes, show the ripple now and stop it\n // on the next tick so the user still gets feedback.\n if (event?.type === 'touchend' && startTimerCommit.current) {\n startTimerCommit.current();\n startTimerCommit.current = null;\n startTimer.start(0, () => {\n stop(event, cb);\n });\n return;\n }\n startTimerCommit.current = null;\n setRippleState(prevState => {\n const firstActiveIndex = prevState.items.findIndex(ripple => !ripple.exiting);\n if (firstActiveIndex === -1) {\n return prevState;\n }\n const nextItems = prevState.items.slice();\n nextItems[firstActiveIndex] = {\n ...nextItems[firstActiveIndex],\n exiting: true\n };\n return {\n items: nextItems,\n order: mergeRippleOrder(prevState.order, nextItems.filter(ripple => !ripple.exiting).map(ripple => ripple.key))\n };\n });\n rippleCallback.current = cb;\n });\n React.useImperativeHandle(ref, () => ({\n pulsate,\n start,\n stop\n }), [pulsate, start, stop]);\n const rippleByKey = new Map(ripples.map(ripple => [ripple.key, ripple]));\n const orderedRipples = rippleState.order.map(rippleKey => rippleByKey.get(rippleKey)).filter(Boolean);\n\n // Keep the old react-transition-group DOM order:\n // exiting ripples stay in place, and new ripples are inserted before the\n // final group waiting for its exit animation to finish.\n return /*#__PURE__*/_jsx(TouchRippleRoot, {\n className: clsx(touchRippleClasses.root, classes.root, className),\n ref: container,\n ...other,\n children: orderedRipples.map(ripple => /*#__PURE__*/_jsx(TouchRippleRipple, {\n classes: {\n ripple: clsx(classes.ripple, touchRippleClasses.ripple),\n rippleVisible: clsx(classes.rippleVisible, touchRippleClasses.rippleVisible),\n ripplePulsate: clsx(classes.ripplePulsate, touchRippleClasses.ripplePulsate),\n child: clsx(classes.child, touchRippleClasses.child),\n childLeaving: clsx(classes.childLeaving, touchRippleClasses.childLeaving),\n childPulsate: clsx(classes.childPulsate, touchRippleClasses.childPulsate)\n },\n timeout: reducedMotion.shouldReduceMotion ? 0 : DURATION,\n pulsate: ripple.pulsate,\n rippleX: ripple.rippleX,\n rippleY: ripple.rippleY,\n rippleSize: ripple.rippleSize,\n in: !ripple.exiting,\n onExited: () => handleExited(ripple.key)\n }, ripple.key))\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? TouchRipple.propTypes /* remove-proptypes */ = {\n /**\n * If `true`, the ripple starts at the center of the component\n * rather than at the point of interaction.\n */\n center: PropTypes.bool,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string\n} : void 0;\nexport default TouchRipple;", "'use client';\n\nimport * as React from 'react';\nconst EMPTY = [];\n\n/**\n * A React.useEffect equivalent that runs once, when the component is mounted.\n */\nexport default function useOnMount(fn) {\n // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- no need to put `fn` in the dependency array\n /* eslint-disable react-hooks/exhaustive-deps */\n React.useEffect(fn, EMPTY);\n /* eslint-enable react-hooks/exhaustive-deps */\n}", "'use client';\n\nimport useLazyRef from \"../useLazyRef/useLazyRef.mjs\";\nimport useOnMount from \"../useOnMount/useOnMount.mjs\";\nexport class Timeout {\n static create() {\n return new Timeout();\n }\n currentId = null;\n\n /**\n * Executes `fn` after `delay`, clearing any previously scheduled call.\n */\n start(delay, fn) {\n this.clear();\n this.currentId = setTimeout(() => {\n this.currentId = null;\n fn();\n }, delay);\n }\n clear = () => {\n if (this.currentId !== null) {\n clearTimeout(this.currentId);\n this.currentId = null;\n }\n };\n disposeEffect = () => {\n return this.clear;\n };\n}\nexport default function useTimeout() {\n const timeout = useLazyRef(Timeout.create).current;\n useOnMount(timeout.disposeEffect);\n return timeout;\n}", "'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport useTimeout from '@mui/utils/useTimeout';\n\n/**\n * @ignore - internal component.\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction Ripple(props) {\n const {\n className,\n classes,\n pulsate = false,\n rippleX,\n rippleY,\n rippleSize,\n in: inProp,\n onExited,\n timeout\n } = props;\n const [leaving, setLeaving] = React.useState(false);\n const exitTimer = useTimeout();\n const exitTimerStartedRef = React.useRef(false);\n const onExitedRef = React.useRef(onExited);\n onExitedRef.current = onExited;\n const hasExitedCallback = onExited != null;\n const rippleClassName = clsx(className, classes.ripple, classes.rippleVisible, pulsate && classes.ripplePulsate);\n const rippleStyles = {\n width: rippleSize,\n height: rippleSize,\n top: -(rippleSize / 2) + rippleY,\n left: -(rippleSize / 2) + rippleX\n };\n const childClassName = clsx(classes.child, leaving && classes.childLeaving, pulsate && classes.childPulsate);\n if (!inProp && !leaving) {\n setLeaving(true);\n }\n React.useEffect(() => {\n if (!inProp && hasExitedCallback) {\n if (!exitTimerStartedRef.current) {\n exitTimerStartedRef.current = true;\n exitTimer.start(timeout, () => {\n exitTimerStartedRef.current = false;\n onExitedRef.current?.();\n });\n }\n } else {\n exitTimerStartedRef.current = false;\n exitTimer.clear();\n }\n }, [exitTimer, hasExitedCallback, inProp, timeout]);\n return /*#__PURE__*/_jsx(\"span\", {\n className: rippleClassName,\n style: rippleStyles,\n children: /*#__PURE__*/_jsx(\"span\", {\n className: childClassName\n })\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? Ripple.propTypes /* remove-proptypes */ = {\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object.isRequired,\n className: PropTypes.string,\n /**\n * @ignore - controlled by TouchRipple\n */\n in: PropTypes.bool,\n /**\n * @ignore - controlled by TouchRipple\n */\n onExited: PropTypes.func,\n /**\n * If `true`, the ripple pulsates, typically indicating the keyboard focus state of an element.\n */\n pulsate: PropTypes.bool,\n /**\n * Diameter of the ripple.\n */\n rippleSize: PropTypes.number,\n /**\n * Horizontal position of the ripple center.\n */\n rippleX: PropTypes.number,\n /**\n * Vertical position of the ripple center.\n */\n rippleY: PropTypes.number,\n /**\n * Exit delay.\n */\n timeout: PropTypes.number.isRequired\n} : void 0;\nexport default Ripple;", "import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getTouchRippleUtilityClass(slot) {\n return generateUtilityClass('MuiTouchRipple', slot);\n}\nconst touchRippleClasses = generateUtilityClasses('MuiTouchRipple', ['root', 'ripple', 'rippleVisible', 'ripplePulsate', 'child', 'childLeaving', 'childPulsate']);\nexport default touchRippleClasses;", "'use client';\n\nimport * as React from 'react';\nimport useEnhancedEffect from '@mui/utils/useEnhancedEffect';\nconst MEDIA_QUERY = '(prefers-reduced-motion: reduce)';\nconst REDUCED_MOTION_DURATION = 0;\nconst REDUCED_MOTION_DELAY = '0ms';\nconst NOOP = () => {};\nconst getDefaultSnapshot = () => false;\nconst getReducedMotionSnapshot = () => true;\nconst subscribeNoop = () => NOOP;\n/**\n * Subscribes to the OS reduced-motion media query only when the theme mode needs it.\n * React 17 reads the media query after mount, matching useMediaQuery's fallback path.\n */\nfunction useReducedMotionMediaQueryOld(enabled) {\n const [queryState, setQueryState] = React.useState(() => ({\n enabled,\n matches: enabled ? null : false\n }));\n let matches = queryState.matches;\n if (queryState.enabled !== enabled) {\n matches = null;\n if (!enabled) {\n matches = false;\n }\n }\n useEnhancedEffect(() => {\n const setResolvedMatches = nextMatches => {\n setQueryState(previousState => {\n if (previousState.enabled === enabled && previousState.matches === nextMatches) {\n return previousState;\n }\n return {\n enabled,\n matches: nextMatches\n };\n });\n };\n if (!enabled) {\n if (queryState.enabled) {\n setResolvedMatches(false);\n }\n return undefined;\n }\n if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') {\n setResolvedMatches(false);\n return undefined;\n }\n const mediaQueryList = window.matchMedia(MEDIA_QUERY);\n const update = () => {\n setResolvedMatches(mediaQueryList.matches);\n };\n update();\n mediaQueryList.addEventListener('change', update);\n return () => {\n mediaQueryList.removeEventListener('change', update);\n };\n }, [enabled, queryState.enabled]);\n return matches;\n}\n\n// See https://github.com/mui/material-ui/issues/41190#issuecomment-2040873379 for why\nconst safeReact = {\n ...React\n};\nconst maybeReactUseSyncExternalStore = safeReact.useSyncExternalStore;\n\n/**\n * React 18+ can read the media query during client renders, so newly mounted\n * transitions do not start from the SSR-safe reduced-motion default.\n */\nfunction useReducedMotionMediaQueryNew(enabled) {\n const getServerSnapshot = enabled ? getReducedMotionSnapshot : getDefaultSnapshot;\n const [getSnapshot, subscribe] = React.useMemo(() => {\n if (!enabled || typeof window === 'undefined' || typeof window.matchMedia !== 'function') {\n return [getDefaultSnapshot, subscribeNoop];\n }\n const mediaQueryList = window.matchMedia(MEDIA_QUERY);\n return [() => mediaQueryList.matches, notify => {\n mediaQueryList.addEventListener('change', notify);\n return () => {\n mediaQueryList.removeEventListener('change', notify);\n };\n }];\n }, [enabled]);\n return maybeReactUseSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}\nconst useReducedMotionMediaQuery = maybeReactUseSyncExternalStore !== undefined ? useReducedMotionMediaQueryNew : useReducedMotionMediaQueryOld;\n\n/**\n * Resolves whether a Material UI transition should reduce motion and provides\n * adjusted CSS transition timing for MUI-owned duration/delay values.\n */\nexport default function useReducedMotion(mode, disablePrefersReducedMotion) {\n const prefersReducedMotion = useReducedMotionMediaQuery(!disablePrefersReducedMotion && mode === 'system');\n const shouldReduceMotion = !disablePrefersReducedMotion && (mode === 'always' || mode === 'system' && prefersReducedMotion !== false);\n return React.useMemo(() => ({\n shouldReduceMotion,\n getTransitionTiming(timing) {\n if (!shouldReduceMotion) {\n return timing;\n }\n return {\n duration: REDUCED_MOTION_DURATION,\n delay: REDUCED_MOTION_DELAY\n };\n }\n }), [shouldReduceMotion]);\n}", "import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getButtonBaseUtilityClass(slot) {\n return generateUtilityClass('MuiButtonBase', slot);\n}\nconst buttonBaseClasses = generateUtilityClasses('MuiButtonBase', ['root', 'disabled', 'focusVisible']);\nexport default buttonBaseClasses;", "import React, { useState } from 'react'\n\nimport ArrowDropDown from '@mui/icons-material/ArrowDropDown'\nimport ArrowRight from '@mui/icons-material/ArrowRight'\nimport {\n Box,\n Button,\n Checkbox,\n FormControlLabel,\n MenuItem as MuiMenuItem,\n Radio,\n TextField,\n ToggleButton,\n ToggleButtonGroup,\n Typography,\n} from '@mui/material'\n\nimport type { MenuItem } from '@jbrowse/core/ui/Menu'\n\ntype RadioMenuItem = Extract<MenuItem, { type: 'radio' }>\n\n/**\n * A submenu of radios may name a compact control to render as: `segmented`\n * for a few short choices, `select` for a longer list\n */\nexport type ChoiceDisplay = 'segmented' | 'select'\n\nfunction radios(items: MenuItem[]) {\n return items.filter(\n (i): i is RadioMenuItem => 'type' in i && i.type === 'radio',\n )\n}\n\nfunction Caption({ children }: { children: React.ReactNode }) {\n return (\n <Typography\n variant=\"caption\"\n color=\"text.secondary\"\n sx={{ mt: 1, display: 'block' }}\n >\n {children}\n </Typography>\n )\n}\n\nfunction Segmented({\n label,\n options,\n}: {\n label: string\n options: RadioMenuItem[]\n}) {\n const value = options.findIndex(o => o.checked)\n return (\n <>\n <Caption>{label}</Caption>\n <ToggleButtonGroup\n exclusive\n fullWidth\n size=\"small\"\n value={value}\n aria-label={label}\n onChange={(_event, i: number | null) => {\n if (i !== null) {\n options[i]?.onClick()\n }\n }}\n >\n {options.map((o, i) => (\n <ToggleButton\n key={String(o.label)}\n value={i}\n disabled={o.disabled}\n title={o.helpText}\n sx={{ textTransform: 'none', py: 0.25 }}\n >\n {o.label}\n </ToggleButton>\n ))}\n </ToggleButtonGroup>\n </>\n )\n}\n\n// each option fires its own onClick, so picking the checked one again still\n// runs, which reopens a dialog like the custom gap threshold\nfunction Select({\n label,\n options,\n}: {\n label: string\n options: RadioMenuItem[]\n}) {\n const value = options.findIndex(o => o.checked)\n return (\n <TextField\n select\n size=\"small\"\n fullWidth\n label={label}\n value={value === -1 ? '' : value}\n sx={{ mt: 1.5, '& .MuiInputBase-root': { typography: 'body2' } }}\n >\n {options.map((o, i) => (\n <MuiMenuItem\n key={String(o.label)}\n value={i}\n disabled={o.disabled}\n dense\n onClick={() => {\n o.onClick()\n }}\n >\n {o.label}\n </MuiMenuItem>\n ))}\n </TextField>\n )\n}\n\n// a short submenu opens in place under a caption, where every choice shows at\n// once; a long one, like the extra color schemes, folds behind a toggle\nconst inlineUpTo = 8\n\nfunction SubSection({ item }: { item: MenuItem }) {\n const [open, setOpen] = useState(false)\n if (!('subMenu' in item) || !Array.isArray(item.subMenu)) {\n return null\n }\n const label = String(item.label)\n const display =\n 'display' in item ? (item.display as ChoiceDisplay) : undefined\n if (display) {\n const options = radios(item.subMenu)\n const rest = item.subMenu.filter(i => !options.includes(i as RadioMenuItem))\n const Control = display === 'segmented' ? Segmented : Select\n return (\n <>\n <Control label={label} options={options} />\n <MenuItemsForm items={rest} />\n </>\n )\n }\n if (item.subMenu.length <= inlineUpTo) {\n return (\n <>\n <Caption>{label}</Caption>\n <MenuItemsForm items={item.subMenu} />\n </>\n )\n }\n return (\n <>\n <Button\n size=\"small\"\n color=\"inherit\"\n startIcon={open ? <ArrowDropDown /> : <ArrowRight />}\n onClick={() => {\n setOpen(!open)\n }}\n sx={{ textTransform: 'none', justifyContent: 'flex-start', px: 0.5 }}\n >\n {label}\n </Button>\n {open ? (\n <Box sx={{ pl: 2 }}>\n <MenuItemsForm items={item.subMenu} />\n </Box>\n ) : null}\n </>\n )\n}\n\nexport default function MenuItemsForm({ items }: { items: MenuItem[] }) {\n return (\n <Box sx={{ display: 'flex', flexDirection: 'column' }}>\n {items.map((item, i) => {\n const key = 'label' in item ? String(item.label) : String(i)\n if (!('label' in item)) {\n return null\n }\n if ('type' in item && item.type === 'subHeader') {\n return <Caption key={key}>{item.label}</Caption>\n }\n if ('subMenu' in item) {\n return <SubSection key={key} item={item} />\n }\n const onClick = 'onClick' in item ? item.onClick : undefined\n if (\n 'type' in item &&\n (item.type === 'checkbox' || item.type === 'radio')\n ) {\n const Control = item.type === 'checkbox' ? Checkbox : Radio\n return (\n <FormControlLabel\n key={key}\n disabled={item.disabled}\n control={\n <Control\n size=\"small\"\n checked={item.checked}\n onChange={() => onClick?.()}\n sx={{ py: 0.25 }}\n />\n }\n label={item.label}\n slotProps={{ typography: { variant: 'body2' } }}\n />\n )\n }\n return (\n <Button\n key={key}\n size=\"small\"\n disabled={item.disabled}\n onClick={() => onClick?.()}\n sx={{ alignSelf: 'flex-start', textTransform: 'none' }}\n >\n {item.label}\n </Button>\n )\n })}\n </Box>\n )\n}\n", "import React, { useState } from 'react'\n\nimport {\n Box,\n Button,\n Checkbox,\n FormControlLabel,\n TextField,\n Typography,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport type { MsaViewModel } from '../../model.ts'\n\ninterface Entry {\n id: string\n label: string\n}\n\nfunction trackGroups(model: MsaViewModel) {\n const computed = new Set(model.computedTrackModels.map(t => t.model.id))\n const computedEntries: Entry[] = []\n const alignmentEntries: Entry[] = []\n const referenceEntries: Entry[] = []\n for (const { model: t } of model.tracks) {\n const entries =\n t.kind === 'reference'\n ? referenceEntries\n : computed.has(t.id)\n ? computedEntries\n : alignmentEntries\n entries.push({ id: t.id, label: t.name })\n }\n return [\n { title: 'Computed from the alignment', entries: computedEntries },\n { title: 'Alignment annotations', entries: alignmentEntries },\n { title: 'Reference row', entries: referenceEntries },\n ].filter(g => g.entries.length > 0)\n}\n\n// a filter box shows once the list is long enough to need one\nconst filterFrom = 10\n\nconst TrackList = observer(function ({ model }: { model: MsaViewModel }) {\n const [filter, setFilter] = useState('')\n const shown = new Set(model.turnedOnTracks.map(t => t.model.id))\n const all = trackGroups(model)\n const needle = filter.trim().toLowerCase()\n const groups = all\n .map(g => ({\n ...g,\n entries: g.entries.filter(e => e.label.toLowerCase().includes(needle)),\n }))\n .filter(g => g.entries.length > 0)\n const matching = groups.flatMap(g => g.entries.map(e => e.id))\n const long = all.reduce((n, g) => n + g.entries.length, 0) >= filterFrom\n return (\n <>\n {long ? (\n <>\n <TextField\n size=\"small\"\n placeholder=\"Filter tracks\"\n value={filter}\n onChange={event => {\n setFilter(event.target.value)\n }}\n fullWidth\n />\n <Box sx={{ display: 'flex' }}>\n <Button\n size=\"small\"\n onClick={() => {\n model.setTracksShown(matching, true)\n }}\n >\n Show all\n </Button>\n <Button\n size=\"small\"\n onClick={() => {\n model.setTracksShown(matching, false)\n }}\n >\n Hide all\n </Button>\n </Box>\n </>\n ) : null}\n {groups.map(({ title, entries }) => (\n <Box key={title}>\n {groups.length > 1 ? (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {title}\n </Typography>\n ) : null}\n {entries.map(({ id, label }) => (\n <FormControlLabel\n key={id}\n sx={{ display: 'flex' }}\n control={\n <Checkbox\n size=\"small\"\n checked={shown.has(id)}\n onChange={() => {\n model.toggleTrack(id)\n }}\n sx={{ py: 0.25 }}\n />\n }\n label={label}\n slotProps={{ typography: { variant: 'body2' } }}\n />\n ))}\n </Box>\n ))}\n {groups.length === 0 ? (\n <Typography variant=\"body2\">No track matches</Typography>\n ) : null}\n </>\n )\n})\n\nexport default TrackList\n", "import React, { useState } from 'react'\n\nimport { observer } from 'mobx-react'\n\nimport { useCanvasTheme } from '../../darkReader.ts'\nimport { useCanvasAutorun } from '../../useCanvasAutorun.ts'\nimport {\n drawTreeOverview,\n drawTreeOverviewBox,\n treeOverviewImage,\n} from './renderTreeOverview.ts'\n\nimport type { MsaViewModel } from '../../model.ts'\n\n/**\n * The brush on the row scale: the whole tree drawn small above the tree panel,\n * with the focused subtree boxed. A click focuses the subtree under the\n * pointer, and a click inside the box clears the focus.\n *\n * The tree itself comes off a cached offscreen canvas, so the frames a pointer\n * moving across it costs are a blit and two boxes.\n */\nconst TreeOverview = observer(function ({ model }: { model: MsaViewModel }) {\n const { effectiveTreeAreaWidth, overviewHeight, highResScaleFactor } = model\n const theme = useCanvasTheme()\n const [hover, setHover] = useState<{ id: string; rows: [number, number] }>()\n const width = Math.round(effectiveTreeAreaWidth * highResScaleFactor)\n const height = Math.round(overviewHeight * highResScaleFactor)\n\n const ref = useCanvasAutorun({\n draw: ctx => {\n ctx.resetTransform()\n ctx.clearRect(0, 0, width, height)\n const image = treeOverviewImage({\n model,\n theme,\n width: effectiveTreeAreaWidth,\n height: overviewHeight,\n scale: highResScaleFactor,\n })\n ctx.scale(highResScaleFactor, highResScaleFactor)\n const box = {\n model,\n ctx,\n width: effectiveTreeAreaWidth,\n height: overviewHeight,\n }\n if (image) {\n ctx.drawImage(\n image,\n 0,\n 0,\n image.width,\n image.height,\n 0,\n 0,\n box.width,\n box.height,\n )\n } else {\n drawTreeOverview({ ...box, theme })\n }\n if (hover) {\n drawTreeOverviewBox({\n ...box,\n rows: hover.rows,\n color: theme.palette.text.secondary,\n })\n }\n const focus = model.treeOverviewFocusRows\n if (focus) {\n drawTreeOverviewBox({\n ...box,\n rows: focus,\n color: theme.palette.text.primary,\n })\n }\n },\n width,\n height,\n deps: [model, theme, hover],\n })\n\n return (\n <canvas\n data-testid=\"tree_overview\"\n ref={ref}\n width={width}\n height={height}\n style={{\n display: 'block',\n flexShrink: 0,\n cursor: 'pointer',\n width: effectiveTreeAreaWidth,\n height: overviewHeight,\n }}\n onMouseMove={event => {\n const hit = model.treeOverviewHit(event.nativeEvent.offsetY)\n setHover(prev => (prev?.id === hit?.id ? prev : hit))\n }}\n onMouseLeave={() => {\n setHover(undefined)\n }}\n onClick={event => {\n model.treeOverviewClick(event.nativeEvent.offsetY)\n }}\n />\n )\n})\n\nexport default TreeOverview\n", "import React from 'react'\n\nimport { observer } from 'mobx-react'\n\nimport TreeCanvas from './TreeCanvas.tsx'\n\nimport type { MsaViewModel } from '../../model.ts'\n\nconst TreePanel = observer(function ({ model }: { model: MsaViewModel }) {\n const { effectiveTreeAreaWidth } = model\n return (\n <div\n style={{\n overflow: 'hidden',\n flexShrink: 0,\n width: effectiveTreeAreaWidth,\n }}\n >\n <TreeCanvas model={model} />\n </div>\n )\n})\n\nexport default TreePanel\n", "import React, { useRef } from 'react'\n\nimport { isAlive } from '@jbrowse/mobx-state-tree'\nimport { observer } from 'mobx-react'\n\nimport { useCanvasAutorun } from '../../useCanvasAutorun.ts'\nimport { useWheelScroll } from '../../useWheelScroll.ts'\nimport CladeLabels from './CladeLabels.tsx'\nimport TreeCanvasBlock from './TreeCanvasBlock.tsx'\nimport { renderTreeMouseover } from './renderTreeMouseover.ts'\n\nimport type { MsaViewModel } from '../../model.ts'\n\nconst TreeCanvas = observer(function ({ model }: { model: MsaViewModel }) {\n const ref = useRef<HTMLDivElement>(null)\n const {\n height,\n blocksY,\n effectiveTreeAreaWidth,\n scrollY,\n highResScaleFactor,\n } = model\n const { onPointerDown, touchAction } = useWheelScroll({\n ref,\n model,\n axes: 'y',\n })\n\n const canvasWidth = effectiveTreeAreaWidth * highResScaleFactor\n const canvasHeight = height * highResScaleFactor\n const mouseoverRef = useCanvasAutorun({\n draw: ctx => {\n if (isAlive(model)) {\n renderTreeMouseover({ ctx, model })\n }\n },\n width: canvasWidth,\n height: canvasHeight,\n deps: [model],\n })\n\n return (\n <div\n ref={ref}\n onPointerDown={onPointerDown}\n style={{\n touchAction,\n height,\n position: 'relative',\n width: effectiveTreeAreaWidth,\n }}\n >\n {/* one transform for the whole block set, matching MSACanvas: the tree\n scrolls in lockstep with the alignment and on the same compositor move */}\n <div\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n transform: `translateY(${scrollY}px)`,\n willChange: 'transform',\n }}\n >\n {blocksY.map(block => (\n <TreeCanvasBlock key={block} model={model} offsetY={block} />\n ))}\n <CladeLabels model={model} />\n </div>\n <canvas\n ref={mouseoverRef}\n width={canvasWidth}\n height={canvasHeight}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n width: effectiveTreeAreaWidth,\n height,\n zIndex: 1000,\n pointerEvents: 'none',\n }}\n />\n </div>\n )\n})\n\nexport default TreeCanvas\n", "import React from 'react'\n\nimport { useTheme } from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport { cladeLabelBoxes } from './cladeBrackets.ts'\n\nimport type { MsaViewModel } from '../../model.ts'\n\n/**\n * The label of each bracket, in the gutter beside its bar, where the canvas\n * draws the bar itself. The text is DOM text, turned on its side for a clade\n * shorter than the font, the way the strip headers are; the SVG export draws\n * the same labels with a `rotate(-90)`.\n */\nconst CladeLabels = observer(function ({ model }: { model: MsaViewModel }) {\n const theme = useTheme()\n const { fontSize } = model\n return (\n <>\n {cladeLabelBoxes(model).map(box => (\n <div\n key={box.key}\n title={box.label}\n style={{\n position: 'absolute',\n left: box.left,\n top: box.top,\n width: box.width,\n height: box.height,\n display: 'flex',\n alignItems: 'center',\n color: box.color ?? theme.palette.text.primary,\n fontSize,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n pointerEvents: 'none',\n // vertical-rl reads top to bottom, and the half turn makes it\n // read upwards, which is what rotate(-90) exports\n ...(box.horizontal\n ? {}\n : { writingMode: 'vertical-rl', transform: 'rotate(180deg)' }),\n }}\n >\n {box.label}\n </div>\n ))}\n </>\n )\n})\n\nexport default CladeLabels\n", "import React, { useState } from 'react'\n\nimport BaseTooltip from '@jbrowse/core/ui/BaseTooltip'\nimport { makeStyles } from '@jbrowse/core/util/tss-react'\nimport { observer } from 'mobx-react'\n\nimport { useCanvasTheme } from '../../darkReader.ts'\nimport { useCanvasAutorun } from '../../useCanvasAutorun.ts'\nimport TreeMenu from './TreeMenu.tsx'\nimport { renderTreeCanvas } from './renderTreeCanvas.ts'\nimport { useTreeHover } from './useTreeHover.ts'\n\nimport type { MsaViewModel } from '../../model.ts'\nimport type { TreeMenuTarget } from './TreeMenu.tsx'\n\nconst useStyles = makeStyles()(theme => ({\n hover: {\n position: 'absolute',\n pointerEvents: 'none',\n zIndex: 100,\n background: theme.palette.action.hover,\n },\n}))\n\nconst TreeCanvasBlock = observer(function ({\n model,\n offsetY,\n}: {\n model: MsaViewModel\n offsetY: number\n}) {\n const { classes } = useStyles()\n const theme = useCanvasTheme()\n const [menu, setMenu] = useState<TreeMenuTarget>()\n const { clickMap, anchor, hitTest, onMouseMove, onMouseLeave } = useTreeHover(\n { model, offsetY },\n )\n const hovered = anchor?.value\n\n const { effectiveTreeAreaWidth, blockSize, highResScaleFactor } = model\n // TreePanel clips to the tree area, so a wider canvas is wasted backing store\n const width = effectiveTreeAreaWidth\n const height = blockSize\n\n const canvasWidth = width * highResScaleFactor\n const canvasHeight = height * highResScaleFactor\n const ref = useCanvasAutorun({\n draw: ctx => {\n ctx.resetTransform()\n ctx.clearRect(0, 0, canvasWidth, canvasHeight)\n renderTreeCanvas({\n ctx,\n model,\n offsetY,\n clickMap,\n theme,\n })\n },\n width: canvasWidth,\n height: canvasHeight,\n deps: [model, clickMap, offsetY, theme],\n })\n\n const style = {\n width,\n height,\n top: offsetY,\n left: 0,\n position: 'absolute',\n } as const\n\n return (\n <>\n {menu ? (\n <TreeMenu\n node={menu}\n model={model}\n onClose={() => {\n setMenu(undefined)\n }}\n />\n ) : null}\n\n <canvas\n ref={ref}\n width={canvasWidth}\n height={canvasHeight}\n style={{ ...style, cursor: hovered ? 'pointer' : 'default' }}\n onMouseMove={event => {\n onMouseMove(event)\n }}\n onMouseLeave={() => {\n onMouseLeave()\n }}\n onClick={event => {\n const entry = hitTest(event)\n if (entry) {\n setMenu({\n x: event.clientX,\n y: event.clientY,\n id: entry.id,\n name: entry.name,\n leaf: !entry.branch,\n })\n }\n }}\n />\n\n {/* direct-hover highlight, drawn only for leaf labels */}\n {hovered && !hovered.branch ? (\n <div\n className={classes.hover}\n style={{\n left: hovered.minX,\n top: hovered.minY,\n width: hovered.maxX - hovered.minX,\n height: hovered.maxY - hovered.minY,\n }}\n />\n ) : null}\n\n {anchor ? (\n <BaseTooltip clientPoint={anchor.clientPoint}>\n {anchor.value.label ?? anchor.value.name}\n </BaseTooltip>\n ) : null}\n </>\n )\n})\n\nexport default TreeCanvasBlock\n", "import React, { lazy } from 'react'\n\nimport { Menu, MenuItem } from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport type { MsaViewModel } from '../../model.ts'\n\nconst TreeNodeInfoDialog = lazy(\n () => import('./dialogs/TreeNodeInfoDialog.tsx'),\n)\n\nexport interface TreeMenuTarget {\n x: number\n y: number\n name: string\n id: string\n leaf: boolean\n}\n\nconst TreeMenu = observer(function ({\n node,\n model,\n onClose,\n}: {\n node: TreeMenuTarget\n model: MsaViewModel\n onClose: () => void\n}) {\n const { collapsed, showOnly, relativeTo } = model\n const { name, id, leaf } = node\n const isCollapsed = collapsed.includes(id)\n const isRoot = id === model.tree.id\n const noun = leaf ? 'subtree' : 'clade'\n return (\n <Menu\n anchorReference=\"anchorPosition\"\n anchorPosition={{ left: node.x, top: node.y }}\n transitionDuration={0}\n open\n onClose={onClose}\n >\n <MenuItem dense disabled>\n {name}\n </MenuItem>\n {leaf ? (\n <MenuItem\n dense\n onClick={() => {\n model.queueDialog(onClose => [\n TreeNodeInfoDialog,\n { info: model.getRowData(name), model, nodeName: name, onClose },\n ])\n onClose()\n }}\n >\n More info...\n </MenuItem>\n ) : null}\n <MenuItem\n dense\n onClick={() => {\n model.toggleCollapsed(id)\n onClose()\n }}\n >\n {isCollapsed ? `Expand ${noun}` : `Collapse ${noun}`}\n </MenuItem>\n {leaf ? null : (\n <MenuItem\n dense\n onClick={() => {\n model.setShowOnly(showOnly === id ? undefined : id)\n onClose()\n }}\n >\n {showOnly === id ? 'Show all rows' : 'Show only this clade'}\n </MenuItem>\n )}\n {leaf || isCollapsed ? null : (\n <MenuItem\n dense\n onClick={() => {\n model.toggleRotated(id)\n onClose()\n }}\n >\n Rotate clade\n </MenuItem>\n )}\n {isRoot ? null : (\n <MenuItem\n dense\n onClick={() => {\n model.rerootAt(id)\n onClose()\n }}\n >\n Reroot here\n </MenuItem>\n )}\n {leaf ? (\n <MenuItem\n dense\n onClick={() => {\n model.drawRelativeTo(name)\n onClose()\n }}\n >\n Use as reference row\n </MenuItem>\n ) : null}\n {leaf && relativeTo ? (\n <MenuItem\n dense\n onClick={() => {\n model.drawRelativeTo(undefined)\n onClose()\n }}\n >\n Clear reference row\n </MenuItem>\n ) : null}\n </Menu>\n )\n})\n\nexport default TreeMenu\n", "import { useState } from 'react'\n\nimport { useHoverAnchor } from '../useHoverAnchor.ts'\nimport { ClickMapIndex } from './clickMap.ts'\n\nimport type { MsaViewModel } from '../../model.ts'\nimport type { ClickEntry } from './clickMap.ts'\nimport type React from 'react'\n\n/**\n * Owns hit-testing for one tree block: the spatial index the render pass fills\n * in, the entry under the pointer with its tooltip anchor, and the model hover\n * state that the MSA panel mirrors.\n */\nexport function useTreeHover({\n model,\n offsetY,\n}: {\n model: MsaViewModel\n offsetY: number\n}) {\n const [clickMap] = useState(() => new ClickMapIndex())\n const { anchor, hoverAt, clearAnchor } = useHoverAnchor<ClickEntry>()\n\n // leaf labels win over the branch/bubble targets they overlap, so a click on a\n // name opens the leaf's menu\n function hitTest(event: React.MouseEvent) {\n const x = event.nativeEvent.offsetX\n const y = event.nativeEvent.offsetY + offsetY\n const entries = clickMap.search({\n minX: x,\n maxX: x + 1,\n minY: y,\n maxY: y + 1,\n })\n return entries.find(entry => !entry.branch) ?? entries[0]\n }\n\n function onMouseMove(event: React.MouseEvent) {\n const entry = hitTest(event)\n hoverAt(event, entry)\n // hovering an internal node highlights every tip below it; hovering a leaf\n // label additionally drives the single-row highlight\n model.setHoveredTreeNode(entry?.id)\n model.setMousePos(\n undefined,\n entry && !entry.branch ? model.rowNamesSet.get(entry.name) : undefined,\n )\n }\n\n function onMouseLeave() {\n clearAnchor()\n model.setHoveredTreeNode(undefined)\n model.setMousePos(undefined, undefined)\n }\n\n return { clickMap, anchor, hitTest, onMouseMove, onMouseLeave }\n}\n", "\n/**\n * @typedef {Float64ArrayConstructor | Float32ArrayConstructor |\n * Uint32ArrayConstructor | Int32ArrayConstructor | Uint16ArrayConstructor |\n * Int16ArrayConstructor | Uint8ArrayConstructor | Int8ArrayConstructor} TypedArrayConstructor\n */\n\n/** @template [T=number] */\nexport default class FlatQueue {\n\n /**\n * Creates an empty queue. If `capacity` is provided, the queue is backed by fixed-size typed\n * arrays for better performance and memory use, but can't grow beyond `capacity`. `values` uses\n * `ValuesArray` (default `Float64Array`) and `ids` uses `IdsArray` (default `Uint32Array`); pass\n * narrower constructors like `Uint16Array` if your values or ids are known to fit them.\n *\n * @param {number} [capacity]\n * @param {TypedArrayConstructor} [ValuesArray]\n * @param {TypedArrayConstructor} [IdsArray]\n */\n constructor(capacity = Infinity, ValuesArray = Float64Array, IdsArray = Uint32Array) {\n const fixed = capacity !== Infinity;\n\n /** @type {T[]} */\n this.ids = fixed ? /** @type {T[]} */ (/** @type {unknown} */ (new IdsArray(capacity))) : [];\n\n /** @type {number[]} */\n this.values = fixed ? /** @type {number[]} */ (/** @type {unknown} */ (new ValuesArray(capacity))) : [];\n\n /** Maximum number of items the queue can hold; `Infinity` for regular-array queues, which grow on demand. */\n this.capacity = capacity;\n\n /** Number of items in the queue. */\n this.length = 0;\n }\n\n /** Removes all items from the queue. */\n clear() {\n this.length = 0;\n }\n\n /**\n * Adds `item` to the queue with the specified `priority`.\n *\n * `priority` must be a number. Items are sorted and returned from low to high priority. Multiple items\n * with the same priority value can be added to the queue, but there is no guaranteed order between these items.\n *\n * For fixed-capacity queues, throws a `RangeError` if the queue is already full.\n *\n * @param {T} item\n * @param {number} priority\n */\n push(item, priority) {\n if (this.length === this.capacity) throw new RangeError('Queue is at capacity.');\n\n let pos = this.length++;\n\n while (pos > 0) {\n const parent = (pos - 1) >> 1;\n const parentValue = this.values[parent];\n if (priority >= parentValue) break;\n this.ids[pos] = this.ids[parent];\n this.values[pos] = parentValue;\n pos = parent;\n }\n\n this.ids[pos] = item;\n this.values[pos] = priority;\n }\n\n /**\n * Removes and returns the item from the head of this queue, which is one of\n * the items with the lowest priority. If this queue is empty, returns `undefined`.\n */\n pop() {\n if (this.length === 0) return undefined;\n\n const ids = this.ids,\n values = this.values,\n top = ids[0],\n last = --this.length;\n\n if (last > 0) {\n const id = ids[last];\n const value = values[last];\n let pos = 0;\n const halfLen = last >> 1;\n\n while (pos < halfLen) {\n const left = (pos << 1) + 1;\n const right = left + 1;\n const child = left + (+(right < last) & +(values[right] < values[left]));\n if (values[child] >= value) break;\n ids[pos] = ids[child];\n values[pos] = values[child];\n pos = child;\n }\n\n ids[pos] = id;\n values[pos] = value;\n }\n\n return top;\n }\n\n /** Returns the item from the head of this queue without removing it. If this queue is empty, returns `undefined`. */\n peek() {\n return this.length > 0 ? this.ids[0] : undefined;\n }\n\n /**\n * Returns the priority value of the item at the head of this queue without\n * removing it. If this queue is empty, returns `undefined`.\n */\n peekValue() {\n return this.length > 0 ? this.values[0] : undefined;\n }\n\n /**\n * Shrinks the internal arrays to `this.length`. No-op for queues with fixed capacity.\n *\n * `pop()` and `clear()` calls don't free memory automatically to avoid unnecessary resize operations.\n * This also means that items that have been added to the queue can't be garbage collected until\n * a new item is pushed in their place, or this method is called.\n */\n shrink() {\n if (Array.isArray(this.ids)) this.ids.length = this.length;\n if (Array.isArray(this.values)) this.values.length = this.length;\n }\n}\n", "import FlatQueue from 'flatqueue';\n\nconst ARRAY_TYPES = [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array];\nconst VERSION = 3; // serialized format version\n\n/** @typedef {Int8ArrayConstructor | Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor} TypedArrayConstructor */\n/** @typedef {Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array} TypedArray */\n\nexport default class Flatbush {\n\n /**\n * Recreate a Flatbush index from raw `ArrayBuffer` or `SharedArrayBuffer` data.\n * @param {ArrayBufferLike} data\n * @param {number} [byteOffset=0] byte offset to the start of the Flatbush buffer in the referenced ArrayBuffer.\n * @returns {Flatbush} index\n */\n static from(data, byteOffset = 0) {\n if (byteOffset % 8 !== 0) {\n throw new Error('byteOffset must be 8-byte aligned.');\n }\n\n if (!data || data.byteLength === undefined || 'buffer' in data) {\n throw new Error('Data must be an instance of ArrayBuffer or SharedArrayBuffer.');\n }\n\n const [magic, versionAndType] = new Uint8Array(data, byteOffset + 0, 2);\n if (magic !== 0xfb) {\n throw new Error('Data does not appear to be in a Flatbush format.');\n }\n const version = versionAndType >> 4;\n if (version !== VERSION) {\n throw new Error(`Got v${version} data when expected v${VERSION}.`);\n }\n const ArrayType = ARRAY_TYPES[versionAndType & 0x0f];\n if (!ArrayType) {\n throw new Error('Unrecognized array type.');\n }\n const [nodeSize] = new Uint16Array(data, byteOffset + 2, 1);\n const [numItems] = new Uint32Array(data, byteOffset + 4, 1);\n\n return new Flatbush(numItems, nodeSize, ArrayType, undefined, data, byteOffset);\n }\n\n /**\n * Create a Flatbush index that will hold a given number of items.\n * @param {number} numItems\n * @param {number} [nodeSize=16] Size of the tree node (16 by default).\n * @param {TypedArrayConstructor} [ArrayType=Float64Array] The array type used for coordinates storage (`Float64Array` by default).\n * @param {ArrayBufferConstructor | SharedArrayBufferConstructor} [ArrayBufferType=ArrayBuffer] The array buffer type used to store data (`ArrayBuffer` by default).\n * @param {ArrayBufferLike} [data] (Only used internally)\n * @param {number} [byteOffset=0] (Only used internally)\n */\n constructor(numItems, nodeSize = 16, ArrayType = Float64Array, ArrayBufferType = ArrayBuffer, data, byteOffset = 0) {\n if (numItems === undefined) throw new Error('Missing required argument: numItems.');\n if (isNaN(numItems) || numItems <= 0) throw new Error(`Unexpected numItems value: ${numItems}.`);\n\n this.numItems = +numItems;\n this.nodeSize = Math.min(Math.max(+nodeSize, 2), 65535);\n this.byteOffset = byteOffset;\n\n // calculate the total number of nodes in the R-tree to allocate space for\n // and the index of each tree level (used in search later)\n let n = numItems;\n let numNodes = n;\n this._levelBounds = [n * 4];\n do {\n n = Math.ceil(n / this.nodeSize);\n numNodes += n;\n this._levelBounds.push(numNodes * 4);\n } while (n !== 1);\n\n this.ArrayType = ArrayType;\n this.IndexArrayType = numNodes < 16384 ? Uint16Array : Uint32Array;\n\n const arrayTypeIndex = ARRAY_TYPES.indexOf(ArrayType);\n const nodesByteSize = numNodes * 4 * ArrayType.BYTES_PER_ELEMENT;\n\n if (arrayTypeIndex < 0) {\n throw new Error(`Unexpected typed array class: ${ArrayType}.`);\n }\n\n /** @type {new(b: ArrayBufferLike, o: number, l: number) => TypedArray} */\n const BoxCtor = ArrayType;\n /** @type {new(b: ArrayBufferLike, o: number, l: number) => Uint16Array | Uint32Array} */\n const IdxCtor = this.IndexArrayType;\n\n if (data) {\n this.data = data;\n this._boxes = new BoxCtor(data, byteOffset + 8, numNodes * 4);\n this._indices = new IdxCtor(data, byteOffset + 8 + nodesByteSize, numNodes);\n\n this._pos = numNodes * 4;\n this.minX = this._boxes[this._pos - 4];\n this.minY = this._boxes[this._pos - 3];\n this.maxX = this._boxes[this._pos - 2];\n this.maxY = this._boxes[this._pos - 1];\n\n } else {\n const data = this.data = new ArrayBufferType(8 + nodesByteSize + numNodes * this.IndexArrayType.BYTES_PER_ELEMENT);\n this._boxes = new BoxCtor(data, 8, numNodes * 4);\n this._indices = new IdxCtor(data, 8 + nodesByteSize, numNodes);\n this._pos = 0;\n this.minX = Infinity;\n this.minY = Infinity;\n this.maxX = -Infinity;\n this.maxY = -Infinity;\n\n new Uint8Array(data, 0, 2).set([0xfb, (VERSION << 4) + arrayTypeIndex]);\n new Uint16Array(data, 2, 1)[0] = nodeSize;\n new Uint32Array(data, 4, 1)[0] = numItems;\n }\n\n // a priority queue for k-nearest-neighbors queries\n /** @type FlatQueue<number> */\n this._queue = new FlatQueue();\n }\n\n /**\n * Add a given rectangle to the index.\n * @param {number} minX\n * @param {number} minY\n * @param {number} maxX\n * @param {number} maxY\n * @returns {number} A zero-based, incremental number that represents the newly added rectangle.\n */\n add(minX, minY, maxX = minX, maxY = minY) {\n const pos = this._pos;\n const index = pos >> 2;\n const boxes = this._boxes;\n this._indices[index] = index;\n boxes[pos] = minX;\n boxes[pos + 1] = minY;\n boxes[pos + 2] = maxX;\n boxes[pos + 3] = maxY;\n this._pos = pos + 4;\n\n if (minX < this.minX) this.minX = minX;\n if (minY < this.minY) this.minY = minY;\n if (maxX > this.maxX) this.maxX = maxX;\n if (maxY > this.maxY) this.maxY = maxY;\n\n return index;\n }\n\n /** Perform indexing of the added rectangles. */\n finish() {\n if (this._pos >> 2 !== this.numItems) {\n throw new Error(`Added ${this._pos >> 2} items when expected ${this.numItems}.`);\n }\n const boxes = this._boxes;\n\n if (this.numItems <= this.nodeSize) {\n // only one node, skip sorting and just fill the root box\n boxes[this._pos++] = this.minX;\n boxes[this._pos++] = this.minY;\n boxes[this._pos++] = this.maxX;\n boxes[this._pos++] = this.maxY;\n return;\n }\n\n const {numItems, minX, minY, nodeSize, _indices: indices, _levelBounds: levelBounds} = this;\n const width = (this.maxX - minX) || 1;\n const height = (this.maxY - minY) || 1;\n const hilbertValues = new Int32Array(numItems);\n const hilbertMax = (1 << 16) - 1;\n const sx = hilbertMax / width;\n const sy = hilbertMax / height;\n\n // map item centers into Hilbert coordinate space and calculate Hilbert values\n for (let i = 0, pos = 0; i < numItems; i++) {\n const itemMinX = boxes[pos++];\n const itemMinY = boxes[pos++];\n const itemMaxX = boxes[pos++];\n const itemMaxY = boxes[pos++];\n const x = (sx * ((itemMinX + itemMaxX) / 2 - minX)) | 0;\n const y = (sy * ((itemMinY + itemMaxY) / 2 - minY)) | 0;\n hilbertValues[i] = hilbert(x, y);\n }\n\n // sort items by their Hilbert value (for packing later)\n sort(hilbertValues, boxes, indices, 0, numItems - 1, nodeSize);\n\n // generate nodes at each tree level, bottom-up\n let pos = numItems * 4;\n for (let i = 0, readPos = 0; i < levelBounds.length - 1; i++) {\n const end = levelBounds[i];\n\n // generate a parent node for each block of consecutive <nodeSize> nodes\n while (readPos < end) {\n const nodeIndex = readPos;\n\n // calculate bbox for the new node\n let nodeMinX = boxes[readPos++];\n let nodeMinY = boxes[readPos++];\n let nodeMaxX = boxes[readPos++];\n let nodeMaxY = boxes[readPos++];\n for (let j = 1; j < nodeSize && readPos < end; j++) {\n nodeMinX = Math.min(nodeMinX, boxes[readPos++]);\n nodeMinY = Math.min(nodeMinY, boxes[readPos++]);\n nodeMaxX = Math.max(nodeMaxX, boxes[readPos++]);\n nodeMaxY = Math.max(nodeMaxY, boxes[readPos++]);\n }\n\n // add the new node to the tree data\n indices[pos >> 2] = nodeIndex;\n boxes[pos++] = nodeMinX;\n boxes[pos++] = nodeMinY;\n boxes[pos++] = nodeMaxX;\n boxes[pos++] = nodeMaxY;\n }\n }\n this._pos = pos;\n }\n\n /**\n * Search the index by a bounding box.\n * @param {number} minX\n * @param {number} minY\n * @param {number} maxX\n * @param {number} maxY\n * @param {(index: number, x0: number, y0: number, x1: number, y1: number) => boolean} [filterFn] An optional function that is called on every found item; if supplied, only items for which this function returns true will be included in the results array.\n * @returns {number[]} An array of indices of items intersecting or touching the given bounding box.\n */\n search(minX, minY, maxX, maxY, filterFn) {\n if (this._pos !== this._boxes.length) {\n throw new Error('Data not yet indexed - call index.finish().');\n }\n const {_boxes: boxes, _levelBounds: levelBounds, _indices: indices, nodeSize} = this;\n const numItems4 = this.numItems * 4;\n\n /** @type number | undefined */\n let nodeIndex = boxes.length - 4;\n let level = levelBounds.length - 1; // start at the root level\n const q = [];\n const results = [];\n\n let contained = false; // whether the current node's bbox is fully inside the query\n\n while (nodeIndex !== undefined) {\n // find the end index of the node, capped at the level boundary\n const end = Math.min(nodeIndex + nodeSize * 4, levelBounds[level]);\n const isNode = nodeIndex >= numItems4;\n\n if (contained) {\n this._collectContained(nodeIndex, end, level, numItems4, results, filterFn);\n\n } else {\n // search through child nodes\n for (let /** @type {number} */ pos = nodeIndex; pos < end; pos += 4) {\n // check if node bbox intersects with query bbox\n const x0 = boxes[pos];\n if (maxX < x0) continue;\n const y0 = boxes[pos + 1];\n if (maxY < y0) continue;\n const x1 = boxes[pos + 2];\n if (minX > x1) continue;\n const y1 = boxes[pos + 3];\n if (minY > y1) continue;\n\n const index = indices[pos >> 2] | 0;\n\n if (isNode) {\n // node intersects; flag it as contained if its bbox is fully inside the query\n const c = +(minX <= x0 && minY <= y0 && maxX >= x1 && maxY >= y1);\n q.push(index | c, level - 1); // node; add it and its level to the search queue\n\n } else if (filterFn === undefined || filterFn(index, x0, y0, x1, y1)) {\n results.push(index); // leaf item\n }\n }\n }\n\n level = /** @type {number} */ (q.pop());\n nodeIndex = q.pop();\n if (nodeIndex !== undefined) {\n contained = (nodeIndex & 1) === 1;\n nodeIndex &= ~1;\n }\n }\n\n return results;\n }\n\n /**\n * Collect all leaves of a subtree that's fully inside the query, skipping intersection tests.\n * Because the tree is packed bottom-up, those leaves occupy one contiguous block of the leaf\n * level, so we skip traversal entirely: descend to the first leaf, then sweep the flat range.\n * @param {number} nodeIndex\n * @param {number} end\n * @param {number} level\n * @param {number} numItems4\n * @param {number[]} results\n * @param {((index: number, x0: number, y0: number, x1: number, y1: number) => boolean) | undefined} filterFn\n */\n _collectContained(nodeIndex, end, level, numItems4, results, filterFn) {\n const boxes = this._boxes;\n const indices = this._indices;\n let pos = nodeIndex;\n for (let l = level; l > 0; l--) pos = indices[pos >> 2];\n const leafEnd = Math.min(pos + (end - nodeIndex) * this.nodeSize ** level, numItems4);\n if (filterFn === undefined) {\n for (; pos < leafEnd; pos += 4) results.push(indices[pos >> 2] | 0);\n } else {\n for (; pos < leafEnd; pos += 4) {\n const index = indices[pos >> 2] | 0;\n if (filterFn(index, boxes[pos], boxes[pos + 1], boxes[pos + 2], boxes[pos + 3])) results.push(index);\n }\n }\n }\n\n /**\n * Search items in order of distance from the given point.\n * @param {number} x\n * @param {number} y\n * @param {number} [maxResults=Infinity]\n * @param {number} [maxDistance=Infinity]\n * @param {(index: number) => boolean} [filterFn] An optional function for filtering the results.\n * @returns {number[]} An array of indices of items found.\n */\n neighbors(x, y, maxResults = Infinity, maxDistance = Infinity, filterFn) {\n if (this._pos !== this._boxes.length) {\n throw new Error('Data not yet indexed - call index.finish().');\n }\n const {_boxes: boxes, _levelBounds: levelBounds, _indices: indices, _queue: q, nodeSize} = this;\n const numItems4 = this.numItems * 4;\n const nodeSize4 = nodeSize * 4;\n const results = [];\n const maxDistSquared = maxDistance * maxDistance;\n\n // For a single nearest neighbor (maxResults === 1), track the closest leaf seen so far and use\n // it as a tightened distance bound, skipping pushes of nodes/leaves that can't beat it\n const trackNearest = maxResults === 1;\n let bound = maxDistSquared;\n\n // Tree nodes and leaves share the queue; encode leaves with LSB = 1 so we can tell them\n // apart with `& 1`. Seed with the root node \u2014 any priority works since the queue is empty.\n q.push((boxes.length - 4) << 1, 0);\n\n while (q.length) {\n const top = q.ids[0];\n // if the closest queued entry is a leaf, it's the next result in distance order\n if (top & 1) {\n q.pop();\n results.push(top >> 1);\n if (results.length === maxResults) break;\n continue;\n }\n\n q.pop();\n const nodeIndex = top >> 1;\n const isLeafLevel = nodeIndex < numItems4;\n const end = Math.min(nodeIndex + nodeSize4, upperBound(nodeIndex, levelBounds));\n\n for (let pos = nodeIndex; pos < end; pos += 4) {\n const minX = boxes[pos];\n const minY = boxes[pos + 1];\n const maxX = boxes[pos + 2];\n const maxY = boxes[pos + 3];\n const dx = Math.max(Math.max(minX - x, x - maxX), 0);\n const dy = Math.max(Math.max(minY - y, y - maxY), 0);\n const dist = dx * dx + dy * dy;\n if (dist > bound) continue;\n\n const childIndex = indices[pos >> 2] | 0;\n if (isLeafLevel) {\n if (filterFn === undefined || filterFn(childIndex)) {\n q.push((childIndex << 1) | 1, dist); // leaf item (odd id)\n if (trackNearest && dist < bound) bound = dist; // tighten bound to the closest leaf so far\n }\n } else {\n q.push(childIndex << 1, dist); // node (even id)\n }\n }\n }\n\n q.clear();\n return results;\n }\n}\n\n/**\n * Binary search for the first value in the array bigger than the given.\n * @param {number} value\n * @param {number[]} arr\n */\nfunction upperBound(value, arr) {\n let i = 0;\n let j = arr.length - 1;\n while (i < j) {\n const m = (i + j) >> 1;\n if (arr[m] > value) {\n j = m;\n } else {\n i = m + 1;\n }\n }\n return arr[i];\n}\n\n/**\n * Custom quicksort that partially sorts bbox data alongside the hilbert values.\n * @param {Int32Array} values\n * @param {TypedArray} boxes\n * @param {Uint16Array | Uint32Array} indices\n * @param {number} left\n * @param {number} right\n * @param {number} nodeSize\n */\nfunction sort(values, boxes, indices, left, right, nodeSize) {\n const stack = [left, right];\n\n while (stack.length) {\n const r = stack.pop() || 0;\n const l = stack.pop() || 0;\n\n if (r - l <= nodeSize && Math.floor(l / nodeSize) >= Math.floor(r / nodeSize)) continue;\n\n const a = values[l];\n const b = values[(l + r) >> 1];\n const c = values[r];\n const pivot = ((a > b) !== (a > c)) ? a :\n ((b < a) !== (b < c)) ? b : c;\n\n let i = l - 1;\n let j = r + 1;\n\n while (true) {\n do i++; while (values[i] < pivot);\n do j--; while (values[j] > pivot);\n if (i >= j) break;\n swap(values, boxes, indices, i, j);\n }\n\n stack.push(l, j, j + 1, r);\n }\n}\n\n/**\n * Swap two values and two corresponding boxes.\n * @param {Int32Array} values\n * @param {TypedArray} boxes\n * @param {Uint16Array | Uint32Array} indices\n * @param {number} i\n * @param {number} j\n */\nfunction swap(values, boxes, indices, i, j) {\n const temp = values[i];\n values[i] = values[j];\n values[j] = temp;\n\n const k = 4 * i;\n const m = 4 * j;\n\n const a = boxes[k];\n const b = boxes[k + 1];\n const c = boxes[k + 2];\n const d = boxes[k + 3];\n boxes[k] = boxes[m];\n boxes[k + 1] = boxes[m + 1];\n boxes[k + 2] = boxes[m + 2];\n boxes[k + 3] = boxes[m + 3];\n boxes[m] = a;\n boxes[m + 1] = b;\n boxes[m + 2] = c;\n boxes[m + 3] = d;\n\n const e = indices[i];\n indices[i] = indices[j];\n indices[j] = e;\n}\n\n/**\n * Fast Hilbert curve algorithm by http://threadlocalmutex.com/\n * Ported from C++ https://github.com/rawrunprotected/hilbert_curves (public domain)\n * @param {number} x\n * @param {number} y\n */\nfunction hilbert(x, y) {\n let a = x ^ y;\n let b = 0xFFFF ^ a;\n let c = 0xFFFF ^ (x | y);\n let d = x & (y ^ 0xFFFF);\n\n let A = a | (b >> 1);\n let B = (a >> 1) ^ a;\n let C = c ^ ((c >> 1) ^ (b & (d >> 1)));\n let D = d ^ ((a & (c >> 1)) ^ (d >> 1));\n\n a = (A & (A >> 2)) ^ (B & (B >> 2));\n b = (A & (B >> 2)) ^ (B & ((A ^ B) >> 2));\n c = C ^ ((A & (C >> 2)) ^ (B & (D >> 2)));\n d = D ^ ((B & (C >> 2)) ^ ((A ^ B) & (D >> 2)));\n\n A = (a & (a >> 4)) ^ (b & (b >> 4));\n B = (a & (b >> 4)) ^ (b & ((a ^ b) >> 4));\n C = c ^ ((a & (c >> 4)) ^ (b & (d >> 4)));\n D = d ^ ((b & (c >> 4)) ^ ((a ^ b) & (d >> 4)));\n\n c = C ^ ((A & (C >> 8)) ^ (B & (D >> 8)));\n d = D ^ ((B & (C >> 8)) ^ ((A ^ B) & (D >> 8)));\n\n c ^= c >> 1;\n d ^= d >> 1;\n a = x ^ y;\n b = d | (0xFFFF ^ (a | c));\n\n a = (a | (a << 8)) & 0x00FF00FF;\n a = (a | (a << 4)) & 0x0F0F0F0F;\n a = (a | (a << 2)) & 0x33333333;\n a = (a | (a << 1)) & 0x55555555;\n\n b = (b | (b << 8)) & 0x00FF00FF;\n b = (b | (b << 4)) & 0x0F0F0F0F;\n b = (b | (b << 2)) & 0x33333333;\n b = (b | (b << 1)) & 0x55555555;\n\n // shift into signed SMI range for performance\n return (((b << 1) | a) >>> 0) - 0x80000000;\n}\n", "import Flatbush from 'flatbush'\n\nexport interface ClickEntry {\n name: string\n /** the text a tip label draws, which may be cut short */\n label?: string\n id: string\n branch?: boolean\n minX: number\n maxX: number\n minY: number\n maxY: number\n}\n\ninterface Box {\n minX: number\n maxX: number\n minY: number\n maxY: number\n}\n\n// Spatial index of clickable tree elements (leaf labels, node bubbles,\n// collapsed-clade triangles). Entries are collected during a render pass, then\n// finish() builds the Flatbush index queried by hit-testing.\nexport class ClickMapIndex {\n private flatbush: Flatbush | null = null\n private entries: ClickEntry[] = []\n\n clear() {\n this.flatbush = null\n this.entries = []\n }\n\n insert(entry: ClickEntry) {\n this.entries.push(entry)\n }\n\n finish() {\n if (this.entries.length === 0) {\n this.flatbush = null\n } else {\n this.flatbush = new Flatbush(this.entries.length)\n for (const entry of this.entries) {\n this.flatbush.add(entry.minX, entry.minY, entry.maxX, entry.maxY)\n }\n this.flatbush.finish()\n }\n }\n\n search(box: Box): ClickEntry[] {\n return (\n this.flatbush\n ?.search(box.minX, box.minY, box.maxX, box.maxY)\n .map(i => this.entries[i]!) ?? []\n )\n }\n}\n", "import { treeHoverColor } from '../overlayColors.ts'\n\nimport type { MsaViewModel } from '../../model.ts'\n\nexport function renderTreeMouseover({\n ctx,\n model,\n}: {\n ctx: CanvasRenderingContext2D\n model: MsaViewModel\n}) {\n const {\n rowHeight,\n effectiveTreeAreaWidth: width,\n height,\n scrollY,\n mouseRow,\n referenceRowIndex,\n hoveredRowIndices,\n highResScaleFactor,\n } = model\n ctx.resetTransform()\n ctx.clearRect(0, 0, width * highResScaleFactor, height * highResScaleFactor)\n ctx.scale(highResScaleFactor, highResScaleFactor)\n\n const rowBand = (index: number) => {\n ctx.fillRect(0, index * rowHeight + scrollY, width, rowHeight)\n }\n\n ctx.fillStyle = treeHoverColor\n for (const index of hoveredRowIndices) {\n rowBand(index)\n }\n if (\n mouseRow !== undefined &&\n mouseRow !== referenceRowIndex &&\n !hoveredRowIndices.includes(mouseRow)\n ) {\n rowBand(mouseRow)\n }\n}\n", "import React from 'react'\n\nimport { useTheme } from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport { treeScaleBarHeight as h } from '../../constants.ts'\nimport ScaleBarSVG from './ScaleBarSVG.tsx'\n\nimport type { MsaViewModel } from '../../model.ts'\n\n// The gutter above the tree panel, the width of the tree area, so the strip\n// headers beside it start where the strips do. A phylogram fills it with a\n// scale bar: without one the branch lengths are drawn to a scale nothing\n// states.\nconst TreeRuler = observer(({ model }: { model: MsaViewModel }) => {\n const { effectiveTreeAreaWidth, marginLeft, treeScaleBar: bar } = model\n const theme = useTheme()\n\n return (\n <div style={{ flexShrink: 0, width: effectiveTreeAreaWidth }}>\n {bar ? (\n <svg\n width={effectiveTreeAreaWidth}\n height={h}\n style={{ display: 'block' }}\n >\n <ScaleBarSVG\n bar={bar}\n marginLeft={marginLeft}\n y={h}\n color={theme.palette.text.primary}\n />\n </svg>\n ) : null}\n </div>\n )\n})\n\nexport default TreeRuler\n", "import React, { useState } from 'react'\n\nimport { ErrorMessage, FileSelector } from '@jbrowse/core/ui'\nimport { Box, Button, Container, Typography } from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport ImportFormExamples from './ImportFormExamples.tsx'\nimport { load } from './util.ts'\n\nimport type { MsaViewModel } from '../../model.ts'\nimport type { FileLocation } from '@jbrowse/core/util/types'\n\nconst phone = '@media (max-width: 640px)'\n\nconst ImportForm = observer(function ({ model }: { model: MsaViewModel }) {\n const [msaFile, setMsaFile] = useState<FileLocation>()\n const [treeFile, setTreeFile] = useState<FileLocation>()\n const [gffFile, setGffFile] = useState<FileLocation>()\n const { error } = model\n\n return (\n <Container sx={{ pt: 2, pb: 3 }}>\n <Box sx={{ width: '50%', mb: 2, [phone]: { width: '100%' } }}>\n {error ? <ErrorMessage error={error} /> : null}\n <Typography>\n Open an MSA file (FASTA, Stockholm, Clustal, A3M or EMF format) and/or\n a tree file (Newick format).\n </Typography>\n <Typography color=\"text.secondary\">\n An MSA alone or a tree alone is enough, and a Stockholm file with an\n embedded tree needs no separate tree file.\n </Typography>\n </Box>\n\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n gap: '40px',\n [phone]: {\n flexDirection: 'column',\n alignItems: 'stretch',\n gap: '16px',\n },\n }}\n >\n <Box\n sx={{\n width: 400,\n display: 'flex',\n flexDirection: 'column',\n gap: 1.5,\n [phone]: { width: 'auto' },\n }}\n >\n <div>\n <Typography>MSA file or URL</Typography>\n <FileSelector inline location={msaFile} setLocation={setMsaFile} />\n </div>\n <div>\n <Typography>Tree file or URL</Typography>\n <FileSelector\n inline\n location={treeFile}\n setLocation={setTreeFile}\n />\n </div>\n <div>\n <Typography>Annotation GFF file or URL (optional)</Typography>\n <FileSelector inline location={gffFile} setLocation={setGffFile} />\n </div>\n </Box>\n <div>\n <Button\n onClick={() => {\n try {\n load(model, msaFile, treeFile, gffFile)\n } catch (e) {\n console.error(e)\n model.setError(e)\n }\n }}\n variant=\"contained\"\n color=\"primary\"\n disabled={!msaFile && !treeFile}\n >\n Open\n </Button>\n </div>\n\n <div>\n <Typography>Examples</Typography>\n <ImportFormExamples model={model} />\n </div>\n </Box>\n </Container>\n )\n})\n\nexport default ImportForm\n", "import React from 'react'\n\nimport { Link, Typography } from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport { smallMSA, smallTree } from './data/seq2.ts'\nimport { load } from './util.ts'\n\nimport type { MsaViewModel } from '../../model.ts'\n\nconst BASE = 'https://jbrowse.org/genomes/multiple_sequence_alignments'\nconst TREES = 'https://jbrowse.org/genomes/newick_trees'\nconst DEMO = 'https://gmod.org/JBrowseMSA/demo/data'\n\n// each example points at remote files (msa/tree/gff urls) or carries its data\n// inline\ninterface Example {\n label: string\n msa?: string\n tree?: string\n gff?: string\n inline?: { msa: string; tree?: string }\n}\n\nconst examples: Example[] = [\n {\n label: 'NLRP1 in 12 mammals, with Pfam domains',\n msa: `${DEMO}/nlrp1.aln`,\n tree: `${DEMO}/nlrp1.nh`,\n gff: `${DEMO}/nlrp1-domains.gff`,\n },\n {\n label: '474 human protein kinase domains, with a FastTree tree',\n msa: `${DEMO}/kinase-pocket/kinase-pocket.afa`,\n tree: `${DEMO}/kinase-pocket/kinase-pocket.nwk`,\n },\n {\n label: 'RSV-A G gene in 1,840 genomes, with the Nextstrain tree',\n msa: `${DEMO}/scale/rsv-full.aln`,\n tree: `${DEMO}/scale/rsv-full.nh`,\n },\n {\n label: '230k COVID-19 samples (tree only)',\n tree: `${TREES}/sarscov2phylo.pub.ft.nh`,\n },\n {\n label: 'Pfam SARS-CoV-2 families, multi-Stockholm with domains',\n msa: `${BASE}/pfam-cov2.stock`,\n gff: `${BASE}/pfam-cov2-domains.gff`,\n },\n {\n label: 'Small protein alignment and tree',\n inline: { msa: smallMSA, tree: smallTree },\n },\n]\n\nfunction uri(url?: string) {\n return url ? { uri: url, locationType: 'UriLocation' as const } : undefined\n}\n\nconst ImportFormExamples = observer(function ({\n model,\n}: {\n model: MsaViewModel\n}) {\n return (\n <ul>\n {examples.map(({ label, msa, tree, gff, inline }) => (\n <li key={label}>\n <Link\n href=\"#\"\n onClick={event => {\n event.preventDefault()\n model.setError(undefined)\n try {\n if (inline) {\n model.setData(inline)\n } else {\n load(model, uri(msa), uri(tree), uri(gff))\n }\n } catch (e) {\n console.error(e)\n model.setError(e)\n }\n }}\n >\n <Typography component=\"span\">{label}</Typography>\n </Link>\n </li>\n ))}\n </ul>\n )\n})\n\nexport default ImportFormExamples\n", "export const smallMSA = `CLUSTAL O(1.2.3) multiple sequence alignment\nUniProt/Swiss-Prot|P26898|IL2RA_SHEEP MEPSLLMWRFFVFIVVPGCVTEACHDDPPSLRNA----------MFKVLRYE----VGTM\nUniProt/Swiss-Prot|P01590|IL2RA_MOUSE MEPRLLMLGFLSLTIVPSCRAELCLYDPPEVPNA----------TFKALSYK----NGTI\nUniProt/Swiss-Prot|P41690|IL2RA_FELCA MEPSLLLWGILTFVVVHGHVTELCDENPPDIQHA----------TFKALTYK----TGTM\nUniProt/Swiss-Prot|P01589|IL2RA_HUMAN MDSYLLMWGLLTFIMVPGCQAELCDDDPPEIPHA----------TFKAMAYK----EGTM\nUniProt/Swiss-Prot|Q5MNY4|IL2RA_MACMU MDPYLLMWGLLTFITVPGCQAELCDDDPPKITHA----------TFKAVAYK----EGTM\nUniProt/Swiss-Prot|Q95118|IL2RG_BOVIN -----------------------------------LLMWGLLT-----------------\nUniProt/Swiss-Prot|P40321|IL2RG_CANFA MLKPPLPLRSLLFLQLSLLGVGLNSTVPMPNGNEDIT------PDFFLTATPSETLSVSS\nUniProt/Swiss-Prot|P26896|IL2RB_RAT MATVDLSWRLPLYILLLLLATT--------------------------------WVSAAV\nUniProt/Swiss-Prot|Q8BZM1|GLMN_MOUSE PLPLRSLLFLQLPLLGVGLNP------------------PLPLRSLLFLQLPLLGVGLNP\nUniProt/Swiss-Prot|P36835|IL2_CAPHI -----------LLGVGLNPKFLTP------------------------------------\nUniProt/Swiss-Prot|Q7JFM4|IL2_AOTVO MLKPPLPLRSLLFLQLPLLGVGLNPKFLTPSGNEDIGGKPGTGGDFFLTSTPAGTLDVST\nUniProt/Swiss-Prot|Q29416|IL2_CANFA --------------LFLQLSLLG-------------------------------------\n`\n\nexport const smallTree =\n '(((UniProt/Swiss-Prot|P26898|IL2RA_SHEEP:0.24036,(UniProt/Swiss-Prot|P41690|IL2RA_FELCA:0.17737,(UniProt/Swiss-Prot|P01589|IL2RA_HUMAN:0.03906,UniProt/Swiss-Prot|Q5MNY4|IL2RA_MACMU:0.03787):0.13033):0.04964):0.02189,UniProt/Swiss-Prot|P01590|IL2RA_MOUSE:0.23072):0.06814,(((UniProt/Swiss-Prot|Q95118|IL2RG_BOVIN:0.09600,UniProt/Swiss-Prot|P40321|IL2RG_CANFA:0.09845):0.25333,UniProt/Swiss-Prot|Q29416|IL2_CANFA:-0.35055):0.10231,(UniProt/Swiss-Prot|P26896|IL2RB_RAT:0.33631,UniProt/Swiss-Prot|Q7JFM4|IL2_AOTVO:-0.33631):0.10166):0.01607,(UniProt/Swiss-Prot|Q8BZM1|GLMN_MOUSE:0.32378,UniProt/Swiss-Prot|P36835|IL2_CAPHI:-0.32378):0.09999)'\n", "import type { MsaViewModel } from '../../model.ts'\nimport type { FileLocation } from '@jbrowse/core/util'\n\nexport function load(\n model: MsaViewModel,\n msaFile?: FileLocation,\n treeFile?: FileLocation,\n gffFile?: FileLocation,\n) {\n model.setError(undefined)\n if (msaFile) {\n model.setMSAFilehandle(msaFile)\n }\n if (treeFile) {\n model.setTreeFilehandle(treeFile)\n }\n if (gffFile) {\n model.setGFFFilehandle(gffFile)\n // a file opened by hand shows even if the overlay was hidden earlier\n model.setShowDomains(true)\n }\n}\n", "import React, {\n forwardRef,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react'\n\nimport useMeasure from '@jbrowse/core/util/useMeasure'\nimport { destroy, isAlive } from '@jbrowse/mobx-state-tree'\nimport { ThemeProvider } from '@mui/material/styles'\nimport { compareStructural, reaction, when } from 'mobx'\n\nimport MSAModelF from '../model.ts'\nimport { letterColors } from '../scales.ts'\nimport {\n fileLocations,\n resolveTheme,\n viewerHighlights,\n viewerSnapshot,\n} from '../viewerSnapshot.ts'\nimport Loading from './Loading.tsx'\n\nimport type { MsaViewModel } from '../model.ts'\nimport type {\n Cell,\n Clade,\n ColorScheme,\n ColumnTrackSpec,\n Encoding,\n Feature,\n Highlight,\n MsaSelection,\n Region,\n ResidueEncoding,\n ResidueMapping,\n RowDataInput,\n RowPanelSpec,\n TreeOrder,\n TreeRoot,\n Viewport,\n} from '../types.ts'\nimport type { FileLocation as FileLocationType } from '@jbrowse/core/util/types'\nimport type { ThemeOptions } from '@mui/material/styles'\nimport type { ForwardedRef } from 'react'\n\nexport interface MSAViewerProps {\n msa?: string\n tree?: string\n gff?: string\n msaFilehandle?: FileLocationType\n treeFilehandle?: FileLocationType\n gffFilehandle?: FileLocationType\n /** a URL the viewer fetches the alignment from; `msaFilehandle` wins */\n msaUrl?: string\n /** a URL the viewer fetches the Newick tree from; `treeFilehandle` wins */\n treeUrl?: string\n /** a URL the viewer fetches the GFF from; `gffFilehandle` wins */\n gffUrl?: string\n /**\n * a scheme name from the built-in table, or `{domain, range}`, a color per\n * residue letter that leaves every other letter uncolored. The earlier\n * `{map}` still reads\n */\n colorScheme?: ColorScheme\n height?: number\n /** initial per-column pixel width (zoom level) */\n colWidth?: number\n /** initial per-row pixel height */\n rowHeight?: number\n /**\n * hide columns at least this percent gaps (default 100, i.e. hide nothing)\n */\n allowedGappyness?: number\n /**\n * alignment columns, 1-based like `highlights`, drawn as one `{start, end}`\n * highlight per run of adjacent columns\n */\n highlightColumns?: number[]\n /**\n * labeled highlights in 1-based inclusive coordinates: `{start, end}` for\n * alignment columns, `{row, start, end}` for residues of that row, `{rows}`\n * for whole rows, each with an optional `label` and `color`\n */\n highlights?: Highlight[]\n /**\n * features on the rows as data, drawn with the GFF's: `{row, start, end}` in\n * residues of that row, 1-based and inclusive, with an optional `name`,\n * `description`, `type`, `strand` and `color`, and any other field an\n * encoding reads (see docs/layers.md)\n */\n features?: Feature[]\n /**\n * clades of the tree with a mark drawn over them: `{mrca, tips, mark}` or\n * `{range, tips, mark}`, where `mark` is `highlight`, `bracket`, `collapse`\n * or `focus` (see docs/layers.md)\n */\n clades?: Clade[]\n /** row name to diff every other row against (matches render as \".\") */\n relativeTo?: string\n /** tracks supplied as data: per-column bar values or a text row (see docs/layers.md) */\n columnTracks?: ColumnTrackSpec[]\n /** which residue of which structure each row's residues are (see docs/layers.md) */\n residueMappings?: ResidueMapping[]\n /** extra fields per row name, such as a lineage or a host (see docs/layers.md) */\n rowData?: RowDataInput\n /**\n * what the viewer's marks read from a table:\n * `{channel, field, range?, domain?, title?}`, where `channel` is\n * `tipLabel`, `rowTint` or `branch` over `rowData`, or `featureFill` or\n * `featureLabel` over the annotations (see docs/layers.md)\n */\n encodings?: Encoding[]\n /**\n * panels between the tree and the alignment, one cell per row:\n * `{kind: 'strip', field, range?, domain?, title?, width?, header?}` colors\n * each row by a `rowData` field (see docs/layers.md)\n */\n rowPanels?: RowPanelSpec[]\n /** draw the phylogenetic tree (default true); false leaves a labels-only gutter */\n drawTree?: boolean\n /** fixed width (px) of the tree/label area; unset fits it to the labels and the tree */\n treeAreaWidth?: number\n /** draw branch lengths (default true); false draws a cladogram */\n showBranchLen?: boolean\n /**\n * the order each node's children draw in: `branchLength` (default,\n * shortest first), `input` (as the file gives them), `ladderize` (fewest\n * tips first) or `ladderizeReverse` (most tips first)\n */\n treeOrder?: TreeOrder\n /**\n * reroot the tree: `midpoint`, or `{outgroup: [tip names]}` on the branch\n * above those tips' common ancestor\n */\n treeRoot?: TreeRoot\n /**\n * which channel `colorScheme` paints: `fill` (default) colors the background\n * of the cell a residue sits in, `color` colors the letter itself and leaves\n * the background plain, which lets a domain overlay mark each span with a bar\n * under the row and the residue colors show through\n */\n residueEncoding?: ResidueEncoding\n /**\n * a span to zoom and scroll to once the alignment loads, and again whenever\n * it changes: `{row, start, end}` in residues of that row, or `{start, end}`\n * in columns, 1-based and inclusive\n */\n region?: Region\n /**\n * the selected block: `{start, end}` columns of the file, 1-based and\n * inclusive, and `rows` by name, every row where absent\n */\n selection?: MsaSelection\n /** leave out the toolbar, for a page drawing its own controls */\n hideHeader?: boolean\n /**\n * 'light' (default), 'dark', or MUI theme options (palette, typography)\n * merged over the JBrowse theme\n */\n theme?: 'light' | 'dark' | ThemeOptions\n /** the cell under the pointer, or undefined when it leaves the alignment */\n onCellHover?: (cell: Cell | undefined) => void\n /** the cell a click pinned, or undefined when a click clears it */\n onCellClick?: (cell: Cell | undefined) => void\n /** the alignment columns on screen, after every scroll, zoom and resize */\n onViewportChange?: (viewport: Viewport | undefined) => void\n /**\n * the selected block, after each change a drag, the header menu, Escape or\n * the `selection` prop makes, or undefined when it clears\n */\n onSelectionChange?: (selection: MsaSelection | undefined) => void\n /**\n * the model the viewer built, for the model API; called again with the new\n * model when msa, tree, msaUrl, treeUrl, msaFilehandle or treeFilehandle\n * changes\n */\n onModel?: (model: MsaViewModel) => void\n}\n\ntype DataSource = Pick<\n MSAViewerProps,\n 'msa' | 'tree' | 'msaFilehandle' | 'treeFilehandle'\n>\n\nfunction sameSource(a: DataSource, b: DataSource) {\n return (\n a.msa === b.msa &&\n a.tree === b.tree &&\n JSON.stringify([a.msaFilehandle, a.treeFilehandle]) ===\n JSON.stringify([b.msaFilehandle, b.treeFilehandle])\n )\n}\n\n/**\n * A new alignment or tree needs a new model, so the viewer remounts when one\n * of those props changes and keeps its model across every other change,\n * including a new annotation file. A `ref` holds the current model.\n */\nconst MSAViewer = forwardRef<MsaViewModel, MSAViewerProps>(\n function MSAViewer(props, ref) {\n const resolved = { ...props, ...fileLocations(props) }\n const { msa, tree, msaFilehandle, treeFilehandle } = resolved\n const source = { msa, tree, msaFilehandle, treeFilehandle }\n const [shown, setShown] = useState({ source, generation: 0 })\n if (!sameSource(shown.source, source)) {\n setShown({ source, generation: shown.generation + 1 })\n }\n return <Viewer key={shown.generation} modelRef={ref} {...resolved} />\n },\n)\n\nexport default MSAViewer\n\nfunction useModelReaction<\n K extends 'hoveredCell' | 'clickedCell' | 'viewport' | 'selection',\n>(\n model: MsaViewModel,\n key: K,\n handler: ((value: MsaViewModel[K]) => void) | undefined,\n) {\n const latest = useRef(handler)\n useEffect(() => {\n latest.current = handler\n })\n const listening = !!handler\n useEffect(\n () =>\n listening\n ? reaction(\n () => model[key],\n value => {\n latest.current?.(value)\n },\n { equals: compareStructural },\n )\n : undefined,\n [model, key, listening],\n )\n}\n\ninterface SyncedProp {\n read: (props: MSAViewerProps) => unknown\n apply: (model: MsaViewModel, value: unknown, props: MSAViewerProps) => void\n inSnapshot?: boolean\n}\n\nfunction synced<T>(\n read: (props: MSAViewerProps) => T,\n apply: (model: MsaViewModel, value: T, props: MSAViewerProps) => void,\n { inSnapshot = false } = {},\n): SyncedProp {\n return {\n read,\n apply: apply as SyncedProp['apply'],\n inSnapshot,\n }\n}\n\nfunction ifSet<T>(set: (model: MsaViewModel, value: T) => void) {\n return (model: MsaViewModel, value: T | undefined) => {\n if (value !== undefined) {\n set(model, value)\n }\n }\n}\n\n/**\n * How each prop reaches the mounted model. `inSnapshot` marks a prop the\n * snapshot already applied, so only a later change reaches its setter.\n */\nconst syncedProps = [\n synced(\n p => p.height,\n ifSet((m, v) => {\n m.setHeight(v)\n }),\n ),\n synced(\n p => p.colWidth,\n ifSet((m, v) => {\n m.setColWidth(v)\n }),\n ),\n synced(\n p => p.rowHeight,\n ifSet((m, v) => {\n m.setRowHeight(v)\n }),\n ),\n synced(\n p => p.allowedGappyness,\n ifSet((m, v) => {\n m.setAllowedGappyness(v)\n }),\n ),\n synced(\n p => p.drawTree,\n ifSet((m, v) => {\n m.setDrawTree(v)\n }),\n ),\n synced(\n p => p.treeAreaWidth,\n ifSet((m, v) => {\n m.setTreeAreaWidth(v)\n }),\n ),\n synced(\n p => p.showBranchLen,\n ifSet((m, v) => {\n m.setShowBranchLen(v)\n }),\n ),\n synced(\n p => p.treeOrder,\n ifSet((m, v) => {\n m.setTreeOrder(v)\n }),\n ),\n synced(\n p => p.residueEncoding,\n ifSet((m, v) => {\n m.setBgColor(v === 'fill')\n }),\n ),\n synced(\n p => !!p.hideHeader,\n (m, v) => {\n m.setHideHeader(v)\n },\n ),\n synced(\n p => p.relativeTo,\n (m, v) => {\n m.drawRelativeTo(v)\n },\n ),\n synced(\n p => p.gffFilehandle,\n (m, location, { gff }) => {\n if (location) {\n m.setGFFFilehandle(location)\n } else {\n m.setGFF(gff)\n }\n },\n { inSnapshot: true },\n ),\n synced(\n p => p.gff,\n (m, v) => {\n m.setGFF(v)\n },\n { inSnapshot: true },\n ),\n synced(\n p => p.colorScheme,\n (m, scheme) => {\n if (typeof scheme === 'string') {\n m.setColorSchemeName(scheme)\n } else if (scheme) {\n m.setCustomColorScheme(letterColors(scheme))\n }\n },\n ),\n synced(viewerHighlights, (m, v) => {\n m.setHighlights(v)\n }),\n synced(\n p => p.features ?? [],\n (m, v) => {\n m.setFeatures(v)\n },\n ),\n synced(\n p => p.selection,\n (m, v) => {\n m.setSelection(v)\n },\n ),\n synced(\n p => p.treeRoot,\n (m, v) => {\n m.setTreeRoot(v)\n },\n ),\n synced(\n p => p.clades ?? [],\n (m, v) => {\n m.setClades(v)\n },\n ),\n synced(\n p => p.columnTracks ?? [],\n (m, v) => {\n m.setColumnTracks(v)\n },\n ),\n synced(\n p => p.residueMappings ?? [],\n (m, v) => {\n m.setResidueMappings(v)\n },\n ),\n synced(\n p => p.rowData,\n (m, table) => {\n if (table && Object.keys(table).length) {\n m.setRowData(table)\n }\n },\n ),\n synced(\n p => p.encodings ?? [],\n (m, v) => {\n m.setEncodings(v)\n },\n ),\n synced(\n p => p.rowPanels ?? [],\n (m, v) => {\n m.setRowPanels(v)\n },\n ),\n]\n\n/**\n * Applies each prop whose content changed since the last render. Comparing\n * JSON keys lets a host pass a freshly computed array every render, and\n * applying only a changed prop keeps a change made inside the viewer across\n * the host's next render. The model receives a parsed copy, never the host's\n * own object.\n */\nfunction useSyncedProps(model: MsaViewModel, props: MSAViewerProps) {\n const applied = useRef<string[] | undefined>(undefined)\n useEffect(() => {\n const keys = syncedProps.map(({ read }) =>\n JSON.stringify(read(props) ?? null),\n )\n applied.current ??= syncedProps.map(({ inSnapshot }, i) =>\n inSnapshot ? keys[i]! : '',\n )\n const last = applied.current\n syncedProps.forEach(({ apply }, i) => {\n const key = keys[i]!\n if (last[i] !== key) {\n last[i] = key\n apply(model, JSON.parse(key) ?? undefined, props)\n }\n })\n })\n}\n\nfunction Viewer({\n modelRef,\n ...props\n}: MSAViewerProps & { modelRef: ForwardedRef<MsaViewModel> }) {\n const {\n region,\n theme,\n onCellHover,\n onCellClick,\n onViewportChange,\n onSelectionChange,\n onModel,\n } = props\n const [model] = useState(() => {\n const model = MSAModelF().create(viewerSnapshot(props))\n model.setImportForm(false)\n return model\n })\n\n const destroyTimer = useRef<ReturnType<typeof setTimeout> | undefined>(\n undefined,\n )\n\n const [ref, { width }] = useMeasure()\n useEffect(() => {\n if (width) {\n model.setWidth(width)\n }\n }, [model, width])\n\n useSyncedProps(model, props)\n\n const regionKey = JSON.stringify(region ?? null)\n useEffect(() => {\n const target = JSON.parse(regionKey) as Region | null\n return target\n ? when(\n () => model.viewInitialized && model.numColumns > 0,\n () => {\n model.revealRegion(target)\n },\n )\n : undefined\n }, [model, regionKey])\n\n useModelReaction(model, 'hoveredCell', onCellHover)\n useModelReaction(model, 'clickedCell', onCellClick)\n useModelReaction(model, 'viewport', onViewportChange)\n useModelReaction(model, 'selection', onSelectionChange)\n\n useImperativeHandle(modelRef, () => model, [model])\n\n const latestOnModel = useRef(onModel)\n useEffect(() => {\n latestOnModel.current = onModel\n })\n useEffect(() => {\n latestOnModel.current?.(model)\n }, [model])\n\n // destroy releases the model's matchMedia listener and fetches. It waits a\n // tick because StrictMode remounts with the same state, and the remount's\n // effect cancels it.\n useEffect(() => {\n if (destroyTimer.current !== undefined) {\n clearTimeout(destroyTimer.current)\n destroyTimer.current = undefined\n }\n return () => {\n destroyTimer.current = setTimeout(() => {\n destroyTimer.current = undefined\n if (isAlive(model)) {\n destroy(model)\n }\n })\n }\n }, [model])\n\n return (\n <ThemeProvider theme={resolveTheme(theme)}>\n <div ref={ref}>\n <Loading model={model} />\n </div>\n </ThemeProvider>\n )\n}\n", "import { clamp, groupBy, notEmpty, sum } from '@jbrowse/core/util'\nimport { ElementId, FileLocation } from '@jbrowse/core/util/types/mst'\nimport {\n addDisposer,\n applySnapshot,\n cast,\n getSnapshot,\n types,\n} from '@jbrowse/mobx-state-tree'\nimport {\n autorun,\n compareStructural,\n computed,\n reaction,\n transaction,\n} from 'mobx'\nimport {\n generateNodeIds,\n gffToAnnotations,\n parseGFF,\n parseMSA,\n} from 'msa-parsers'\n\nimport { blockFasta } from './blockFasta.ts'\nimport { calculateBlocks } from './calculateBlocks.ts'\nimport { clustalXColumnColors } from './clustalX.ts'\nimport colorSchemes, { letterColorTable } from './colorSchemes.ts'\nimport { columnCountsFromRows, letterOfResidueSlot } from './columnCounts.ts'\nimport { columnStats } from './columnStats.ts'\nimport { packDomainLanes } from './components/msa/packDomainLanes.ts'\nimport { visibleColRange } from './components/msa/visibleColRange.ts'\nimport { cladeGutterWidth } from './components/tree/cladeBrackets.ts'\nimport { scaleBarLength } from './components/tree/scaleBar.ts'\nimport {\n defaultAllowedGappyness,\n defaultColWidth,\n defaultColorSchemeName,\n defaultCurrentAlignment,\n defaultDrawMsaLetters,\n defaultHeight,\n defaultHideGaps,\n defaultRowHeight,\n defaultScrollX,\n defaultScrollY,\n defaultScrollZoom,\n defaultScrollZoomAxis,\n defaultShowDomainLegend,\n defaultShowDomains,\n defaultSubFeatureRows,\n fontSizeFor,\n labelFitFontSize,\n maxCellSize,\n maxFitTreeWidth,\n maxTreeAreaShare,\n maxInlineSnapshotBytes as defaultMaxInlineSnapshotBytes,\n maxNeighborJoiningRows,\n minColWidth,\n minLetterColWidth,\n minLetterRowHeight,\n minRowHeight,\n minTreeWidth,\n pxPerTreeDepth,\n resizeHandleWidth,\n rowPanelHeaderHeight,\n rowTintAlpha,\n scrollZoomAxes,\n segmentFeatureTypes,\n segmentShades,\n settingsPanelWidth,\n treeScaleBarHeight,\n} from './constants.ts'\nimport { createPaletteMap } from './createPaletteMap.ts'\nimport { exportFileName } from './exportFileName.ts'\nimport { featureField, featureName } from './featureFields.ts'\nimport {\n colorByRow,\n featureColorMap,\n featureLabelMap,\n featurePanelSpans,\n rowPanelWidth,\n stringFields,\n} from './featurePanels.ts'\nimport { featuresToAnnotations } from './featuresLayer.ts'\nimport { installFilehandleLoader } from './filehandleLoader.ts'\nimport {\n find,\n hierarchy,\n layoutTree,\n leaves,\n nodeCoveringRows,\n} from './hierarchy.ts'\nimport { DataModelF } from './model/DataModel.ts'\nimport { DialogQueueSessionMixin } from './model/DialogQueue.ts'\nimport { MSAModelF } from './model/msaModel.ts'\nimport { TreeModelF } from './model/treeModel.ts'\nimport { calculateNeighborJoiningTree } from './neighborJoining.ts'\nimport { calculatePropertyConservation } from './propertyConservation.ts'\nimport { preorder } from './rerootTree.ts'\nimport {\n globalColToVisibleCol,\n seqPosOfGlobalCol,\n visibleColToGlobalCol,\n visibleColsBefore,\n} from './rowCoordinateCalculations.ts'\nimport {\n colorTable,\n declarationKey,\n readColumnTrack,\n readEncoding,\n readRowPanel,\n resolveShared,\n} from './scales.ts'\nimport { buildSeqPosIndex } from './seqPosToGlobalCol.ts'\nimport { maxBitsFor } from './sequenceLogo.ts'\nimport {\n blosum62ColumnColors,\n identityColumnColors,\n} from './similarityColors.ts'\nimport { stripDefault } from './stripDefault.ts'\nimport { treeTips, widestLabel } from './tipLabels.ts'\nimport {\n buildTreeRoot,\n outgroupNode,\n parseTreeText,\n resolveClades,\n rootTree,\n tipRange,\n} from './treeDisplay.ts'\nimport {\n computeRowInsertions,\n dropBlanks,\n len,\n readComputed,\n skipBlanks,\n withAlpha,\n} from './util.ts'\nimport { saveAs } from './vendor/fileSaver.ts'\nimport { writeNewick } from './writeNewick.ts'\nimport { parseWuss } from './wuss.ts'\nimport { takeZoomSnapshot, zoomSnapshotCovers } from './zoomSnapshot.ts'\n\nimport type { ColumnStats } from './columnStats.ts'\nimport type { ScrollZoomAxis } from './constants.ts'\nimport type { HierarchyNode } from './hierarchy.ts'\nimport type { ExportSvgOptions } from './renderToSvg.tsx'\nimport type {\n ColorChannel,\n LegacyColumnTrack,\n LegacyEncoding,\n LegacyRowPanel,\n ScaleTable,\n ScaleUse,\n SharedScale,\n} from './scales.ts'\nimport type {\n Annotation,\n Arc,\n BasicTrack,\n Cell,\n Clade,\n ResidueMappingProblem,\n ColumnTrackSpec,\n DomainBand,\n Encoding,\n EncodingChannel,\n Feature,\n Highlight,\n Legend,\n LegendEntry,\n MsaSelection,\n NodeWithIds,\n Region,\n ResidueMapping,\n ResidueSegment,\n ResolvedClade,\n ResolvedEncoding,\n ResolvedFeaturePanel,\n ResolvedStripPanel,\n ResolvedHighlight,\n ResolvedSelection,\n TreeRoot,\n ResolvedRowPanel,\n RowDataInput,\n RowPanelSpec,\n RowResidue,\n StructureResidue,\n TrackKind,\n UnshareableData,\n Viewport,\n} from './types.ts'\nimport type { ZoomSnapshot } from './zoomSnapshot.ts'\nimport type { FileLocation as FileLocationType } from '@jbrowse/core/util/types'\nimport type { Instance } from '@jbrowse/mobx-state-tree'\nimport type { IComputedValue } from 'mobx'\n\n// The height each kind draws at before the user drags a divider. A text track\n// is absent: it is one alignment row tall and follows rowHeight, so the zoom\n// controls already size it.\nexport const defaultTrackHeights: Partial<Record<TrackKind, number>> = {\n bar: 40,\n // taller than a bar track: in a 40px stack of four residues each glyph is\n // too short to identify. Twice the height of the tracks above it, so it\n // starts hidden\n logo: 80,\n arc: 50,\n ruler: 20,\n}\n\n// the kinds a divider resizes. The ruler is a fixed scale, and a text track\n// follows the vertical zoom.\nconst resizableKinds = new Set<TrackKind>(['bar', 'logo', 'arc'])\n\nconst defaultOffTracks = new Set(['sequence-logo', 'position-ruler'])\n\n// a data track carries its own height rather than its kind's, so its divider\n// resizes it alone\nconst ownHeightKey = (id: string) => `own:${id}`\n\n// base-pair arcs: one color for nested helices, one for pseudoknots, which cross\n// them\nconst HELIX_ARC = '#4e79a7'\nconst PSEUDOKNOT_ARC = '#e15759'\n\nconst columnTrackBytes = new WeakMap<ColumnTrackSpec, number>()\n\nfunction columnTrackSize(track: ColumnTrackSpec) {\n let bytes = columnTrackBytes.get(track)\n if (bytes === undefined) {\n bytes = JSON.stringify(track).length\n columnTrackBytes.set(track, bytes)\n }\n return bytes\n}\n\n// a data track over this size stays in the live model but leaves the snapshot,\n// the same rule DataModel applies to an inline document\nfunction columnTrackSizes(tracks?: readonly ColumnTrackSpec[]) {\n return (tracks ?? []).map(columnTrackSize)\n}\n\nfunction smallColumnTracks(\n tracks: ColumnTrackSpec[] | undefined,\n maxInlineSnapshotBytes: number,\n) {\n const sizes = columnTrackSizes(tracks)\n const kept = tracks?.filter((_t, i) => sizes[i]! <= maxInlineSnapshotBytes)\n return kept?.length ? { columnTracks: kept } : {}\n}\n\n/**\n * The snapshot properties reset() carries across a return to the import form:\n * display preferences and layout, nothing derived from the loaded file.\n *\n * reset() applies a default snapshot filtered to this list, so any property\n * left off it resets, including downstream composed ones (e.g. the jbrowse\n * plugin's). Node ids are path-derived (node-0-0-1), so a carried-over\n * `collapsed` or `showOnly` id would match a real node in the next tree and\n * fold it.\n *\n * Exported for modelReset.test.ts.\n */\nexport const preservedOnReset = new Set([\n 'id',\n 'type',\n 'height',\n 'drawMsaLetters',\n 'scrollZoom',\n 'scrollZoomAxis',\n 'bgColor',\n 'colorSchemeName',\n 'customColorScheme',\n 'showColumnStats',\n 'drawLabels',\n 'labelsAlignRight',\n 'treeAreaWidth',\n 'treeWidth',\n 'showBranchLen',\n 'treeOrder',\n 'drawTree',\n 'drawNodeBubbles',\n 'drawNodeLabels',\n 'showTreeOverview',\n 'showTreeScaleBar',\n 'overviewHeight',\n 'turnedOffTracks',\n 'trackHeights',\n 'hideGaps',\n 'allowedGappyness',\n 'subFeatureRows',\n 'showDomainLegend',\n 'domainFill',\n 'embeddedMode',\n])\n\n// `turnedOffTracks` holds only the user's explicit choices, so a hidden-by-default\n// track writes nothing into the snapshot\nfunction trackIsOff(\n turnedOffTracks: { get: (id: string) => boolean | undefined },\n id: string,\n) {\n return turnedOffTracks.get(id) ?? defaultOffTracks.has(id)\n}\n\n// shared empty results, so observers don't see a fresh [] as a change\nconst noDomains: Annotation[] = []\nconst noClades: ResolvedClade[] = []\n\n// the channels reading the feature table; every other channel reads rowData\nconst featureChannels = new Set<EncodingChannel>([\n 'featureFill',\n 'featureLabel',\n])\n\n// seqPos -> column indexes per row, keyed on the parse so they are garbage\n// collected with it. A computed would rebuild every row's index when read\n// outside a reactive context.\n// Newick tools write a colon in a name as an underscore, so a tree's row\n// `chr1_100-200` is the GFF's `chr1:100-200`, as FastaMSA.getRow resolves it\nfunction annotationRowName(id: string, rowNames: Map<string, number>) {\n if (rowNames.has(id)) {\n return id\n }\n const underscored = id.replaceAll(':', '_')\n return rowNames.has(underscored) ? underscored : id\n}\n\nconst seqPosIndexCache = new WeakMap<object, Map<string, Int32Array>>()\n\n// A segment is a 1:1 run. A segment whose sides differ in length is malformed,\n// and the lookups treat it like an uncovered position.\nfunction sameLength(segment: ResidueSegment) {\n return (\n segment.rowEnd - segment.rowStart ===\n segment.structEnd - segment.structStart\n )\n}\n\n// A zoom that passes the default cell size stops on it, and one that starts on\n// it holds there until the wheel has gathered `zoomDetent` worth of scale, so\n// a zoom in or out finds its way back to the default\nconst zoomDetent = Math.log(1.3)\n\nfunction detentZoom(\n value: number,\n scale: number,\n home: number,\n held: number,\n min: number,\n canHold: boolean,\n) {\n if (value === home && canHold) {\n const total = held + Math.log(scale)\n return Math.abs(total) < zoomDetent\n ? { value, held: total }\n : { value: clamp(home * Math.exp(total), min, maxCellSize), held: 0 }\n }\n const next = clamp(value * scale, min, maxCellSize)\n return (value - home) * (next - home) < 0\n ? { value: home, held: 0 }\n : { value: next, held: 0 }\n}\n\n// fit() divides the viewport by the row or column count and multiplies back, so\n// an exact fit can land a fraction of a pixel over. A plain `>` would then show\n// a scrollbar that shrinks the viewport and leaves a gap.\nfunction overflows(content: number, viewport: number) {\n return content - viewport > 0.5\n}\n\nfunction inRanges(ranges: [number, number][] | undefined, position: number) {\n return !!ranges?.some(([start, end]) => position >= start && position <= end)\n}\n\n// sorted integers as inclusive [first, last] runs of consecutive values\nfunction consecutiveRuns(sorted: number[]) {\n const runs: [number, number][] = []\n for (const n of sorted) {\n const last = runs.at(-1)\n if (last && n <= last[1] + 1) {\n last[1] = Math.max(last[1], n)\n } else {\n runs.push([n, n])\n }\n }\n return runs\n}\n\n// the value every one of a node's children reports, or undefined where one of\n// them has no value or they disagree\nfunction sharedValue(values: (string | undefined)[]) {\n const [first] = values\n return first !== undefined && values.every(v => v === first)\n ? first\n : undefined\n}\n\ntype StripPanelScale = Omit<ResolvedStripPanel, 'id' | 'width' | 'offsetX'>\ntype FeaturePanelScale = Omit<\n ResolvedFeaturePanel,\n 'id' | 'width' | 'offsetX' | 'spans'\n>\n\n/**\n * #stateModel MsaView\n *\n * The main MSAView state model. Holds the loaded alignment, tree, and optional\n * overlay annotations, plus all display state (color scheme, zoom,\n * scroll, collapsed clades). It composes in members from `DialogQueueSessionMixin`,\n * `Tree`, and `MSAModel` (see Inherited members below). Data is loaded reactively\n * from the `msaFilehandle` / `treeFilehandle` / `gffFilehandle` properties, or set\n * directly with `setData`. Most state is persisted into the shareable URL.\n *\n * #example\n * ```js\n * import { MSAModelF } from 'react-msaview'\n * import { types } from '@jbrowse/mobx-state-tree'\n *\n * const RootModel = types.model({ view: types.optional(MSAModelF(), {}) })\n * const root = RootModel.create({})\n * root.view.setData({ msa: '>seq1\\nACGT\\n>seq2\\nACGT' })\n * ```\n *\n * `maxInlineSnapshotBytes` is the largest pasted or local document, and the\n * largest data track, the snapshot keeps; a larger one stays in the live model\n * and `unshareableData` names it. The standalone app, whose links carry the\n * snapshot in the URL fragment, raises it.\n */\nfunction stateModelFactory({\n maxInlineSnapshotBytes = defaultMaxInlineSnapshotBytes,\n}: { maxInlineSnapshotBytes?: number } = {}) {\n return types\n .compose(\n DialogQueueSessionMixin(),\n TreeModelF(),\n MSAModelF(),\n types.model('MsaView', {\n /**\n * #property\n * id of view, randomly generated if not provided\n */\n id: ElementId,\n\n /**\n * #property\n */\n showDomains: stripDefault(types.boolean, defaultShowDomains),\n /**\n * #property\n * whether shown domains fill the cells they cover. Off, the residue\n * scheme keeps the cells and each domain draws as a bar under its\n * row. See `cellFill`.\n */\n domainFill: stripDefault(types.boolean, true),\n /**\n * #property\n * whether the domain legend is expanded. The legend floats over the\n * top-right of the alignment and covers residues, so a session or\n * figure can open with it collapsed.\n */\n showDomainLegend: stripDefault(types.boolean, defaultShowDomainLegend),\n /**\n * #property\n */\n hideGaps: stripDefault(types.boolean, defaultHideGaps),\n /**\n * #property\n */\n allowedGappyness: stripDefault(types.number, defaultAllowedGappyness),\n /**\n * #property\n */\n subFeatureRows: stripDefault(types.boolean, defaultSubFeatureRows),\n\n /**\n * #property\n * hardcoded view type\n */\n type: types.literal('MsaView'),\n\n /**\n * #property\n */\n drawMsaLetters: stripDefault(types.boolean, defaultDrawMsaLetters),\n\n /**\n * #property\n * draws the toolbar's menus and Settings as icons without text, for a\n * host with little room, such as a JBrowse view\n */\n embeddedMode: stripDefault(types.boolean, false),\n\n /**\n * #property\n * zoom in/out on plain mouse-wheel without holding ctrl\n */\n scrollZoom: stripDefault(types.boolean, defaultScrollZoom),\n\n /**\n * #property\n * which cell dimensions a wheel zoom scales, while `scrollZoom` is on\n */\n scrollZoomAxis: stripDefault(\n types.enumeration('ScrollZoomAxis', [...scrollZoomAxes]),\n defaultScrollZoomAxis,\n ),\n\n /**\n * #property\n * height of the div containing the view, px\n */\n height: stripDefault(types.number, defaultHeight),\n\n /**\n * #property\n * height of each row, px\n */\n rowHeight: stripDefault(types.number, defaultRowHeight),\n\n /**\n * #property\n * scroll position, Y-offset, px\n */\n scrollY: stripDefault(types.number, defaultScrollY),\n\n /**\n * #property\n * scroll position, X-offset, px\n */\n scrollX: stripDefault(types.number, defaultScrollX),\n\n /**\n * #property\n * width of columns, px\n */\n colWidth: stripDefault(types.number, defaultColWidth),\n\n /**\n * #property\n * filehandle object for the tree\n */\n treeFilehandle: types.maybe(FileLocation),\n\n /**\n * #property\n * filehandle object for the MSA (which could contain a tree e.g. with\n * stockholm files)\n */\n msaFilehandle: types.maybe(FileLocation),\n\n /**\n * #property\n * filehandle object for tree metadata\n */\n treeMetadataFilehandle: types.maybe(FileLocation),\n\n /**\n * #property\n * filehandle object for a GFF file of overlay annotations\n */\n gffFilehandle: types.maybe(FileLocation),\n\n /**\n * #property\n */\n currentAlignment: stripDefault(types.number, defaultCurrentAlignment),\n\n /**\n * #property\n * array of tree parent nodes that are 'collapsed' (all children are\n * hidden)\n */\n collapsed: stripDefault(types.array(types.string), []),\n\n /**\n * #property\n * tree nodes whose children draw in reverse order, which is ggtree's\n * `rotate`: the same tree, with the clades on either side of the node\n * swapped\n */\n rotated: stripDefault(types.array(types.string), []),\n\n /**\n * #property\n * where the tree is rooted: `midpoint` roots it halfway along the\n * longest path between two tips, `{outgroup}` on the branch above\n * the tips named, and undefined keeps the file's root\n */\n treeRoot: types.frozen<TreeRoot | undefined>(),\n\n /**\n * #property\n * focus on particular subtree\n */\n showOnly: types.maybe(types.string),\n /**\n * #property\n * the user's explicit show/hide choice per track id, keyed by id with\n * the value meaning \"off\". A track the user has never touched is absent\n * and falls back to its own default (see `defaultOffTracks`), so a\n * hidden-by-default track adds nothing to the shared URL.\n */\n turnedOffTracks: stripDefault(types.map(types.boolean), {}),\n\n /**\n * #property\n * the height of every track one divider resizes, keyed by `heightKey`:\n * the `kind` for the computed tracks, `own:<id>` for a data track. A\n * key is absent until the user drags that divider, and\n * `defaultTrackHeights` answers for it until then, so an untouched\n * viewer adds nothing to the shared URL.\n */\n trackHeights: stripDefault(types.map(types.number), {}),\n /**\n * #property\n * tracks supplied as data: per-column values drawn as bars, or a\n * per-column string drawn as a text track. See docs/layers.md\n */\n columnTracks: stripDefault(\n types.array(\n types.snapshotProcessor(types.frozen<ColumnTrackSpec>(), {\n preProcessor: readColumnTrack,\n }),\n ),\n [],\n ),\n\n /**\n * #property\n * row-to-structure residue correspondence, computed outside the viewer\n * (e.g. from SIFTS). Matching by sequence equality places a tagged\n * construct, a truncation or a subsequence row on the wrong residue.\n * See docs/layers.md\n */\n residueMappings: stripDefault(\n types.array(types.frozen<ResidueMapping>()),\n [],\n ),\n\n /**\n * #property\n * data from the loaded tree/msa/treeMetadata, generally loaded by\n * autorun\n */\n data: types.optional(DataModelF(maxInlineSnapshotBytes), {}),\n\n /**\n * #property\n * the user's departures from each annotation accession's default,\n * keyed by accession with the value meaning \"off\", like\n * `turnedOffTracks`. An untouched accession is absent and takes its\n * default, so the shared URL grows only with the user's filters\n */\n turnedOffFeatures: stripDefault(types.map(types.boolean), {}),\n /**\n * #property\n */\n relativeTo: types.maybe(types.string),\n /**\n * #property\n * declarative seed for the highlighted-columns overlay (visible column\n * indices). Unlike the volatile `highlightedColumns` (driven by\n * transient genome-hover sync), this persists in the snapshot/URL so a\n * shared link can open with specific columns highlighted. Applied once\n * in afterCreate.\n */\n highlightColumns: types.frozen<number[] | undefined>(),\n /**\n * #property\n * labeled highlights in 1-based inclusive coordinates: a column span\n * `{start, end}`, a residue span `{row, start, end}` of a named row,\n * or a row set `{rows}`, each with an optional `label` and `color`.\n * Persists in the snapshot and the URL.\n */\n highlights: stripDefault(types.array(types.frozen<Highlight>()), []),\n /**\n * #property\n * features on the rows as data, `{row, start, end, name, ...}` in\n * residues of each row, drawn with the GFF's annotations. Persists in\n * the snapshot and the URL.\n */\n features: stripDefault(types.array(types.frozen<Feature>()), []),\n /**\n * #property\n * the block the reader selected: `{start, end}` columns of the file,\n * 1-based inclusive like a column highlight, and `rows` by name, every\n * row where absent. Undefined until something is selected, so a view\n * without one adds nothing to the shared URL.\n */\n selection: types.frozen<MsaSelection | undefined>(),\n /**\n * #property\n * where the view opens, in `highlights` coordinates: `{row, start,\n * end}` zooms onto residues of that row and scrolls the row to the\n * middle, `{start, end}` zooms onto alignment columns. Applied once the\n * alignment and any tree file have loaded, then cleared, so a reloaded\n * session keeps the reader's own scroll.\n */\n region: types.frozen<Region | undefined>(),\n /**\n * #property\n * clades of the tree with a mark drawn over them. `mrca` names tips\n * whose common ancestor is the clade, or `range` its first and last\n * tip in display order, and `tips` is the leaf count the producer\n * measured. `mark` is `highlight`, `bracket`, `collapse`, `focus` or\n * `rotate`.\n * See docs/layers.md\n */\n clades: stripDefault(types.array(types.frozen<Clade>()), []),\n /**\n * #property\n * what the viewer's own marks read from `rowData` or the feature\n * table: `{channel, field, range?, domain?, title?}` per channel. The\n * earlier `scale: {palette}` and `scale: {map}` read as `range` and\n * `domain`. See docs/layers.md\n */\n encodings: stripDefault(\n types.array(\n types.snapshotProcessor(types.frozen<Encoding>(), {\n preProcessor: readEncoding,\n }),\n ),\n [],\n ),\n /**\n * #property\n * panels drawn between the tree and the alignment:\n * `{kind: \"strip\", field, range?, domain?, title?, width?, header?}`\n * colors one cell per row from a `rowData` field, and\n * `{kind: \"features\", x, encoding?, transform?, width?, header?}`\n * draws the spans the GFF carries. See docs/layers.md\n */\n rowPanels: stripDefault(\n types.array(\n types.snapshotProcessor(types.frozen<RowPanelSpec>(), {\n preProcessor: readRowPanel,\n }),\n ),\n [],\n ),\n }),\n )\n .volatile(() => ({\n /**\n * #volatile\n */\n headerHeight: 0,\n /**\n * #volatile\n * whether the settings panel docks beside the alignment, taking\n * `settingsPanelWidth` out of the width the view lays out in\n */\n settingsOpen: false,\n /**\n * #volatile\n * the log scale a wheel zoom has gathered against the detent at the\n * default column width and row height, per axis\n */\n zoomHeld: { col: 0, row: 0 },\n /**\n * #volatile\n * leaves the toolbar out, for a host drawing its own controls. Kept out\n * of the snapshot so a link opened in the full app shows the toolbar.\n */\n hideHeader: false,\n /**\n * #volatile\n * shows the import form while the view has no data. MSAViewer turns it\n * off, since its host supplies the data and the form is the demo app's\n */\n importForm: true,\n /**\n * #volatile\n */\n status: undefined as { msg: string; onCancel?: () => void } | undefined,\n /**\n * #volatile\n * canvas scale factor, from the device pixel ratio\n */\n highResScaleFactor:\n typeof window === 'undefined' ? 1 : window.devicePixelRatio,\n\n /**\n * #volatile\n * the cell size and block grid the alignment last drew at, held from a\n * wheel-zoom frame until the gesture settles. MSACanvas stretches those\n * blocks to the current cell size with one CSS transform\n */\n zoomSnapshot: undefined as ZoomSnapshot | undefined,\n /**\n * #volatile\n */\n loadingMSA: false,\n /**\n * #volatile\n */\n loadingTree: false,\n /**\n * #volatile\n */\n volatileWidth: undefined as number | undefined,\n /**\n * #volatile\n * thickness of the dividers, between the tree and the alignment and under\n * the view, px\n */\n resizeHandleWidth,\n\n /**\n * #volatile\n * size of blocks of content to be drawn, px\n */\n blockSize: 500,\n\n /**\n * #volatile\n * the currently mouse-hovered row\n */\n mouseRow: undefined as number | undefined,\n\n /**\n * #volatile\n * the currently mouse-hovered column\n */\n mouseCol: undefined as number | undefined,\n\n /**\n * #volatile\n * the currently mouse-click row\n */\n mouseClickRow: undefined as number | undefined,\n\n /**\n * #volatile\n * the currently mouse-click column\n */\n mouseClickCol: undefined as number | undefined,\n\n /**\n * #volatile\n * the currently hovered tree node ID and its descendant leaf names\n */\n hoveredTreeNode: undefined as\n | { nodeId: string; descendantNames: string[] }\n | undefined,\n\n /**\n * #volatile\n * array of column indices to highlight\n */\n highlightedColumns: undefined as number[] | undefined,\n\n /**\n * #volatile\n * transient highlights keyed by owner, so a structure viewer's hover and\n * a genome view's hover each clear only their own. Not persisted.\n */\n transientHighlights: {} as Record<string, Highlight[]>,\n\n /**\n * #volatile\n */\n minimapHeight: 56,\n\n /**\n * #volatile\n */\n marginLeft: 20,\n\n /**\n * #volatile\n */\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n error: undefined as unknown,\n\n /**\n * #volatile\n * non-fatal load problems: an optional layer that failed to load, an\n * overlay that failed to parse. `error` replaces the view and is for the\n * alignment itself. `warnings` adds the ones derived from the data\n */\n loadWarnings: [] as string[],\n\n /**\n * #volatile\n * derived warnings the user dismissed, which stay hidden while the data\n * behind them holds\n */\n dismissedWarnings: [] as string[],\n\n /**\n * #volatile\n * bumped by reset(). The error boundary above the view uses it as its key,\n * since the boundary keeps its caught error until remounted\n */\n resetCount: 0,\n\n /**\n * #volatile\n * set by a host that restores the loaded documents itself, such as a\n * jbrowse session or a page that refetches them. `unshareableData` then\n * reports nothing\n */\n hostCarriesData: false,\n\n /**\n * #volatile\n * overlay annotations drawn on the alignment. InterProScan JSON, GFF and\n * user uploads all convert to this flat list\n */\n annotations: [] as Annotation[],\n }))\n .actions(self => ({\n /**\n * #action\n * draw the alignment with positions numbered relative to the given row's\n * sequence (its node id), instead of in raw MSA-column coordinates\n */\n drawRelativeTo(id: string | undefined) {\n self.relativeTo = id\n },\n /**\n * #action\n * hide columns that are entirely (or mostly, see allowedGappyness) gaps\n */\n setHideGaps(arg: boolean) {\n self.hideGaps = arg\n },\n /**\n * #action\n */\n setAllowedGappyness(arg: number) {\n self.allowedGappyness = arg\n },\n /**\n * #action\n */\n setLoadingMSA(arg: boolean) {\n self.loadingMSA = arg\n },\n /**\n * #action\n */\n setLoadingTree(arg: boolean) {\n self.loadingTree = arg\n },\n /**\n * #action\n */\n setWidth(arg: number) {\n self.volatileWidth = arg\n },\n /**\n * #action\n */\n setSettingsOpen(arg: boolean) {\n self.settingsOpen = arg\n },\n /**\n * #action\n * update the canvas scale factor when the device pixel ratio changes\n * (moving between monitors, browser zoom)\n */\n setHighResScaleFactor(arg: number) {\n self.highResScaleFactor = arg\n },\n /**\n * #action\n * set the height of the view in px\n */\n setHeight(height: number) {\n self.height = height\n },\n\n /**\n * #action\n * set error state\n */\n setError(error?: unknown) {\n self.error = error\n },\n\n /**\n * #action\n * record a non-fatal load problem: a layer that failed to load, a file\n * that failed to parse. A message already on the list is not added again\n */\n addWarning(warning: string) {\n if (!self.loadWarnings.includes(warning)) {\n self.loadWarnings = [...self.loadWarnings, warning]\n }\n },\n\n /**\n * #action\n * declare that this host restores the loaded documents itself, which\n * hides the \"Not in the link\" warning. See `hostCarriesData`\n */\n setHostCarriesData(arg: boolean) {\n self.hostCarriesData = arg\n },\n\n /**\n * #action\n * set mouse position (row, column) in the MSA\n *\n * Public API: a host calls this (and reads `mouseCol`) to sync hover with\n * its own view, such as a genome view or 3D structure. Keep the name and\n * signature stable.\n */\n setMousePos(col?: number, row?: number) {\n self.mouseCol = col\n self.mouseRow = row\n },\n\n /**\n * #action\n * set highlighted columns\n *\n * Public API: jbrowse-plugin-msaview calls this from its\n * afterCreateAutoruns, and MSAViewer passes its `highlightColumns` prop\n * through it.\n */\n setHighlightedColumns(columns?: number[]) {\n self.highlightedColumns = columns\n },\n /**\n * #action\n */\n setRegion(region?: Region) {\n self.region = region\n },\n /**\n * #action\n */\n setHighlights(highlights: Highlight[]) {\n self.highlights.replace(highlights)\n },\n /**\n * #action\n */\n setFeatures(features: Feature[]) {\n self.features.replace(features)\n },\n /**\n * #action\n * select a block, in `selection` coordinates. `start` and `end` may come\n * in either order.\n */\n setSelection(selection?: MsaSelection) {\n const next = selection && {\n start: Math.min(selection.start, selection.end),\n end: Math.max(selection.start, selection.end),\n ...(selection.rows ? { rows: selection.rows } : {}),\n }\n if (!compareStructural(next, self.selection)) {\n self.selection = next\n }\n },\n /**\n * #action\n */\n clearSelection() {\n this.setSelection(undefined)\n },\n\n /**\n * #action\n * replace the clades the viewer marks (see docs/layers.md)\n */\n setClades(clades: Clade[]) {\n self.clades.replace(clades)\n },\n /**\n * #action\n * show `highlights` for `owner`, replacing that owner's previous ones and\n * leaving other owners' in place\n */\n applyHighlight(owner: string, highlights: Highlight[]) {\n self.transientHighlights = {\n ...self.transientHighlights,\n [owner]: highlights,\n }\n },\n /**\n * #action\n * remove `owner`'s highlights, leaving other owners' in place\n */\n clearHighlight(owner: string) {\n if (owner in self.transientHighlights) {\n const { [owner]: _dropped, ...rest } = self.transientHighlights\n self.transientHighlights = rest\n }\n },\n /**\n * #action\n * toggle the annotation overlay on the alignment\n */\n setShowDomains(arg: boolean) {\n self.showDomains = arg\n },\n /**\n * #action\n */\n setDomainFill(arg: boolean) {\n self.domainFill = arg\n },\n /**\n * #action\n * hand the cell fill to the residue scheme, the domains, or neither,\n * which colors the letters instead\n */\n setCellFill(mode: 'residue' | 'domain' | 'none') {\n self.setBgColor(mode !== 'none')\n if (mode !== 'none') {\n self.domainFill = mode === 'domain'\n }\n },\n /**\n * #action\n * expand or collapse the domain legend that floats over the alignment\n */\n setShowDomainLegend(arg: boolean) {\n self.showDomainLegend = arg\n },\n /**\n * #action\n */\n setSubFeatureRows(arg: boolean) {\n self.subFeatureRows = arg\n },\n /**\n * #action\n * set mouse click position (row, column) in the MSA\n */\n setMouseClickPos(col?: number, row?: number) {\n self.mouseClickCol = col\n self.mouseClickRow = row\n },\n\n /**\n * #action\n * set row height (px)\n */\n setRowHeight(n: number) {\n self.rowHeight = n\n self.zoomHeld = { ...self.zoomHeld, row: 0 }\n },\n\n /**\n * #action\n * set col width (px)\n */\n setColWidth(n: number) {\n self.colWidth = n\n self.zoomHeld = { ...self.zoomHeld, col: 0 }\n },\n\n /**\n * #action\n * switch to another alignment of a multi-alignment file (Stockholm).\n * Clears the collapsed and rotated node ids, the subtree in focus, the\n * reference row and the scroll position, which all refer to the\n * previous alignment\n */\n setCurrentAlignment(n: number) {\n if (n === self.currentAlignment) {\n return\n }\n transaction(() => {\n self.currentAlignment = n\n self.collapsed.clear()\n self.rotated.clear()\n this.setShowOnly(undefined)\n this.drawRelativeTo(undefined)\n self.scrollX = 0\n self.scrollY = 0\n })\n },\n\n /**\n * #action\n * collapse or un-collapse the subtree rooted at the given tree node id\n */\n toggleCollapsed(node: string) {\n if (self.collapsed.includes(node)) {\n self.collapsed.remove(node)\n } else {\n self.collapsed.push(node)\n }\n },\n\n /**\n * #action\n * reverse the order of the given node's children, or restore it\n */\n toggleRotated(node: string) {\n if (self.rotated.includes(node)) {\n self.rotated.remove(node)\n } else {\n self.rotated.push(node)\n }\n },\n\n /**\n * #action\n */\n clearRotated() {\n self.rotated.clear()\n },\n\n /**\n * #action\n * reroot the tree. Clears `collapsed`, `rotated` and `showOnly`, whose\n * path-derived node ids name other nodes in the rerooted tree\n */\n setTreeRoot(treeRoot?: TreeRoot) {\n if (compareStructural(self.treeRoot, treeRoot)) {\n return\n }\n transaction(() => {\n self.treeRoot = treeRoot\n self.collapsed.clear()\n self.rotated.clear()\n this.setShowOnly(undefined)\n })\n },\n\n /**\n * #action\n * show only the subtree rooted at the given node id (pass undefined to\n * show the whole tree again)\n */\n setShowOnly(node?: string) {\n self.showOnly = node\n },\n\n /**\n * #action\n * set the alignment/tree/metadata/domain data directly from strings,\n * bypassing the filehandle loaders\n */\n setData(data: {\n msa?: string\n tree?: string\n treeMetadata?: string\n gff?: string\n }) {\n self.data = cast(data)\n },\n\n /**\n * #action\n */\n setMSAFilehandle(msaFilehandle?: FileLocationType) {\n self.msaFilehandle = cast(msaFilehandle)\n },\n\n /**\n * #action\n */\n setTreeFilehandle(treeFilehandle?: FileLocationType) {\n self.treeFilehandle = cast(treeFilehandle)\n },\n\n /**\n * #action\n */\n setTreeMetadataFilehandle(treeMetadataFilehandle?: FileLocationType) {\n self.treeMetadataFilehandle = cast(treeMetadataFilehandle)\n },\n\n /**\n * #action\n */\n setGFFFilehandle(gffFilehandle?: FileLocationType) {\n self.gffFilehandle = cast(gffFilehandle)\n },\n\n /**\n * #action\n */\n setMSA(result: string) {\n self.data.setMSA(result)\n },\n\n /**\n * #action\n */\n setTree(result: string) {\n self.data.setTree(result)\n },\n\n /**\n * #action\n */\n setTreeMetadata(result: string) {\n self.data.setTreeMetadata(result)\n },\n\n /**\n * #action\n * store the GFF text in the snapshot like the alignment and tree. The\n * parsed annotations are volatile and a blob filehandle is cleared once\n * read, so the text is the only persisted copy. An autorun parses it\n * into annotations, and clears the ones it drew when the text goes.\n */\n setGFF(result?: string) {\n self.data.setGFF(result)\n },\n }))\n\n .views(self => ({\n /**\n * #getter\n * hideGaps takes effect when a collapse or a focus hides rows, whose\n * residues leave columns all gaps among the rest, or when\n * allowedGappyness is under 100\n */\n get hideGapsEffective() {\n return (\n self.hideGaps &&\n (self.collapsed.length > 0 ||\n self.showOnly !== undefined ||\n self.allowedGappyness < 100)\n )\n },\n\n /**\n * #getter\n * whether the host restores the loaded documents outside the snapshot.\n * When true, `unshareableData` is empty.\n *\n * A simple host sets `hostCarriesData`. A host where this depends on how\n * the view was opened overrides the getter in its own composed model's\n * `.views` block; jbrowse-plugin-msaview's indexed-location views refetch\n * from a URL the session holds, while its data-store views do not.\n * `unshareableData` reads it off `self`, so an override takes effect.\n */\n get hostRestoresData() {\n return self.hostCarriesData\n },\n get viewInitialized() {\n return self.volatileWidth !== undefined\n },\n /**\n * #getter\n */\n get width() {\n if (self.volatileWidth === undefined) {\n throw new Error('not initialized')\n }\n return self.volatileWidth - (self.settingsOpen ? settingsPanelWidth : 0)\n },\n }))\n .views(self => ({\n /**\n * #getter\n */\n get colorScheme() {\n const { customColorScheme, colorSchemeName } = self\n // colorSchemeName is a free string (menus, snapshots, URL params), so a\n // stale name falls back to the default\n return customColorScheme\n ? letterColorTable(customColorScheme)\n : (colorSchemes[colorSchemeName] ??\n colorSchemes[defaultColorSchemeName]!)\n },\n\n /**\n * #getter\n * the scheme coloring each cell from its column's statistics, or\n * undefined while the cells take a fixed color per letter, from the\n * built-in table or from `customColorScheme`\n */\n get dynamicColorSchemeName() {\n const { customColorScheme, colorSchemeName } = self\n return !customColorScheme && colorSchemeName.includes('dynamic')\n ? colorSchemeName\n : undefined\n },\n\n /**\n * #getter\n */\n get header() {\n return this.MSA?.getHeader() ?? {}\n },\n\n /**\n * #getter\n */\n get alignmentNames() {\n return this.MSA?.alignmentNames ?? []\n },\n /**\n * #getter\n */\n get noTree() {\n return !!this.tree.noTree\n },\n get noDomains() {\n return this.allAnnotations.length === 0\n },\n\n /**\n * #getter\n * loaded documents left out of the snapshot, largest first. A file opened\n * from disk or pasted in becomes inline text, and DataModel drops an\n * inline document past `maxInlineSnapshotBytes`.\n *\n * The header lists these, and the standalone app drops `#data=` from\n * the address bar while the list is non-empty or the encoded link would\n * pass its `maxLinkLength`, so a copied link never opens an empty viewer\n * unannounced. A document fetched from a URL never appears here, since\n * the snapshot keeps its filehandle.\n *\n * Empty when `hostCarriesData` is true.\n */\n get unshareableData(): UnshareableData[] {\n if (self.hostRestoresData) {\n return []\n }\n const { data } = self\n // data tracks past the limit also leave the snapshot\n const trackBytes = columnTrackSizes(self.columnTracks)\n .filter(bytes => bytes > maxInlineSnapshotBytes)\n .reduce((a, b) => a + b, 0)\n return (\n [\n ['alignment', data.msa, self.msaFilehandle],\n ['tree', data.tree, self.treeFilehandle],\n ['annotations', data.gff, self.gffFilehandle],\n ['row metadata', data.treeMetadata, self.treeMetadataFilehandle],\n ] as const\n )\n .flatMap<UnshareableData>(([what, text, filehandle]) =>\n !filehandle && text && text.length > maxInlineSnapshotBytes\n ? [{ what, bytes: text.length }]\n : [],\n )\n .concat(\n trackBytes ? [{ what: 'data tracks', bytes: trackBytes }] : [],\n )\n .sort((a, b) => b.bytes - a.bytes)\n },\n menuItems() {\n return []\n },\n /**\n * #getter\n * the row table: extra fields per row, keyed by row name, which the\n * `encodings` channels read. It is stored as the JSON string\n * `data.treeMetadata`, the name that travels in existing links, so the\n * inline size limit and `treeMetadataFilehandle` cover it. The tree area\n * fit reads it on every layout, so a malformed user-supplied file\n * returns {} instead of throwing out of rendering, and every field is a\n * string by the time a scale sorts it.\n */\n get rowData(): Record<string, Record<string, string> | undefined> {\n const text = self.data.treeMetadata\n if (!text) {\n return {}\n }\n try {\n const parsed: unknown = JSON.parse(text)\n return typeof parsed === 'object' && parsed !== null\n ? Object.fromEntries(\n Object.entries(parsed).map(([name, row]) => [\n name,\n stringFields(row),\n ]),\n )\n : {}\n } catch (e) {\n console.error('failed to parse rowData', e)\n return {}\n }\n },\n /**\n * #method\n * one row's fields, the single reader of the row table\n */\n rowDataOf(name: string) {\n return this.rowData[name]\n },\n /**\n * #getter\n * the field names the row table carries, sorted, for a producer or a UI\n * choosing one to encode\n */\n get rowFields(): string[] {\n const fields = new Set<string>()\n for (const row of Object.values(this.rowData)) {\n for (const field of Object.keys(row ?? {})) {\n fields.add(field)\n }\n }\n return [...fields].sort((a, b) => a.localeCompare(b))\n },\n /**\n * #getter\n */\n get MSA() {\n const text = self.data.msa\n // uses parseMSA so the named MSAParserType return type is portable\n // to downstream consumers (avoids TS2883 with default exports)\n return text\n ? parseMSA(text, self.currentAlignment, self.msaFormat)\n : null\n },\n /**\n * #getter\n * the annotations the overlay, the legend and the encodings draw: the\n * GFF's, the `features` layer's, then the file's own per-row lines\n */\n get allAnnotations(): Annotation[] {\n const inline = this.MSA?.annotations ?? []\n return self.features.length > 0 || inline.length > 0\n ? [\n ...self.annotations,\n ...featuresToAnnotations(self.features),\n ...inline,\n ]\n : self.annotations\n },\n /**\n * #getter\n */\n get actuallyShowDomains() {\n return self.showDomains && this.allAnnotations.length > 0\n },\n /**\n * #getter\n */\n get numColumns() {\n return (this.MSA?.getWidth() ?? 0) - this.blanks.length\n },\n\n /**\n * #getter\n * the tree the file or the alignment gives, before `treeRoot`\n */\n get inputTree(): NodeWithIds {\n const text = self.data.tree\n return text\n ? generateNodeIds(parseTreeText(text))\n : (this.MSA?.getTree() ?? {\n noTree: true,\n children: [],\n id: 'empty',\n name: 'empty',\n })\n },\n\n /**\n * #getter\n * the tree as the file or the alignment gives it, rerooted where\n * `treeRoot` asks. Every node id, and so `collapsed`, `rotated` and\n * `showOnly`, refers to this tree.\n */\n get tree(): NodeWithIds {\n const tree = this.inputTree\n return self.treeRoot && !tree.noTree\n ? rootTree(tree, self.treeRoot)\n : tree\n },\n\n /**\n * #getter\n * Returns the list of row (sequence) names in display order.\n * Part of the public API used by downstream consumers (e.g. jbrowse plugins).\n */\n get rowNames(): string[] {\n return this.leaves.map(n => n.data.name)\n },\n /**\n * #getter\n */\n get rowNamesSet() {\n return new Map(\n this.leaves.map((leaf, index) => [leaf.data.name, index] as const),\n )\n },\n /**\n * #getter\n * `clades` resolved to the rows each one covers. The tip names resolve\n * against `tree` rather than `root`, so a clade whose ancestor the user\n * collapsed keeps its rows. One leaf pass over the tree serves every\n * clade. A `range` record names no node, so `collapse`, `focus` and\n * `rotate`, which need one, drop it.\n */\n get resolvedClades(): ResolvedClade[] {\n if (self.clades.length === 0) {\n return noClades\n }\n return resolveClades(\n self.clades,\n hierarchy(this.tree, d => d.children),\n this.root,\n )\n },\n /**\n * #getter\n * the pixel column reserved at the right of the tree area for the bracket\n * mark, which the tip labels and the tree itself stay clear of. Zero\n * where no clade draws a bar or a label.\n */\n get cladeGutterWidth() {\n return cladeGutterWidth(self.clades)\n },\n /**\n * #getter\n * whether a tree draws beside the labels: false for a file with no\n * tree, and with drawTree off\n */\n get treeDrawn() {\n return self.drawTree && !this.noTree\n },\n /**\n * #getter\n * the leaf names of the whole tree and its depth in levels. The fit\n * reads these, so a collapse or a focus leaves the tree area as it is\n */\n get treeTips() {\n return treeTips(this.tree)\n },\n /**\n * #getter\n * the widest tip label at labelFitFontSize, measured whether or not a\n * zoom hides the labels\n */\n get maxTipLabelWidth() {\n return widestLabel(\n this.treeTips.names.map(name => this.rowDataOf(name)?.genome || name),\n labelFitFontSize,\n )\n },\n /**\n * #getter\n * the px the tip labels take across the tree area: the widest label at\n * labelFitFontSize and the gaps either side of it, or 0 with drawLabels\n * off\n */\n get labelColumnWidth() {\n return self.drawLabels\n ? this.maxTipLabelWidth + (this.treeDrawn ? 10 : 6)\n : 0\n },\n /**\n * #getter\n * the tree area width while treeAreaWidth is undefined: the label column\n * beside a tree that widens with its depth, up to maxTreeAreaShare of the\n * view, or the room the row panels leave where there is no alignment.\n * Where that binds, the tree keeps minTreeWidth and the renderer\n * ellipsizes the labels\n */\n get fittedTreeAreaWidth() {\n const chrome = self.marginLeft + this.cladeGutterWidth\n const tree = this.treeDrawn\n ? (self.treeWidth ??\n clamp(\n this.treeTips.depth * pxPerTreeDepth,\n minTreeWidth,\n maxFitTreeWidth,\n ))\n : 0\n const fit = chrome + tree + this.labelColumnWidth\n const room = self.viewInitialized\n ? this.numColumns > 0\n ? self.width * maxTreeAreaShare\n : self.width - this.rowPanelsWidth - self.resizeHandleWidth\n : Infinity\n const cap = Math.max(room, chrome + Math.min(tree, minTreeWidth))\n return Math.ceil(Math.min(fit, cap))\n },\n /**\n * #getter\n * the width of the area the tree and its labels draw in, px:\n * treeAreaWidth where set, the fit otherwise\n */\n get effectiveTreeAreaWidth() {\n return self.treeAreaWidth ?? this.fittedTreeAreaWidth\n },\n /**\n * #getter\n * the width of the tree, px: treeWidth where set, otherwise the tree\n * area less the label column, which a zoom hiding the labels gives to\n * the tree\n */\n get effectiveTreeWidth() {\n const labels = this.showTreeText ? this.labelColumnWidth : 0\n return (\n self.treeWidth ??\n Math.max(\n minTreeWidth,\n Math.floor(\n this.effectiveTreeAreaWidth -\n self.marginLeft -\n this.cladeGutterWidth -\n labels,\n ),\n )\n )\n },\n /**\n * #getter\n */\n get showTreeText() {\n return self.drawLabels && self.rowHeight >= minLetterRowHeight\n },\n /**\n * #getter\n */\n get mouseOverRowName() {\n const { mouseRow } = self\n return mouseRow === undefined\n ? undefined\n : this.leaves[mouseRow]?.data.name\n },\n /**\n * #getter\n * Returns insertion info if mouse is hovering over an insertion indicator\n */\n get hoveredInsertion() {\n const { mouseCol, mouseRow } = self\n if (mouseCol !== undefined && mouseRow !== undefined) {\n const rowName = this.leaves[mouseRow]?.data.name\n if (rowName) {\n const insertion = this.insertionPositions\n .get(rowName)\n ?.find(ins => ins.pos === mouseCol)\n if (insertion) {\n return { rowName, col: mouseCol, letters: insertion.letters }\n }\n }\n }\n return undefined\n },\n\n /**\n * #getter\n */\n get root() {\n return buildTreeRoot(this.tree, {\n collapsed: self.collapsed,\n rotated: self.rotated,\n order: self.treeOrder,\n showOnly: self.showOnly,\n })\n },\n\n /**\n * #getter\n * the tree as Newick in the order and with the root it is drawn, with\n * every clade, collapsed or out of focus\n */\n get treeNewick() {\n return writeNewick(\n buildTreeRoot(this.tree, {\n collapsed: [],\n rotated: self.rotated,\n order: self.treeOrder,\n }),\n )\n },\n\n /**\n * #getter\n * height of the band the tree overview draws in, zero when it is off\n */\n get treeOverviewHeight() {\n return self.showTreeOverview ? self.overviewHeight : 0\n },\n\n /**\n * #getter\n * the whole tree laid out for the overview, or undefined when the\n * overview is off. The focus is left out, so the focused subtree draws\n * inside the whole tree, and the collapsed clades are folded, since\n * those are rows the view no longer has. `x` is in tip-index space and\n * `len` is a fraction of the root-to-tip length, so one layout serves\n * any band size.\n */\n get treeOverviewLayout() {\n if (!self.showTreeOverview) {\n return undefined\n }\n const layout = layoutTree(\n buildTreeRoot(this.tree, {\n collapsed: self.collapsed,\n rotated: self.rotated,\n order: self.treeOrder,\n }),\n { rowHeight: 1, treeWidth: 1 },\n )\n return {\n root: layout.root,\n numTips: layout.leaves.length,\n maxDepthToLeaf: layout.root.depthToLeaf,\n showBranchLen: self.showBranchLen && layout.rootToTipLength > 0,\n }\n },\n\n /**\n * #getter\n * the `clades` highlights in the overview's own row space, which the\n * focus does not narrow\n */\n get treeOverviewClades(): ResolvedClade[] {\n const layout = this.treeOverviewLayout\n if (!layout || self.clades.length === 0) {\n return noClades\n }\n return resolveClades(\n self.clades,\n hierarchy(this.tree, d => d.children),\n layout.root,\n )\n },\n\n /**\n * #getter\n * the inclusive tip rows the focused subtree covers in the overview,\n * which is the box drawn on it. undefined with no focus\n */\n get treeOverviewFocusRows(): [number, number] | undefined {\n const layout = this.treeOverviewLayout\n if (!layout || !self.showOnly) {\n return undefined\n }\n const node = find(layout.root, n => n.data.id === self.showOnly)\n return node ? tipRange(node) : undefined\n },\n\n /**\n * #method\n * the subtree a point `y` pixels down the tree overview picks: the\n * deepest one whose tip range covers every row under that pixel, with\n * the rows it covers. A pixel stands for several tips on a large tree,\n * which is what keeps the pick off the individual tips. undefined when\n * the overview is off or the point picks the whole tree.\n */\n treeOverviewHit(y: number) {\n const layout = this.treeOverviewLayout\n if (!layout) {\n return undefined\n }\n const { root, numTips } = layout\n const perPixel = numTips / self.overviewHeight\n const first = clamp(Math.floor(y * perPixel), 0, numTips - 1)\n const last = clamp(\n Math.ceil((y + 1) * perPixel) - 1,\n first,\n numTips - 1,\n )\n let node = nodeCoveringRows(root, first + 0.5, last + 0.5)\n // focusing one tip leaves a single row on screen, so the pick lifts to\n // the subtree that tip sits in\n while (!node.children && node.parent) {\n node = node.parent\n }\n return node === root\n ? undefined\n : { id: node.data.id, rows: tipRange(node) }\n },\n\n /**\n * #getter\n * the pixel column the row panels occupy between the tree and the\n * alignment, the sum of each record's width\n */\n get rowPanelsWidth() {\n return sum(self.rowPanels.map(p => rowPanelWidth(p, self)))\n },\n /**\n * #getter\n * height of the band the row panel headers draw in, which is zero with\n * no row panels and leaves the top area as it was\n */\n get rowPanelsHeaderHeight() {\n return self.rowPanels.length > 0 ? rowPanelHeaderHeight : 0\n },\n /**\n * #getter\n * widget width minus the tree area and the row panels gives the space\n * for the MSA\n */\n get msaAreaWidth() {\n return (\n self.width -\n this.effectiveTreeAreaWidth -\n this.rowPanelsWidth -\n self.resizeHandleWidth\n )\n },\n\n /**\n * #getter\n * the right edge the tip labels end at, which is the tree area less the\n * margin and the bracket gutter\n */\n get treeAreaWidthMinusMargin() {\n return (\n this.effectiveTreeAreaWidth - self.marginLeft - this.cladeGutterWidth\n )\n },\n /**\n * #getter\n */\n get blanks() {\n const { hideGapsEffective, allowedGappyness } = self\n if (!hideGapsEffective) {\n return []\n }\n const strs = this.leaves\n .map(leaf => this.MSA?.getRow(leaf.data.name))\n .filter(notEmpty)\n if (strs.length === 0) {\n return []\n }\n // ragged input (a3m, hand-edited fasta) can have rows shorter than the\n // alignment; the widest row of the whole alignment, collapsed rows\n // included, defines the column count as it does for numColumns, and a\n // row that stops early counts as gapped for the remainder\n const numCols = this.MSA?.getWidth() ?? 0\n const numRows = strs.length\n const threshold = Math.ceil((allowedGappyness / 100) * numRows)\n const blankCounts = new Uint32Array(numCols)\n for (let j = 0; j < numRows; j++) {\n const str = strs[j]!\n const len = str.length\n for (let i = 0; i < numCols; i++) {\n // bit trick: (code - 45) >>> 0 <= 1 checks for '-' (45) or '.' (46)\n if (i >= len || (str.charCodeAt(i) - 45) >>> 0 <= 1) {\n blankCounts[i]!++\n }\n }\n }\n const blanks = []\n for (let i = 0; i < numCols; i++) {\n if (blankCounts[i]! >= threshold) {\n blanks.push(i)\n }\n }\n return blanks\n },\n /**\n * #getter\n * Returns a map of row name to array of insertions with display position and letters\n */\n get insertionPositions() {\n const { blanks, rows } = this\n if (blanks.length === 0) {\n return new Map<string, { pos: number; letters: string }[]>()\n }\n const result = new Map<string, { pos: number; letters: string }[]>()\n for (const [name, seq] of rows) {\n const insertions = computeRowInsertions(blanks, seq)\n if (insertions.length > 0) {\n result.set(name, insertions)\n }\n }\n return result\n },\n /**\n * #getter\n */\n get rows() {\n const MSA = this.MSA\n return this.leaves\n .map(leaf => [leaf.data.name, MSA?.getRow(leaf.data.name)] as const)\n .filter((f): f is [string, string] => !!f[1])\n },\n /**\n * #getter\n * number of rows on screen: the leaf count, which includes tree leaves\n * with no matching MSA row (drawn blank), unlike `rows.length`.\n */\n get numRows() {\n return this.leaves.length\n },\n\n /**\n * #method\n * index of the global column holding each ungapped sequence position of a\n * row. The domain overlay resolves thousands of these per redraw. Built\n * lazily per row and cached on the parse.\n */\n seqPosIndex(rowName: string): Int32Array | undefined {\n const MSA = this.MSA\n if (!MSA) {\n return undefined\n }\n let cache = seqPosIndexCache.get(MSA)\n if (!cache) {\n cache = new Map()\n seqPosIndexCache.set(MSA, cache)\n }\n let index = cache.get(rowName)\n if (!index) {\n const seq = MSA.getRow(rowName)\n if (!seq) {\n return undefined\n }\n index = buildSeqPosIndex(seq)\n cache.set(rowName, index)\n }\n return index\n },\n\n /**\n * #method\n * the row's aligned sequence by the name the tree gives it, including\n * rows a collapsed clade hides. `MSA.getRow` resolves a FASTA name whose\n * colon a Newick tool wrote as an underscore, which `rowMap` does not\n */\n rowSequence(name: string) {\n return this.MSA?.getRow(name) || undefined\n },\n /**\n * #getter\n * every sequence in the alignment, keyed by the alignment's own row\n * names, including rows a collapsed clade hides\n */\n get rowMap() {\n const MSA = this.MSA\n return new Map(\n MSA?.getNames()\n .map(name => [name, MSA.getRow(name)] as const)\n .filter(([, seq]) => !!seq),\n )\n },\n /**\n * #getter\n */\n get columns() {\n const columns2d = this.columns2d\n return new Map(\n this.rows.map((row, index) => [row[0], columns2d[index]!] as const),\n )\n },\n /**\n * #getter\n */\n get columns2d() {\n const { hideGapsEffective } = self\n return this.rows.map(([, str]) =>\n (hideGapsEffective\n ? skipBlanks(this.blanks, str)\n : str\n ).toUpperCase(),\n )\n },\n /**\n * #getter\n */\n get fontSize() {\n return fontSizeFor(self.rowHeight)\n },\n /**\n * #getter\n */\n get colStats() {\n return columnCountsFromRows(this.columns2d, this.numColumns)\n },\n\n /**\n * #getter\n * Detects sequence type based on letters present in the alignment.\n * Returns 'dna', 'rna', or 'amino'.\n */\n get sequenceType(): 'dna' | 'rna' | 'amino' {\n const letters = this.colStats.lettersPresent\n // the two-base IUPAC codes keep an ambiguous read nucleotide; the\n // three-base ones (B, D, H, V) are common amino acids, so they don't\n const ambiguous = ['N', 'R', 'Y', 'K', 'M', 'S', 'W']\n const dna = new Set(['A', 'C', 'G', 'T', ...ambiguous])\n const rna = new Set(['A', 'C', 'G', 'U', ...ambiguous])\n const isDna = letters.size > 0 && [...letters].every(l => dna.has(l))\n const isRna = letters.size > 0 && [...letters].every(l => rna.has(l))\n return isDna ? 'dna' : isRna ? 'rna' : 'amino'\n },\n\n /**\n * #getter\n * Pre-computed consensus letter and percent identity color per column.\n * Used by percent_identity_dynamic color scheme.\n */\n get colConsensus() {\n const { colStats } = this\n return Array.from({ length: colStats.numColumns }, (_, col) => {\n const total = colStats.total(col)\n let maxCount = 0\n let letter = ''\n colStats.forEachResidue(col, (slot, count) => {\n if (count > maxCount) {\n maxCount = count\n letter = letterOfResidueSlot(slot)\n }\n })\n const proportion = total ? maxCount / total : 0\n return {\n letter,\n color:\n proportion > 0.4\n ? `hsl(240, 30%, ${100 * Math.max(1 - proportion / 3, 0.3)}%)`\n : undefined,\n }\n })\n },\n\n /**\n * #getter\n * Pre-computed ClustalX colors per column.\n * Returns a map of letter -> color for each column.\n * ref http://www.jalview.org/help/html/colourSchemes/clustal.html\n */\n get colClustalX() {\n const { colStats } = this\n return Array.from({ length: colStats.numColumns }, (_, col) =>\n clustalXColumnColors(colStats, col),\n )\n },\n\n /**\n * #getter\n * Pre-computed similarity shades per column, for blosum62_dynamic.\n * Returns a map of letter -> color for each column. Amino acids shade by\n * BLOSUM62 similarity to the rest of the column, and an alignment of\n * nucleotides by identity, since the matrix names amino acids.\n */\n get colSimilarity() {\n const { colStats, sequenceType } = this\n const columnColors =\n sequenceType === 'amino' ? blosum62ColumnColors : identityColumnColors\n return Array.from({ length: colStats.numColumns }, (_, col) =>\n columnColors(colStats, col),\n )\n },\n\n /**\n * #getter\n * Conservation score per column using Shannon entropy (biojs-msa style).\n * Conservation = (1 - H/Hmax) * (1 - gapFraction)\n * Returns values 0-1 where 1 = fully conserved, 0 = no conservation.\n */\n get conservation() {\n const { colStats, alphabetMaxBits } = this\n return Array.from({ length: colStats.numColumns }, (_, col) => {\n const total = colStats.total(col)\n const gapCount = colStats.gapCount(col)\n return total > gapCount\n ? Math.max(0, 1 - colStats.entropy(col) / alphabetMaxBits) *\n (1 - gapCount / total)\n : 0\n })\n },\n /**\n * #getter\n * The information content of a fully conserved column, in bits, which\n * depends on the alphabet. Both the entropy ceiling `conservation`\n * normalizes against and the y-axis ceiling of the sequence logo track.\n */\n get alphabetMaxBits() {\n return maxBitsFor(this.sequenceType)\n },\n /**\n * #getter\n * Per-column conservation of physicochemical property class (amino acids\n * only). Surfaces conservative-substitution sites that identity-based\n * conservation misses. Empty for nucleotide alignments.\n */\n get propertyConservation() {\n return this.sequenceType === 'amino'\n ? calculatePropertyConservation(this.colStats)\n : []\n },\n /**\n * #getter\n * `root` laid out on new nodes in row and branch-length units, read in\n * pixels through `rowHeight` and `effectiveTreeWidth`. A zoom leaves it\n * and every node in it as they are, and an observer reading a node's `x`\n * or `len` observes the size it scales by.\n */\n get treeLayout() {\n const treeWidth = () => this.effectiveTreeWidth\n return layoutTree(this.root, {\n get rowHeight() {\n return self.rowHeight\n },\n get treeWidth() {\n return treeWidth()\n },\n })\n },\n\n /**\n * #getter\n * the laid-out tree, with pixel positions on every node\n */\n get hierarchy(): HierarchyNode<NodeWithIds> {\n return this.treeLayout.root\n },\n\n /**\n * #getter\n */\n get totalHeight() {\n return this.leaves.length * self.rowHeight\n },\n\n /**\n * #getter\n */\n get leaves(): HierarchyNode<NodeWithIds>[] {\n return this.treeLayout.leaves\n },\n\n /**\n * #getter\n * branch-length extent of the displayed tree, root to farthest tip, in\n * the tree's own units\n */\n get rootToTipLength() {\n return this.treeLayout.rootToTipLength\n },\n\n /**\n * #getter\n * pixels per unit of branch length in the phylogram layout, 0 in\n * cladogram mode. The tree's scale bar uses it.\n */\n get pxPerBranchLength() {\n const max = this.rootToTipLength\n return this.showBranchLenEffective && max\n ? this.effectiveTreeWidth / max\n : 0\n },\n\n /**\n * #getter\n * max topological depth to a tip, used to scale cladogram x-positions\n */\n get maxDepthToLeaf() {\n return this.treeLayout.root.depthToLeaf\n },\n\n /**\n * #getter\n */\n get allBranchesLength0() {\n return this.rootToTipLength === 0\n },\n\n /**\n * #getter\n * effective showBranchLen accounting for allBranchesLength0\n */\n get showBranchLenEffective() {\n return this.allBranchesLength0 ? false : self.showBranchLen\n },\n }))\n .views(self => ({\n /**\n * #getter\n */\n get totalWidth() {\n return self.numColumns * self.colWidth\n },\n }))\n\n .views(self => ({\n /**\n * #getter\n */\n get showMsaLetters() {\n return (\n self.drawMsaLetters &&\n self.rowHeight >= minLetterRowHeight &&\n self.colWidth >= minLetterColWidth &&\n self.colWidth > self.rowHeight / 2\n )\n },\n }))\n .views(self => {\n // a spec is a frozen value, so it keys its computed until setColumnTracks\n // replaces it\n const columnTrackModels = new WeakMap<\n ColumnTrackSpec,\n IComputedValue<BasicTrack>\n >()\n return {\n /**\n * #getter\n * a data track's values or string, projected from its row's residues\n * onto alignment columns when it names a row\n */\n get columnTrackContent() {\n const { MSA, blanks, hideGapsEffective } = self\n const width = MSA?.getWidth() ?? 0\n const project = <T>(track: ColumnTrackSpec, items: T[], fill: T) => {\n if (!track.row) {\n return items\n }\n const out = Array.from({ length: width }, () => fill)\n const index = self.seqPosIndex(track.row)\n items.forEach((item, seqPos) => {\n const col = index?.[seqPos]\n if (col !== undefined) {\n out[col] = item\n }\n })\n return out\n }\n const skip = <T>(items: T[]) =>\n hideGapsEffective ? dropBlanks(blanks, items) : items\n // an arc endpoint maps row residue -> column -> visible column.\n // visibleColsBefore, not globalColToVisibleCol, so an endpoint in a\n // hidden column moves to the neighboring visible one and the arc stays\n const resolve = (track: ColumnTrackSpec, pos: number) => {\n const col = track.row\n ? self.seqPosIndex(track.row)?.[pos - 1]\n : pos - 1\n if (col === undefined || col < 0 || col >= width) {\n return undefined\n }\n return hideGapsEffective ? visibleColsBefore(blanks, col) : col\n }\n return new Map<\n string,\n { values?: number[]; data?: string; arcs?: Arc[] }\n >(\n self.columnTracks.map(track => {\n if (track.kind === 'arc') {\n const arcs = (track.arcs ?? [])\n .map(arc => {\n const start = resolve(track, Math.min(arc.start, arc.end))\n const end = resolve(track, Math.max(arc.start, arc.end))\n return start !== undefined &&\n end !== undefined &&\n start < end\n ? { start, end, color: arc.color }\n : undefined\n })\n .filter(notEmpty)\n return [track.id, { arcs }] as const\n }\n if (track.kind === 'bar') {\n const max = track.scales?.y?.domainMax ?? 1\n const values = skip(project(track, track.values ?? [], 0)).map(\n v => Math.min(1, Math.max(0, v / max)),\n )\n return [track.id, { values }] as const\n }\n const data = skip(\n project(track, (track.data ?? '').split(''), ' '),\n )\n return [track.id, { data: data.join('') }] as const\n }),\n )\n },\n /**\n * #method\n * the height a track draws at: what the user dragged its divider to,\n * then the height its snapshot asked for, then its kind's default. Only\n * a text track falls through to rowHeight\n */\n trackHeight(kind: TrackKind, heightKey: string = kind, given?: number) {\n return (\n self.trackHeights.get(heightKey) ??\n given ??\n defaultTrackHeights[kind] ??\n self.rowHeight\n )\n },\n /**\n * #method\n * the track a column track spec draws as, computed once per spec. A\n * text track's height falls through to rowHeight, and its own computed\n * confines the vertical zoom to it, so a sibling keeps its object and\n * its canvas skips the redraw\n */\n columnTrackModel(track: ColumnTrackSpec): BasicTrack {\n let computedModel = columnTrackModels.get(track)\n if (!computedModel) {\n computedModel = computed(() => {\n const heightKey = resizableKinds.has(track.kind)\n ? ownHeightKey(track.id)\n : undefined\n const content = this.columnTrackContent.get(track.id)\n return {\n model: {\n id: track.id,\n name: track.name,\n kind: track.kind,\n heightKey,\n height: this.trackHeight(track.kind, heightKey, track.height),\n barColor: track.color,\n arcColor: track.color,\n customColorScheme: track.encoding?.color\n ? colorTable(track.encoding.color, [\n ...(track.encoding.color.domain ?? []),\n ...new Set(track.data),\n ])\n : undefined,\n data: content?.data,\n arcs: content?.arcs,\n },\n }\n })\n columnTrackModels.set(track, computedModel)\n }\n return computedModel.get()\n },\n /**\n * #getter\n */\n get columnTrackModels(): BasicTrack[] {\n return self.columnTracks.map(track => this.columnTrackModel(track))\n },\n }\n })\n .views(self => ({\n /**\n * #getter\n */\n get secondaryStructureConsensus() {\n return self.MSA?.secondaryStructureConsensus\n },\n\n /**\n * #getter\n * the base pairs of the consensus secondary structure, as arcs, in\n * visible column space (hidden columns are removed before parsing)\n */\n get secondaryStructureArcs(): Arc[] | undefined {\n const { blanks, hideGapsEffective } = self\n const ss = this.secondaryStructureConsensus\n if (!ss) {\n return undefined\n }\n return parseWuss(hideGapsEffective ? skipBlanks(blanks, ss) : ss).map(\n ({ start, end, pseudoknot }) => ({\n start,\n end,\n color: pseudoknot ? PSEUDOKNOT_ARC : HELIX_ARC,\n }),\n )\n },\n\n /**\n * #getter\n */\n get adapterTrackModels(): BasicTrack[] {\n const { MSA, hideGapsEffective, blanks } = self\n const tracks = (MSA?.tracks ?? []).filter(t => !!t.data)\n if (tracks.length === 0) {\n // return before reading rowHeight, so zooming does not rebuild the\n // list and redraw every track canvas\n return []\n }\n const { rowHeight } = self\n return tracks.map(t => ({\n model: {\n ...t,\n kind: 'text' as const,\n data: hideGapsEffective ? skipBlanks(blanks, t.data!) : t.data,\n height: rowHeight,\n },\n }))\n },\n\n /**\n * #getter\n * the consensus secondary structure as a track, when there is one. A\n * separate getter keeps the object stable across zoom, so its canvas\n * does not redraw\n */\n get basePairTrackModels(): BasicTrack[] {\n const arcs = this.secondaryStructureArcs\n return arcs?.length\n ? [\n {\n model: {\n id: 'base-pairs',\n name: 'Base pairs',\n kind: 'arc' as const,\n heightKey: 'arc',\n height: self.trackHeight('arc'),\n arcs,\n },\n },\n ]\n : []\n },\n\n /**\n * #getter\n * the tracks computed from the alignment; they depend on their heights\n * and the alphabet, not on zoom\n */\n get computedTrackModels(): BasicTrack[] {\n return [\n {\n id: 'conservation',\n name: 'Conservation',\n kind: 'bar' as const,\n barColor: 'gray',\n },\n ...(self.sequenceType === 'amino'\n ? [\n {\n id: 'property-conservation',\n name: 'Property conservation',\n kind: 'bar' as const,\n barColor: '#6a51a3',\n },\n ]\n : []),\n {\n id: 'sequence-logo',\n name: 'Sequence logo',\n kind: 'logo' as const,\n },\n // last, so it sits against the alignment it numbers\n {\n id: 'position-ruler',\n name: 'Position',\n kind: 'ruler' as const,\n },\n ].map(model => ({\n // every computed track of a kind shares that kind's height, so the\n // kind is its key\n model: {\n ...model,\n heightKey: resizableKinds.has(model.kind) ? model.kind : undefined,\n height: self.trackHeight(model.kind),\n },\n }))\n },\n\n /**\n * #getter\n * the reference row (`relativeTo`) repeated above the alignment, so it\n * stays in view while the rows compared against it scroll\n */\n get referenceTrackModels(): BasicTrack[] {\n const { relativeTo } = self\n const data =\n relativeTo === undefined ? undefined : self.columns.get(relativeTo)\n return relativeTo === undefined || data === undefined\n ? []\n : [\n {\n model: {\n id: 'reference-row',\n name: relativeTo,\n kind: 'reference' as const,\n data,\n height: self.rowHeight,\n },\n },\n ]\n },\n\n get tracks(): BasicTrack[] {\n return [\n ...this.adapterTrackModels,\n ...this.basePairTrackModels,\n ...self.columnTrackModels,\n // every computed track reads the alignment's columns, and a tree, a\n // GFF and a features panel draw a figure with none\n ...(self.numColumns > 0 ? this.computedTrackModels : []),\n ...this.referenceTrackModels,\n ]\n },\n\n /**\n * #getter\n */\n get turnedOnTracks() {\n return this.tracks.filter(\n f => !trackIsOff(self.turnedOffTracks, f.model.id),\n )\n },\n\n /**\n * #getter\n */\n get showHorizontalScrollbar() {\n return overflows(self.totalWidth, self.msaAreaWidth)\n },\n\n /**\n * #method\n * Return the character a row holds at a visible column: a residue, or\n * the gap character (`-` or `.`) on a gap. Undefined for a row name the\n * alignment does not have or a column past the row's end.\n *\n * @param rowName - The name of the row\n * @param visibleCol - The visible column index (what the user sees on screen)\n * @returns The character at that position\n */\n visibleColToRowLetter(rowName: string, visibleCol: number) {\n return self.rowSequence(rowName)?.[\n this.visibleColToGlobalCol(visibleCol)\n ]\n },\n\n /**\n * #method\n * Convert a visible column to a row-specific sequence position (0-based).\n * Returns undefined if the position is a gap in the sequence.\n *\n * Public API, like the sibling converters (visibleColToGlobalCol,\n * seqPosToVisibleCol, globalColToVisibleCol, seqPosToGlobalCol) hosts\n * use to translate between columns and residue positions. Keep them\n * stable.\n *\n * @param rowName - The name of the row\n * @param visibleCol - The visible column index\n * @returns The sequence position (0-based), or undefined if it's a gap\n */\n visibleColToSeqPos(rowName: string, visibleCol: number) {\n // binary search: this runs on every mouse move, and scanning a\n // 30k-column row per event takes the whole frame\n return seqPosOfGlobalCol(\n self.seqPosIndex(rowName),\n this.visibleColToGlobalCol(visibleCol),\n )\n },\n\n /**\n * #method\n * Convert a visible column to a row-specific sequence position (1-based).\n * Returns undefined if the position is a gap in the sequence.\n *\n * @param rowName - The name of the row\n * @param visibleCol - The visible column index\n * @returns The sequence position (1-based), or undefined if it's a gap\n */\n visibleColToSeqPosOneBased(rowName: string, visibleCol: number) {\n const val = this.visibleColToSeqPos(rowName, visibleCol)\n return val !== undefined ? val + 1 : undefined\n },\n\n /**\n * #method\n * Convert a global column index to a visible column index.\n * Returns undefined if the column is hidden (in blanks).\n * This is the inverse of visibleColToGlobalCol.\n *\n * @param globalCol - The global column index in the full MSA\n * @returns The visible column index, or undefined if the column is hidden\n */\n globalColToVisibleCol(globalCol: number) {\n const { blanks, hideGapsEffective } = self\n if (!hideGapsEffective) {\n return globalCol\n }\n return globalColToVisibleCol(blanks, globalCol)\n },\n\n /**\n * #method\n * Convert a visible column index (what a mouse handler reports) to a\n * column of the full alignment. A host indexing its own per-column data\n * needs this when columns are hidden.\n *\n * @param visibleCol - The visible column index\n * @returns The global column index in the full MSA\n */\n visibleColToGlobalCol(visibleCol: number) {\n const { blanks, hideGapsEffective } = self\n return hideGapsEffective\n ? visibleColToGlobalCol(blanks, visibleCol)\n : visibleCol\n },\n\n /**\n * #method\n * Convert a sequence position (ungapped) to a global column index.\n * Returns undefined for a row name the alignment does not have.\n *\n * @param rowName - The name of the row\n * @param seqPos - The sequence position (0-based, ungapped)\n * @returns The global column index in the full MSA, or undefined\n */\n seqPosToGlobalCol(rowName: string, seqPos: number) {\n const seq = self.rowSequence(rowName)\n if (seq === undefined) {\n return undefined\n }\n const col = self.seqPosIndex(rowName)?.[seqPos]\n // past the end of the ungapped sequence: 0 for the degenerate all-gap\n // row, otherwise one past the last column\n return col ?? (seqPos === 0 ? 0 : seq.length)\n },\n\n /**\n * #method\n * the global column of a span's last residue, clamping a position past\n * the end of the row to its last residue. Undefined for a row name the\n * alignment does not have, or a row with no residues.\n *\n * @param rowName - The name of the row\n * @param seqPos - The sequence position (0-based, ungapped)\n */\n seqEndToGlobalCol(rowName: string, seqPos: number) {\n const index = self.seqPosIndex(rowName)\n return index && index.length > 0\n ? index[Math.min(seqPos, index.length - 1)]\n : undefined\n },\n\n /**\n * #method\n * Convert a sequence position (ungapped) directly to a visible column index.\n * This combines seqPosToGlobalCol and globalColToVisibleCol.\n *\n * @param rowName - The name of the row\n * @param seqPos - The sequence position (0-based, ungapped)\n * @returns The visible column index, or undefined if the column is hidden\n */\n seqPosToVisibleCol(rowName: string, seqPos: number) {\n const globalCol = this.seqPosToGlobalCol(rowName, seqPos)\n return globalCol === undefined\n ? undefined\n : this.globalColToVisibleCol(globalCol)\n },\n\n /**\n * #method\n * the visible columns a span covers, in highlight coordinates: `start`\n * and `end` are 1-based residues of `row`, or columns of the file\n * without it. A fractional position, as a zoom gesture reports one,\n * widens to the whole residue or column it falls in. A span entirely on\n * hidden columns, or naming a row the alignment lacks, gives undefined.\n */\n visibleSpan({ row, start: rawStart, end: rawEnd }: Region) {\n const { blanks } = self\n const start = Math.max(1, Math.floor(rawStart))\n const end = Math.ceil(rawEnd)\n let startGlobal = start - 1\n let endGlobal = Math.min(end, self.MSA?.getWidth() ?? end) - 1\n if (row !== undefined) {\n const rowStart = this.seqPosToGlobalCol(row, start - 1)\n const rowEnd = this.seqEndToGlobalCol(row, end - 1)\n if (rowStart === undefined || rowEnd === undefined) {\n return undefined\n }\n startGlobal = rowStart\n endGlobal = rowEnd\n }\n const startCol =\n this.globalColToVisibleCol(startGlobal) ??\n visibleColsBefore(blanks, startGlobal)\n const endCol =\n this.globalColToVisibleCol(endGlobal) ??\n visibleColsBefore(blanks, endGlobal) - 1\n return startCol <= endCol ? { startCol, endCol } : undefined\n },\n\n /**\n * #getter\n * why each ignored residue mapping is ignored, so a host can tell a\n * missing structure from a mapping made against a different alignment.\n */\n get residueMappingProblems(): ResidueMappingProblem[] {\n const problems: ResidueMappingProblem[] = []\n for (const mapping of self.residueMappings) {\n const where = { row: mapping.row, structureId: mapping.structure.id }\n const residues = self.seqPosIndex(mapping.row)?.length\n if (residues === undefined) {\n problems.push({\n ...where,\n scope: 'mapping',\n reason: 'no such row in the alignment',\n })\n continue\n }\n if (\n mapping.rowLength !== undefined &&\n mapping.rowLength !== residues\n ) {\n problems.push({\n ...where,\n scope: 'mapping',\n reason: `computed against a ${mapping.rowLength}-residue row; this one has ${residues}`,\n })\n continue\n }\n const overrun = mapping.segments.find(\n segment => segment.rowEnd > residues || segment.rowStart < 1,\n )\n if (overrun) {\n problems.push({\n ...where,\n scope: 'mapping',\n reason: `segment ${overrun.rowStart}-${overrun.rowEnd} does not fit a ${residues}-residue row`,\n })\n continue\n }\n for (const segment of mapping.segments) {\n if (!sameLength(segment)) {\n problems.push({\n ...where,\n scope: 'segment',\n reason: `segment ${segment.rowStart}-${segment.rowEnd} maps to ${segment.structStart}-${segment.structEnd}, which is a different length`,\n })\n }\n }\n }\n return problems\n },\n\n /**\n * #getter\n * the mappings that fit the loaded alignment. A row-level problem drops\n * the whole mapping; a malformed segment drops only that segment.\n */\n get usableResidueMappings(): ResidueMapping[] {\n const unusable = new Set(\n this.residueMappingProblems\n .filter(problem => problem.scope === 'mapping')\n .map(problem => `${problem.row}\\u0000${problem.structureId}`),\n )\n return self.residueMappings\n .filter(m => !unusable.has(`${m.row}\\u0000${m.structure.id}`))\n .map(m => ({\n ...m,\n segments: m.segments.filter(sameLength),\n }))\n },\n\n /**\n * #getter\n * the structures with usable mappings. A row can map onto several, such\n * as an experimental entry and a predicted model.\n */\n get mappedStructures() {\n return this.usableResidueMappings.map(m => ({\n row: m.row,\n structure: m.structure,\n }))\n },\n\n /**\n * #method\n * The structure residue for a row residue. Returns undefined when no\n * segment covers `seqPos`, or when the row maps onto several structures\n * and `structureId` does not pick one (see `mappedStructures`).\n *\n * Positions are 1-based, like `residueMappings` and `highlights`; the\n * column helpers above are 0-based.\n *\n * @param rowName - The alignment row\n * @param seqPos - Residue of that row, 1-based\n * @param structureId - Which structure, when the row maps onto several\n */\n structureResidue(\n rowName: string,\n seqPos: number,\n structureId?: string,\n ): StructureResidue | undefined {\n const hits: StructureResidue[] = []\n for (const mapping of this.usableResidueMappings) {\n if (mapping.row !== rowName) {\n continue\n }\n if (\n structureId !== undefined &&\n mapping.structure.id !== structureId\n ) {\n continue\n }\n const segment = mapping.segments.find(\n seg => seqPos >= seg.rowStart && seqPos <= seg.rowEnd,\n )\n if (segment) {\n const position = segment.structStart + (seqPos - segment.rowStart)\n hits.push({\n structure: mapping.structure,\n position,\n observed: !inRanges(mapping.unobserved, position),\n })\n }\n }\n return hits.length === 1 ? hits[0] : undefined\n },\n\n /**\n * #method\n * The row residue for a structure residue; the inverse of\n * `structureResidue`, returning undefined in the same cases. `asymId`\n * picks a chain when several mappings share an entry id, as in a\n * homodimer.\n *\n * @param structureId - The structure's id, as the mapping names it\n * @param position - Residue of that structure, 1-based label_seq_id\n * @param asymId - Which chain, when the id alone is ambiguous\n */\n rowResidue(\n structureId: string,\n position: number,\n asymId?: string,\n ): RowResidue | undefined {\n const hits: RowResidue[] = []\n for (const mapping of this.usableResidueMappings) {\n if (mapping.structure.id !== structureId) {\n continue\n }\n if (\n asymId !== undefined &&\n mapping.structure.asymId !== undefined &&\n mapping.structure.asymId !== asymId\n ) {\n continue\n }\n const segment = mapping.segments.find(\n seg => position >= seg.structStart && position <= seg.structEnd,\n )\n if (segment) {\n hits.push({\n rowName: mapping.row,\n seqPos: segment.rowStart + (position - segment.structStart),\n })\n }\n }\n return hits.length === 1 ? hits[0] : undefined\n },\n }))\n\n .views(self => ({\n /**\n * #getter\n * the branch-length scale bar over the tree, undefined while\n * `showTreeScaleBar` is off, in cladogram mode, or when the tree area is\n * too narrow for one\n */\n get treeScaleBar() {\n if (!self.showTreeScaleBar) {\n return undefined\n }\n return scaleBarLength(\n self.pxPerBranchLength,\n self.effectiveTreeAreaWidth - self.marginLeft * 2,\n )\n },\n /**\n * #getter\n * the band across the top: the minimap over the alignment, the row panel\n * headers, and the tree overview stacked on the scale bar, as tall as the\n * tallest of the three\n */\n get topBandHeight() {\n return Math.max(\n self.showHorizontalScrollbar ? self.minimapHeight : 0,\n self.rowPanelsHeaderHeight,\n self.treeOverviewHeight +\n (this.treeScaleBar ? treeScaleBarHeight : 0),\n )\n },\n /**\n * #getter\n * the vertical space for alignment rows: the widget height less the\n * header, the top band and the tracks. Shared by blocksY, maxScrollY, the\n * vertical scrollbar and fitVertically.\n */\n get msaAreaHeight() {\n return (\n self.height -\n this.topBandHeight -\n self.headerHeight -\n this.totalTrackAreaHeight\n )\n },\n /**\n * #getter\n * total height of track area (px)\n */\n get totalTrackAreaHeight() {\n return sum(self.turnedOnTracks.map(r => r.model.height))\n },\n /**\n * one representative annotation per accession, for the legend, the\n * filter dialog and the palettes\n */\n get annotationTypes() {\n // first occurrence wins; only name, description and segment start are\n // read from it\n const types = new Map<string, Annotation>()\n for (const annot of self.allAnnotations) {\n if (!types.has(annot.accession)) {\n types.set(annot.accession, annot)\n }\n }\n return types\n },\n /**\n * accessions hidden until the user turns them on, such as a Stockholm\n * file's #=GR lines\n */\n get defaultOffAccessions() {\n return new Set(\n self.allAnnotations.filter(a => a.defaultOff).map(a => a.accession),\n )\n },\n /**\n * #method\n */\n featureOff(accession: string) {\n return (\n self.turnedOffFeatures.get(accession) ??\n this.defaultOffAccessions.has(accession)\n )\n },\n get filteredAnnotations() {\n return self.allAnnotations.filter(r => !this.featureOff(r.accession))\n },\n /**\n * #getter\n * what colors the alignment's cells: the residue scheme, the domains\n * covering them, or nothing, which leaves the scheme to the letters.\n * Domains own the fill only while some are drawn, so a file whose\n * annotations all start hidden keeps its residue colors\n */\n get cellFill(): 'residue' | 'domain' | 'none' {\n return !self.bgColor\n ? 'none'\n : self.actuallyShowDomains &&\n self.domainFill &&\n this.filteredAnnotations.length > 0\n ? 'domain'\n : 'residue'\n },\n get annotationsByRow() {\n const { rowNamesSet } = self\n return groupBy(this.filteredAnnotations, r =>\n annotationRowName(r.id, rowNamesSet),\n )\n },\n }))\n .views(self => ({\n /**\n * #getter\n */\n get showVerticalScrollbar() {\n return overflows(self.totalHeight, self.msaAreaHeight)\n },\n }))\n .views(self => ({\n /**\n * #getter\n */\n get dataInitialized() {\n // truthiness, not `!== ''`: DataModel drops an inline document over\n // 50kb from the snapshot, so a restored session can hold `undefined`\n return !!(self.data.msa || self.data.tree) && !self.error\n },\n /**\n * #getter\n */\n get blocksX() {\n return calculateBlocks({\n viewportSize: self.msaAreaWidth,\n viewportPos: -self.scrollX,\n blockSize: self.blockSize,\n mapSize: self.totalWidth,\n })\n },\n /**\n * #getter\n */\n get blocksY() {\n return calculateBlocks({\n viewportSize: self.msaAreaHeight,\n viewportPos: -self.scrollY,\n blockSize: self.blockSize,\n mapSize: self.totalHeight,\n })\n },\n }))\n .views(self => ({\n /**\n * #getter\n */\n get verticalScrollbarWidth() {\n return self.showVerticalScrollbar ? 20 : 0\n },\n /**\n * #getter\n * width of the alignment canvas: the msa area less the vertical\n * scrollbar. showHorizontalScrollbar must not read it, since that feeds\n * msaAreaHeight -> showVerticalScrollbar and would form a cycle\n */\n get msaCanvasWidth() {\n return self.msaAreaWidth - this.verticalScrollbarWidth\n },\n /**\n * #getter\n * most-negative allowed scrollX, which keeps the last column in view\n */\n get maxScrollX() {\n return Math.min(-self.totalWidth + this.msaCanvasWidth, 0)\n },\n /**\n * #getter\n */\n get blocks2d() {\n return self.blocksY.flatMap(by =>\n self.blocksX.map(bx => [bx, by] as const),\n )\n },\n /**\n * #getter\n */\n get wheelZooming() {\n return self.zoomSnapshot !== undefined\n },\n\n /**\n * #getter\n */\n get isLoading() {\n return self.loadingMSA || self.loadingTree\n },\n /**\n * #getter\n * warnings that follow from the loaded data and clear when it changes. A\n * GFF whose first column names rows of some other alignment parses\n * without error and draws nothing\n */\n get dataWarnings(): string[] {\n const { annotations, rowNamesSet } = self\n return self.dataInitialized &&\n annotations.length > 0 &&\n !annotations.some(a =>\n rowNamesSet.has(annotationRowName(a.id, rowNamesSet)),\n )\n ? [\n `0 of ${annotations.length} annotations name a row in this alignment`,\n ]\n : []\n },\n /**\n * #getter\n * the load warnings and the undismissed data warnings, for the header\n */\n get warnings(): string[] {\n return [\n ...self.loadWarnings,\n ...this.dataWarnings.filter(w => !self.dismissedWarnings.includes(w)),\n ]\n },\n /**\n * #getter\n * most-negative allowed scrollY, which keeps the last row in view\n */\n get maxScrollY() {\n return Math.min(-self.totalHeight + self.msaAreaHeight, 0)\n },\n /**\n * #getter\n * axis a wheel zoom scales, for ctrl+wheel as much as for scroll-zoom.\n * With scroll-zoom off the toolbar shows no axis, so ctrl+wheel takes\n * both.\n */\n get wheelZoomAxis(): ScrollZoomAxis {\n return self.scrollZoom ? self.scrollZoomAxis : 'both'\n },\n }))\n .actions(self => ({\n /**\n * #action\n */\n setDrawMsaLetters(arg: boolean) {\n self.drawMsaLetters = arg\n },\n\n /**\n * #action\n */\n clearWarnings() {\n self.loadWarnings = []\n self.dismissedWarnings = self.dataWarnings\n },\n\n /**\n * #action\n */\n setScrollZoom(arg: boolean) {\n self.scrollZoom = arg\n },\n\n /**\n * #action\n */\n setScrollZoomAxis(arg: ScrollZoomAxis) {\n self.scrollZoomAxis = arg\n },\n\n /**\n * #action\n * set hovered tree node and its descendants\n */\n setHoveredTreeNode(nodeId?: string) {\n // called on every tree mousemove; `find` walks the whole hierarchy and a\n // new object redraws the tree and MSA overlays\n if (nodeId === self.hoveredTreeNode?.nodeId) {\n return\n }\n if (!nodeId) {\n self.hoveredTreeNode = undefined\n return\n }\n const node = find(self.hierarchy, n => n.data.id === nodeId)\n self.hoveredTreeNode = node\n ? {\n nodeId,\n descendantNames: leaves(node).map(leaf => leaf.data.name),\n }\n : undefined\n },\n\n /**\n * #action\n * Calculate a neighbor joining tree from the current MSA using BLOSUM62\n * distances. Throws above `maxNeighborJoiningRows`: the join loop is\n * cubic and runs on the main thread, and 800 rows freeze the tab for ten\n * seconds with no cancel.\n */\n calculateNeighborJoiningTreeFromMSA() {\n // every sequence, including rows in collapsed clades\n const rows = [...self.rowMap]\n if (rows.length < 2) {\n throw new Error('Need at least 2 sequences to build a tree')\n }\n if (rows.length > maxNeighborJoiningRows) {\n throw new Error(\n `Neighbor joining here is capped at ${maxNeighborJoiningRows} sequences and this alignment has ${rows.length}. Build the tree with FastTree or IQ-TREE and open it alongside the alignment: https://gmod.org/JBrowseMSA/tutorials/protein_family`,\n )\n }\n this.replaceTree(calculateNeighborJoiningTree(rows))\n },\n\n /**\n * #action\n * root the tree on the branch above the given node. The node's tips are\n * a split of the unrooted tree, and the side of it that is a clade in\n * the tree as written stands for it as an outgroup, by its first and\n * last tip, so the root survives the path ids changing under it\n */\n rerootAt(nodeId: string) {\n const shown = find(\n hierarchy(self.tree, d => d.children),\n n => n.data.id === nodeId,\n )\n if (!shown?.parent) {\n return\n }\n const node = outgroupNode(\n hierarchy(self.inputTree, d => d.children),\n leaves(shown).map(n => n.data.name),\n )\n if (node) {\n const tips = leaves(node)\n self.setTreeRoot({\n outgroup: [\n ...new Set([tips[0]!.data.name, tips.at(-1)!.data.name]),\n ],\n })\n }\n },\n\n /**\n * #action\n * swap in a different tree over the same alignment. Clears `collapsed`,\n * `rotated` and `showOnly`, since path-derived node ids (node-0-0-1) from the old\n * tree would match unrelated nodes in the new one, and the tree's\n * filehandle, which the snapshot would otherwise reopen in place of\n * the new tree\n */\n replaceTree(newick: string) {\n transaction(() => {\n self.setTreeFilehandle(undefined)\n self.collapsed.clear()\n self.rotated.clear()\n self.setShowOnly(undefined)\n self.setTree(newick)\n })\n },\n\n /**\n * #action\n * restore the default column width and row height\n */\n resetZoom() {\n self.setColWidth(defaultColWidth)\n self.setRowHeight(defaultRowHeight)\n },\n /**\n * #action\n * zoom by `scaleFactor` about the center of the alignment area\n */\n zoomAtCenter(scaleFactor: number, axis: ScrollZoomAxis = 'both') {\n this.zoomToPos(\n scaleFactor,\n self.msaCanvasWidth / 2,\n self.msaAreaHeight / 2,\n axis,\n )\n },\n /**\n * #action\n */\n zoomIn() {\n this.zoomAtCenter(1.5)\n },\n /**\n * #action\n */\n zoomOut() {\n this.zoomAtCenter(0.75)\n },\n /**\n * #action\n * Smoothly zoom by a continuous scaleFactor. The column under the cursor\n * (offsetX/offsetY, px relative to the MSA area) stays anchored\n * horizontally. Vertically the anchor is biased toward y=0 when the\n * alignment nearly fits the viewport, fading to cursor-anchoring as the\n * alignment grows taller than the viewport.\n * Drives wheel/trackpad-pinch zoom. `axis` holds one cell dimension\n * fixed; the held axis still re-anchors its scroll offset, since the\n * other one can change how much of the alignment fits.\n */\n zoomToPos(\n scaleFactor: number,\n offsetX: number,\n offsetY: number,\n axis: ScrollZoomAxis = 'both',\n ) {\n transaction(() => {\n const colInView = (-self.scrollX + offsetX) / self.colWidth\n const rowInView = (-self.scrollY + offsetY) / self.rowHeight\n // zooming both axes, an axis holds at the default only while the\n // other sits there too, or one would hold while the other grows\n const canHold =\n axis !== 'both' ||\n (self.colWidth === defaultColWidth &&\n self.rowHeight === defaultRowHeight)\n if (axis !== 'vertical') {\n const { value, held } = detentZoom(\n self.colWidth,\n scaleFactor,\n defaultColWidth,\n self.zoomHeld.col,\n minColWidth,\n canHold,\n )\n self.colWidth = value\n self.zoomHeld = { ...self.zoomHeld, col: held }\n }\n if (axis !== 'horizontal') {\n const { value, held } = detentZoom(\n self.rowHeight,\n scaleFactor,\n defaultRowHeight,\n self.zoomHeld.row,\n minRowHeight,\n canHold,\n )\n self.rowHeight = value\n self.zoomHeld = { ...self.zoomHeld, row: held }\n }\n self.scrollX = clamp(\n offsetX - colInView * self.colWidth,\n self.maxScrollX,\n 0,\n )\n\n const anchoredScrollY = offsetY - rowInView * self.rowHeight\n // -maxScrollY is the overflow past the viewport, 0 when it fits\n const overflow = Math.max(0, -self.maxScrollY)\n const visibleHeight = self.totalHeight - overflow\n const topBias =\n visibleHeight > 0 ? clamp(1 - overflow / visibleHeight, 0, 1) : 1\n self.scrollY = clamp(\n anchoredScrollY * (1 - topBias),\n self.maxScrollY,\n 0,\n )\n })\n },\n /**\n * #action\n * zoomToPos for one wheel or pinch frame. The alignment keeps the blocks\n * it drew at the start of the gesture, scaled, and redraws them only once\n * they stop covering the viewport; endWheelZoom redraws them sharp\n */\n wheelZoomToPos(scaleFactor: number, offsetX: number, offsetY: number) {\n self.zoomSnapshot ??= takeZoomSnapshot(self, false)\n this.zoomToPos(scaleFactor, offsetX, offsetY, self.wheelZoomAxis)\n if (!zoomSnapshotCovers(self, self.zoomSnapshot)) {\n self.zoomSnapshot = takeZoomSnapshot(self, true)\n }\n },\n /**\n * #action\n */\n endWheelZoom() {\n self.zoomSnapshot = undefined\n },\n /**\n * #action\n */\n doScrollY(deltaY: number) {\n this.setScrollY(self.scrollY + deltaY)\n },\n\n /**\n * #action\n * set scroll Y-offset (px), clamped to keep the alignment in view\n */\n setScrollY(n: number) {\n self.scrollY = clamp(n, self.maxScrollY, 0)\n },\n\n /**\n * #action\n * Set the overlay annotations (an empty list clears them). InterProScan,\n * GFF, user uploads and NCBI CDD all arrive here as Annotation[].\n *\n * Leaves `showDomains` alone, because a restored snapshot reloads its\n * GFF and must keep a hidden overlay hidden.\n */\n setAnnotations(annotations: Annotation[]) {\n self.annotations = annotations\n },\n\n applyGFFText(gffText: string) {\n this.setAnnotations(gffToAnnotations(parseGFF(gffText)))\n },\n\n /**\n * #action\n */\n doScrollX(deltaX: number) {\n this.setScrollX(self.scrollX + deltaX)\n },\n\n /**\n * #action\n */\n setScrollX(n: number) {\n self.scrollX = clamp(n, self.maxScrollX, 0)\n },\n\n /**\n * #action\n */\n setColumnTracks(tracks: (ColumnTrackSpec | LegacyColumnTrack)[]) {\n self.columnTracks.replace(tracks.map(readColumnTrack))\n },\n /**\n * #action\n * replace the row table, which the model keeps as the JSON string\n * `data.treeMetadata` (see docs/layers.md)\n */\n setRowData(rowData: RowDataInput) {\n self.data.setTreeMetadata(JSON.stringify(rowData))\n },\n /**\n * #action\n * replace what the viewer's marks read from the row table\n */\n setEncodings(encodings: (Encoding | LegacyEncoding)[]) {\n self.encodings.replace(encodings.map(readEncoding))\n },\n /**\n * #action\n * replace the panels drawn between the tree and the alignment\n */\n setRowPanels(panels: (RowPanelSpec | LegacyRowPanel)[]) {\n self.rowPanels.replace(panels.map(readRowPanel))\n },\n /**\n * #action\n * replace the alignment<->structure correspondence (see docs/layers.md)\n */\n setResidueMappings(mappings: ResidueMapping[]) {\n self.residueMappings.replace(mappings)\n },\n /**\n * #action\n */\n toggleTrack(id: string) {\n self.turnedOffTracks.set(id, !trackIsOff(self.turnedOffTracks, id))\n },\n /**\n * #action\n * show or hide several tracks at once, as the track selector's Show all\n * and Hide all do. A choice matching the track's default is dropped, so\n * it stays out of the shared URL\n */\n setTracksShown(ids: string[], shown: boolean) {\n for (const id of ids) {\n if (defaultOffTracks.has(id) === !shown) {\n self.turnedOffTracks.delete(id)\n } else {\n self.turnedOffTracks.set(id, !shown)\n }\n }\n },\n /**\n * #action\n */\n setStatus(status?: { msg: string; onCancel?: () => void }) {\n self.status = status\n },\n }))\n .views(self => ({\n /**\n * #method\n * the cell at a visible column and row index, in the coordinates a host\n * writes highlights in. On a gap `residue` is undefined and `letter` is\n * the gap character\n */\n cellAt(visibleCol: number, rowIndex?: number): Cell {\n const column = self.visibleColToGlobalCol(visibleCol)\n const row =\n rowIndex === undefined ? undefined : self.leaves[rowIndex]?.data.name\n return row === undefined\n ? { column: column + 1 }\n : {\n column: column + 1,\n row,\n residue: self.visibleColToSeqPosOneBased(row, visibleCol),\n letter: self.rowSequence(row)?.[column],\n }\n },\n /**\n * #getter\n * the cell under the pointer. Public API: MSAViewer's onCellHover\n * reports it.\n */\n get hoveredCell() {\n const { mouseCol, mouseRow } = self\n return mouseCol === undefined\n ? undefined\n : this.cellAt(mouseCol, mouseRow)\n },\n /**\n * #getter\n * the cell a click pinned. Public API: MSAViewer's onCellClick reports it.\n */\n get clickedCell() {\n const { mouseClickCol, mouseClickRow } = self\n return mouseClickCol === undefined\n ? undefined\n : this.cellAt(mouseClickCol, mouseClickRow)\n },\n /**\n * #getter\n * the columns on screen. Public API: MSAViewer's onViewportChange reports\n * it.\n */\n get viewport(): Viewport | undefined {\n const { scrollX, colWidth, numColumns, viewInitialized } = self\n if (numColumns === 0 || !viewInitialized) {\n return undefined\n }\n const { xStart, xEnd } = visibleColRange({\n offsetX: -scrollX,\n blockWidth: self.msaCanvasWidth,\n colWidth,\n })\n const last = Math.max(0, Math.min(xEnd, numColumns) - 1)\n return {\n startColumn: self.visibleColToGlobalCol(Math.min(xStart, last)) + 1,\n endColumn: self.visibleColToGlobalCol(last) + 1,\n }\n },\n /**\n * #getter\n * ordinal segment types (exons etc.), ordered by sequence position so\n * exon-1..exon-14 run left-to-right; colored by alternating shade and\n * labeled by number, with no legend row\n */\n get segmentDomainTypes() {\n return [...self.annotationTypes.values()]\n .filter(d => segmentFeatureTypes.has(d.featureType ?? ''))\n .toSorted((a, b) => a.start - b.start)\n },\n /**\n * #getter\n * categorical feature types (InterPro domains and the like) that each get\n * their own color and a legend entry\n */\n get categoricalDomainTypes() {\n return [...self.annotationTypes.values()].filter(\n d => !segmentFeatureTypes.has(d.featureType ?? ''),\n )\n },\n get fillPalette() {\n const segments = Object.fromEntries(\n this.segmentDomainTypes.map((d, i) => [\n d.accession,\n segmentShades[i % segmentShades.length]!,\n ]),\n )\n const categorical = createPaletteMap(\n this.categoricalDomainTypes.map(d => d.accession),\n )\n return { ...segments, ...categorical }\n },\n /**\n * #getter\n * the encoding coloring the overlay's spans, undefined when none does,\n * which leaves each span the color its accession takes in `fillPalette`\n */\n get featureFillEncoding(): ResolvedEncoding | undefined {\n return this.resolvedEncodings.find(e => e.channel === 'featureFill')\n },\n\n /**\n * #getter\n * the fill and outline of every feature's span: its own GFF `color=`\n * first, then the `featureFill` scale, then the accession palette.\n * Computed once per change of the features, the encodings or the palette\n */\n get featureColors(): Map<Annotation, { fill: string; stroke: string }> {\n return featureColorMap(\n self.filteredAnnotations,\n this.featureFillEncoding,\n this.fillPalette,\n )\n },\n\n /**\n * #getter\n * the text the `featureLabel` channel draws inside each span, undefined\n * when no encoding names the channel. A data channel, so it draws\n * whether or not the residue letters do\n */\n get featureLabels(): Map<Annotation, string> | undefined {\n const encoding = this.resolvedEncodings.find(\n e => e.channel === 'featureLabel',\n )\n return encoding\n ? featureLabelMap(self.filteredAnnotations, encoding.field)\n : undefined\n },\n\n /**\n * #getter\n * accession -> number drawn on each segment band: the trailing number of\n * the feature name (\"exon-3\" -> \"3\"), else its 1-based position\n */\n get segmentLabels() {\n return new Map(\n this.segmentDomainTypes.map((d, i) => {\n const m = /(\\d+)\\s*$/.exec(d.name)\n return [d.accession, m ? m[1]! : `${i + 1}`]\n }),\n )\n },\n\n /**\n * #getter\n * the domain types currently drawn on the alignment (filtered-on), shared\n * by the on-screen legend and the SVG export legend: the categorical types\n * ordered by sequence position. Ordinal segments (exons) are numbered on\n * the band instead\n */\n get visibleDomainTypes() {\n return this.categoricalDomainTypes\n .filter(d => !self.featureOff(d.accession))\n .toSorted((a, b) => a.start - b.start)\n },\n\n /**\n * #getter\n * the categorical color keys drawn for this view, shared by the on-screen\n * legend overlay and the SVG export's reserved column. The domain overlay\n * produces the first, listing the `featureFill` scale where an encoding\n * names one. Every scale a row-table encoding or a row panel reads\n * produces one more, keyed by its declaration, so two channels or two\n * strips declaring one scale list it once, and strips over eight fields\n * naming one `title` list one legend between them\n */\n get legends(): Legend[] {\n const { featureFillEncoding, fillPalette, visibleDomainTypes } = this\n const byKey = new Map<string, Legend>()\n const ids = new Set<string>()\n // the accession palette keys on no field, so it takes a key of its own\n const add = (\n key: string | undefined,\n title: string | undefined,\n entries: LegendEntry[],\n overlay = false,\n ) => {\n const k = key ?? 'domains'\n if (entries.length === 0 || byKey.has(k)) {\n return\n }\n const base =\n overlay || key === undefined ? 'domains' : `rowData-${title}`\n let id = base\n for (let n = 2; ids.has(id); n++) {\n id = `${base}-${n}`\n }\n ids.add(id)\n byKey.set(k, { id, title: title ?? 'Domains', entries })\n }\n // the overlay draws the domain key; with no columns it draws nothing,\n // and a features panel taking the same colors lists them instead\n if (self.actuallyShowDomains && self.numColumns > 0) {\n add(\n featureFillEncoding?.key,\n featureFillEncoding?.title,\n featureFillEncoding\n ? featureFillEncoding.legend\n : visibleDomainTypes.map(d => ({\n id: d.accession,\n label: d.name,\n color: d.color ?? fillPalette[d.accession]!,\n })),\n true,\n )\n }\n for (const { channel, key, title, legend } of this.resolvedEncodings) {\n if (!featureChannels.has(channel)) {\n add(key, title, legend)\n }\n }\n for (const { legendKey, legendTitle, legend } of this.rowPanelScales) {\n add(legendKey, legendTitle, legend)\n }\n return [...byKey.values()]\n },\n\n /**\n * #getter\n * whether the overlay marks each domain with a bar under its row instead\n * of filling the row behind the letters: whenever the domains do not own\n * the cell fill (`cellFill`), a filled box would paint over the residue\n * colors the user picked. Sub-row layout already stacks\n * the boxes clear of the letters, and with the letters too small to draw\n * the filled box is the only thing left to read.\n */\n get domainUnderline() {\n return (\n self.actuallyShowDomains &&\n self.cellFill !== 'domain' &&\n !self.subFeatureRows &&\n self.showMsaLetters\n )\n },\n\n /**\n * #getter\n * every filtered-on annotation resolved to the visible column span it is\n * drawn across, keyed by row name. Each row is ordered longest-first so a\n * nested short domain draws on top, and each band carries the lane the\n * sub-row layout puts it in. Resolved once here instead of per canvas\n * block per redraw; the letter renderer also reads the band colors to\n * pick legible letter colors.\n */\n get domainBands() {\n const { blanks } = self\n const bands = new Map<string, DomainBand[]>()\n for (const [name, annotations] of Object.entries(\n self.annotationsByRow,\n )) {\n const rowBands = annotations\n .toSorted((a, b) => len(b) - len(a))\n .map(annotation => {\n // annotation positions are 1-based and inclusive. endCol is\n // exclusive, one past the last residue's column, so the band does\n // not extend over a following gap run. An endpoint in a hidden\n // column moves to the neighboring boundary. Bands with no visible\n // columns, or naming a missing row, are dropped.\n const start = self.seqPosToGlobalCol(name, annotation.start - 1)\n const end = self.seqEndToGlobalCol(name, annotation.end - 1)\n if (start === undefined || end === undefined) {\n return undefined\n }\n const startCol = visibleColsBefore(blanks, start)\n const endCol = visibleColsBefore(blanks, end + 1)\n return endCol > startCol\n ? { annotation, startCol, endCol }\n : undefined\n })\n .filter(notEmpty)\n // numbered after filtering, so a dropped band leaves no gap\n .map((band, stackIndex) => ({ ...band, stackIndex }))\n if (rowBands.length > 0) {\n bands.set(name, packDomainLanes(rowBands))\n }\n }\n return bands\n },\n\n /**\n * #getter\n * the same bands ordered by start column, for left-to-right sweeps (the\n * letter renderer walks columns and needs the band covering each one)\n */\n get domainBandsByStart() {\n return new Map(\n [...this.domainBands].map(\n ([name, bands]) =>\n [\n name,\n bands.toSorted((a, b) => a.startCol - b.startCol),\n ] as const,\n ),\n )\n },\n\n /**\n * #getter\n * domain annotations under the mouse, hit-tested against the exact visible\n * column span each box is drawn at (so it matches the overlay across gaps)\n */\n get mouseOverDomains(): Annotation[] {\n const { mouseCol } = self\n const name = self.mouseOverRowName\n if (name === undefined || mouseCol === undefined) {\n return noDomains\n }\n const hits = (this.domainBands.get(name) ?? [])\n .filter(b => mouseCol >= b.startCol && mouseCol < b.endCol)\n .map(b => b.annotation)\n return hits.length > 0 ? hits : noDomains\n },\n\n /**\n * #getter\n * row index of the reference row (`relativeTo`), undefined when unset\n */\n get referenceRowIndex() {\n const { relativeTo } = self\n return relativeTo === undefined\n ? undefined\n : self.rowNamesSet.get(relativeTo)\n },\n\n /**\n * #getter\n * row indices highlighted by the current tree hover (a hovered internal\n * node highlights every tip below it). Shared by the tree and MSA overlay\n * canvases, via the memoized name->index map.\n */\n get hoveredRowIndices() {\n const { hoveredTreeNode, rowNamesSet } = self\n return hoveredTreeNode\n ? hoveredTreeNode.descendantNames\n .map(name => rowNamesSet.get(name))\n .filter(notEmpty)\n : []\n },\n\n /**\n * #getter\n * contiguous runs of `highlightedColumns`, so a run of highlighted columns\n * draws as one bordered band. Memoized because the overlay canvas redraws\n * on every mouse move.\n */\n get highlightedColumnRuns() {\n return consecutiveRuns(\n [...(self.highlightedColumns ?? [])].sort((a, b) => a - b),\n ).map(([start, end]) => ({ start, end }))\n },\n\n /**\n * #method\n * a highlight label with `{residue}` and `{position}` filled in from the\n * row's letter at `start`, which is how the `175` shorthand draws \"R175\"\n */\n fillHighlightLabel(label: string, row?: string, start?: number) {\n if (!label.includes('{')) {\n return label\n }\n const col =\n row && start !== undefined\n ? self.seqPosIndex(row)?.[start - 1]\n : undefined\n const residue =\n row && col !== undefined ? (self.MSA?.getRow(row)[col] ?? '') : ''\n return label\n .replaceAll('{residue}', residue)\n .replaceAll('{position}', start === undefined ? '' : String(start))\n },\n\n /**\n * #getter\n * `highlights` projected onto what is on screen: residue spans go\n * through the named row's gap structure, column spans through the\n * hidden-column list, and a span that lands entirely on hidden columns\n * is dropped. Row names that match no row are ignored.\n */\n get resolvedHighlights(): ResolvedHighlight[] {\n const { rowNamesSet, transientHighlights } = self\n // persisted highlights first, so transient ones draw on top\n const all = [\n ...self.highlights,\n ...Object.values(transientHighlights).flat(),\n ]\n return all.flatMap(({ row, rows, start, end, label, color }) => {\n const base = {\n label: label && this.fillHighlightLabel(label, row, start),\n color,\n }\n if (rows) {\n const rowIndices = rows\n .map(name => rowNamesSet.get(name))\n .filter(notEmpty)\n return rowIndices.length ? [{ ...base, rowIndices }] : []\n }\n if (start === undefined || end === undefined) {\n return []\n }\n const span = self.visibleSpan({ row, start, end })\n return span ? [{ ...base, ...span, rowIndices: [] }] : []\n })\n },\n\n /**\n * #getter\n * `selection` projected onto what is on screen, the way\n * `resolvedHighlights` projects a column span and a row set. A\n * selection whose columns are all hidden, or whose rows are all\n * collapsed away or unknown, resolves to undefined.\n */\n get resolvedSelection(): ResolvedSelection | undefined {\n const { selection, rowNamesSet, numRows } = self\n const span =\n selection &&\n self.visibleSpan({ start: selection.start, end: selection.end })\n if (!selection || !span) {\n return undefined\n }\n const rowRuns = selection.rows\n ? consecutiveRuns(\n selection.rows\n .map(name => rowNamesSet.get(name))\n .filter(notEmpty)\n .sort((a, b) => a - b),\n )\n : numRows > 0\n ? [[0, numRows - 1] as [number, number]]\n : []\n return rowRuns.length > 0 ? { ...span, rowRuns } : undefined\n },\n\n /**\n * #getter\n * the columns and rows the selection covers, for the header's readout.\n * Columns count the file's columns from `start` to `end`, hidden ones\n * included, as `selectionFasta` copies them.\n */\n get selectionSize() {\n const resolved = this.resolvedSelection\n const span = this.selectionFileSpan\n return resolved && span\n ? {\n columns: span.end - span.start + 1,\n rows: sum(resolved.rowRuns.map(([a, b]) => b - a + 1)),\n }\n : undefined\n },\n\n /**\n * #getter\n * `selection`'s columns clamped to the file's\n */\n get selectionFileSpan() {\n const { selection } = self\n const width = self.MSA?.getWidth() ?? 0\n const start = Math.max(1, Math.floor(selection?.start ?? 0))\n const end = Math.min(width, Math.ceil(selection?.end ?? 0))\n return selection && start <= end ? { start, end } : undefined\n },\n\n /**\n * #getter\n * the selected block as FASTA: the selected rows on screen, top to\n * bottom, each with its letters across the file's columns from `start`\n * to `end`, gaps included\n */\n get selectionFasta() {\n const { rowNames } = self\n const resolved = this.resolvedSelection\n const span = this.selectionFileSpan\n if (!resolved || !span) {\n return ''\n }\n const rows = resolved.rowRuns\n .flatMap(([first, last]) => rowNames.slice(first, last + 1))\n .flatMap(name => {\n const seq = self.rowSequence(name)\n return seq === undefined ? [] : [[name, seq] as const]\n })\n return blockFasta(rows, span.start, span.end)\n },\n\n /**\n * #method\n * per-column summary statistics: consensus residue and its identity\n * fraction, both conservation scores, gap fraction, and the sorted non-gap\n * residue distribution. undefined past the end of the alignment or for an\n * all-gap column.\n */\n columnStatsAt(col: number): ColumnStats | undefined {\n const { colStats, conservation, propertyConservation } = self\n return columnStats({\n col,\n colStats,\n conservation,\n propertyConservation,\n })\n },\n\n /**\n * #method\n */\n getRowData(name: string) {\n return {\n data: self.MSA?.getRowData(name),\n rowData: self.rowDataOf(name),\n }\n },\n\n /**\n * #getter\n * each encoding with its scale resolved against the values its field\n * takes: a feature channel reads them across every feature loaded, every\n * other channel across the row table. Resolved once per change of that\n * table or the encodings, never per row per frame.\n */\n get resolvedEncodings(): ResolvedEncoding[] {\n return self.encodings.map(encoding => ({\n ...encoding,\n ...this.scaleOf(\n encoding,\n featureChannels.has(encoding.channel) ? 'features' : 'rows',\n ),\n }))\n },\n\n /**\n * #getter\n * every color object the encodings and the row panels declare, keyed\n * by declaration (`declarationKey`) and resolved once over the union\n * of the values its records' fields take, so a value two strips share\n * takes one color in both. A feature field reads every feature loaded,\n * so hiding a type in the filter dialog leaves the rest in their\n * colors, and its legend lists the values of the drawn features.\n */\n get resolvedScales() {\n const rows = Object.values(self.rowData)\n const featureValues = (list: Annotation[], field: string) =>\n list.map(a => featureField(a, field)).filter(notEmpty)\n const use = (channel: ColorChannel, table: ScaleTable): ScaleUse => ({\n spec: channel,\n field: channel.field,\n table,\n ...(table === 'rows'\n ? {\n values: rows.map(row => row?.[channel.field]).filter(notEmpty),\n }\n : {\n values: featureValues(self.allAnnotations, channel.field),\n shown: featureValues(self.filteredAnnotations, channel.field),\n }),\n })\n return resolveShared([\n ...self.encodings.map(encoding =>\n use(\n encoding,\n featureChannels.has(encoding.channel) ? 'features' : 'rows',\n ),\n ),\n ...self.rowPanels.flatMap(panel =>\n panel.kind === 'strip'\n ? [use(panel, 'rows')]\n : panel.encoding?.color\n ? [use(panel.encoding.color, 'features')]\n : [],\n ),\n ])\n },\n\n /**\n * #method\n * the shared scale a record's color object resolves to\n */\n scaleOf(channel: ColorChannel, table: ScaleTable): SharedScale {\n return this.resolvedScales.get(\n declarationKey({ spec: channel, field: channel.field, table }),\n )!\n },\n\n /**\n * #getter\n * each row panel's scale resolved against the values its field takes,\n * giving the colors, labels and legend entries. Reads no cell size, so\n * a zoom reuses it and the legends built from it.\n */\n get rowPanelScales(): (StripPanelScale | FeaturePanelScale)[] {\n const { rowData } = self\n const { fillPalette, featureFillEncoding, featureLabels } = this\n const annotations = self.filteredAnnotations\n return self.rowPanels.map(panel => {\n if (panel.kind === 'features') {\n const color = panel.encoding?.color\n const encoding = color\n ? { field: color.field, ...this.scaleOf(color, 'features') }\n : featureFillEncoding\n const label = panel.encoding?.label\n return {\n kind: panel.kind,\n x: panel.x,\n header: panel.header ?? '',\n field: encoding?.field,\n legendKey: encoding?.key,\n legendTitle: encoding?.title,\n colors: color\n ? featureColorMap(annotations, encoding, fillPalette)\n : this.featureColors,\n labels: label\n ? featureLabelMap(annotations, label)\n : featureLabels,\n legend:\n encoding?.legend ??\n this.visibleDomainTypes.map(d => ({\n id: d.accession,\n label: d.name,\n color: d.color ?? fillPalette[d.accession]!,\n })),\n }\n }\n const { colorOf, legend, key, title } = this.scaleOf(panel, 'rows')\n return {\n kind: panel.kind,\n field: panel.field,\n header: panel.header ?? panel.field,\n legendKey: key,\n legendTitle: title,\n colors: colorByRow(rowData, panel.field, colorOf),\n legend,\n }\n })\n },\n\n /**\n * #getter\n * each row panel with its scale from `rowPanelScales` and its geometry:\n * the pixel column it draws in and, for a features panel, the spans per\n * row. Resolved once per change of those inputs, never per block per\n * frame.\n */\n get resolvedRowPanels(): ResolvedRowPanel[] {\n const scales = this.rowPanelScales\n let offsetX = 0\n return self.rowPanels.map((panel, index) => {\n const width = rowPanelWidth(panel, self)\n const base = { id: `rowpanel-${index}`, width, offsetX }\n offsetX += width\n if (panel.kind === 'features') {\n const align = panel.transform?.find(t => t.type === 'align')\n return {\n ...base,\n ...(scales[index] as FeaturePanelScale),\n spans: featurePanelSpans({\n panel,\n width,\n colWidth: self.colWidth,\n domainBands: this.domainBands,\n annotationsByRow: self.annotationsByRow,\n shifts: align\n ? this.featureAlignShifts.get(align.on)\n : undefined,\n }),\n }\n }\n return { ...base, ...(scales[index] as StripPanelScale) }\n })\n },\n\n /**\n * #getter\n * the shift an `align` transform gives each row, keyed by the feature\n * name it aligns on: the offset putting the first feature of that name\n * at zero. A row carrying no such feature is absent, and keeps its own\n * origin.\n */\n get featureAlignShifts(): Map<string, Map<string, number>> {\n const names = new Set(\n self.rowPanels.flatMap(panel =>\n panel.kind === 'features' && panel.x === 'position'\n ? (panel.transform ?? [])\n .filter(t => t.type === 'align')\n .map(t => t.on)\n : [],\n ),\n )\n return new Map(\n [...names].map(on => [\n on,\n new Map(\n Object.entries(self.annotationsByRow)\n .map(([name, annotations]) => {\n const hit = annotations.find(a => featureName(a) === on)\n return hit ? ([name, 1 - hit.start] as const) : undefined\n })\n .filter(notEmpty),\n ),\n ]),\n )\n },\n\n /**\n * #getter\n * the color the `tipLabel` channel gives each row, by row name. Undefined\n * when no encoding names the channel, which leaves the labels the theme's\n * text color.\n */\n get tipLabelColors(): Map<string, string> | undefined {\n const encoding = this.resolvedEncodings.find(\n e => e.channel === 'tipLabel',\n )\n return encoding\n ? colorByRow(self.rowData, encoding.field, encoding.colorOf)\n : undefined\n },\n\n /**\n * #getter\n * the wash the `rowTint` channel draws over each row, indexed by row, or\n * undefined when no encoding names the channel. The overlay draws these,\n * so a tint stays out of the raster tile cache and its keys.\n */\n get rowTints(): (string | undefined)[] | undefined {\n const encoding = this.resolvedEncodings.find(\n e => e.channel === 'rowTint',\n )\n if (!encoding) {\n return undefined\n }\n const colors = colorByRow(\n self.rowData,\n encoding.field,\n encoding.colorOf,\n )\n return self.rowNames.map(name => {\n const color = colors.get(name)\n return color && withAlpha(color, rowTintAlpha)\n })\n },\n\n /**\n * #getter\n * the color the `branch` channel gives each tree edge, by the node id at\n * the edge's far end, or undefined when no encoding names the channel. A\n * node takes the field value its tips agree on, so a clade of one value\n * colors down from where it splits off, and a node whose tips disagree or\n * whose value has no color is absent and draws in the default color.\n *\n * The pass runs over the whole tree, never `root`, so a collapsed or\n * focused clade keeps the color the full tree gives it.\n */\n get branchColors(): Map<string, string> | undefined {\n const encoding = this.resolvedEncodings.find(\n e => e.channel === 'branch',\n )\n if (!encoding) {\n return undefined\n }\n const order = preorder(self.tree)\n const values = new Map<NodeWithIds, string | undefined>()\n const colors = new Map<string, string>()\n for (let i = order.length - 1; i >= 0; i--) {\n const node = order[i]!\n const value =\n node.children.length > 0\n ? sharedValue(node.children.map(child => values.get(child)))\n : self.rowDataOf(node.name)?.[encoding.field]\n values.set(node, value)\n const color =\n value === undefined ? undefined : encoding.colorOf(value)\n if (color) {\n colors.set(node.id, color)\n }\n }\n return colors\n },\n }))\n .actions(self => ({\n /**\n * #action\n */\n setHeaderHeight(arg: number) {\n self.headerHeight = arg\n },\n /**\n * #action\n */\n setHideHeader(arg: boolean) {\n self.hideHeader = arg\n },\n /**\n * #action\n */\n setEmbeddedMode(arg: boolean) {\n self.embeddedMode = arg\n },\n /**\n * #action\n */\n setImportForm(arg: boolean) {\n self.importForm = arg\n },\n /**\n * #action\n * focus the subtree a click `y` pixels down the tree overview lands on.\n * A click inside the box already drawn there clears the focus, the way\n * clicking the focused branch again does.\n */\n treeOverviewClick(y: number) {\n const hit = self.treeOverviewHit(y)\n const focus = self.treeOverviewFocusRows\n const inside =\n !!focus && !!hit && hit.rows[0] >= focus[0] && hit.rows[1] <= focus[1]\n self.setShowOnly(inside || !hit ? undefined : hit.id)\n },\n /**\n * #action\n * resize every track sharing a `heightKey`; see `trackHeights`\n */\n setTrackHeight(heightKey: string, height: number) {\n self.trackHeights.set(heightKey, height)\n },\n /**\n * #action\n * Return to the import form: reset every property not in\n * `preservedOnReset` to its default, then clear the file-derived\n * volatiles applySnapshot does not touch.\n */\n reset() {\n self.resetCount++\n self.loadWarnings = []\n self.dismissedWarnings = []\n self.setStatus(undefined)\n applySnapshot(\n self,\n Object.fromEntries(\n Object.entries(getSnapshot(self) as Record<string, unknown>).filter(\n ([key]) => preservedOnReset.has(key),\n ),\n ),\n )\n self.setError(undefined)\n self.setAnnotations([])\n self.setHighlightedColumns(undefined)\n self.transientHighlights = {}\n self.setMousePos(undefined, undefined)\n self.setMouseClickPos(undefined, undefined)\n self.setHoveredTreeNode(undefined)\n },\n /**\n * #action\n */\n async exportSVG(opts: ExportSvgOptions) {\n const { renderToSvg } = await import('./renderToSvg.tsx')\n const html = await renderToSvg(self as MsaViewModel, opts)\n const blob = new Blob([html], { type: 'image/svg+xml' })\n saveAs(blob, exportFileName(self.msaFilehandle, 'svg'))\n },\n /**\n * #action\n * save `treeNewick` as a file\n */\n exportNewick() {\n const blob = new Blob([self.treeNewick], { type: 'text/plain' })\n saveAs(\n blob,\n exportFileName(\n self.treeFilehandle ?? self.msaFilehandle,\n 'nwk',\n 'tree',\n ),\n )\n },\n /**\n * #action\n * show or hide an annotation type. Only a choice that differs from the\n * type's default is recorded; see `turnedOffFeatures`\n */\n setFilter(accession: string, shown: boolean) {\n // only a departure from the accession's default is recorded\n if (shown === self.defaultOffAccessions.has(accession)) {\n self.turnedOffFeatures.set(accession, !shown)\n } else {\n self.turnedOffFeatures.delete(accession)\n }\n },\n\n /**\n * #action\n */\n fit() {\n // two passes: each direction's viewport depends on whether the other\n // overflows (the minimap takes height, the vertical scrollbar width).\n // Fit shrinks an alignment into the window but never grows one past\n // the default cell size, which would stretch a small alignment's rows\n // and columns out of proportion\n transaction(() => {\n for (let pass = 0; pass < 2; pass++) {\n this.fitHorizontally(defaultColWidth)\n this.fitVertically(defaultRowHeight)\n }\n })\n },\n /**\n * #action\n */\n fitVertically(maxRowHeight = maxCellSize) {\n if (self.numRows > 0) {\n self.setRowHeight(\n clamp(\n self.msaAreaHeight / self.numRows,\n minRowHeight,\n maxRowHeight,\n ),\n )\n }\n self.scrollY = 0\n },\n /**\n * #action\n * zoom and scroll so a span fills the alignment's width, in highlight\n * coordinates (see visibleSpan). Does nothing before the viewer knows\n * its width, or for a span that resolves to no visible column.\n */\n zoomToRegion(region: Region) {\n const span = self.visibleSpan(region)\n if (!span || !self.viewInitialized) {\n return\n }\n transaction(() => {\n self.setColWidth(\n clamp(\n self.msaCanvasWidth / (span.endCol - span.startCol + 1),\n minColWidth,\n maxCellSize,\n ),\n )\n self.scrollX = clamp(\n -span.startCol * self.colWidth,\n self.maxScrollX,\n 0,\n )\n })\n },\n /**\n * #action\n * zoomToRegion, and for a region naming a row, also scroll that row to\n * the middle of the alignment, as Go to does. What `region` opens on; a\n * caller following a range as it moves wants zoomToRegion alone, which\n * leaves the reader's vertical scroll where they put it.\n */\n revealRegion(region: Region) {\n transaction(() => {\n this.zoomToRegion(region)\n const row =\n region.row === undefined\n ? undefined\n : self.rowNamesSet.get(region.row)\n if (row !== undefined && self.viewInitialized) {\n self.setScrollY(\n -(row + 0.5) * self.rowHeight + self.msaAreaHeight / 2,\n )\n }\n })\n },\n /**\n * #action\n * zoom and scroll so the selected columns fill the alignment's width,\n * and, where the selection names its rows, so those rows fill its height\n */\n zoomToSelection() {\n const { selection, resolvedSelection } = self\n if (!selection || !resolvedSelection) {\n return\n }\n transaction(() => {\n this.zoomToRegion({ start: selection.start, end: selection.end })\n if (selection.rows && self.viewInitialized) {\n const { rowRuns } = resolvedSelection\n const first = rowRuns[0]![0]\n const last = rowRuns.at(-1)![1]\n self.setRowHeight(\n clamp(\n self.msaAreaHeight / (last - first + 1),\n minRowHeight,\n maxCellSize,\n ),\n )\n self.scrollY = clamp(-first * self.rowHeight, self.maxScrollY, 0)\n }\n })\n },\n /**\n * #action\n * select the block between two cells given as visible column and row\n * indices, the coordinates a drag reports, clamped to the alignment. A\n * cell with no `row` selects the columns across every row, and so does a\n * block spanning every row on screen.\n */\n selectBlock(\n anchor: { col: number; row?: number },\n head: { col: number; row?: number },\n ) {\n const { numColumns, numRows, rowNames } = self\n if (numColumns === 0 || numRows === 0) {\n return\n }\n const ordered = (a: number, b: number, last: number) =>\n [clamp(a, 0, last), clamp(b, 0, last)].sort((x, y) => x - y) as [\n number,\n number,\n ]\n const [startCol, endCol] = ordered(anchor.col, head.col, numColumns - 1)\n const [firstRow, lastRow] =\n anchor.row === undefined || head.row === undefined\n ? [0, numRows - 1]\n : ordered(anchor.row, head.row, numRows - 1)\n const everyRow = firstRow === 0 && lastRow === numRows - 1\n self.setSelection({\n start: self.visibleColToGlobalCol(startCol) + 1,\n end: self.visibleColToGlobalCol(endCol) + 1,\n ...(everyRow ? {} : { rows: rowNames.slice(firstRow, lastRow + 1) }),\n })\n },\n /**\n * #action\n */\n fitHorizontally(maxColWidth = maxCellSize) {\n if (self.numColumns > 0) {\n // msaCanvasWidth excludes the vertical scrollbar's 20px\n self.setColWidth(\n clamp(\n self.msaCanvasWidth / self.numColumns,\n minColWidth,\n maxColWidth,\n ),\n )\n }\n self.scrollX = 0\n },\n\n afterCreate() {\n if (self.highlightColumns?.length) {\n self.setHighlightedColumns(self.highlightColumns)\n }\n\n const awaitingTree = () => !!self.treeFilehandle && !self.data.tree\n\n // `collapse`, `focus` and `rotate` marks seed `collapsed`, `showOnly`\n // and `rotated`. Seeding runs once per data load, `clades` change and\n // reroot, so expanding a seeded clade sticks until one of those. A tree\n // filehandle holds it back, since `dataInitialized` is true while the\n // tree is still the flat stub.\n addDisposer(\n self,\n reaction(\n () =>\n self.dataInitialized && !awaitingTree()\n ? { clades: getSnapshot(self.clades), treeRoot: self.treeRoot }\n : undefined,\n seed => {\n if (!seed?.clades.length) {\n return\n }\n for (const { mark, nodeId } of self.resolvedClades) {\n if (nodeId === undefined) {\n continue\n }\n if (mark === 'collapse' && !self.collapsed.includes(nodeId)) {\n self.toggleCollapsed(nodeId)\n } else if (mark === 'focus') {\n self.setShowOnly(nodeId)\n } else if (\n mark === 'rotate' &&\n !self.rotated.includes(nodeId)\n ) {\n self.toggleRotated(nodeId)\n }\n }\n },\n { fireImmediately: true, equals: compareStructural },\n ),\n )\n\n // zoomToRegion needs a width and resolves residues through the visible\n // columns, so this waits for both, and for a tree file whose collapsed\n // clades would hide columns and move the target after the zoom\n addDisposer(\n self,\n autorun(() => {\n const { region } = self\n if (\n region &&\n self.viewInitialized &&\n self.numColumns > 0 &&\n !awaitingTree()\n ) {\n this.revealRegion(region)\n self.setRegion(undefined)\n }\n }),\n )\n\n // the matchMedia query is pinned to the current device pixel ratio, so\n // each change re-registers against the new one\n if (\n typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function'\n ) {\n const query = () =>\n window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`)\n let mql = query()\n const onChange = () => {\n self.setHighResScaleFactor(window.devicePixelRatio)\n mql.removeEventListener('change', onChange)\n mql = query()\n mql.addEventListener('change', onChange)\n }\n mql.addEventListener('change', onChange)\n addDisposer(self, () => {\n mql.removeEventListener('change', onChange)\n })\n }\n\n installFilehandleLoader(self, {\n what: 'tree',\n getFilehandle: () => self.treeFilehandle,\n onLoad: text => {\n self.setTree(text)\n },\n setLoading: arg => {\n self.setLoadingTree(arg)\n },\n clearFilehandle: () => {\n self.setTreeFilehandle(undefined)\n },\n })\n\n // treeMetadata has no import-form step, so no loading flag or cancel\n installFilehandleLoader(self, {\n what: 'row metadata',\n optional: true,\n getFilehandle: () => self.treeMetadataFilehandle,\n onLoad: text => {\n self.setTreeMetadata(text)\n },\n })\n\n // parses data.gff into annotations. Clearing the text clears only the\n // annotations this autorun applied, not ones a host set directly\n let appliedGFF = false\n addDisposer(\n self,\n autorun(() => {\n const gffText = self.data.gff\n if (gffText) {\n try {\n self.applyGFFText(gffText)\n appliedGFF = true\n } catch (e) {\n console.error(e)\n self.addWarning(`The annotations did not parse: ${e}`)\n }\n } else if (appliedGFF) {\n appliedGFF = false\n self.setAnnotations([])\n }\n }),\n )\n\n // gffFilehandle loads into data.gff, which the autorun above parses\n installFilehandleLoader(self, {\n what: 'annotations',\n optional: true,\n getFilehandle: () => self.gffFilehandle,\n onLoad: text => {\n self.setGFF(text)\n },\n clearFilehandle: () => {\n self.setGFFFilehandle(undefined)\n },\n })\n\n installFilehandleLoader(self, {\n what: 'alignment',\n getFilehandle: () => self.msaFilehandle,\n onLoad: text => {\n self.setMSA(text)\n },\n setLoading: arg => {\n self.setLoadingMSA(arg)\n },\n clearFilehandle: () => {\n self.setMSAFilehandle(undefined)\n },\n })\n\n // Keep computeds alive that are read outside reactions, so they are not\n // recomputed on every access: self.columns (and through it the\n // parseMSA result), and the column statistics that dynamic color\n // schemes and the mousemove-driven hover tooltip read.\n // xref solution https://github.com/mobxjs/mobx/issues/266#issuecomment-222007278\n // xref problem https://github.com/GMOD/react-msaview/issues/75\n addDisposer(\n self,\n autorun(() => {\n if (self.dynamicColorSchemeName) {\n readComputed(self.colStats)\n }\n if (self.showColumnStats) {\n readComputed(\n self.colStats,\n self.conservation,\n self.propertyConservation,\n )\n }\n readComputed(self.columns)\n }),\n )\n },\n }))\n .postProcessSnapshot(({ data, columnTracks, ...rest }) => ({\n // stripDefault handles per-property defaults; this drops inline documents\n // whose filehandle can refetch them\n ...rest,\n ...smallColumnTracks(columnTracks, maxInlineSnapshotBytes),\n data: {\n ...(rest.treeFilehandle ? {} : { tree: data.tree }),\n ...(rest.msaFilehandle ? {} : { msa: data.msa }),\n ...(rest.treeMetadataFilehandle\n ? {}\n : { treeMetadata: data.treeMetadata }),\n ...(rest.gffFilehandle ? {} : { gff: data.gff }),\n },\n }))\n}\n\nexport default stateModelFactory\n\nexport type MsaViewStateModel = ReturnType<typeof stateModelFactory>\nexport type MsaViewModel = Instance<MsaViewStateModel>\n", "/**\n * FASTA for a block of the alignment: each row's letters from column `start`\n * to `end`, 1-based and inclusive, under its name. Gaps stay in, and a row that\n * ends before `end` is padded with gaps, so every record is the block's width.\n */\nexport function blockFasta(\n rows: readonly (readonly [string, string])[],\n start: number,\n end: number,\n) {\n const width = Math.max(0, end - start + 1)\n return rows\n .map(\n ([name, seq]) =>\n `>${name}\\n${seq.slice(start - 1, end).padEnd(width, '-')}\\n`,\n )\n .join('')\n}\n", "// ClustalX consensus coloring.\n// ref http://www.jalview.org/help/html/colourSchemes/clustal.html\n\nimport type { ColumnCounts } from './columnCounts.ts'\n\nconst BLUE = 'rgb(128,179,230)'\nconst RED = '#d88'\nconst MAGENTA_E = 'rgb(192, 72, 192)'\nconst MAGENTA_D = 'rgb(204, 77, 204)'\nconst GREEN = '#8f8'\nconst GREEN_ST = 'rgb(26,204,26)'\nconst PINK = 'rgb(240, 128, 128)'\nconst ORANGE = 'rgb(240, 144, 72)'\nconst YELLOW = 'rgb(204, 204, 0)'\nconst CYAN = 'rgb(26, 179, 179)'\n\n/**\n * Computes the ClustalX letter->color map for a single alignment column, read\n * out of the alignment-wide `ColumnCounts` tally.\n */\nexport function clustalXColumnColors(counts: ColumnCounts, col: number) {\n const total = counts.total(col)\n const count = (letter: string) => counts.count(col, letter)\n const W = count('W')\n const L = count('L')\n const V = count('V')\n const I = count('I')\n const M = count('M')\n const A = count('A')\n const F = count('F')\n const C = count('C')\n const H = count('H')\n const P = count('P')\n const R = count('R')\n const K = count('K')\n const Q = count('Q')\n const E = count('E')\n const D = count('D')\n const T = count('T')\n const S = count('S')\n const G = count('G')\n const Y = count('Y')\n const N = count('N')\n\n const hydrophobic = W + L + V + I + M + A + F + C + H + P + Y\n const KR = K + R\n const QE = Q + E\n const ED = E + D\n const TS = T + S\n const p = (subtotal: number) => subtotal / total\n\n const colors: Record<string, string> = {}\n\n if (p(hydrophobic) > 0.6) {\n colors.W = BLUE\n colors.L = BLUE\n colors.V = BLUE\n colors.A = BLUE\n colors.I = BLUE\n colors.M = BLUE\n colors.F = BLUE\n colors.C = BLUE\n }\n\n if (p(KR) > 0.6 || p(K) > 0.8 || p(R) > 0.8 || p(Q) > 0.8) {\n colors.K = RED\n colors.R = RED\n }\n\n if (p(KR) > 0.6 || p(QE) > 0.5 || p(E) > 0.8 || p(Q) > 0.8 || p(D) > 0.8) {\n colors.E = MAGENTA_E\n }\n\n if (p(KR) > 0.6 || p(ED) > 0.5 || p(K) > 0.8 || p(R) > 0.8 || p(Q) > 0.8) {\n colors.D = MAGENTA_D\n }\n\n if (p(N) > 0.5 || p(Y) > 0.85) {\n colors.N = GREEN\n }\n\n if (\n p(KR) > 0.6 ||\n p(QE) > 0.6 ||\n p(Q) > 0.85 ||\n p(E) > 0.85 ||\n p(K) > 0.85 ||\n p(R) > 0.85\n ) {\n colors.Q = GREEN\n }\n\n if (p(hydrophobic) > 0.6 || p(TS) > 0.5 || p(S) > 0.85 || p(T) > 0.85) {\n colors.S = GREEN_ST\n colors.T = GREEN_ST\n }\n\n if (p(C) > 0.85) {\n colors.C = PINK\n }\n\n if (G > 0) {\n colors.G = ORANGE\n }\n\n if (P > 0) {\n colors.P = YELLOW\n }\n\n if (\n p(hydrophobic) > 0.6 ||\n p(W) > 0.85 ||\n p(Y) > 0.85 ||\n p(A) > 0.85 ||\n p(C) > 0.85 ||\n p(P) > 0.85 ||\n p(Q) > 0.85 ||\n p(F) > 0.85 ||\n p(H) > 0.85 ||\n p(I) > 0.85 ||\n p(L) > 0.85 ||\n p(M) > 0.85 ||\n p(V) > 0.85\n ) {\n colors.H = CYAN\n colors.Y = CYAN\n }\n\n return colors\n}\n", "import { blue, green, orange, red } from '@mui/material/colors'\nimport { colord } from 'colord'\n\nimport { transform } from './util.ts'\n\n// standard A/C/G/T(/U) coloring, shared by the `jbrowse_dna` and `nucleotide`\n// scheme names\nconst dna = {\n A: green[500],\n C: blue[500],\n G: orange[500],\n T: red[500],\n U: red[500],\n}\n\n// Record<string, ...> so a free-string scheme name can index it\nconst colorSchemes: Record<string, Record<string, string>> = {\n none: {},\n nucleotide: dna,\n clustal: {\n G: 'orange',\n P: 'orange',\n S: 'orange',\n T: 'orange',\n H: 'red',\n K: 'red',\n R: 'red',\n F: 'blue',\n W: 'blue',\n Y: 'blue',\n I: 'green',\n L: 'green',\n M: 'green',\n V: 'green',\n },\n lesk: {\n G: 'orange',\n A: 'orange',\n S: 'orange',\n T: 'orange',\n C: 'green',\n V: 'green',\n I: 'green',\n L: 'green',\n P: 'green',\n F: 'green',\n Y: 'green',\n M: 'green',\n W: 'green',\n N: 'magenta',\n Q: 'magenta',\n H: 'magenta',\n D: 'red',\n E: 'red',\n K: 'blue',\n R: 'blue',\n },\n maeditor: {\n A: 'lightgreen',\n G: 'lightgreen',\n C: 'green',\n D: 'darkgreen',\n E: 'darkgreen',\n N: 'darkgreen',\n Q: 'darkgreen',\n I: 'blue',\n L: 'blue',\n M: 'blue',\n V: 'blue',\n F: '#c8a2c8',\n W: '#c8a2c8',\n Y: '#c8a2c8',\n H: 'darkblue',\n K: 'orange',\n R: 'orange',\n P: 'pink',\n S: 'red',\n T: 'red',\n },\n\n percent_identity_dynamic: {},\n blosum62_dynamic: {},\n // https://github.com/biotite-dev/biotite/blob/8c460972f8ab904312f130dfb80f3efc8c9bd7c5/src/biotite/sequence/graphics/color_schemes/flower.json\n flower: {\n A: '#b18a51',\n C: '#ff5701',\n D: '#01a578',\n E: '#2da0a1',\n F: '#fa559d',\n G: '#b1c23c',\n H: '#0194f9',\n I: '#f27663',\n K: '#7fc3d7',\n L: '#df6e75',\n M: '#fe9daf',\n N: '#0bcec6',\n P: '#4fa32a',\n Q: '#7295ae',\n R: '#83bff1',\n S: '#b4bd9b',\n T: '#d2b576',\n V: '#fd997b',\n W: '#ff2ded',\n Y: '#c96ecf',\n },\n rainbow_dna: {\n A: '#3737f5',\n C: '#37f537',\n G: '#f5f537',\n T: '#f53737',\n U: '#f53737',\n },\n\n // https://github.com/biotite-dev/biotite/blob/8c460972f8ab904312f130dfb80f3efc8c9bd7c5/src/biotite/sequence/graphics/color_schemes/clustalx_protein.json\n clustalx_protein: {\n A: '#197fe5',\n C: '#e57f7f',\n D: '#cc4ccc',\n E: '#cc4ccc',\n F: '#197fe5',\n G: '#e5994c',\n H: '#19b2b2',\n I: '#197fe5',\n K: '#e53319',\n L: '#197fe5',\n M: '#197fe5',\n N: '#19cc19',\n P: '#cccc00',\n Q: '#19cc19',\n R: '#e53319',\n S: '#19cc19',\n T: '#19cc19',\n V: '#197fe5',\n W: '#197fe5',\n Y: '#19b2b2',\n },\n\n // this has special handling\n clustalx_protein_dynamic: {},\n\n clustalx_dna: {\n A: '#e53319',\n C: '#197fe5',\n G: '#e5994c',\n T: '#19cc19',\n U: '#19cc19',\n },\n jbrowse_dna: dna,\n jalview_buried: {\n A: '#00a35c',\n R: '#00fc03',\n N: '#00eb14',\n D: '#00eb14',\n C: '#0000ff',\n Q: '#00f10e',\n E: '#00f10e',\n G: '#009d62',\n H: '#00d52a',\n I: '#0054ab',\n L: '#007b84',\n K: '#00ff00',\n M: '#009768',\n F: '#008778',\n P: '#00e01f',\n S: '#00d52a',\n T: '#00db24',\n W: '#00a857',\n Y: '#00e619',\n V: '#005fa0',\n B: '#00eb14',\n X: '#00b649',\n Z: '#00f10e',\n },\n\n jalview_hydrophobicity: {\n A: '#ad0052',\n R: '#0000ff',\n N: '#0c00f3',\n D: '#0c00f3',\n C: '#c2003d',\n Q: '#0c00f3',\n E: '#0c00f3',\n G: '#6a0095',\n H: '#1500ea',\n I: '#ff0000',\n L: '#ea0015',\n K: '#0000ff',\n M: '#b0004f',\n F: '#cb0034',\n P: '#4600b9',\n S: '#5e00a1',\n T: '#61009e',\n W: '#5b00a4',\n Y: '#4f00b0',\n V: '#f60009',\n B: '#0c00f3',\n X: '#680097',\n Z: '#0c00f3',\n },\n\n jalview_prophelix: {\n A: '#e718e7',\n R: '#6f906f',\n N: '#1be41b',\n D: '#778877',\n C: '#23dc23',\n Q: '#926d92',\n E: '#ff00ff',\n G: '#00ff00',\n H: '#758a75',\n I: '#8a758a',\n L: '#ae51ae',\n K: '#a05fa0',\n M: '#ef10ef',\n F: '#986798',\n P: '#00ff00',\n S: '#36c936',\n T: '#47b847',\n W: '#8a758a',\n Y: '#21de21',\n V: '#857a85',\n B: '#49b649',\n X: '#758a75',\n Z: '#c936c9',\n },\n\n jalview_propstrand: {\n A: '#5858a7',\n R: '#6b6b94',\n N: '#64649b',\n D: '#2121de',\n C: '#9d9d62',\n Q: '#8c8c73',\n E: '#0000ff',\n G: '#4949b6',\n H: '#60609f',\n I: '#ecec13',\n L: '#b2b24d',\n K: '#4747b8',\n M: '#82827d',\n F: '#c2c23d',\n P: '#2323dc',\n S: '#4949b6',\n T: '#9d9d62',\n W: '#c0c03f',\n Y: '#d3d32c',\n V: '#ffff00',\n B: '#4343bc',\n X: '#797986',\n Z: '#4747b8',\n },\n\n jalview_propturn: {\n A: '#2cd3d3',\n R: '#708f8f',\n N: '#ff0000',\n D: '#e81717',\n C: '#a85757',\n Q: '#3fc0c0',\n E: '#778888',\n G: '#ff0000',\n H: '#708f8f',\n I: '#00ffff',\n L: '#1ce3e3',\n K: '#7e8181',\n M: '#1ee1e1',\n F: '#1ee1e1',\n P: '#f60909',\n S: '#e11e1e',\n T: '#738c8c',\n W: '#738c8c',\n Y: '#9d6262',\n V: '#07f8f8',\n B: '#f30c0c',\n X: '#7c8383',\n Z: '#5ba4a4',\n },\n\n jalview_taylor: {\n A: '#ccff00',\n R: '#0000ff',\n N: '#cc00ff',\n D: '#ff0000',\n C: '#ffff00',\n Q: '#ff00cc',\n E: '#ff0066',\n G: '#ff9900',\n H: '#0066ff',\n I: '#66ff00',\n L: '#33ff00',\n K: '#6600ff',\n M: '#00ff00',\n F: '#00ff66',\n P: '#ffcc00',\n S: '#ff3300',\n T: '#ff6600',\n W: '#00ccff',\n Y: '#00ffcc',\n V: '#99ff00',\n },\n\n jalview_zappo: {\n A: '#ffafaf',\n R: '#6464ff',\n N: '#00ff00',\n D: '#ff0000',\n C: '#ffff00',\n Q: '#00ff00',\n E: '#ff0000',\n G: '#ff00ff',\n H: '#6464ff',\n I: '#ffafaf',\n L: '#ffafaf',\n K: '#6464ff',\n M: '#ffafaf',\n F: '#ffc800',\n P: '#ff00ff',\n S: '#00ff00',\n T: '#00ff00',\n W: '#ffc800',\n Y: '#ffc800',\n V: '#ffafaf',\n },\n\n cinema: {\n H: 'blue',\n K: 'blue',\n R: 'blue',\n D: 'red',\n E: 'red',\n S: 'green',\n T: 'green',\n N: 'green',\n Q: 'green',\n A: 'white',\n V: 'white',\n L: 'white',\n I: 'white',\n M: 'white',\n F: 'magenta',\n W: 'magenta',\n Y: 'magenta',\n P: 'brown',\n G: 'brown',\n C: 'yellow',\n B: 'gray',\n Z: 'gray',\n X: 'gray',\n '-': 'gray',\n '.': 'gray',\n },\n}\n\n// turn all supplied colors to hex colors which getContrastText from mui\n// requires\nexport default transform(colorSchemes, ([key, val]) => [\n key,\n transform(val, ([letter, color]) => [letter, colord(color).toHex()]),\n])\n\nconst letterTables = new WeakMap<\n Record<string, string>,\n Record<string, string>\n>()\n\n/**\n * A letter map as the renderer looks letters up. The model upper-cases every\n * row before coloring it, so a table keys its letters in upper case and a map\n * may key them in either. The table is cached per map, so its identity is\n * stable enough for the raster cache to key on.\n */\nexport function letterColorTable(map: Record<string, string>) {\n let table = letterTables.get(map)\n if (!table) {\n table = transform(map, ([letter, color]) => [letter.toUpperCase(), color])\n letterTables.set(map, table)\n }\n return table\n}\n", "import type { ColumnCounts } from './columnCounts.ts'\n\nexport interface ColumnStats {\n col: number\n total: number\n gaps: number\n gapFraction: number\n conservation: number\n propertyConservation: number | undefined\n consensusLetter: string\n consensusCount: number\n consensusFraction: number\n distribution: [string, number][]\n}\n\n/**\n * Summarize one column: consensus residue and its identity fraction, the two\n * conservation scores, gap fraction, and the non-gap residue distribution\n * sorted by count. undefined past the end of the alignment or for a column with\n * no sequences.\n *\n * A module-level function: a getter that reached the method through `this` made\n * TypeScript infer the whole views object to type it, and fell back to `any`.\n */\nexport function columnStats({\n col,\n colStats,\n conservation,\n propertyConservation,\n}: {\n col: number\n colStats: ColumnCounts\n conservation: number[]\n propertyConservation: number[]\n}): ColumnStats | undefined {\n if (col >= colStats.numColumns) {\n return undefined\n }\n const total = colStats.total(col)\n if (!total) {\n return undefined\n }\n const gaps = colStats.gapCount(col)\n const distribution = colStats.residueEntries(col).sort((a, b) => b[1] - a[1])\n const consensus = distribution[0]\n return {\n col,\n total,\n gaps,\n gapFraction: gaps / total,\n conservation: conservation[col] ?? 0,\n propertyConservation: propertyConservation[col],\n consensusLetter: consensus?.[0] ?? '',\n consensusCount: consensus?.[1] ?? 0,\n consensusFraction: consensus ? consensus[1] / total : 0,\n distribution,\n }\n}\n", "/**\n * Assigns each of one row's bands a lane: the first lane whose last band ends\n * before this one starts, so only bands that actually overlap stack. A row of\n * adjacent exons packs into a single lane; a family with a domain nested inside\n * it takes two.\n *\n * Packing runs left to right, but the result keeps the input's largest-first\n * paint order. `laneCount` is the row's depth, which the renderer divides the\n * row height by so a deep stack stays inside its own row.\n *\n * The coordinates are whatever the caller packs in: alignment columns for the\n * overlay, residue positions for a `features` row panel.\n */\nexport function packDomainLanes<T extends { startCol: number; endCol: number }>(\n bands: T[],\n): (T & { lane: number; laneCount: number })[] {\n const laneEnds: number[] = []\n const lanes = new Array<number>(bands.length)\n const byStart = bands\n .map((_, i) => i)\n .sort((a, b) => bands[a]!.startCol - bands[b]!.startCol)\n\n for (const i of byStart) {\n const { startCol, endCol } = bands[i]!\n const found = laneEnds.findIndex(end => end <= startCol)\n const lane = found === -1 ? laneEnds.length : found\n laneEnds[lane] = endCol\n lanes[i] = lane\n }\n\n return bands.map((band, i) => ({\n ...band,\n lane: lanes[i]!,\n laneCount: laneEnds.length,\n }))\n}\n", "/**\n * A round branch-length step and its width in pixels: the largest 1/2/5 x 10^n\n * substitutions-per-site that fits in `maxPx`, aiming at about half of it.\n * Returns undefined in cladogram mode, where the x-positions carry no length.\n */\nexport function scaleBarLength(pxPerUnit: number, maxPx: number) {\n if (pxPerUnit <= 0 || maxPx < 20) {\n return undefined\n }\n const target = maxPx / 2 / pxPerUnit\n const magnitude = 10 ** Math.floor(Math.log10(target))\n const mantissa = target / magnitude\n const step = (mantissa >= 5 ? 5 : mantissa >= 2 ? 2 : 1) * magnitude\n const px = step * pxPerUnit\n return px > maxPx\n ? undefined\n : {\n step,\n px,\n // a length of 0.02 reads as 0.02, not 0.020000000000000004\n label: `${Number(step.toPrecision(2))}`,\n }\n}\n", "const palettes = [\n ['#F8766D'],\n ['#F8766D', '#00BFC4'],\n ['#F8766D', '#00BA38', '#619CFF'],\n ['#F8766D', '#7CAE00', '#00BFC4', '#C77CFF'],\n ['#F8766D', '#A3A500', '#00BF7D', '#00B0F6', '#E76BF3'],\n ['#F8766D', '#B79F00', '#00BA38', '#00BFC4', '#619CFF', '#F564E3'],\n ['#F8766D', '#C49A00', '#53B400', '#00C094', '#00B6EB', '#A58AFF', '#FB61D7'],\n [\n '#F8766D',\n '#CD9600',\n '#7CAE00',\n '#00BE67',\n '#00BFC4',\n '#00A9FF',\n '#C77CFF',\n '#FF61CC',\n ],\n]\n\nexport default palettes\n\n/**\n * Fixed categorical palettes a scale names. `ggplot` is not one of them: it is\n * the ramp above, which picks its colors from the number of keys.\n */\nexport const namedPalettes: Record<string, readonly string[]> = {\n set1: [\n '#e41a1c',\n '#377eb8',\n '#4daf4a',\n '#984ea3',\n '#ff7f00',\n '#ffff33',\n '#a65628',\n '#f781bf',\n '#999999',\n ],\n dark2: [\n '#1b9e77',\n '#d95f02',\n '#7570b3',\n '#e7298a',\n '#66a61e',\n '#e6ab02',\n '#a6761d',\n '#666666',\n ],\n // Okabe-Ito, which stays distinguishable under the common forms of color\n // blindness\n okabeito: [\n '#e69f00',\n '#56b4e9',\n '#009e73',\n '#f0e442',\n '#0072b2',\n '#d55e00',\n '#cc79a7',\n '#000000',\n ],\n tableau: [\n '#4e79a7',\n '#f28e2b',\n '#e15759',\n '#76b7b2',\n '#59a14f',\n '#edc948',\n '#b07aa1',\n '#ff9da7',\n '#9c755f',\n '#bab0ac',\n ],\n}\n\n// the spellings jbrowse-components' `paletteFromSpec` takes for two of them\nconst aliases: Record<string, string> = {\n okabeIto: 'okabeito',\n tableau10: 'tableau',\n}\n\n/**\n * The colors a palette name asks for. `ggplot`, an unknown name, and no name at\n * all give undefined, which `createPaletteMap` answers with the hue ramp.\n */\nexport function paletteNamed(name?: string) {\n return name === undefined\n ? undefined\n : Object.hasOwn(namedPalettes, name)\n ? namedPalettes[name]\n : Object.hasOwn(aliases, name)\n ? namedPalettes[aliases[name]!]\n : undefined\n}\n", "import { colord } from 'colord'\n\nimport palettes from './ggplotPalettes.ts'\n\n/**\n * Creates a map from keys to colors. `palette` names the colors to take in\n * order, such as the list a scale asked for by name; without it the keys take\n * the ggplot palette of their own size. Beyond the colors available \u2014 a\n * gene-structure overlay with one feature per exon, or nine keys on an\n * eight-color palette \u2014 every key gets an evenly spaced HSL hue instead, so no\n * two keys share a color.\n */\nexport function createPaletteMap(keys: string[], palette?: readonly string[]) {\n const n = keys.length\n const colors = palette ?? palettes[n - 1]\n if (colors && n <= colors.length) {\n return Object.fromEntries(keys.map((key, i) => [key, colors[i]!]))\n }\n return Object.fromEntries(\n keys.map((key, i) => [\n key,\n colord({ h: (i * 360) / n, s: 60, l: 60 }).toHex(),\n ]),\n )\n}\n", "import type { FileLocation } from '@jbrowse/core/util/types'\n\n/**\n * The name to save an export under: the loaded file's name with the extension\n * swapped, or `fallback` when the data was pasted in.\n */\nexport function exportFileName(\n location: FileLocation | undefined,\n extension: string,\n fallback = 'image',\n) {\n const loc = location as\n | { uri?: string; localPath?: string; name?: string }\n | undefined\n const path = loc?.uri ?? loc?.localPath ?? loc?.name\n const base = path\n ?.split(/[?#]/)[0]\n ?.split(/[/\\\\]/)\n .pop()\n ?.replace(/\\.[^.]*$/, '')\n return `${base || fallback}.${extension}`\n}\n", "import { packDomainLanes } from './components/msa/packDomainLanes.ts'\nimport { defaultFeaturePanelWidth } from './constants.ts'\nimport { featureField } from './featureFields.ts'\nimport { outlineColor } from './util.ts'\n\nimport type {\n Annotation,\n DomainBand,\n RowFeaturesSpec,\n RowPanelSpan,\n RowPanelSpec,\n} from './types.ts'\n\n// the fill of a span under a scale that gives its value no color, such as a\n// gene a `domain` of gene names leaves out\nconst UNSCALED_FEATURE = '#d9d9d9'\n\n// the fraction of a span a following one may cover before it takes a lane of\n// its own in a `features` panel\nconst laneOverlap = 0.1\n\n// a row panel's own width, or a default: the row height, which makes a strip\n// cell square, and a gene neighborhood's width for a features panel. The row\n// height is read only when used, so a panel with a width of its own does not\n// recompute on a vertical zoom\nexport function rowPanelWidth(\n panel: RowPanelSpec,\n view: { rowHeight: number },\n) {\n return (\n panel.width ??\n (panel.kind === 'features' ? defaultFeaturePanelWidth : view.rowHeight)\n )\n}\n\n// one row of the row table as the channels read it. A number or a boolean\n// reads as its string, the way a GFF value does, and null or an object drops\nexport function stringFields(row: unknown) {\n if (typeof row !== 'object' || row === null) {\n return undefined\n }\n const fields: Record<string, string> = {}\n for (const [field, value] of Object.entries(row)) {\n if (typeof value === 'string') {\n fields[field] = value\n } else if (typeof value === 'number' || typeof value === 'boolean') {\n fields[field] = String(value)\n }\n }\n return fields\n}\n\n// the color each row takes from a field of the row table under a scale\nexport function colorByRow(\n rowData: Record<string, Record<string, string> | undefined>,\n field: string,\n colorOf: (value: string) => string | undefined,\n) {\n const colors = new Map<string, string>()\n for (const [name, row] of Object.entries(rowData)) {\n const value = row?.[field]\n const color = value === undefined ? undefined : colorOf(value)\n if (color) {\n colors.set(name, color)\n }\n }\n return colors\n}\n\n// the fill and outline of every feature in a list: its own GFF `color=` first,\n// then the scale an encoding resolves over one of its fields, then the\n// accession palette\nexport function featureColorMap(\n annotations: Annotation[],\n encoding:\n | { field: string; colorOf: (value: string) => string | undefined }\n | undefined,\n fillPalette: Record<string, string>,\n) {\n const strokes = new Map<string, string>()\n const strokeOf = (fill: string) => {\n const hit = strokes.get(fill)\n if (hit !== undefined) {\n return hit\n }\n const stroke = outlineColor(fill)\n strokes.set(fill, stroke)\n return stroke\n }\n return new Map(\n annotations.map(annotation => {\n const value = encoding\n ? featureField(annotation, encoding.field)\n : undefined\n const fill =\n annotation.color ??\n (value === undefined ? undefined : encoding!.colorOf(value)) ??\n (encoding ? UNSCALED_FEATURE : fillPalette[annotation.accession]!)\n return [annotation, { fill, stroke: strokeOf(fill) }]\n }),\n )\n}\n\n// the text a label channel draws inside each span, for the features carrying\n// the field it names\nexport function featureLabelMap(annotations: Annotation[], field: string) {\n const labels = new Map<Annotation, string>()\n for (const annotation of annotations) {\n const value = featureField(annotation, field)\n if (value !== undefined) {\n labels.set(annotation, value)\n }\n }\n return labels\n}\n\n/** what `packDomainLanes` needs to lay a row out, before it has its lane */\ntype Unlaned = Omit<RowPanelSpan, 'lane' | 'laneCount'> & {\n startCol: number\n endCol: number\n}\n\n/**\n * Lanes for `position: \"strandpile\"`, gggenomes' `position_strandpile`: the\n * forward features stack above the line and the reverse below it, each strand\n * packing on its own. The deepest row on each side sets the grid every row lays\n * out on, so the line between the strands sits at one height down the panel and\n * a reader can scan it. A feature with no strand piles with the forward ones.\n */\nfunction strandpileLanes(\n rows: [string, Unlaned[]][],\n): Map<string, RowPanelSpan[]> {\n const piled = rows.map(([name, bands]) => {\n const reverse = packDomainLanes(\n bands.filter(b => b.annotation.strand === -1),\n )\n const forward = packDomainLanes(\n bands.filter(b => b.annotation.strand !== -1),\n )\n return { name, forward, reverse }\n })\n const up = Math.max(0, ...piled.map(p => p.forward[0]?.laneCount ?? 0))\n const down = Math.max(0, ...piled.map(p => p.reverse[0]?.laneCount ?? 0))\n const laneCount = up + down\n return new Map(\n piled.map(({ name, forward, reverse }) => [\n name,\n [\n // forward level 0 is the lane just above the line, stacking upward\n ...forward.map(b => ({ ...b, lane: up - 1 - b.lane, laneCount })),\n ...reverse.map(b => ({ ...b, lane: up + b.lane, laneCount })),\n ],\n ]),\n )\n}\n\n/** one row's spans laid out by the panel's `position` */\nfunction panelLanes(\n panel: RowFeaturesSpec,\n rows: [string, Unlaned[]][],\n): Map<string, RowPanelSpan[]> {\n return panel.position === 'strandpile'\n ? strandpileLanes(rows)\n : new Map(rows.map(([name, bands]) => [name, packDomainLanes(bands)]))\n}\n\n/**\n * The spans a `features` panel draws, keyed by row name and measured in the\n * panel's own pixels. `column` takes the bands the overlay draws, at the\n * alignment's column width. `position` packs each row's features in its own\n * residue positions, shifted by an `align` transform, and maps the extent they\n * cover across every row onto the panel width, so a row with no alignment\n * still has an x.\n */\nexport function featurePanelSpans({\n panel,\n width,\n colWidth,\n domainBands,\n annotationsByRow,\n shifts,\n}: {\n panel: RowFeaturesSpec\n width: number\n colWidth: number\n domainBands: Map<string, DomainBand[]>\n annotationsByRow: Record<string, Annotation[]>\n shifts: Map<string, number> | undefined\n}): Map<string, RowPanelSpan[]> {\n if (panel.x === 'column') {\n return panelLanes(\n panel,\n [...domainBands].map(([name, bands]) => [\n name,\n bands.map(band => ({\n ...band,\n xStart: band.startCol * colWidth,\n xEnd: band.endCol * colWidth,\n })),\n ]),\n )\n }\n const shifted = Object.entries(annotationsByRow).map(\n ([name, annotations]) => {\n const shift = shifts?.get(name) ?? 0\n return [\n name,\n annotations.map(annotation => ({\n annotation,\n start: annotation.start - 1 + shift,\n end: annotation.end + shift,\n })),\n ] as const\n },\n )\n let min = Infinity\n let max = -Infinity\n for (const [, features] of shifted) {\n for (const { start, end } of features) {\n min = Math.min(min, start)\n max = Math.max(max, end)\n }\n }\n // a gene arrow ends where its feature does, so the extent maps onto the whole\n // panel less the pixel the rightmost stroke needs\n const drawable = Math.max(1, width - 1)\n const scale = max > min ? drawable / (max - min) : 0\n // a lane opens where a span covers more than a tenth of the one before it,\n // which keeps the genes of an operon on one lane: adjacent genes commonly\n // share a few bases, and a stop codon overlapping the next start reads as a\n // second lane over the whole row\n return panelLanes(\n panel,\n shifted.map(([name, features]) => [\n name,\n features.map(({ annotation, start, end }) => ({\n annotation,\n xStart: (start - min) * scale,\n xEnd: (end - min) * scale,\n startCol: start,\n endCol: end - (end - start) * laneOverlap,\n })),\n ]),\n )\n}\n", "import type { Annotation, Feature } from './types.ts'\n\nconst placement = new Set(['row', 'start', 'end'])\n\n// The colors and labels are maps keyed by annotation, and a getter read\n// outside a reaction recomputes on every read. Caching on the frozen feature\n// gives it one annotation however often the layer converts.\nconst converted = new WeakMap<Feature, Annotation>()\n\n/**\n * The `features` layer as the annotations a GFF would parse to. Every field\n * but the placement is also an attribute, as a string like a GFF value, so an\n * encoding reads `type` or a host's own field the way it reads a GFF column 9\n * key.\n */\nexport function featuresToAnnotations(features: Feature[]): Annotation[] {\n return features.map(feature => {\n const cached = converted.get(feature)\n if (cached) {\n return cached\n }\n const annotation = featureAnnotation(feature)\n converted.set(feature, annotation)\n return annotation\n })\n}\n\nfunction featureAnnotation(feature: Feature): Annotation {\n const { row, start, end, name, description, type, strand, color } = feature\n const accession = name ?? `${row}:${start}-${end}`\n const attributes = Object.fromEntries(\n Object.entries(feature)\n .filter(([key, value]) => !placement.has(key) && value !== undefined)\n .map(([key, value]) => [key, String(value)]),\n )\n return {\n id: row,\n accession,\n name: name ?? accession,\n description: description ?? name ?? accession,\n featureType: type,\n start,\n end,\n strand: strand === '+' ? 1 : strand === '-' ? -1 : undefined,\n color,\n attributes,\n }\n}\n", "import { openLocation } from '@jbrowse/core/util/io'\nimport { addDisposer, isAlive } from '@jbrowse/mobx-state-tree'\nimport { autorun, transaction } from 'mobx'\n\nimport { fetchTextWithProgress, isAbortError } from './fetchUtils.ts'\n\nimport type { FetchStatus } from './fetchUtils.ts'\nimport type { FileLocation } from '@jbrowse/core/util/types'\nimport type { IStateTreeNode } from '@jbrowse/mobx-state-tree'\n\ninterface LoaderHost extends IStateTreeNode {\n setStatus: (status?: FetchStatus) => void\n setError: (error?: unknown) => void\n addWarning: (warning: string) => void\n}\n\ninterface FilehandleLoader {\n /** the layer's name in a failure message */\n what: string\n getFilehandle: () => FileLocation | undefined\n onLoad: (text: string) => void\n setLoading?: (loading: boolean) => void\n /** runs after a local file loads, since a blob has no URL to refetch, and on cancel */\n clearFilehandle?: () => void\n /** a failure adds a warning instead of an error */\n optional?: boolean\n}\n\n/**\n * Latest-wins abort rotation, after `createAbortRotation` in\n * jbrowse-components. Each `begin()` aborts the previous fetch and returns a\n * signal with an `isCurrent()` guard; gate every write after an await on it so a\n * superseded or torn-down fetch cannot overwrite fresher data. `end()` in the\n * `finally` closes the guard of a fetch that completed.\n */\nexport function createAbortRotation(self: IStateTreeNode) {\n let current: { controller: AbortController; ended: boolean } | undefined\n return {\n /** aborts the running fetch, and returns whether one was running */\n cancel() {\n const running = current !== undefined && !current.ended\n current?.controller.abort()\n current = undefined\n return running\n },\n begin() {\n current?.controller.abort()\n const mine = { controller: new AbortController(), ended: false }\n current = mine\n return {\n controller: mine.controller,\n isCurrent: () => !mine.ended && mine === current && isAlive(self),\n end() {\n mine.ended = true\n },\n }\n },\n }\n}\n\n/**\n * Fetches the filehandle whenever it changes and hands the text to `onLoad`. A\n * superseded or cleared request is aborted and clears its status line.\n */\nexport function installFilehandleLoader(\n self: LoaderHost,\n {\n what,\n getFilehandle,\n onLoad,\n setLoading,\n clearFilehandle,\n optional = false,\n }: FilehandleLoader,\n) {\n const rotation = createAbortRotation(self)\n const cancel = () => {\n if (rotation.cancel() && isAlive(self)) {\n self.setStatus(undefined)\n }\n }\n addDisposer(self, cancel)\n addDisposer(\n self,\n autorun(async () => {\n const filehandle = getFilehandle()\n cancel()\n if (!filehandle) {\n setLoading?.(false)\n return\n }\n const { controller, isCurrent, end } = rotation.begin()\n try {\n setLoading?.(true)\n if (!optional) {\n self.setError(undefined)\n }\n const text = await fetchTextWithProgress(\n openLocation(filehandle),\n status => {\n if (isCurrent()) {\n self.setStatus(status)\n }\n },\n { controller },\n )\n if (isCurrent()) {\n transaction(() => {\n onLoad(text)\n if (filehandle.locationType === 'BlobLocation') {\n clearFilehandle?.()\n }\n })\n }\n } catch (e) {\n if (isCurrent()) {\n if (isAbortError(e)) {\n clearFilehandle?.()\n } else {\n console.error(e)\n if (optional) {\n self.addWarning(`The ${what} did not load: ${e}`)\n } else {\n self.setError(e)\n }\n }\n }\n } finally {\n if (isCurrent()) {\n setLoading?.(false)\n }\n end()\n }\n }),\n )\n}\n", "import { fetchAndMaybeUnzipText } from '@jbrowse/core/util'\n\nimport type { RpcStatus } from '@jbrowse/core/util'\n\n/**\n * Extract the human-readable text from a status value, which core reports\n * either as a bare string or as a `{message, current, total}` progress object.\n *\n * Inlined rather than imported from `@jbrowse/core/util` on purpose:\n * `statusMessageText` is a recent core export, and in the UMD plugin build\n * `@jbrowse/core/util` is an external resolved against whatever core the host\n * jbrowse-web ships. Against an older host this import lands as `undefined` and\n * every download tick throws `statusMessageText is not a function`. Keeping the\n * one-liner local makes the viewer work on old and new hosts alike.\n */\nfunction statusMessageText(status: RpcStatus | undefined) {\n return typeof status === 'string' ? status : status?.message\n}\n\nexport interface FetchStatus {\n msg: string\n onCancel?: () => void\n}\n\ntype Filehandle = Parameters<typeof fetchAndMaybeUnzipText>[0]\n\ntype ProgressFetcher = (\n loc: Filehandle,\n opts: { signal: AbortSignal; statusCallback: (status: RpcStatus) => void },\n) => Promise<string>\n\n/**\n * Fetch text from a filehandle while reporting download/unzip progress through\n * setStatus, and wiring a Cancel handler that aborts the underlying request.\n * The status is always cleared once the fetch settles. The fetcher is injectable\n * for testing, and so is the AbortController: a caller that can supersede its\n * own request -- the model's loaders, when the filehandle changes under them --\n * holds one and aborts the download it no longer wants.\n */\nexport async function fetchTextWithProgress(\n loc: Filehandle,\n setStatus: (status?: FetchStatus) => void,\n {\n fetcher = fetchAndMaybeUnzipText,\n controller = new AbortController(),\n }: { fetcher?: ProgressFetcher; controller?: AbortController } = {},\n) {\n try {\n return await fetcher(loc, {\n signal: controller.signal,\n statusCallback: status => {\n const msg = statusMessageText(status)\n setStatus(\n msg\n ? {\n msg,\n onCancel: () => {\n controller.abort()\n },\n }\n : undefined,\n )\n },\n })\n } finally {\n setStatus(undefined)\n }\n}\n\nexport function isAbortError(e: unknown) {\n return e instanceof DOMException && e.name === 'AbortError'\n}\n", "import { types } from '@jbrowse/mobx-state-tree'\n\nimport { maxInlineSnapshotBytes } from '../constants.ts'\n\n/**\n * #stateModel DataModel\n * the data stored for the model. this is sometimes temporary in the case that\n * e.g. msaFilehandle is available on the parent model, because then the msa\n * data will not be persisted in saved session snapshots, it will be fetched\n * from msaFilehandle at startup\n */\nexport function DataModelF(maxInlineBytes = maxInlineSnapshotBytes) {\n return types\n .model({\n /**\n * #property\n */\n tree: types.maybe(types.string),\n /**\n * #property\n */\n msa: types.maybe(types.string),\n /**\n * #property\n */\n treeMetadata: types.maybe(types.string),\n /**\n * #property\n */\n gff: types.maybe(types.string),\n })\n .actions(self => ({\n /**\n * #action\n */\n setTree(tree?: string) {\n self.tree = tree\n },\n /**\n * #action\n */\n setMSA(msa?: string) {\n self.msa = msa\n },\n /**\n * #action\n */\n setTreeMetadata(treeMetadata?: string) {\n self.treeMetadata = treeMetadata\n },\n /**\n * #action\n */\n setGFF(gff?: string) {\n self.gff = gff\n },\n }))\n .postProcessSnapshot(snap =>\n // drops any field over maxInlineBytes; the parent model's\n // `unshareableData` reports what was dropped\n Object.fromEntries(\n Object.entries(snap).map(([key, text]) => [\n key,\n text && text.length > maxInlineBytes ? undefined : text,\n ]),\n ),\n )\n}\n", "import { types } from '@jbrowse/mobx-state-tree'\n\nimport type { DialogComponentType } from '@jbrowse/core/util'\n\n/**\n * #stateModel DialogQueueSessionMixin\n */\nexport function DialogQueueSessionMixin() {\n return types\n .model('DialogQueueSessionMixin', {})\n .volatile(() => ({\n queueOfDialogs: [] as [DialogComponentType, any][],\n }))\n .views(self => ({\n /**\n * #getter\n */\n get DialogComponent() {\n return self.queueOfDialogs[0]?.[0]\n },\n /**\n * #getter\n */\n get DialogProps() {\n return self.queueOfDialogs[0]?.[1]\n },\n }))\n .actions(self => ({\n /**\n * #action\n */\n removeActiveDialog() {\n self.queueOfDialogs = self.queueOfDialogs.slice(1)\n },\n /**\n * #action\n */\n queueDialog(\n cb: (doneCallback: () => void) => [DialogComponentType, unknown],\n ) {\n const [component, props] = cb(() => {\n this.removeActiveDialog()\n })\n self.queueOfDialogs = [...self.queueOfDialogs, [component, props]]\n },\n }))\n}\n", "import { types } from '@jbrowse/mobx-state-tree'\n\nimport {\n defaultBgColor,\n defaultColorSchemeName,\n defaultShowColumnStats,\n} from '../constants.ts'\nimport { stripDefault } from '../stripDefault.ts'\n\nimport type { MSAFormat } from 'msa-parsers'\n\nconst msaFormats: MSAFormat[] = ['stockholm', 'a3m', 'fasta', 'emf', 'clustal']\n\n/**\n * #stateModel MSAModel\n */\nexport function MSAModelF() {\n return types\n .model({\n /**\n * #property\n * draw MSA tiles with a background color\n */\n bgColor: stripDefault(types.boolean, defaultBgColor),\n\n /**\n * #property\n * default color scheme name\n */\n colorSchemeName: stripDefault(types.string, defaultColorSchemeName),\n\n /**\n * #property\n * a color per residue letter, which replaces the `colorSchemeName` table\n * while set. A letter the map leaves out takes no color\n */\n customColorScheme: types.frozen<Record<string, string> | undefined>(),\n\n /**\n * #property\n * show a tooltip with the hovered column's value for a track while\n * hovering that track: the conservation scores, the logo's composition,\n * an arc's partner columns\n */\n showColumnStats: stripDefault(types.boolean, defaultShowColumnStats),\n\n /**\n * #property\n * force the MSA data to be parsed as a specific format instead of relying\n * on auto-detection (which is ambiguous between e.g. fasta and a3m)\n */\n msaFormat: types.maybe(\n types.enumeration<MSAFormat>('MSAFormat', msaFormats),\n ),\n })\n .actions(self => ({\n /**\n * #action\n * pick a scheme from the built-in table, which clears\n * `customColorScheme`\n */\n setColorSchemeName(name: string) {\n self.colorSchemeName = name\n self.customColorScheme = undefined\n },\n\n /**\n * #action\n * color residues from a map of letter to color, or pass undefined to\n * return to `colorSchemeName`\n */\n setCustomColorScheme(map?: Record<string, string>) {\n self.customColorScheme = map\n },\n\n /**\n * #action\n */\n setBgColor(arg: boolean) {\n self.bgColor = arg\n },\n\n /**\n * #action\n */\n setShowColumnStats(arg: boolean) {\n self.showColumnStats = arg\n },\n\n /**\n * #action\n * force a specific MSA parser, or pass undefined to auto-detect\n */\n setMSAFormat(arg?: MSAFormat) {\n self.msaFormat = arg\n },\n }))\n}\n", "import { types } from '@jbrowse/mobx-state-tree'\n\nimport type {\n IAnyType,\n IOptionalIType,\n OptionalDefaultValueOrFunction,\n} from '@jbrowse/mobx-state-tree'\n\n/**\n * `types.stripDefault`, degrading to `types.optional` on hosts that lack it.\n *\n * stripDefault keeps defaulted properties out of snapshots, and only the\n * mobx-state-tree in unreleased @jbrowse/core has it. The plugin bundle\n * externalizes mobx-state-tree, so the host's copy is known only at runtime, and\n * calling a missing stripDefault during model construction makes PluginLoader\n * reject and the whole app show its error page.\n *\n * The signatures are identical; on older hosts, defaults reappear in snapshots\n * and shared URLs. stripDefaultSnapshot.test.ts pins the stripped behaviour.\n */\nexport function stripDefault<IT extends IAnyType>(\n type: IT,\n defaultValue: OptionalDefaultValueOrFunction<IT>,\n): IOptionalIType<IT, [undefined]> {\n return typeof types.stripDefault === 'function'\n ? types.stripDefault(type, defaultValue)\n : types.optional(type, defaultValue)\n}\n", "import { types } from '@jbrowse/mobx-state-tree'\n\nimport {\n defaultDrawLabels,\n defaultDrawNodeBubbles,\n defaultDrawNodeLabels,\n defaultDrawTree,\n defaultLabelsAlignRight,\n defaultOverviewHeight,\n defaultShowBranchLen,\n defaultTreeOrder,\n defaultShowTreeOverview,\n defaultShowTreeScaleBar,\n treeOrders,\n} from '../constants.ts'\nimport { stripDefault } from '../stripDefault.ts'\n\nimport type { TreeOrder } from '../types.ts'\n\n/**\n * #stateModel Tree\n */\nexport function TreeModelF() {\n return types\n .model({\n /**\n * #property\n */\n drawLabels: stripDefault(types.boolean, defaultDrawLabels),\n /**\n * #property\n * right-align the labels\n */\n labelsAlignRight: stripDefault(types.boolean, defaultLabelsAlignRight),\n\n /**\n * #property\n * width of the area the tree and its labels draw in, px. Undefined fits\n * the area to the labels and the tree; `effectiveTreeAreaWidth` reads\n * the width either way\n */\n treeAreaWidth: types.maybe(types.number),\n\n /**\n * #property\n * width of the tree within the tree area, px. Undefined gives the tree\n * the area less the labels; `effectiveTreeWidth` reads the width either\n * way\n */\n treeWidth: types.maybe(types.number),\n\n /**\n * #property\n * use \"branch length\" e.g. evolutionary distance to draw tree branch\n * lengths. if false, the layout is a \"cladogram\" that does not take into\n * account evolutionary distances\n */\n showBranchLen: stripDefault(types.boolean, defaultShowBranchLen),\n\n /**\n * #property\n * the order each node's children draw in: `branchLength` (shortest\n * first), `input` (as the file gives them), `ladderize` (fewest tips\n * first) or `ladderizeReverse` (most tips first)\n */\n treeOrder: stripDefault(\n types.enumeration<TreeOrder>('TreeOrder', [...treeOrders]),\n defaultTreeOrder,\n ),\n\n /**\n * #property\n * draw tree, boolean\n */\n drawTree: stripDefault(types.boolean, defaultDrawTree),\n\n /**\n * #property\n * draw node bubbles on the tree; the branches stay clickable either way\n */\n drawNodeBubbles: stripDefault(types.boolean, defaultDrawNodeBubbles),\n\n /**\n * #property\n * draw the label a newick file gives an internal node, which is where a\n * bootstrap or posterior support value lands\n */\n drawNodeLabels: stripDefault(types.boolean, defaultDrawNodeLabels),\n\n /**\n * #property\n * draw the whole tree small above the tree panel, with the focused\n * subtree boxed. A click on it focuses the subtree under the pointer\n */\n showTreeOverview: stripDefault(types.boolean, defaultShowTreeOverview),\n\n /**\n * #property\n * draw the branch-length scale bar above the tree of a phylogram\n */\n showTreeScaleBar: stripDefault(types.boolean, defaultShowTreeScaleBar),\n\n /**\n * #property\n * height of the tree overview band, px\n */\n overviewHeight: stripDefault(types.number, defaultOverviewHeight),\n })\n .actions(self => ({\n /**\n * #action\n * set the tree area width, px, or undefined to fit it to the labels and\n * the tree. The tree then fills the area less the labels\n */\n setTreeAreaWidth(n: number | undefined) {\n self.treeAreaWidth = n === undefined ? undefined : Math.round(n)\n self.treeWidth = undefined\n },\n /**\n * #action\n * set the tree width, px, or undefined to fill the tree area less the\n * labels\n */\n setTreeWidth(n: number | undefined) {\n self.treeWidth = n === undefined ? undefined : Math.round(n)\n },\n\n /**\n * #action\n */\n setLabelsAlignRight(arg: boolean) {\n self.labelsAlignRight = arg\n },\n /**\n * #action\n */\n setDrawTree(arg: boolean) {\n self.drawTree = arg\n },\n\n /**\n * #action\n */\n setShowBranchLen(arg: boolean) {\n self.showBranchLen = arg\n },\n\n /**\n * #action\n */\n setTreeOrder(order: TreeOrder) {\n self.treeOrder = order\n },\n\n /**\n * #action\n */\n setDrawNodeBubbles(arg: boolean) {\n self.drawNodeBubbles = arg\n },\n /**\n * #action\n */\n setDrawNodeLabels(arg: boolean) {\n self.drawNodeLabels = arg\n },\n /**\n * #action\n */\n setShowTreeOverview(arg: boolean) {\n self.showTreeOverview = arg\n },\n /**\n * #action\n */\n setShowTreeScaleBar(arg: boolean) {\n self.showTreeScaleBar = arg\n },\n /**\n * #action\n */\n setDrawLabels(arg: boolean) {\n self.drawLabels = arg\n },\n }))\n}\n", "// BLOSUM62 (Henikoff & Henikoff 1992), shared by the neighbor-joining tree and\n// the blosum62_dynamic color scheme\n\n// prettier-ignore\nconst BLOSUM62_KEYS = 'ARNDCQEGHILKMFPSTWYVBZX*'\n// prettier-ignore\nconst BLOSUM62_DATA = [\n [ 4,-1,-2,-2, 0,-1,-1, 0,-2,-1,-1,-1,-1,-2,-1, 1, 0,-3,-2, 0,-2,-1, 0,-4],\n [-1, 5, 0,-2,-3, 1, 0,-2, 0,-3,-2, 2,-1,-3,-2,-1,-1,-3,-2,-3,-1, 0,-1,-4],\n [-2, 0, 6, 1,-3, 0, 0, 0, 1,-3,-3, 0,-2,-3,-2, 1, 0,-4,-2,-3, 3, 0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,-1,-2,-1, 1, 5,-2,-2, 0,-1,-1, 0,-4],\n [-3,-3,-4,-4,-2,-2,-3,-2,-2,-3,-2,-3,-1, 1,-4,-3,-2,11, 2,-3,-4,-3,-2,-4],\n [-2,-2,-2,-3,-2,-1,-2,-3, 2,-1,-1,-2,-1, 3,-3,-2,-2, 2, 7,-1,-3,-2,-1,-4],\n [ 0,-3,-3,-3,-1,-2,-2,-3,-3, 3, 1,-2, 1,-1,-2,-2, 0,-3,-1, 4,-3,-2,-1,-4],\n [-2,-1, 3, 4,-3, 0, 1,-1, 0,-3,-4, 0,-3,-3,-2, 0,-1,-4,-3,-3, 4, 1,-1,-4],\n [-1, 0, 0, 1,-3, 3, 4,-2, 0,-3,-3, 1,-1,-3,-1, 0,-1,-3,-2,-2, 1, 4,-1,-4],\n [ 0,-1,-1,-1,-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-2, 0, 0,-2,-1,-1,-1,-1,-1,-4],\n [-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4, 1],\n]\n\nexport const NUM_SYMBOLS = BLOSUM62_KEYS.length\nexport const BLOSUM62 = Int8Array.from(BLOSUM62_DATA.flat())\n\n// charCode -> row/column in BLOSUM62, -1 for anything the matrix does not name.\n// On a 120x800 alignment a Map keyed by upper-cased character took 2.6s to\n// build a tree, against 0.34s for this table.\nexport const symbolOfCode = new Int8Array(128).fill(-1)\nfor (let i = 0; i < NUM_SYMBOLS; i++) {\n const key = BLOSUM62_KEYS[i]!\n symbolOfCode[key.charCodeAt(0)] = i\n symbolOfCode[key.toLowerCase().charCodeAt(0)] = i\n}\n", "// Neighbor Joining tree construction using BLOSUM62 distances\n// Based on Saitou & Nei (1987) \"The neighbor-joining method\"\n\nimport { BLOSUM62, NUM_SYMBOLS, symbolOfCode } from './blosum62.ts'\n\n// gap, or past the end of a row shorter than the alignment\nconst GAP = -2\n\n// stockholm and a3m also write gaps as '.'\nfunction symbolAt(seq: string, i: number) {\n if (i >= seq.length) {\n return GAP\n }\n const code = seq.charCodeAt(i)\n // bit trick: (code - 45) >>> 0 <= 1 checks for '-' (45) or '.' (46)\n if ((code - 45) >>> 0 <= 1) {\n return GAP\n }\n return code < 128 ? symbolOfCode[code]! : -1\n}\n\nfunction blosumScore(a: number, b: number) {\n return a < 0 || b < 0 ? -4 : BLOSUM62[a * NUM_SYMBOLS + b]!\n}\n\nfunction computePairwiseDistance(seq1: string, seq2: string) {\n // a3m and hand-edited fasta produce short rows; past its end a row counts as\n // gapped, as in the model's `blanks` getter\n const len = Math.max(seq1.length, seq2.length)\n let compared = 0\n let totalScore = 0\n let maxPossibleScore = 0\n\n for (let i = 0; i < len; i++) {\n const a = symbolAt(seq1, i)\n const b = symbolAt(seq2, i)\n\n const aGap = a === GAP\n const bGap = b === GAP\n if (aGap && bGap) {\n continue\n }\n\n compared++\n if (aGap || bGap) {\n continue\n }\n\n totalScore += blosumScore(a, b)\n maxPossibleScore += Math.max(blosumScore(a, a), blosumScore(b, b))\n }\n\n if (compared === 0) {\n return 1\n }\n\n if (maxPossibleScore <= 0) {\n return 1\n }\n\n const normalizedScore = totalScore / maxPossibleScore\n const clampedScore = Math.max(0.01, Math.min(1, normalizedScore))\n\n // Kimura-like correction: d = -ln(similarity)\n return -Math.log(clampedScore)\n}\n\nfunction computeDistanceMatrix(rows: readonly [string, string][]) {\n const n = rows.length\n const distances: number[][] = []\n\n for (let i = 0; i < n; i++) {\n distances[i] = []\n for (let j = 0; j < n; j++) {\n if (i === j) {\n distances[i]![j] = 0\n } else if (j < i) {\n distances[i]![j] = distances[j]![i]!\n } else {\n distances[i]![j] = computePairwiseDistance(rows[i]![1], rows[j]![1])\n }\n }\n }\n\n return distances\n}\n\ninterface NJNode {\n name?: string\n left?: NJNode\n right?: NJNode\n leftLength?: number\n rightLength?: number\n}\n\nfunction neighborJoining(distances: number[][], names: string[]): NJNode {\n const n = distances.length\n if (n < 2) {\n return { name: names[0] }\n }\n if (n === 2) {\n const d = distances[0]![1]!\n return {\n left: { name: names[0] },\n right: { name: names[1] },\n leftLength: d / 2,\n rightLength: d / 2,\n }\n }\n\n const D: number[][] = []\n for (let i = 0; i < n; i++) {\n D[i] = [...distances[i]!]\n }\n const nodes: (NJNode | undefined)[] = names.map(name => ({ name }))\n\n let remaining = n\n\n while (remaining > 2) {\n const active: number[] = []\n for (let i = 0; i < nodes.length; i++) {\n if (nodes[i] !== undefined) {\n active.push(i)\n }\n }\n\n const r = new Map<number, number>()\n for (const i of active) {\n let sum = 0\n for (const j of active) {\n if (i !== j) {\n sum += D[i]![j]!\n }\n }\n r.set(i, sum)\n }\n\n let minQ = Infinity\n let minI = -1\n let minJ = -1\n\n for (let ai = 0; ai < active.length; ai++) {\n for (let aj = ai + 1; aj < active.length; aj++) {\n const i = active[ai]!\n const j = active[aj]!\n const q = (remaining - 2) * D[i]![j]! - r.get(i)! - r.get(j)!\n\n if (q < minQ) {\n minQ = q\n minI = i\n minJ = j\n }\n }\n }\n\n const dij = D[minI]![minJ]!\n const ri = r.get(minI)!\n const rj = r.get(minJ)!\n\n let limbI = dij / 2 + (ri - rj) / (2 * (remaining - 2))\n let limbJ = dij - limbI\n\n limbI = Math.max(0, limbI)\n limbJ = Math.max(0, limbJ)\n\n const newNode: NJNode = {\n left: nodes[minI],\n right: nodes[minJ],\n leftLength: limbI,\n rightLength: limbJ,\n }\n\n // the merged node reuses minI's slot\n for (const k of active) {\n if (k !== minI && k !== minJ) {\n const newDist = (D[minI]![k]! + D[minJ]![k]! - dij) / 2\n D[minI]![k] = Math.max(0, newDist)\n D[k]![minI] = Math.max(0, newDist)\n }\n }\n\n nodes[minJ] = undefined\n nodes[minI] = newNode\n\n remaining--\n }\n\n const finalActive: number[] = []\n for (let i = 0; i < nodes.length; i++) {\n if (nodes[i] !== undefined) {\n finalActive.push(i)\n }\n }\n\n if (finalActive.length === 2) {\n const i = finalActive[0]!\n const j = finalActive[1]!\n const d = D[i]![j]!\n return {\n left: nodes[i],\n right: nodes[j],\n leftLength: d / 2,\n rightLength: d / 2,\n }\n }\n\n return nodes[finalActive[0]!]!\n}\n\nfunction withBranchLength(newick: string, branchLength?: number) {\n return branchLength === undefined\n ? newick\n : `${newick}:${branchLength.toFixed(6)}`\n}\n\n// iterative: an NJ tree of N leaves can be a caterpillar of depth ~N\nfunction nodeToNewick(root: NJNode): string {\n const postOrder: NJNode[] = []\n const stack: NJNode[] = [root]\n while (stack.length > 0) {\n const node = stack.pop()!\n postOrder.push(node)\n if (node.left) {\n stack.push(node.left)\n }\n if (node.right) {\n stack.push(node.right)\n }\n }\n\n const newickByNode = new Map<NJNode, string>()\n for (let i = postOrder.length - 1; i >= 0; i--) {\n const node = postOrder[i]!\n if (node.name !== undefined && !node.left && !node.right) {\n newickByNode.set(node, `'${node.name.replaceAll(\"'\", \"''\")}'`)\n } else {\n const left = node.left\n ? withBranchLength(newickByNode.get(node.left)!, node.leftLength)\n : ''\n const right = node.right\n ? withBranchLength(newickByNode.get(node.right)!, node.rightLength)\n : ''\n newickByNode.set(node, `(${left},${right})`)\n }\n }\n return newickByNode.get(root)!\n}\n\nexport function calculateNeighborJoiningTree(\n rows: readonly [string, string][],\n) {\n if (rows.length < 2) {\n throw new Error('Need at least 2 sequences to build a tree')\n }\n\n const names = rows.map(r => r[0])\n const distances = computeDistanceMatrix(rows)\n const tree = neighborJoining(distances, names)\n\n return nodeToNewick(tree) + ';'\n}\n", "import { numResidueSlots, residueSlotOfLetter } from './columnCounts.ts'\n\nimport type { ColumnCounts } from './columnCounts.ts'\n\n// Disjoint physicochemical classes for the 20 standard amino acids. Property\n// conservation asks a different question than identity conservation: a column\n// can vary in exact residue yet stay within one property class (a conservative\n// substitution), which often marks a functionally constrained site that plain\n// identity conservation reports as variable.\n//\n// Histidine is grouped with the aromatics (it is only weakly/conditionally\n// positive at physiological pH); this mirrors common substitution-class schemes.\nconst aminoPropertyClass: Record<string, string> = {\n A: 'hydrophobic',\n V: 'hydrophobic',\n L: 'hydrophobic',\n I: 'hydrophobic',\n M: 'hydrophobic',\n C: 'hydrophobic',\n F: 'aromatic',\n W: 'aromatic',\n Y: 'aromatic',\n H: 'aromatic',\n K: 'positive',\n R: 'positive',\n D: 'negative',\n E: 'negative',\n S: 'polar',\n T: 'polar',\n N: 'polar',\n Q: 'polar',\n G: 'special',\n P: 'special',\n}\n\nconst propertyClasses = [...new Set(Object.values(aminoPropertyClass))]\nconst maxPropertyEntropy = Math.log2(propertyClasses.length)\n\n// residue slot -> index into propertyClasses (-1 for residues with no class,\n// e.g. X or '*'), so the per-column tally needs no string lookups\nconst classOfSlot = new Int8Array(numResidueSlots).fill(-1)\nfor (const [letter, cls] of Object.entries(aminoPropertyClass)) {\n classOfSlot[residueSlotOfLetter(letter)] = propertyClasses.indexOf(cls)\n}\n\n/**\n * Per-column property conservation using Shannon entropy over physicochemical\n * classes rather than exact residues. Returns 0-1 where 1 = every non-gap\n * residue shares one property class. Mirrors the identity-conservation formula\n * so the two tracks are directly comparable: (1 - H/Hmax) * (1 - gapFraction).\n */\nexport function calculatePropertyConservation(counts: ColumnCounts) {\n const classCounts = new Float64Array(propertyClasses.length)\n return Array.from({ length: counts.numColumns }, (_, col) => {\n const total = counts.total(col)\n let score = 0\n if (total) {\n classCounts.fill(0)\n let nonGapTotal = 0\n counts.forEachResidue(col, (slot, count) => {\n const cls = classOfSlot[slot]!\n if (cls >= 0) {\n classCounts[cls]! += count\n nonGapTotal += count\n }\n })\n if (nonGapTotal > 0) {\n let entropy = 0\n for (const count of classCounts) {\n if (count > 0) {\n const freq = count / nonGapTotal\n entropy -= freq * Math.log2(freq)\n }\n }\n const gapFraction = (total - nonGapTotal) / total\n score =\n Math.max(0, 1 - entropy / maxPropertyEntropy) * (1 - gapFraction)\n }\n }\n return score\n })\n}\n", "/**\n * Rerooting over the plain node `parseNewick` produces, the shape\n * `@gmod/newick` and jbrowse-components' tree sidebar share, so these can move\n * into that package unchanged.\n *\n * Every traversal is iterative, for the reason the ones in `@gmod/newick` are: a\n * caterpillar tree is as deep as it has leaves, and recursion overflows the\n * stack past about 5000 of them.\n */\nexport interface TreeNode {\n name?: string\n length?: number\n children?: TreeNode[]\n}\n\nexport function preorder<N extends TreeNode>(root: N, parents?: Map<N, N>) {\n const order: N[] = []\n const stack = [root]\n while (stack.length > 0) {\n const node = stack.pop()!\n order.push(node)\n for (const child of (node.children ?? []) as N[]) {\n parents?.set(child, node)\n stack.push(child)\n }\n }\n return order\n}\n\nfunction hasLengths(order: TreeNode[]) {\n return order.some(n => n.length !== undefined)\n}\n\n// the root's two children make one branch of the unrooted tree, which is the\n// branch a rerooting at either of them splits\nfunction mergedSibling<N extends TreeNode>(root: N, target: N) {\n return root.children?.length === 2\n ? (root.children.find(c => c !== target) as N | undefined)\n : undefined\n}\n\n/**\n * The tree rooted on the branch above `target`, `offset` up from it, or at the\n * middle of that branch without one. Where the root has two children, their\n * branches are one branch of the unrooted tree, and `offset` runs across both.\n *\n * The nodes between `target` and the old root turn over. A name on one of them\n * labels the branch above it, which is where a support value sits, so the name\n * follows that branch to the node now at its lower end. A two-child root has\n * nothing left to split once one child leaves, so it drops out and its\n * branches join.\n */\nexport function rerootTree<N extends TreeNode>(\n root: N,\n target: N,\n offset?: number,\n): TreeNode {\n const parents = new Map<N, N>()\n const order = preorder(root, parents)\n if (!parents.has(target)) {\n return root\n }\n const lengths = hasLengths(order)\n const sibling =\n parents.get(target) === root ? mergedSibling(root, target) : undefined\n const branch = (target.length ?? 0) + (sibling?.length ?? 0)\n const at = Math.min(Math.max(offset ?? branch / 2, 0), branch)\n const length = (n: number) => (lengths ? n : undefined)\n\n const path = [target]\n for (let n = parents.get(target); n; n = parents.get(n)) {\n path.push(n)\n }\n // Built from the old root down, so the node each turned node now hangs\n // `above` it already exists. undefined where the old root dropped out.\n let above: TreeNode | undefined\n for (let i = path.length - 1; i >= 1; i--) {\n const node = path[i]!\n const below = path[i - 1]!\n const children = node.children!.filter(c => c !== below)\n if (above) {\n children.push(above)\n }\n if (children.length === 0) {\n above = undefined\n } else if (i === path.length - 1 && children.length === 1) {\n const only = children[0]!\n above = {\n ...only,\n length: length(\n (only.length ?? 0) + (below.length ?? 0) - (i === 1 ? at : 0),\n ),\n }\n } else {\n above = {\n ...node,\n name: i === 1 ? undefined : below.name,\n children,\n length: length((below.length ?? 0) - (i === 1 ? at : 0)),\n }\n }\n }\n return {\n children: [{ ...target, length: length(at) }, ...(above ? [above] : [])],\n }\n}\n\n/**\n * The tree rooted halfway along the longest path between two tips, which is\n * where a clock would put the root: the usual choice for the unrooted tree\n * FastTree, IQ-TREE or neighbor joining writes. A tree with no branch lengths\n * counts branches.\n */\nexport function midpointRoot<N extends TreeNode>(root: N): TreeNode {\n const parents = new Map<N, N>()\n const order = preorder(root, parents)\n const tips = order.filter(n => !n.children?.length)\n if (tips.length < 2) {\n return root\n }\n const lengths = hasLengths(order)\n const weight = (n: N) => (lengths ? (n.length ?? 0) : 1)\n\n // distance from `from` to every node over the unrooted tree, and the\n // neighbor each was reached through\n function reach(from: N) {\n const dist = new Map<N, number>([[from, 0]])\n const via = new Map<N, N>()\n const stack = [from]\n while (stack.length > 0) {\n const node = stack.pop()!\n const d = dist.get(node)!\n const parent = parents.get(node)\n if (parent && !dist.has(parent)) {\n dist.set(parent, d + weight(node))\n via.set(parent, node)\n stack.push(parent)\n }\n for (const child of (node.children ?? []) as N[]) {\n if (!dist.has(child)) {\n dist.set(child, d + weight(child))\n via.set(child, node)\n stack.push(child)\n }\n }\n }\n return { dist, via }\n }\n function farthest(dist: Map<N, number>) {\n return tips.reduce((best, tip) =>\n dist.get(tip)! > dist.get(best)! ? tip : best,\n )\n }\n\n const a = farthest(reach(tips[0]!).dist)\n const { dist, via } = reach(a)\n const b = farthest(dist)\n if (b === a) {\n return root\n }\n const half = dist.get(b)! / 2\n let node = b\n let next = via.get(node)!\n while (dist.get(next)! > half) {\n node = next\n next = via.get(node)!\n }\n // the midpoint lies on the branch between `node` and `next`, and whichever\n // of them is the child carries that branch\n return parents.get(node) === next\n ? rerootTree(root, node, dist.get(node)! - half)\n : rerootTree(root, next, half - dist.get(next)!)\n}\n", "/**\n * MSA Coordinate Systems:\n *\n * 1. **Global Column (globalCol)**: The column index in the full, unfiltered MSA.\n * Range: 0 to (MSA width - 1)\n * This is the \"true\" column position before any gap-hiding is applied.\n *\n * 2. **Visible Column (visibleCol)**: The column index after hiding gappy columns.\n * Range: 0 to (numColumns - 1) where numColumns = MSA width - blanks.length\n * This is what the user sees on screen when \"Hide columns w/ N% gaps\" is enabled.\n * When gap hiding is disabled, visibleCol === globalCol.\n *\n * 3. **Sequence Position (seqPos)**: The position within a specific row's ungapped sequence.\n * Range: 0 to (ungapped sequence length - 1)\n * This counts only non-gap characters ('-' and '.' are gaps).\n * Each row can have different seqPos values for the same globalCol due to gaps.\n */\n\n/**\n * Index of the first element in `[0, len)` for which `pred` holds, over a range\n * where `pred` is false up to some point and true from there on. Both\n * conversions below are that shape, since `blanks` is sorted ascending.\n */\nfunction partitionPoint(len: number, pred: (i: number) => boolean) {\n let left = 0\n let right = len\n while (left < right) {\n const mid = (left + right) >>> 1\n if (pred(mid)) {\n right = mid\n } else {\n left = mid + 1\n }\n }\n return left\n}\n\n/**\n * Convert a visible column index to a global column index.\n * This is used when translating mouse/screen coordinates to MSA coordinates.\n *\n * @param blanks - Sorted array of global column indices that are hidden\n * @param visibleCol - The visible column index (what the user sees on screen)\n * @returns The corresponding global column index in the full MSA\n */\nexport function visibleColToGlobalCol(blanks: number[], visibleCol: number) {\n // `blanks[i] - i` counts the visible columns before the i-th blank, so the\n // first blank with more than visibleCol of them in front of it is the first\n // one sitting past this column. Its index is how many blanks shift it right.\n return (\n visibleCol + partitionPoint(blanks.length, i => blanks[i]! - i > visibleCol)\n )\n}\n\n/**\n * Convert a global column index to a visible column index.\n * This is the inverse of visibleColToGlobalCol.\n *\n * @param blanks - Sorted array of global column indices that are hidden\n * @param globalCol - The global column index in the full MSA\n * @returns The visible column index, or undefined if the column is hidden\n */\nexport function globalColToVisibleCol(\n blanks: number[],\n globalCol: number,\n): number | undefined {\n const blanksBefore = countBlanksBefore(blanks, globalCol)\n return blanks[blanksBefore] === globalCol\n ? undefined // Column is hidden\n : globalCol - blanksBefore\n}\n\nfunction countBlanksBefore(blanks: number[], globalCol: number) {\n return partitionPoint(blanks.length, i => blanks[i]! >= globalCol)\n}\n\n/**\n * How many visible columns come before a global column. For a visible column\n * that is its own visible index; for a hidden one it is the index of the next\n * visible column, i.e. where the hidden column collapses to.\n *\n * Spans use this, since globalColToVisibleCol drops a span whenever either end\n * lands in a hidden column.\n *\n * @param blanks - Sorted array of global column indices that are hidden\n * @param globalCol - The global column index in the full MSA\n */\nexport function visibleColsBefore(blanks: number[], globalCol: number) {\n return globalCol - countBlanksBefore(blanks, globalCol)\n}\n\n/**\n * The ungapped position a row holds at a global column, or undefined when that\n * column is a gap in the row or past its end.\n *\n * Binary-searches the row's ascending seqPos index; it runs on every mouse\n * move, and scanning a 30k-column row per event takes the whole frame.\n *\n * @param index - The row's seqPos -> global column index (buildSeqPosIndex)\n * @param globalCol - The global column index in the full MSA\n */\nexport function seqPosOfGlobalCol(\n index: Int32Array | undefined,\n globalCol: number,\n) {\n if (!index) {\n return undefined\n }\n const seqPos = partitionPoint(index.length, i => index[i]! >= globalCol)\n return index[seqPos] === globalCol ? seqPos : undefined\n}\n", "// copied from jbrowse-components packages/core/src/util/groupKeys.ts, which\n// @jbrowse/core 5.0.0-beta.9 ships but the hosts the plugin runs on do not\n\nconst NUMERIC = /^-?\\d+(\\.\\d+)?$/\nconst DIGIT_RUNS = /\\d+|\\D+/g\n\nfunction compareRuns(a: string, b: string) {\n const runsA = a.match(DIGIT_RUNS) ?? []\n const runsB = b.match(DIGIT_RUNS) ?? []\n const shared = Math.min(runsA.length, runsB.length)\n for (let i = 0; i < shared; i++) {\n const x = runsA[i]!\n const y = runsB[i]!\n if (x === y) {\n continue\n }\n if (/^\\d/.test(x) && /^\\d/.test(y)) {\n const nx = Number(x)\n const ny = Number(y)\n if (nx !== ny) {\n return nx < ny ? -1 : 1\n }\n return x.length < y.length ? -1 : 1\n }\n return x < y ? -1 : 1\n }\n return runsA.length - runsB.length\n}\n\n/**\n * Numbers first by value, then every other value run by run with digit runs\n * by magnitude, so `2` before `10`, `chr2` before `chr10` and `2.3.2.1a`\n * before `2.3.4.4b`. The empty value sorts last.\n */\nexport function compareGroupKeys(a: string, b: string) {\n if (a === b) {\n return 0\n }\n if (a === '' || b === '') {\n return a === '' ? 1 : -1\n }\n const numA = NUMERIC.test(a)\n const numB = NUMERIC.test(b)\n if (numA !== numB) {\n return numA ? -1 : 1\n }\n if (numA) {\n const diff = Number(a) - Number(b)\n if (diff !== 0) {\n return diff < 0 ? -1 : 1\n }\n }\n return compareRuns(a, b)\n}\n", "import { colord } from 'colord'\n\nimport { createPaletteMap } from './createPaletteMap.ts'\nimport { paletteNamed } from './ggplotPalettes.ts'\nimport { compareGroupKeys } from './groupKeys.ts'\n\nimport type {\n ColorScheme,\n ColumnTrackSpec,\n Encoding,\n LegendEntry,\n RowPanelSpec,\n} from './types.ts'\n\n/**\n * The color object: the scale a channel reads its field through, the members\n * jbrowse-components' displays declare (its ADR-151). The values the field\n * takes are the scale's domain, `range` holds the colors they map onto, and\n * the legend is the guide listing each value with its color.\n *\n * - `scale`: the kind, `categorical` when unset and the only kind so far\n * - `domain`: values in legend order, each taking the `range` color at its own\n * index; the field's other values follow in natural order\n * - `range`: a palette name (`ggplot`, `set1`, `dark2`, `okabeito`, `tableau`)\n * or a list of colors, which colors as many values as it holds\n * - `title`: the legend's title, the field when unset\n *\n * Records declaring the same members, `title` included, share one scale.\n */\nexport interface ColorSpec {\n scale?: 'categorical'\n domain?: string[]\n range?: string | string[]\n title?: string\n}\n\n/** a channel record: a field read through a color object */\nexport interface ColorChannel extends ColorSpec {\n field: string\n}\n\nexport interface ResolvedScale {\n kind: 'categorical'\n colorOf: (value: string) => string | undefined\n legend: LegendEntry[]\n}\n\n/**\n * The colors a `range` lists, read the way jbrowse-components'\n * `paletteFromSpec` reads a string: a palette name gives undefined here, and a\n * comma-separated list of colors gives the list\n */\nfunction rangeList(range: ColorSpec['range']) {\n if (typeof range !== 'string') {\n return range\n }\n if (paletteNamed(range)) {\n return undefined\n }\n const colors = range.split(/,(?![^(]*\\))/).map(c => c.trim())\n return colors.every(c => colord(c).isValid()) ? colors : undefined\n}\n\nfunction rangeColors(range: ColorSpec['range'], order: string[]) {\n const list = rangeList(range)\n return list\n ? new Map(order.slice(0, list.length).map((value, i) => [value, list[i]!]))\n : new Map(\n Object.entries(\n createPaletteMap(\n order,\n paletteNamed(typeof range === 'string' ? range : undefined),\n ),\n ),\n )\n}\n\n/**\n * The scale a channel reads its field through. `values` are the field's\n * values, in any order and with repeats. The domain lists the values `domain`\n * names first, then the rest in natural order, so a value keeps its color when\n * rows are re-ordered, collapsed or filtered.\n *\n * A palette name, or no `range` at all, colors every value: past the end of\n * the palette each takes an evenly spaced hue. A list of colors leaves the\n * values past its end uncolored, so `{domain, range}` colors the values it\n * names and no others.\n */\nexport function resolveScale(\n spec: ColorSpec | undefined,\n values: Iterable<string>,\n): ResolvedScale {\n const present = new Set(values)\n const listed = new Set(spec?.domain)\n const order = [\n ...listed,\n ...[...present].filter(v => !listed.has(v)).sort(compareGroupKeys),\n ]\n const colors = rangeColors(spec?.range, order)\n return {\n kind: 'categorical',\n colorOf: (value: string) => colors.get(value),\n legend: order\n .filter(value => present.has(value) && colors.has(value))\n .map(value => ({ id: value, label: value, color: colors.get(value)! })),\n }\n}\n\n/** which table a record's field is read from */\nexport type ScaleTable = 'rows' | 'features'\n\n/**\n * One record's use of a color object: the values its field takes in its\n * table, and for the feature table the values the drawn features carry, which\n * the legend lists\n */\nexport interface ScaleUse {\n spec: ColorSpec\n field: string\n table: ScaleTable\n values: string[]\n shown?: string[]\n}\n\nexport interface SharedScale extends ResolvedScale {\n key: string\n title: string\n}\n\n/**\n * The key records share a scale under: the table and the members as declared,\n * with `title` standing in for the field. Two strips over one palette with no\n * title read two fields and list two legends; naming one title gives them one\n * scale and one legend.\n */\nexport function declarationKey({\n spec,\n field,\n table,\n}: Pick<ScaleUse, 'spec' | 'field' | 'table'>) {\n const { scale = 'categorical', domain, range, title = field } = spec\n return JSON.stringify([table, scale, domain, range, title])\n}\n\n/**\n * Resolves each declaration once over the union of its records' values, so a\n * value two fields share takes one color in both\n */\nexport function resolveShared(uses: ScaleUse[]) {\n const groups = new Map<string, ScaleUse[]>()\n for (const use of uses) {\n const key = declarationKey(use)\n groups.set(key, [...(groups.get(key) ?? []), use])\n }\n return new Map(\n [...groups].map(([key, group]) => {\n const { spec, field } = group[0]!\n const resolved = resolveScale(\n spec,\n group.flatMap(u => u.values),\n )\n const shown = group[0]!.shown\n ? new Set(group.flatMap(u => u.shown ?? []))\n : undefined\n const scale: SharedScale = {\n ...resolved,\n key,\n title: spec.title ?? field,\n legend: shown\n ? resolved.legend.filter(entry => shown.has(entry.id))\n : resolved.legend,\n }\n return [key, scale] as const\n }),\n )\n}\n\n/** the spelling a color object had before ADR-151's: `{palette}` or `{map}` */\nexport interface LegacyScale {\n palette?: string\n map?: Record<string, string>\n}\n\n/** a record as an older snapshot, R or Python may write it */\nexport type LegacyColor<T extends ColorSpec> = Omit<T, 'scale'> & {\n scale?: ColorSpec['scale'] | LegacyScale\n legend?: string\n}\n\n/**\n * Lifts the earlier spelling onto the color object: `{palette: p}` reads as\n * `{range: p}`, `{map: m}` as `{domain: keys(m), range: values(m)}`, and a\n * strip's `legend` as `title`. A member written in the new spelling wins.\n */\nexport function readColor<T extends ColorSpec>(record: LegacyColor<T>): T {\n const { scale, legend, ...rest } = record\n if (typeof scale !== 'object' && legend === undefined) {\n return record as T\n }\n const lifted: ColorSpec =\n typeof scale !== 'object'\n ? scale === undefined\n ? {}\n : { scale }\n : scale.map\n ? { domain: Object.keys(scale.map), range: Object.values(scale.map) }\n : scale.palette === undefined\n ? {}\n : { range: scale.palette }\n return {\n ...(legend === undefined ? {} : { title: legend }),\n ...lifted,\n ...rest,\n } as unknown as T\n}\n\nexport type LegacyEncoding = LegacyColor<Encoding>\n\nexport function readEncoding(encoding: Encoding | LegacyEncoding) {\n return readColor<Encoding>(encoding)\n}\n\nexport type LegacyRowPanel =\n | LegacyColor<Extract<RowPanelSpec, { kind: 'strip' }>>\n | (Omit<Extract<RowPanelSpec, { kind: 'features' }>, 'encoding'> & {\n encoding?: {\n color?: LegacyColor<ColorChannel>\n label?: string\n }\n })\n\nexport function readRowPanel(panel: RowPanelSpec | LegacyRowPanel) {\n if (panel.kind === 'strip') {\n return readColor<Extract<RowPanelSpec, { kind: 'strip' }>>(panel)\n }\n const color = panel.encoding?.color\n return (\n color\n ? { ...panel, encoding: { ...panel.encoding, color: readColor(color) } }\n : panel\n ) as RowPanelSpec\n}\n\nexport type LegacyColumnTrack = ColumnTrackSpec & {\n max?: number\n colors?: Record<string, string>\n}\n\n/**\n * Lifts a column track's `colors` onto `encoding.color` and its `max` onto\n * `scales.y.domainMax`\n */\nexport function readColumnTrack(track: LegacyColumnTrack): ColumnTrackSpec {\n const { max, colors, ...rest } = track\n if (max === undefined && colors === undefined) {\n return track\n }\n return {\n ...(colors\n ? {\n encoding: {\n color: {\n domain: Object.keys(colors),\n range: Object.values(colors),\n },\n },\n }\n : {}),\n ...(max === undefined ? {} : { scales: { y: { domainMax: max } } }),\n ...rest,\n }\n}\n\n/**\n * The color a color object gives each value listed, for a reader that keys\n * colors by value, such as the residue letters of a scheme or a text track\n */\nexport function colorTable(spec: ColorSpec, values: Iterable<string>) {\n return Object.fromEntries(\n resolveScale(spec, values).legend.map(e => [e.id, e.color]),\n )\n}\n\n/**\n * The letter-to-color table an object `colorScheme` gives, `{domain, range}`\n * or the earlier `{map}`\n */\nexport function letterColors(scheme: Exclude<ColorScheme, string>) {\n return 'map' in scheme ? scheme.map : colorTable(scheme, scheme.domain ?? [])\n}\n", "/**\n * The global column of every ungapped sequence position in a row, i.e.\n * index[seqPos] is the column holding the seqPos-th non-gap character.\n *\n * The domain overlay resolves one position per feature per row on every redraw,\n * and scanning the row for each would be quadratic.\n *\n * @example\n * // Row: \"A-TG-C\" (A at 0, T at 2, G at 3, C at 5)\n * buildSeqPosIndex('A-TG-C') // \u2192 [0, 2, 3, 5]\n */\nexport function buildSeqPosIndex(row: string) {\n const index = new Int32Array(row.length)\n let n = 0\n for (let col = 0; col < row.length; col++) {\n // bit trick: (code - 45) >>> 0 <= 1 checks for '-' (45) or '.' (46)\n if (!((row.charCodeAt(col) - 45) >>> 0 <= 1)) {\n index[n++] = col\n }\n }\n // slice, not subarray: a subarray keeps the whole row-length buffer alive,\n // and a gappy alignment's indexes are held for as long as the parse is\n return index.slice(0, n)\n}\n", "// Similarity shading, after biotite's plot_alignment_similarity_based and\n// Jalview's BLOSUM62 score scheme. Each residue takes a shade of one hue by how\n// similar it is, on average, to the other residues of its column.\n\nimport { BLOSUM62, NUM_SYMBOLS, symbolOfCode } from './blosum62.ts'\nimport { letterOfResidueSlot, numResidueSlots } from './columnCounts.ts'\n\nimport type { ColumnCounts } from './columnCounts.ts'\n\nconst AMINO_ACIDS = 20\nconst HUE = 240\nconst SATURATION = 50\nconst LIGHTEST = 96\nconst DARKEST = 40\n\n// BLOSUM62 scaled per row to 0..1 over the twenty amino acids, so a residue's\n// own score is 1 and its worst substitution 0. Not symmetric, like biotite's.\nconst normalized = new Float32Array(NUM_SYMBOLS * NUM_SYMBOLS)\nfor (let a = 0; a < NUM_SYMBOLS; a++) {\n let min = Infinity\n let max = -Infinity\n for (let b = 0; b < AMINO_ACIDS; b++) {\n const score = BLOSUM62[a * NUM_SYMBOLS + b]!\n min = Math.min(min, score)\n max = Math.max(max, score)\n }\n for (let b = 0; b < NUM_SYMBOLS; b++) {\n const scaled = (BLOSUM62[a * NUM_SYMBOLS + b]! - min) / (max - min)\n normalized[a * NUM_SYMBOLS + b] = Math.min(Math.max(scaled, 0), 1)\n }\n}\n\n// residue slot -> row of the matrix, -1 for a letter the matrix does not name\nconst symbolOfSlot = Int8Array.from({ length: numResidueSlots }, (_, slot) => {\n const letter = letterOfResidueSlot(slot)\n return letter.length === 1 ? symbolOfCode[letter.charCodeAt(0)]! : -1\n})\n\nfunction shade(similarity: number) {\n const lightness = Math.round(LIGHTEST - (LIGHTEST - DARKEST) * similarity)\n return `hsl(${HUE}, ${SATURATION}%, ${lightness}%)`\n}\n\ninterface Measure {\n /** whether a residue counts toward the means at all */\n counted: (slot: number) => boolean\n /** whether a residue takes a shade, given it is counted */\n shaded: (slot: number) => boolean\n /** similarity of residue `a` to residue `b`, 0..1 */\n score: (a: number, b: number) => number\n}\n\n/**\n * Shades each residue of one column by its mean similarity to the column's\n * other residues, gaps left out of the mean. A column of fewer than two counted\n * residues has nothing to compare and colors nothing.\n */\nfunction shadeColumn(counts: ColumnCounts, col: number, measure: Measure) {\n const { counted, shaded, score } = measure\n const present: [slot: number, count: number][] = []\n let total = 0\n counts.forEachResidue(col, (slot, count) => {\n if (counted(slot)) {\n present.push([slot, count])\n total += count\n }\n })\n\n const colors: Record<string, string> = {}\n if (total < 2) {\n return colors\n }\n for (const [a] of present) {\n if (shaded(a)) {\n let sum = -score(a, a)\n for (const [b, count] of present) {\n sum += count * score(a, b)\n }\n colors[letterOfResidueSlot(a)] = shade(sum / (total - 1))\n }\n }\n return colors\n}\n\nconst blosum62: Measure = {\n counted: slot => symbolOfSlot[slot]! >= 0,\n shaded: slot => symbolOfSlot[slot]! < AMINO_ACIDS,\n score: (a, b) =>\n normalized[symbolOfSlot[a]! * NUM_SYMBOLS + symbolOfSlot[b]!]!,\n}\n\nconst identity: Measure = {\n counted: () => true,\n shaded: () => true,\n score: (a, b) => (a === b ? 1 : 0),\n}\n\n/**\n * The amino acids of a column shaded by BLOSUM62 similarity. Letters the matrix\n * does not name, such as U, O and J, count for nothing and take no shade.\n */\nexport function blosum62ColumnColors(counts: ColumnCounts, col: number) {\n return shadeColumn(counts, col, blosum62)\n}\n\n/**\n * Nucleotides and anything else without a substitution matrix: a residue's\n * similarity is the fraction of the rest of its column that equals it.\n */\nexport function identityColumnColors(counts: ColumnCounts, col: number) {\n return shadeColumn(counts, col, identity)\n}\n", "import { measureTextCanvas } from './measureTextCanvas.ts'\n\nimport type { NodeWithIds } from './types.ts'\n\n// A label's width follows its length closely enough that the widest one is\n// among the longest few, so a 230k-tip tree measures this many strings.\nconst measuredLabels = 100\n\n/** the leaf names of a tree, and its depth in levels from the root */\nexport function treeTips(tree: NodeWithIds) {\n const names: string[] = []\n let depth = 0\n const stack: [NodeWithIds, number][] = [[tree, 0]]\n for (let entry = stack.pop(); entry; entry = stack.pop()) {\n const [node, level] = entry\n const { children } = node\n if (children.length > 0) {\n for (const child of children) {\n stack.push([child, level + 1])\n }\n } else {\n names.push(node.name)\n depth = Math.max(depth, level)\n }\n }\n return { names, depth }\n}\n\n/** the width of the widest label at `fontSize`, measuring the longest few */\nexport function widestLabel(labels: string[], fontSize: number) {\n const counts: number[] = []\n for (const label of labels) {\n counts[label.length] = (counts[label.length] ?? 0) + 1\n }\n let shortest = counts.length\n for (let seen = 0; shortest > 0 && seen < measuredLabels;) {\n shortest--\n seen += counts[shortest] ?? 0\n }\n let widest = 0\n let ties = 0\n for (const label of labels) {\n if (\n label.length > shortest ||\n (label.length === shortest && ties++ < measuredLabels)\n ) {\n widest = Math.max(widest, measureTextCanvas(label, fontSize))\n }\n }\n return widest\n}\n", "interface FlatItem {\n id: number\n parent?: number\n // NCBI BioTreeContainer features, already un-remapped by parseAsn1. Both are\n // strings there: the ASN.1 encodes every feature value as one.\n label?: string\n dist?: string\n}\n\ninterface TreeNode {\n id: string\n name: string\n length?: number\n children: TreeNode[]\n}\n\nexport function flatToTree(items: FlatItem[]): TreeNode {\n const nodeMap = new Map(\n items.map(item => {\n const length = item.dist === undefined ? undefined : Number(item.dist)\n return [\n item.id,\n {\n id: `${item.id}`,\n // NCBI's tree viewer shows the label\n name: item.label || `${item.id}`,\n ...(length !== undefined && Number.isFinite(length)\n ? { length }\n : {}),\n children: [] as TreeNode[],\n },\n ]\n }),\n )\n\n let root: TreeNode | undefined\n for (const item of items) {\n const node = nodeMap.get(item.id)!\n const parent =\n item.parent !== undefined ? nodeMap.get(item.parent) : undefined\n if (parent) {\n parent.children.push(node)\n } else {\n root ??= node\n }\n }\n\n if (root === undefined) {\n // no node lacks a (resolvable) parent: empty input, or every node's parent\n // points back into the set (a cycle). returning undefined here would crash\n // cryptically downstream, so fail with a diagnosable message instead\n throw new Error(\n 'could not build tree from flat node list: no root found (input was empty or contains a parent cycle)',\n )\n }\n\n return root\n}\n", "export interface ASNNode {\n id: number\n parent?: number\n features?: ASNFeature[]\n}\n\nexport interface ASNFeature {\n featureid: number\n value: string\n}\n\nexport interface ASNDictEntry {\n id: number\n name: string\n}\n\nexport interface BioTreeContainer {\n fdict: ASNDictEntry[]\n nodes: ASNNode[]\n}\n\nconst remap: Record<string, string> = {\n $NODE_COLLAPSED: 'collapsed',\n $NODE_COLOR: 'color',\n $LABEL_BG_COLOR: 'color',\n 'seq-id': 'seqId',\n 'seq-title': 'seqTitle',\n 'align-index': 'alignIndex',\n 'accession-nbr': 'accessionNbr',\n 'blast-name': 'blastName',\n 'common-name': 'commonName',\n 'leaf-count': 'leafCount',\n}\n\n// index just past the '}' closing the '{' at openIdx, or -1 when it never\n// closes. Braces nest (a node holds features, which hold values), so finding the\n// end of a block means counting depth rather than taking the next '}'.\nfunction afterMatchingBrace(str: string, openIdx: number) {\n let depth = 1\n let pos = openIdx + 1\n while (pos < str.length && depth > 0) {\n if (str[pos] === '{') {\n depth++\n } else if (str[pos] === '}') {\n depth--\n }\n pos++\n }\n return depth === 0 ? pos : -1\n}\n\n// the contents of each top-level {...} block in str, siblings only\nfunction extractBracedBlocks(str: string): string[] {\n const blocks: string[] = []\n let pos = 0\n while (pos < str.length) {\n const openIdx = str.indexOf('{', pos)\n if (openIdx === -1) {\n break\n }\n const end = afterMatchingBrace(str, openIdx)\n if (end === -1) {\n break\n }\n blocks.push(str.slice(openIdx + 1, end - 1).trim())\n pos = end\n }\n return blocks\n}\n\nfunction findBracedContent(str: string, after: number) {\n const openIdx = str.indexOf('{', after)\n if (openIdx === -1) {\n return undefined\n }\n const end = afterMatchingBrace(str, openIdx)\n return end === -1 ? undefined : str.slice(openIdx + 1, end - 1).trim()\n}\n\nexport function parseAsn1(\n asnString: string,\n): { id: number; parent: number; name: string }[] {\n const normalized = asnString\n .replace(/\\s+/g, ' ')\n .replace(/\\s*{\\s*/g, '{')\n .replace(/\\s*}\\s*/g, '}')\n .replace(/\\s*,\\s*/g, ',')\n .replace(/\\s*::\\s*=\\s*/g, '::=')\n .replace(/^.*?::=/, '')\n\n const sections = extractSections(normalized)\n const { fdict, nodes } = sections\n if (fdict === undefined || nodes === undefined) {\n // a truncated/malformed BioTreeContainer would otherwise pass undefined to\n // extractBracedBlocks and crash cryptically; fail with a clear message\n throw new Error(\n `invalid BioTreeContainer ASN.1: missing '${fdict === undefined ? 'fdict' : 'nodes'}' section`,\n )\n }\n\n const dict = Object.fromEntries(\n extractBracedBlocks(fdict).flatMap(block => {\n const entry = parseDictEntry(block)\n return entry ? [[entry.id, remap[entry.name] || entry.name]] : []\n }),\n )\n\n return extractBracedBlocks(nodes).flatMap(block => {\n const node = parseNode(block)\n if (!node) {\n return []\n }\n const { features = [], ...rest } = node\n return [\n {\n ...rest,\n ...Object.fromEntries(\n features.map(f => [dict[f.featureid], f.value] as const),\n ),\n } as { id: number; parent: number; name: string },\n ]\n })\n}\n\nfunction extractSections(asnString: string): Record<string, string> {\n const sections: Record<string, string> = {}\n let content = asnString.trim()\n if (content.startsWith('{') && content.endsWith('}')) {\n content = content.slice(1, -1).trim()\n }\n\n let pos = 0\n while (pos < content.length) {\n while (pos < content.length && /\\s/.test(content[pos]!)) {\n pos++\n }\n if (pos >= content.length) {\n break\n }\n\n const nameStart = pos\n while (pos < content.length && /\\w/.test(content[pos]!)) {\n pos++\n }\n\n if (\n pos >= content.length ||\n (content[pos] !== ' ' && content[pos] !== '{')\n ) {\n pos = content.indexOf(',', pos)\n pos = pos === -1 ? content.length : pos + 1\n continue\n }\n\n const name = content.slice(nameStart, pos).trim()\n\n while (pos < content.length && /\\s/.test(content[pos]!)) {\n pos++\n }\n\n if (pos >= content.length || content[pos] !== '{') {\n pos = content.indexOf(',', pos)\n pos = pos === -1 ? content.length : pos + 1\n continue\n }\n\n const end = afterMatchingBrace(content, pos)\n if (end === -1) {\n break\n }\n sections[name] = content.slice(pos + 1, end - 1).trim()\n\n pos = content.indexOf(',', end)\n pos = pos === -1 ? content.length : pos + 1\n }\n\n return sections\n}\n\nfunction parseDictEntry(entryString: string): ASNDictEntry | null {\n const idMatch = /id\\s+(\\d+)/.exec(entryString)\n const nameMatch = /name\\s+\"((?:[^\"\\\\]|\\\\.)*)\"/s.exec(entryString)\n if (!idMatch || !nameMatch) {\n return null\n }\n return {\n id: parseInt(idMatch[1]!, 10),\n name: nameMatch[1]!.replace(/\\\\\"/g, '\"').replace(/\\\\\\\\/g, '\\\\'),\n }\n}\n\nfunction parseNode(nodeString: string): ASNNode | null {\n const idMatch = /id\\s+(\\d+)/.exec(nodeString)\n if (!idMatch) {\n return null\n }\n const parentMatch = /parent\\s+(\\d+)/.exec(nodeString)\n const featuresIdx = nodeString.indexOf('features')\n const featuresContent =\n featuresIdx !== -1 ? findBracedContent(nodeString, featuresIdx) : undefined\n\n return {\n id: parseInt(idMatch[1]!, 10),\n ...(parentMatch ? { parent: parseInt(parentMatch[1]!, 10) } : {}),\n features: featuresContent\n ? extractBracedBlocks(featuresContent).flatMap(block => {\n const f = parseFeature(block)\n return f ? [f] : []\n })\n : [],\n }\n}\n\nfunction parseFeature(featureString: string): ASNFeature | null {\n const featureidMatch = /featureid\\s+(\\d+)/.exec(featureString)\n const valueMatch = /value\\s+\"((?:[^\"\\\\]|\\\\.)*)\"/s.exec(featureString)\n if (!featureidMatch || !valueMatch) {\n return null\n }\n return {\n featureid: parseInt(featureidMatch[1]!, 10),\n value: valueMatch[1]!.replace(/\\\\\"/g, '\"').replace(/\\\\\\\\/g, '\\\\'),\n }\n}\n", "import { generateNodeIds, parseEmfTree, parseNewick } from 'msa-parsers'\n\nimport { cladeHighlightAlpha, cladeHighlightColor } from './constants.ts'\nimport { flatToTree } from './flatToTree.ts'\nimport {\n collapse,\n find,\n forEachDescendant,\n hierarchy,\n leafIndex,\n leaves,\n mrca,\n sort,\n sum as hierarchySum,\n} from './hierarchy.ts'\nimport { parseAsn1 } from './parseAsn1.ts'\nimport { midpointRoot, preorder, rerootTree } from './rerootTree.ts'\nimport { withAlpha } from './util.ts'\n\nimport type { HierarchyNode } from './hierarchy.ts'\nimport type { TreeNode } from './rerootTree.ts'\nimport type {\n Clade,\n CladeMark,\n NodeWithIds,\n ResolvedClade,\n TreeOrder,\n TreeRoot,\n} from './types.ts'\n\nexport function parseTreeText(text: string) {\n if (text.startsWith('BioTreeContainer')) {\n return flatToTree(parseAsn1(text))\n }\n return parseNewick(text.startsWith('SEQ') ? parseEmfTree(text).tree : text)\n}\n\n// the marks that set tree state from a node rather than drawing\nconst seedingMarks = new Set<CladeMark>(['collapse', 'focus', 'rotate'])\n\n/**\n * Each tip of the full tree in the order the tree draws it, with the on-screen\n * row that shows it: its own, or the row of the collapsed node standing for it\n */\nfunction tipRows(root: HierarchyNode<NodeWithIds>) {\n const rows = new Map<string, { order: number; row: number }>()\n let row = 0\n const pushReversed = (\n stack: HierarchyNode<NodeWithIds>[],\n nodes: HierarchyNode<NodeWithIds>[],\n ) => {\n for (let i = nodes.length - 1; i >= 0; i--) {\n stack.push(nodes[i]!)\n }\n }\n const stack = [root]\n while (stack.length > 0) {\n const node = stack.pop()!\n if (node.children?.length) {\n pushReversed(stack, node.children)\n } else {\n const hidden = [node]\n while (hidden.length > 0) {\n const tip = hidden.pop()!\n const kids = tip.children ?? tip._children\n if (kids?.length) {\n pushReversed(hidden, kids)\n } else {\n rows.set(tip.data.name, { order: rows.size, row })\n }\n }\n row++\n }\n }\n return rows\n}\n\n/**\n * The rows a clade covers and the node an `mrca` names, or undefined when the\n * clade does not resolve: a tip name the tree does not have or has twice, or a\n * leaf count `tips` disagrees with. A `range` counts its tips in the order\n * `tips` gives them, so a collapsed clade inside it counts every leaf it\n * stands for. `index` is the memoized leaf pass over the tree.\n */\nfunction cladeRows(\n clade: Clade,\n root: HierarchyNode<NodeWithIds>,\n index: Map<string, HierarchyNode<NodeWithIds> | undefined>,\n tips: Map<string, { order: number; row: number }>,\n): { rows: [number, number]; nodeId?: string } | undefined {\n if (clade.range) {\n const [a, b] = clade.range.map(name =>\n index.get(name) ? tips.get(name) : undefined,\n )\n if (a === undefined || b === undefined) {\n return undefined\n }\n const [first, last] = a.order <= b.order ? [a, b] : [b, a]\n return last.order - first.order + 1 === clade.tips\n ? { rows: [first.row, last.row] }\n : undefined\n }\n const node = clade.mrca ? mrca(root, clade.mrca, index) : undefined\n if (!node) {\n return undefined\n }\n const nodeTips = leaves(node)\n if (nodeTips.length !== clade.tips) {\n return undefined\n }\n let first = Infinity\n let last = -Infinity\n for (const tip of nodeTips) {\n const row = tips.get(tip.data.name)?.row\n if (row !== undefined) {\n first = Math.min(first, row)\n last = Math.max(last, row)\n }\n }\n return first <= last\n ? { rows: [first, last], nodeId: node.data.id }\n : undefined\n}\n\n/**\n * Every clade that resolves, with its fill color settled, against the rows of\n * `displayed`, the tree as drawn. The tree panel resolves against the\n * displayed rows and the overview against its own, so both take the tree they\n * draw. A `range` record names no node, so the seeding marks, which need one,\n * drop it.\n */\nexport function resolveClades(\n clades: Clade[],\n root: HierarchyNode<NodeWithIds>,\n displayed: HierarchyNode<NodeWithIds>,\n): ResolvedClade[] {\n const index = leafIndex(root)\n const tips = tipRows(displayed)\n return clades.flatMap(clade => {\n const resolved = cladeRows(clade, root, index, tips)\n const seeding = seedingMarks.has(clade.mark)\n return resolved && !(seeding && resolved.nodeId === undefined)\n ? [\n {\n ...resolved,\n mark: clade.mark,\n color: withAlpha(\n clade.color ?? cladeHighlightColor,\n cladeHighlightAlpha,\n ),\n markColor: clade.color,\n label: clade.label,\n },\n ]\n : []\n })\n}\n\nconst childOrders: Record<\n TreeOrder,\n ((a: HierarchyNode, b: HierarchyNode) => number) | undefined\n> = {\n input: undefined,\n branchLength: (a, b) => (a.data.length ?? 1) - (b.data.length ?? 1),\n ladderize: (a, b) => a.value! - b.value!,\n ladderizeReverse: (a, b) => b.value! - a.value!,\n}\n\n/**\n * The tree with the display transforms applied: leaf counts summed, children\n * put in `order` and each `rotated` node's reversed, `showOnly` taken as the\n * new root, and each `collapsed` clade folded. The overview builds the same\n * tree without the focus, so it shows the focused subtree inside the whole.\n */\nexport function buildTreeRoot(\n tree: NodeWithIds,\n {\n collapsed,\n rotated,\n order,\n showOnly,\n }: {\n collapsed: readonly string[]\n rotated: readonly string[]\n order: TreeOrder\n showOnly?: string\n },\n) {\n let hier = hierarchy(tree, d => d.children)\n hierarchySum(hier, d => (d.children.length > 0 ? 0 : 1))\n const compare = childOrders[order]\n if (compare) {\n sort(hier, compare)\n }\n if (rotated.length > 0) {\n const flip = new Set(rotated)\n forEachDescendant(hier, n => {\n if (flip.has(n.data.id)) {\n n.children?.reverse()\n }\n })\n }\n\n if (showOnly) {\n const res = find(hier, n => n.data.id === showOnly)\n if (res) {\n hier = res\n }\n }\n\n for (const collapsedId of collapsed) {\n const node = find(hier, n => n.data.id === collapsedId)\n if (node) {\n if (node.children) {\n collapse(node)\n } else if (node.parent?.children) {\n node.parent.children = node.parent.children.filter(\n c => c.data.id !== collapsedId,\n )\n }\n }\n }\n\n return hier\n}\n\n/**\n * The node whose branch an outgroup roots the tree on: the outgroup's most\n * recent common ancestor, or the rest of the tips' where that ancestor is the\n * root, since the outgroup then straddles the root and the branch above the\n * other side is the same branch of the unrooted tree.\n */\nexport function outgroupNode(root: HierarchyNode, outgroup: string[]) {\n const index = leafIndex(root)\n const node = mrca(root, outgroup, index)\n if (node !== root) {\n return node\n }\n const out = new Set(outgroup)\n const rest = leaves(root)\n .map(n => n.data.name)\n .filter(name => !out.has(name))\n const other = mrca(root, rest, index)\n return other === root ? undefined : other\n}\n\n/**\n * `tree` rerooted as `treeRoot` asks, with fresh path ids. The ids of the tree\n * as written become names on unnamed nodes, and a rerooting would carry them\n * along as labels, so they come off first.\n */\nexport function rootTree(tree: NodeWithIds, treeRoot: TreeRoot) {\n const plain = new Map<NodeWithIds, TreeNode>()\n for (const node of preorder(tree).reverse()) {\n plain.set(node, {\n name: node.name === node.id ? undefined : node.name,\n length: node.length,\n children: node.children.map(c => plain.get(c)!),\n })\n }\n const input = plain.get(tree)!\n if (treeRoot === 'midpoint') {\n return generateNodeIds(midpointRoot(input))\n }\n const target = outgroupNode(\n hierarchy(tree, d => d.children),\n treeRoot.outgroup,\n )\n return target\n ? generateNodeIds(rerootTree(input, plain.get(target.data)!))\n : tree\n}\n\n// the inclusive tip indices a node covers, from its xMin/xMax in a layout one\n// row per tip\nexport function tipRange(node: HierarchyNode): [number, number] {\n return [Math.round(node.xMin! - 0.5), Math.round(node.xMax! - 0.5)]\n}\n", "import { descendants } from './hierarchy.ts'\n\nimport type { HierarchyNode } from './hierarchy.ts'\n\n// a name holding any of these reads back as grammar unless it is quoted\nconst needsQuotes = /[\\s(),:;[\\]']/\n\nfunction quote(name: string) {\n return needsQuotes.test(name) ? `'${name.replaceAll(\"'\", \"''\")}'` : name\n}\n\n/**\n * The tree as Newick, in the order it is drawn. An internal node whose name is\n * only its generated id goes unnamed. Each subtree's string is dropped once its\n * parent takes it in, since a caterpillar tree is as deep as it has tips and\n * keeping every one is quadratic.\n */\nexport function writeNewick(root: HierarchyNode) {\n const written = new Map<HierarchyNode, string>()\n for (const node of descendants(root).reverse()) {\n const { id, name, length } = node.data\n let text = ''\n if (node.children) {\n text = `(${node.children.map(c => written.get(c)!).join(',')})`\n for (const child of node.children) {\n written.delete(child)\n }\n }\n if (!(node.children && name === id)) {\n text += quote(name)\n }\n if (length !== undefined) {\n text += `:${length}`\n }\n written.set(node, text)\n }\n return `${written.get(root)!};`\n}\n", "// WUSS notation (Rfam's `#=GC SS_cons`) names a consensus secondary structure\n// by pairing columns. Nested helices use bracket pairs -- <>, (), [], {} --\n// each type kept on its own stack, and a pseudoknot, which by definition\n// crosses a helix it cannot nest inside, uses a letter pair instead: `A` opens\n// and `a` closes, `B`/`b` for a second one. Everything else (. , _ - : ~) is\n// unpaired.\n\nconst closeToOpen: Record<string, string> = {\n '>': '<',\n ')': '(',\n ']': '[',\n '}': '{',\n}\nconst opens = new Set(Object.values(closeToOpen))\n\nexport interface BasePair {\n /** 0-based column */\n start: number\n /** 0-based column */\n end: number\n /** the pair crosses a helix rather than nesting inside one */\n pseudoknot: boolean\n}\n\n/**\n * The base pairs a WUSS string encodes, as 0-based column indexes. Unmatched\n * brackets are dropped rather than throwing: a hand-edited or truncated\n * alignment should still draw the helices it does close.\n */\nexport function parseWuss(ss: string): BasePair[] {\n const stacks = new Map<string, number[]>()\n const pairs: BasePair[] = []\n const push = (key: string, col: number) => {\n const stack = stacks.get(key)\n if (stack) {\n stack.push(col)\n } else {\n stacks.set(key, [col])\n }\n }\n const pop = (key: string, col: number, pseudoknot: boolean) => {\n const start = stacks.get(key)?.pop()\n if (start !== undefined) {\n pairs.push({ start, end: col, pseudoknot })\n }\n }\n\n for (let col = 0; col < ss.length; col++) {\n const ch = ss[col]!\n const opener = closeToOpen[ch]\n if (opens.has(ch)) {\n push(ch, col)\n } else if (opener) {\n pop(opener, col, false)\n } else if (ch >= 'A' && ch <= 'Z') {\n push(ch, col)\n } else if (ch >= 'a' && ch <= 'z') {\n pop(ch.toUpperCase(), col, true)\n }\n }\n return pairs.sort((a, b) => a.start - b.start)\n}\n", "import { createJBrowseTheme } from '@jbrowse/core/ui/theme'\n\nimport { letterColors } from './scales.ts'\n\nimport type { MSAViewerProps } from './components/MSAViewer.tsx'\nimport type { ColorScheme, Highlight } from './types.ts'\n\nexport function colorSchemeSnapshot(scheme: ColorScheme | undefined) {\n return typeof scheme === 'string'\n ? { colorSchemeName: scheme }\n : scheme\n ? { customColorScheme: letterColors(scheme) }\n : {}\n}\n\n/**\n * The `highlightColumns` prop as `highlights`: one `{start, end}` per run of\n * adjacent 1-based alignment columns\n */\nexport function columnHighlights(columns: number[] = []) {\n const sorted = [...new Set(columns)].sort((a, b) => a - b)\n const runs: { start: number; end: number }[] = []\n for (const column of sorted) {\n const last = runs.at(-1)\n if (last?.end === column - 1) {\n last.end = column\n } else {\n runs.push({ start: column, end: column })\n }\n }\n return runs\n}\n\nexport function viewerHighlights({\n highlights = [],\n highlightColumns,\n}: Pick<MSAViewerProps, 'highlights' | 'highlightColumns'>): Highlight[] {\n return [...highlights, ...columnHighlights(highlightColumns)]\n}\n\nfunction urlLocation(uri: string | undefined) {\n return uri ? { uri, locationType: 'UriLocation' as const } : undefined\n}\n\n/** each filehandle prop, or the URL prop standing in for it */\nexport function fileLocations({\n msaFilehandle,\n treeFilehandle,\n gffFilehandle,\n msaUrl,\n treeUrl,\n gffUrl,\n}: MSAViewerProps) {\n return {\n msaFilehandle: msaFilehandle ?? urlLocation(msaUrl),\n treeFilehandle: treeFilehandle ?? urlLocation(treeUrl),\n gffFilehandle: gffFilehandle ?? urlLocation(gffUrl),\n }\n}\n\nexport function resolveTheme(theme: MSAViewerProps['theme']) {\n return createJBrowseTheme(\n theme === 'dark'\n ? { palette: { mode: 'dark' } }\n : typeof theme === 'object'\n ? theme\n : undefined,\n )\n}\n\n/**\n * The model snapshot `MSAViewer` creates from its props. The CLI's `--props`\n * reads the same JSON the R and Python widgets send, so a figure exported\n * headlessly draws what the widget drew.\n */\nexport function viewerSnapshot(props: MSAViewerProps) {\n const {\n msa,\n tree,\n gff,\n rowData,\n colorScheme,\n height,\n colWidth,\n rowHeight,\n allowedGappyness,\n highlightColumns,\n highlights,\n features,\n selection,\n clades,\n relativeTo,\n columnTracks,\n residueMappings,\n encodings,\n rowPanels,\n drawTree,\n treeAreaWidth,\n showBranchLen,\n treeOrder,\n treeRoot,\n region,\n residueEncoding,\n } = props\n const { msaFilehandle, treeFilehandle, gffFilehandle } = fileLocations(props)\n return {\n type: 'MsaView' as const,\n ...(msa || tree || gff || rowData\n ? {\n data: {\n msa: msa ?? '',\n tree: tree ?? '',\n gff,\n // the row table is stored as this JSON string, which is what a\n // shared URL and the size limit already cover\n ...(rowData ? { treeMetadata: JSON.stringify(rowData) } : {}),\n },\n }\n : {}),\n ...(msaFilehandle ? { msaFilehandle } : {}),\n ...(treeFilehandle ? { treeFilehandle } : {}),\n ...(gffFilehandle ? { gffFilehandle } : {}),\n ...colorSchemeSnapshot(colorScheme),\n ...(height ? { height } : {}),\n ...(colWidth ? { colWidth } : {}),\n ...(rowHeight ? { rowHeight } : {}),\n ...(allowedGappyness !== undefined ? { allowedGappyness } : {}),\n ...(highlights || highlightColumns\n ? { highlights: viewerHighlights({ highlights, highlightColumns }) }\n : {}),\n ...(features ? { features } : {}),\n ...(selection ? { selection } : {}),\n ...(clades ? { clades } : {}),\n ...(relativeTo ? { relativeTo } : {}),\n ...(columnTracks ? { columnTracks } : {}),\n ...(residueMappings ? { residueMappings } : {}),\n ...(encodings ? { encodings } : {}),\n ...(rowPanels ? { rowPanels } : {}),\n ...(drawTree !== undefined ? { drawTree } : {}),\n ...(treeAreaWidth ? { treeAreaWidth } : {}),\n ...(showBranchLen !== undefined ? { showBranchLen } : {}),\n ...(treeOrder ? { treeOrder } : {}),\n ...(treeRoot ? { treeRoot } : {}),\n ...(region ? { region } : {}),\n ...(residueEncoding !== undefined\n ? { bgColor: residueEncoding === 'fill' }\n : {}),\n }\n}\n", "import { colord } from 'colord'\n\nimport { tileColorFn } from './components/msa/tileColor.ts'\n\nimport type { MsaViewModel } from './model.ts'\n\n/**\n * A reader for the color the active scheme gives a row's residue, as hex, for a\n * host that paints another view, such as a structure, with the alignment's own\n * colors. `seqPos` is 1-based, like `structureResidue`. The reader returns\n * undefined where the scheme leaves the residue uncolored, the row lacks it, or\n * its column is hidden.\n *\n * Build it inside a reaction: a new scheme, a hidden gap column or a collapsed\n * clade then re-runs the caller.\n */\nexport function schemeResidueColor(model: MsaViewModel) {\n const colorAt = tileColorFn(model)\n const { columns } = model\n const hexes = new Map<string, string | undefined>()\n const toHex = (color: string) => {\n if (!hexes.has(color)) {\n const parsed = colord(color)\n hexes.set(color, parsed.isValid() ? parsed.toHex() : undefined)\n }\n return hexes.get(color)\n }\n return (rowName: string, seqPos: number) => {\n const col = model.seqPosToVisibleCol(rowName, seqPos - 1)\n const letter = col === undefined ? undefined : columns.get(rowName)?.[col]\n const color =\n col === undefined || letter === undefined\n ? undefined\n : colorAt(col, letter)\n return color === undefined ? undefined : toHex(color)\n }\n}\n", "import React from 'react'\n\nimport { createRoot } from 'react-dom/client'\n\nimport MSAViewer from './components/MSAViewer.tsx'\n\nimport type { MSAViewerProps } from './components/MSAViewer.tsx'\n\nexport interface MountedViewer {\n /** merge new props over the current ones */\n update: (props: Partial<MSAViewerProps>) => void\n destroy: () => void\n}\n\n/**\n * Render MSAViewer into an element, for a host that is not a React app: a\n * script tag, an R htmlwidget, a notebook widget, a custom element.\n */\nexport function mount(el: HTMLElement, props: MSAViewerProps): MountedViewer {\n const root = createRoot(el)\n let current = props\n root.render(<MSAViewer {...current} />)\n return {\n update(next) {\n current = { ...current, ...next }\n root.render(<MSAViewer {...current} />)\n },\n destroy() {\n root.unmount()\n },\n }\n}\n", "import { when } from 'mobx'\n\nimport { defaultHeight, resizeHandleWidth } from './constants.ts'\nimport { mount } from './mount.tsx'\n\nimport type { MSAViewerProps } from './components/MSAViewer.tsx'\nimport type { MsaViewModel } from './model.ts'\nimport type { MountedViewer } from './mount.tsx'\nimport type { Cell, Highlight, MsaSelection, Viewport } from './types.ts'\n\ntype ElementData = Pick<\n MSAViewerProps,\n | 'msa'\n | 'tree'\n | 'gff'\n | 'features'\n | 'colorScheme'\n | 'highlights'\n | 'columnTracks'\n | 'residueMappings'\n | 'selection'\n>\n\nconst dataProperties = [\n 'msa',\n 'tree',\n 'gff',\n 'features',\n 'colorScheme',\n 'highlights',\n 'columnTracks',\n 'residueMappings',\n] as const satisfies (keyof ElementData)[]\n\ninterface NightingaleManager extends HTMLElement {\n register: (element: HTMLElement) => void\n unregister: (element: HTMLElement) => void\n}\n\nconst ownAttributes = [\n 'msa-url',\n 'tree-url',\n 'gff-url',\n 'color-scheme',\n 'height',\n 'hide-header',\n 'theme',\n 'reference-row',\n 'tree-area-width',\n 'loading',\n] as const\n\n// how far outside the viewport a lazy element starts mounting, so the viewer\n// is drawing by the time the reader scrolls to it\nconst lazyMargin = '200px'\n\n// the attributes a <nightingale-manager> writes on the elements it holds\nconst nightingaleAttributes = ['display-start', 'display-end', 'highlight']\n\nfunction numberAttribute(value: string | null | undefined) {\n const n = value ? Number(value) : Number.NaN\n return Number.isFinite(n) ? n : undefined\n}\n\n// Nightingale writes a highlight as \"start:end,start:end\", 1-based inclusive\nfunction parseHighlight(value: string | null, row?: string): Highlight[] {\n return (value ?? '').split(',').flatMap(span => {\n const [start, end] = span.split(':').map(numberAttribute)\n return start === undefined ? [] : [{ row, start, end: end ?? start }]\n })\n}\n\nfunction residueAtColumn(model: MsaViewModel, row: string, column: number) {\n const visible = model.globalColToVisibleCol(column - 1)\n return visible === undefined\n ? undefined\n : model.visibleColToSeqPosOneBased(row, visible)\n}\n\n// the first and last residues of `row` inside the viewport's columns\nfunction residueRange(model: MsaViewModel, row: string, viewport: Viewport) {\n let start: number | undefined\n let end: number | undefined\n for (let c = viewport.startColumn; c <= viewport.endColumn && !start; c++) {\n start = residueAtColumn(model, row, c)\n }\n for (let c = viewport.endColumn; c >= viewport.startColumn && !end; c--) {\n end = residueAtColumn(model, row, c)\n }\n return start && end ? { start, end } : undefined\n}\n\n/**\n * Registers a custom element that renders MSAViewer, for pages with no React.\n * Attributes: msa-url, tree-url, gff-url, color-scheme, height, hide-header,\n * theme, tree-area-width, reference-row and loading. Properties: msa, tree and\n * gff text, features, colorScheme, highlights, columnTracks, residueMappings\n * and selection. The colorScheme property takes a `{domain, range}` the\n * color-scheme attribute cannot hold, and wins over the attribute while set. Events:\n * cell-hover, cell-click, viewport-change and selection-change, each with the\n * MSAViewer callback's value as detail.\n *\n * `loading=\"lazy\"` mounts the viewer once the element comes within 200 pixels\n * of the viewport, as `<img loading=\"lazy\">` loads its image. Until then the\n * element shows its own children, such as an `<img>` of the first frame, and\n * reserves the viewer's height.\n *\n * Inside a <nightingale-manager>, the element registers with it and speaks its\n * protocol: it follows the display-start, display-end and highlight attributes\n * the manager writes, and reports its own range and hovered residue as change\n * events. Positions are residues of reference-row, or columns without one.\n */\nexport function defineMsaElement(tagName = 'jbrowse-msa') {\n const existing = customElements.get(tagName)\n if (existing) {\n return existing\n }\n\n class MsaElement extends HTMLElement {\n static observedAttributes = [...ownAttributes, ...nightingaleAttributes]\n\n #viewer?: MountedViewer\n #nearby?: IntersectionObserver\n #model?: MsaViewModel\n #manager?: NightingaleManager\n #cancelRange?: () => void\n #rangePending = false\n #reported?: { start: number; end: number }\n #data: ElementData = {}\n\n declare msa: ElementData['msa']\n declare tree: ElementData['tree']\n declare gff: ElementData['gff']\n declare features: ElementData['features']\n declare colorScheme: ElementData['colorScheme']\n declare highlights: ElementData['highlights']\n declare columnTracks: ElementData['columnTracks']\n declare residueMappings: ElementData['residueMappings']\n\n static {\n for (const key of dataProperties) {\n Object.defineProperty(MsaElement.prototype, key, {\n configurable: true,\n get(this: MsaElement) {\n return this.#data[key]\n },\n set(this: MsaElement, value: ElementData[typeof key]) {\n this.#setData({ [key]: value })\n },\n })\n }\n }\n\n // the viewer's selection, which the reader's drags change\n get selection() {\n return this.#model ? this.#model.selection : this.#data.selection\n }\n set selection(value: MsaSelection | undefined) {\n this.#setData({ selection: value })\n }\n\n get #referenceRow() {\n return this.getAttribute('reference-row') ?? undefined\n }\n\n #setData(data: ElementData) {\n this.#data = { ...this.#data, ...data }\n this.#viewer?.update(this.#props())\n }\n\n #props(): MSAViewerProps {\n const theme = this.getAttribute('theme')\n return {\n ...this.#data,\n msaUrl: this.getAttribute('msa-url') ?? undefined,\n treeUrl: this.getAttribute('tree-url') ?? undefined,\n gffUrl: this.getAttribute('gff-url') ?? undefined,\n colorScheme:\n this.#data.colorScheme ??\n this.getAttribute('color-scheme') ??\n undefined,\n height: numberAttribute(this.getAttribute('height')),\n treeAreaWidth: numberAttribute(this.getAttribute('tree-area-width')),\n hideHeader: this.hasAttribute('hide-header'),\n theme: theme === 'dark' ? 'dark' : 'light',\n onCellHover: cell => {\n this.#emit('cell-hover', cell)\n this.#reportHover(cell)\n },\n onCellClick: cell => {\n this.#emit('cell-click', cell)\n },\n onViewportChange: viewport => {\n this.#emit('viewport-change', viewport)\n this.#reportRange(viewport)\n },\n onSelectionChange: selection => {\n this.#emit('selection-change', selection)\n },\n onModel: model => {\n this.#model = model\n this.#followRange()\n this.#followHighlight()\n },\n }\n }\n\n #emit(type: string, detail: unknown) {\n this.dispatchEvent(new CustomEvent(type, { detail }))\n }\n\n #nightingaleChange(detail: Record<string, unknown>) {\n if (this.#manager) {\n this.dispatchEvent(\n new CustomEvent('change', {\n detail,\n bubbles: true,\n cancelable: true,\n }),\n )\n }\n }\n\n #reportHover(cell: Cell | undefined) {\n const model = this.#model\n const row = this.#referenceRow\n const position =\n cell && model && row\n ? residueAtColumn(model, row, cell.column)\n : cell?.column\n this.#nightingaleChange({\n type: 'highlight',\n value: position === undefined ? null : `${position}:${position}`,\n })\n }\n\n #reportRange(viewport: Viewport | undefined) {\n const model = this.#model\n const row = this.#referenceRow\n if (!viewport || !model) {\n return\n }\n const range = row\n ? residueRange(model, row, viewport)\n : { start: viewport.startColumn, end: viewport.endColumn }\n const shownStart = numberAttribute(this.getAttribute('display-start'))\n const shownEnd = numberAttribute(this.getAttribute('display-end'))\n // a range the manager just wrote comes back within a column of itself,\n // since the viewer shows whole columns\n const echo =\n range &&\n shownStart !== undefined &&\n shownEnd !== undefined &&\n Math.abs(range.start - shownStart) <= 1 &&\n Math.abs(range.end - shownEnd) <= 1\n if (range && !echo) {\n this.#reported = range\n this.#nightingaleChange({\n 'display-start': range.start,\n 'display-end': range.end,\n })\n }\n }\n\n #followRange() {\n const model = this.#model\n const start = numberAttribute(this.getAttribute('display-start'))\n const end = numberAttribute(this.getAttribute('display-end'))\n const reported = this.#reported\n // the manager writes the range this element reported back onto it, and\n // zooming to it again would snap the reader's own zoom to whole residues\n if (reported && reported.start === start && reported.end === end) {\n return\n }\n this.#cancelRange?.()\n if (model && start !== undefined && end !== undefined) {\n const row = this.#referenceRow\n this.#cancelRange = when(\n () => model.viewInitialized && model.numColumns > 0,\n () => {\n model.zoomToRegion({ row, start, end })\n },\n )\n }\n }\n\n #followHighlight() {\n const spans = parseHighlight(\n this.getAttribute('highlight'),\n this.#referenceRow,\n )\n if (spans.length) {\n this.#model?.applyHighlight('nightingale', spans)\n } else {\n this.#model?.clearHighlight('nightingale')\n }\n }\n\n connectedCallback() {\n if (!this.style.display) {\n this.style.display = 'block'\n }\n if (this.#lazy) {\n const height =\n numberAttribute(this.getAttribute('height')) ?? defaultHeight\n this.style.minHeight = `${height + resizeHandleWidth}px`\n this.#nearby = new IntersectionObserver(\n entries => {\n if (entries.some(entry => entry.isIntersecting)) {\n this.#mount()\n }\n },\n { rootMargin: lazyMargin },\n )\n this.#nearby.observe(this)\n } else {\n this.#mount()\n }\n const manager = this.closest<NightingaleManager>('nightingale-manager')\n if (manager) {\n void customElements.whenDefined('nightingale-manager').then(() => {\n if (this.isConnected) {\n this.#manager = manager\n manager.register(this)\n }\n })\n }\n }\n\n get #lazy() {\n return (\n this.getAttribute('loading') === 'lazy' &&\n typeof IntersectionObserver !== 'undefined'\n )\n }\n\n #mount() {\n this.#nearby?.disconnect()\n this.#nearby = undefined\n this.#viewer ??= mount(this, this.#props())\n }\n\n disconnectedCallback() {\n this.#nearby?.disconnect()\n this.#nearby = undefined\n this.#manager?.unregister(this)\n this.#manager = undefined\n this.#cancelRange?.()\n this.#viewer?.destroy()\n this.#viewer = undefined\n this.#model = undefined\n }\n\n attributeChangedCallback(name: string) {\n if (name === 'display-start' || name === 'display-end') {\n // the manager writes the two attributes one after the other, and a\n // zoom between them reports a range that overwrites the second\n if (!this.#rangePending) {\n this.#rangePending = true\n queueMicrotask(() => {\n this.#rangePending = false\n this.#followRange()\n })\n }\n } else if (name === 'highlight') {\n this.#followHighlight()\n } else if (name === 'loading') {\n if (this.#nearby && !this.#lazy) {\n this.#mount()\n }\n } else {\n this.#viewer?.update(this.#props())\n }\n }\n }\n\n customElements.define(tagName, MsaElement)\n return MsaElement\n}\n", "import { useEffect, useState } from 'react'\n\nimport { createJBrowseTheme } from '@jbrowse/core/ui/theme'\nimport { getSnapshot } from '@jbrowse/mobx-state-tree'\nimport { compareShallow, reaction } from 'mobx'\n\nimport { renderToSvg } from './renderToSvg.tsx'\n\nimport type { MsaViewModel } from './model.ts'\nimport type { Theme } from '@mui/material'\n\nexport interface MsaSvgFigure {\n /** the SVG document for what is on screen, once the first draw finishes */\n svg?: string\n error?: unknown\n}\n\n/**\n * The viewer's SVG export of its viewport, as markup for the page to insert.\n * It redraws after the view settles: `delay` ms after the last scroll, zoom,\n * resize, highlight or change to the snapshot. A draw a later one overtakes is\n * dropped.\n *\n * The figure's row names and letters are SVG text, so the browser's find\n * locates them, a reader can select them, and print stylesheets apply.\n */\nexport function useMsaSvgFigure(\n model: MsaViewModel,\n {\n theme,\n includeTracks = false,\n delay = 300,\n }: { theme?: Theme; includeTracks?: boolean; delay?: number } = {},\n) {\n const [figure, setFigure] = useState<MsaSvgFigure>({})\n useEffect(() => {\n let latest = 0\n const dispose = reaction(\n () =>\n model.viewInitialized && model.dataInitialized\n ? [\n getSnapshot(model),\n model.width,\n model.height,\n model.resolvedHighlights,\n model.highlightedColumnRuns,\n ]\n : undefined,\n key => {\n if (!key) {\n return\n }\n const draw = ++latest\n renderToSvg(model, {\n theme: theme ?? createJBrowseTheme(),\n exportType: 'viewport',\n includeTracks,\n }).then(\n svg => {\n if (draw === latest) {\n setFigure({ svg })\n }\n },\n (error: unknown) => {\n if (draw === latest) {\n setFigure({ error })\n }\n },\n )\n },\n { delay, fireImmediately: true, equals: compareShallow },\n )\n return () => {\n latest = -1\n dispose()\n }\n }, [model, theme, includeTracks, delay])\n return figure\n}\n"],
|
|
5
|
+
"mappings": "oiDAAA,IAAAA,GAAAC,GAAA,CAAAC,GAAAC,KAAA,CAAAA,GAAO,QAAU,eAAe,gCAAgC,ICAhE,IAAAC,GAAAC,GAAA,CAAAC,GAAAC,KAAA,CAAAA,GAAO,QAAU,eAAe,8BAA8B,ICA9D,IAAAC,GAAAC,GAAA,CAAAC,GAAAC,KAAA,CAAAA,GAAO,QAAU,eAAe,wBAAwB,ICAxD,IAAAC,GAAAC,GAAA,CAAAC,GAAAC,KAAA,CAAAA,GAAO,QAAU,eAAe,+BAA+B,ICA/D,IAAAC,GAAAC,GAAAC,GAAA,cAWA,IAAIC,GAAqB,OAAO,IAAI,4BAA4B,EAC9DC,GAAoB,OAAO,IAAI,cAAc,EAC7CC,GAAsB,OAAO,IAAI,gBAAgB,EACjDC,GAAyB,OAAO,IAAI,mBAAmB,EACvDC,GAAsB,OAAO,IAAI,gBAAgB,EACjDC,GAAsB,OAAO,IAAI,gBAAgB,EACjDC,GAAqB,OAAO,IAAI,eAAe,EAC/CC,GAAyB,OAAO,IAAI,mBAAmB,EACvDC,GAAsB,OAAO,IAAI,gBAAgB,EACjDC,GAA2B,OAAO,IAAI,qBAAqB,EAC3DC,GAAkB,OAAO,IAAI,YAAY,EACzCC,GAAkB,OAAO,IAAI,YAAY,EACzCC,GAA6B,OAAO,IAAI,uBAAuB,EAC/DC,GAAyB,OAAO,IAAI,wBAAwB,EAC9D,SAASC,GAAOC,EAAQ,CACtB,GAAiB,OAAOA,GAApB,UAAuCA,IAAT,KAAiB,CACjD,IAAIC,EAAWD,EAAO,SACtB,OAAQC,EAAU,CAChB,KAAKhB,GACH,OAAUe,EAASA,EAAO,KAAOA,EAAS,CACxC,KAAKb,GACL,KAAKE,GACL,KAAKD,GACL,KAAKK,GACL,KAAKC,GACL,KAAKG,GACH,OAAOG,EACT,QAC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OA,EACT,EACA,SAAU,CACR,MAAOA,EACT,EACA,SAAU,CACR,MAAOA,EACT,EACA,cAAe,CACb,MAAOA,EACT,EACA,mBAAoB,CAClB,MAAOA,EACT,EACA,iBAAkB,CAChB,MAAOA,EACT,EACA,aAAc,CACZ,MAAOA,EACT,EACA,kBAAmB,CACjB,MAAOA,EACT,EACA,gBAAiB,CACf,MAAOA,EACT,EACA,EAAG,CACD,MAAOC,EACT,EACA,GAAI,CACF,MAAOA,EACT,EACA,GAAI,CACF,MAAOA,EACT,EACA,GAAI,CACF,MAAOA,EACT,EACA,GAAI,CACF,MAAOA,EACT,EACA,GAAI,CACF,MAAOA,EACT,EACA,GAAI,CACF,MAAOA,EACT,EACA,OAAQ,CACN,MAAOA,EACT,EACA,UAAW,CACT,MAAOA,EACT,EACA,YAAa,CACX,MAAOA,EACT,EACA,aAAc,CACZ,MAAOA,EACT,EACA,WAAY,CACV,MAAOA,EACT,EACA,QAAS,CACP,MAAOA,EACT,EACA,QAAS,CACP,MAAOA,EACT,EACA,aAAc,CACZ,MAAOA,EACT,EACA,kBAAmB,CACjB,MAAOA,EACT,EACA,gBAAiB,CACf,MAAOA,EACT,EACA,YAAa,CACX,MAAOA,EACT,EACA,iBAAkB,CAChB,MAAOA,EACT,EACA,eAAgB,CACd,MAAOA,EACT,EAEA,aAAc,CACZ,YAAa,GACb,UAAWC,IAAU,CACnB,eAAgB,CACd,QAASA,CACX,CACF,EACF,EACA,QAAS,CAAC,EACV,SAAU,CAAC,EACX,aAAc,CAAC,EACf,WAAY,CAAC,EACb,WAAY,CAAC,EAEb,UAAW,CAAC,EACZ,cAAe,CAAC,EAChB,SAAU,CAAC,EACX,eAAgB,CAAC,EACjB,WAAY,CAAC,EACb,aAAc,CAAC,EACf,MAAO,CAAC,EACR,KAAM,CAAC,EACP,SAAU,CAAC,EACX,WAAY,CAAC,EACb,UAAW,CAAC,EACZ,aAAc,CAAC,EACf,YAAa,CAAC,EAEd,IAAK,CACH,MAAOC,EACT,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,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,WAGL,kBAAmB,CACjB,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,WAGL,mBAAoB,CAClB,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,WAGL,iBAAkB,CAChB,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,WAGL,eAAgB,CACd,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,WAGL,cAAe,CACb,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,UACH,EAAG,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ClB,KAAKlB,GAAgB,EACZkB,IAAS,UACd,KAAKrC,IAAW,CAAC,KAAK8B,IACxB,KAAKI,GAAM,EAGb,KAAKnC,IAAS,OAAO,KAAKY,GAAM,CAAE,CAEtC,EAGF,sBAAe,OAAOf,EAASE,CAAU,EAClCA,CACT,CC1XA,IAAAwC,GAAoC,SAEpCC,GAAmC,UACnCC,GAA4B,UAC5BC,GAAyC,UAsBnC,SAAUC,GACdC,EACA,CACE,MAAAC,EACA,cAAAC,EAAgB,GAChB,MAAAC,EAAQ,GAAG,EACmD,CAAA,EAAE,CAElE,GAAM,CAACC,EAAQC,CAAS,KAAI,aAAuB,CAAA,CAAE,EACrD,uBAAU,IAAK,CACb,IAAIC,EAAS,EACPC,KAAU,aACd,IACEP,EAAM,iBAAmBA,EAAM,gBAC3B,IACE,gBAAYA,CAAK,EACjBA,EAAM,MACNA,EAAM,OACNA,EAAM,mBACNA,EAAM,uBAER,OACNQ,GAAM,CACJ,GAAI,CAACA,EACH,OAEF,IAAMC,EAAO,EAAEH,EACfI,GAAYV,EAAO,CACjB,MAAOC,MAAS,uBAAkB,EAClC,WAAY,WACZ,cAAAC,EACD,EAAE,KACDS,GAAM,CACAF,IAASH,GACXD,EAAU,CAAE,IAAAM,CAAG,CAAE,CAErB,EACCC,GAAkB,CACbH,IAASH,GACXD,EAAU,CAAE,MAAAO,CAAK,CAAE,CAEvB,CAAC,CAEL,EACA,CAAE,MAAAT,EAAO,gBAAiB,GAAM,OAAQ,iBAAc,CAAE,EAE1D,MAAO,IAAK,CACVG,EAAS,GACTC,EAAO,CACT,CACF,EAAG,CAACP,EAAOC,EAAOC,EAAeC,CAAK,CAAC,EAChCC,CACT",
|
|
6
|
+
"names": ["require_ErrorBoundary", "__commonJSMin", "exports", "module", "require_BaseTooltip", "__commonJSMin", "exports", "module", "require_theme", "__commonJSMin", "exports", "module", "require_useMeasure", "__commonJSMin", "exports", "module", "require_react_is_production", "__commonJSMin", "exports", "REACT_ELEMENT_TYPE", "REACT_PORTAL_TYPE", "REACT_FRAGMENT_TYPE", "REACT_STRICT_MODE_TYPE", "REACT_PROFILER_TYPE", "REACT_CONSUMER_TYPE", "REACT_CONTEXT_TYPE", "REACT_FORWARD_REF_TYPE", "REACT_SUSPENSE_TYPE", "REACT_SUSPENSE_LIST_TYPE", "REACT_MEMO_TYPE", "REACT_LAZY_TYPE", "REACT_VIEW_TRANSITION_TYPE", "REACT_CLIENT_REFERENCE", "typeOf", "object", "$$typeof", "type", "require_react_is", "__commonJSMin", "exports", "module", "require_react_is_production_min", "__commonJSMin", "exports", "b", "c", "d", "e", "f", "g", "h", "k", "l", "m", "n", "p", "q", "r", "t", "v", "w", "x", "y", "z", "a", "u", "A", "require_react_is", "__commonJSMin", "exports", "module", "require_hoist_non_react_statics_cjs", "__commonJSMin", "exports", "module", "reactIs", "REACT_STATICS", "KNOWN_STATICS", "FORWARD_REF_STATICS", "MEMO_STATICS", "TYPE_STATICS", "getStatics", "component", "defineProperty", "getOwnPropertyNames", "getOwnPropertySymbols", "getOwnPropertyDescriptor", "getPrototypeOf", "objectPrototype", "hoistNonReactStatics", "targetComponent", "sourceComponent", "blacklist", "inheritedComponent", "keys", "targetStatics", "sourceStatics", "i", "key", "descriptor", "require_CascadingMenuButton", "__commonJSMin", "exports", "module", "require_styles", "__commonJSMin", "exports", "module", "require_mst", "__commonJSMin", "exports", "module", "HeadlessDOMMatrix", "_HeadlessDOMMatrix", "init", "a", "b", "c", "d", "e", "f", "o", "x", "y", "HeadlessDOMPoint", "_HeadlessDOMPoint", "m", "installHeadlessRenderEnv", "win", "contextExtras", "measureContext", "g", "canvas", "font", "v", "t", "CHAR_WIDTH_RATIO", "residueLabel", "span", "parseSpan", "text", "what", "match", "a", "b", "withRow", "entry", "query", "row", "rest", "resolved", "expandHighlight", "start", "end", "label", "expandRegion", "region", "slug", "name", "kindOf", "track", "expandTrack", "ids", "pad", "id", "n", "isInlineMsa", "msa", "isInlineTree", "tree", "uri", "location", "expandSpec", "spec", "highlights", "columnTracks", "data", "t", "h", "import_react", "import_ui", "import_ErrorBoundary", "import_material", "import_mobx_react", "import_react", "import_mobx_react", "import_react", "import_mobx_react", "minViewHeight", "VerticalResizeHandle", "model", "onDrag", "delta", "startWidth", "React", "DragHandle", "HorizontalResizeHandle", "startHeight", "TrackResizeHandle", "track", "id", "heightKey", "height", "siblings", "t", "count", "import_react", "import_BaseTooltip", "import_tss_react", "import_jsx_runtime", "ArrowDropDown_default", "_jsx", "import_jsx_runtime", "Close_default", "_jsx", "import_material", "import_mobx_react", "import_react", "MAX_FRAME_LOG", "MAX_PENDING_LOG", "normalizeWheelDelta", "delta", "mode", "clampAbs", "x", "max", "WheelZoomSmoother", "deltaY", "deltaMode", "isPinch", "px", "notches", "elapsedMs", "eased", "log", "zoomSettleMs", "wheelLatchMs", "canScrollY", "model", "delta", "scrollY", "maxScrollY", "pinchZoom", "withPinch", "pan", "panTouchAction", "axes", "x", "y", "useWheelScroll", "ref", "zoom", "onWheelScroll", "scheduled", "zoomFrame", "zoomSettle", "deltaX", "deltaY", "lastTaken", "zoomSmoother", "WheelZoomSmoother", "zoomX", "zoomY", "lastZoomTime", "prev", "latest", "panFrame", "panPointer", "setPanPointer", "curr", "onWheel", "event", "isCtrlZoom", "isScrollZoom", "rect", "frame", "now", "elapsed", "dx", "dy", "vertical", "latched", "takeY", "takeX", "onMove", "to", "onUp", "onPointerDown", "onMsaKey", "model", "key", "shiftKey", "colWidth", "rowHeight", "msaCanvasWidth", "msaAreaHeight", "dx", "dy", "import_react", "import_mobx_react", "import_react", "import_theme", "import_material", "DARK_READER_ATTRIBUTE", "darkReaderIsDark", "onDarkReaderChange", "listener", "observer", "darkTheme", "useCanvasTheme", "theme", "import_react", "import_mobx", "useCanvasAutorun", "draw", "width", "height", "deps", "ref", "ctx", "TrackBlock", "model", "track", "offsetX", "blockSize", "highResScaleFactor", "height", "theme", "useCanvasTheme", "canvasWidth", "canvasHeight", "ref", "useCanvasAutorun", "ctx", "drawTrackBlock", "React", "TrackBlocks", "blocksX", "msaCanvasWidth", "scrollX", "kind", "data", "arcs", "bx", "TrackResizeHandle", "TrackBlocks_default", "import_react", "import_mobx_react", "pct", "n", "MAX_PARTNERS", "ColumnLabel", "model", "col", "relativeTo", "pos", "React", "BarTooltip", "track", "id", "name", "value", "barTrackValues", "LogoTooltip", "stats", "total", "consensusLetter", "consensusFraction", "gapFraction", "bits", "columnLogoStack", "a", "b", "letter", "count", "TextTooltip", "data", "ArcTooltip", "arcs", "partners", "arc", "TrackTooltipContent", "TrackTooltipContent_default", "import_mobx_state_tree", "maxClickTravel", "dragSelection", "model", "start", "cellAt", "anchor", "clientX", "clientY", "dragging", "onMove", "event", "onUp", "import_react", "useHoverAnchor", "anchor", "setAnchor", "hoverAt", "event", "value", "clearAnchor", "useTrackHover", "model", "tooltip", "anchor", "hoverAt", "clearAnchor", "useHoverAnchor", "colAt", "clientX", "left", "onMouseMove", "event", "el", "col", "hit", "onMouseDown", "dragSelection", "onMouseLeave", "TrackInfoDialog", "useStyles", "theme", "TrackLabel", "model", "track", "anchorEl", "setAnchorEl", "closeMenu", "drawLabels", "fontSize", "width", "name", "height", "classes", "trackLabelHeight", "closeSize", "React", "Close_default", "event", "ArrowDropDown_default", "onClose", "Track", "resizeHandleWidth", "rowPanelsWidth", "showColumnStats", "ref", "useWheelScroll", "anchor", "onMouseMove", "onMouseDown", "onMouseLeave", "useTrackHover", "onMsaKey", "TrackBlocks_default", "BaseTooltip", "TrackTooltipContent_default", "Track_default", "import_react", "import_mobx_react", "width", "VerticalScrollbar", "model", "msaAreaHeight", "scrollY", "totalHeight", "unit", "t", "b", "onDrag", "delta", "startScroll", "React", "event", "y", "DragHandle", "VerticalScrollbar_default", "import_react", "import_useMeasure", "import_jsx_runtime", "Tune_default", "_jsx", "import_material", "React", "r", "f", "clsx", "clsx_default", "composeClasses", "slots", "getUtilityClass", "classes", "output", "slotName", "slot", "buffer", "start", "i", "value", "fastDeepAssign", "target", "source", "sourceIsArray", "targetIsArray", "isPrimitive", "isPrimitiveOrBuiltIn", "clone", "mergeArray", "mergeObject", "cloneArray", "value", "i", "il", "result", "cloneObject", "key", "tl", "isMergeableObject", "entry", "formatMuiErrorMessage", "code", "args", "url", "arg", "capitalize", "string", "formatMuiErrorMessage", "isObjectEmpty", "object", "_", "React", "import_react_is", "isPlainObject", "item", "prototype", "deepClone", "source", "output", "key", "deepmerge", "target", "options", "MIN_WIDTH_PATTERN", "sortContainerQueries", "theme", "css", "hasContainerQuery", "keys", "key", "a", "b", "result", "i", "value", "isCqShorthand", "breakpointKeys", "getContainerQuery", "shorthand", "matches", "containerQuery", "containerName", "cssContainerQueries", "themeInput", "toContainerQuery", "mediaQuery", "name", "attachCq", "node", "args", "containerQueries", "sortBreakpointsValues", "values", "breakpointsAsArray", "key", "breakpoint1", "breakpoint2", "acc", "obj", "createBreakpoints", "breakpoints", "unit", "step", "other", "sortedValues", "keys", "up", "down", "between", "start", "end", "endIndex", "only", "not", "keyIndex", "mediaKeys", "i", "EMPTY_THEME", "values", "DEFAULT_BREAKPOINTS", "createBreakpoints", "defaultContainerQueries", "containerName", "key", "result", "handleBreakpoints", "props", "propValue", "styleFromPropValue", "iterateBreakpoints", "mediaKey", "value", "initialKey", "finalValue", "fastDeepAssign", "target", "theme", "callback", "breakpoints", "buildBreakpoint", "breakpointValues", "isCqShorthand", "containerKey", "getContainerQuery", "cssKey", "createEmptyBreakpointObject", "breakpoints", "DEFAULT_BREAKPOINTS", "mediaKeys", "result", "i", "removeUnusedBreakpoints", "style", "breakpointKeys", "key", "isObjectEmpty", "hasBreakpoint", "breakpoints", "value", "i", "valueKeys", "isCqShorthand", "getStyleValue2", "themeMapping", "transform", "userValue", "alternateProp", "value", "getPath", "obj", "pathInput", "checkVars", "path", "val", "getPathImpl", "object", "lastResult", "result", "index", "lastKey", "alternateKey", "capitalize", "style", "options", "prop", "cssProperty", "themeKey", "fn", "props", "propValue", "theme", "handleBreakpoints", "valueFinal", "EMPTY_THEME", "properties", "directions", "aliases", "CSS_PROPERTIES", "key", "keyProperty", "keyDirection", "property", "direction", "value", "dir", "marginKeys", "paddingKeys", "spacingKeys", "createUnaryUnit", "theme", "themeKey", "defaultValue", "propName", "themeSpacing", "getPath", "val", "abs", "transformed", "createUnarySpacing", "getValue", "transformer", "propValue", "container", "style", "props", "keys", "result", "prop", "cssProperties", "iterateBreakpoints", "mediaKey", "target", "i", "marginFn", "margin", "paddingFn", "padding", "spacingFn", "compose", "styles", "handlers", "acc", "style", "prop", "fn", "props", "result", "fastDeepAssign", "compose_default", "borderTransform", "value", "createBorderStyle", "prop", "transform", "style", "border", "borderTop", "borderRight", "borderBottom", "borderLeft", "borderColor", "borderTopColor", "borderRightColor", "borderBottomColor", "borderLeftColor", "outline", "outlineColor", "borderRadius", "props", "transformer", "createUnaryUnit", "styleFromPropValue", "propValue", "getValue", "handleBreakpoints", "borders", "compose_default", "gap", "props", "transformer", "createUnaryUnit", "styleFromPropValue", "propValue", "getValue", "handleBreakpoints", "columnGap", "rowGap", "gridColumn", "style", "gridRow", "gridAutoFlow", "gridAutoColumns", "gridAutoRows", "gridTemplateColumns", "gridTemplateRows", "gridTemplateAreas", "gridArea", "grid", "compose_default", "paletteTransform", "value", "userValue", "color", "style", "bgcolor", "backgroundColor", "palette", "compose_default", "breakpointsValues", "values", "sizingTransform", "value", "width", "style", "maxWidth", "props", "styleFromPropValue", "propValue", "breakpoint", "handleBreakpoints", "minWidth", "height", "maxHeight", "minHeight", "sizeWidth", "sizeHeight", "boxSizing", "sizing", "compose_default", "defaultSxConfig", "borderTransform", "borderRadius", "paletteTransform", "padding", "margin", "value", "gap", "rowGap", "columnGap", "sizingTransform", "maxWidth", "defaultSxConfig_default", "EMPTY_THEME", "unstable_createStyleFunctionSx", "styleFunctionSx", "props", "sx", "theme", "nested", "config", "defaultSxConfig_default", "wrapper", "process", "sxInput", "sxObject", "breakpoints", "DEFAULT_BREAKPOINTS", "css", "createEmptyBreakpointObject", "styleKey", "value", "callIfFn", "setThemeValue", "hasBreakpoint", "iterateBreakpoints", "mediaKey", "finalValue", "sortContainerQueries", "removeUnusedBreakpoints", "styleFunctionSx_default", "prop", "options", "themeKey", "style", "fastDeepAssign", "cssProperty", "transform", "themeMapping", "getPath", "valueFinal", "getStyleValue2", "maybeFn", "arg", "React", "_extends", "n", "e", "t", "r", "React", "import_react", "isDevelopment", "sheetForTag", "tag", "i", "createStyleElement", "options", "StyleSheet", "_this", "before", "_proto", "nodes", "rule", "sheet", "_tag$parentNode", "MS", "MOZ", "WEBKIT", "COMMENT", "RULESET", "DECLARATION", "IMPORT", "KEYFRAMES", "LAYER", "abs", "from", "assign", "hash", "value", "length", "charat", "trim", "match", "pattern", "replace", "replacement", "indexof", "search", "index", "substr", "begin", "end", "strlen", "sizeof", "append", "array", "combine", "callback", "line", "column", "length", "position", "character", "characters", "node", "value", "root", "parent", "type", "props", "children", "copy", "assign", "char", "prev", "charat", "next", "peek", "caret", "slice", "begin", "end", "substr", "token", "alloc", "strlen", "dealloc", "delimit", "trim", "delimiter", "whitespace", "type", "character", "peek", "next", "token", "escaping", "index", "count", "next", "character", "slice", "caret", "peek", "delimiter", "type", "position", "commenter", "from", "identifier", "token", "compile", "value", "dealloc", "parse", "alloc", "root", "parent", "rule", "rules", "rulesets", "pseudo", "points", "declarations", "index", "offset", "length", "atrule", "property", "previous", "variable", "scanning", "ampersand", "character", "type", "props", "children", "reference", "characters", "next", "charat", "indexof", "replace", "delimit", "whitespace", "escaping", "caret", "peek", "append", "comment", "commenter", "strlen", "declaration", "ruleset", "prev", "from", "identifier", "post", "size", "sizeof", "i", "j", "k", "x", "y", "substr", "abs", "z", "trim", "node", "RULESET", "COMMENT", "char", "DECLARATION", "serialize", "children", "callback", "output", "length", "sizeof", "i", "stringify", "element", "index", "LAYER", "IMPORT", "DECLARATION", "COMMENT", "KEYFRAMES", "RULESET", "strlen", "middleware", "collection", "length", "sizeof", "element", "index", "children", "callback", "output", "i", "rulesheet", "memoize", "fn", "cache", "arg", "identifierWithPointTracking", "begin", "points", "index", "previous", "character", "peek", "token", "next", "slice", "position", "toRules", "parsed", "delimit", "from", "getRules", "value", "dealloc", "alloc", "fixedElements", "compat", "element", "parent", "isImplicitRule", "rules", "parentRules", "i", "k", "j", "removeLabel", "prefix", "length", "hash", "WEBKIT", "MOZ", "MS", "replace", "strlen", "charat", "indexof", "prefixer", "children", "callback", "DECLARATION", "KEYFRAMES", "serialize", "copy", "RULESET", "combine", "match", "defaultStylisPlugins", "createCache", "options", "key", "ssrStyles", "node", "dataEmotionAttribute", "stylisPlugins", "inserted", "container", "nodesToHydrate", "attrib", "_insert", "omnipresentPlugins", "currentSheet", "finalizingPlugins", "stringify", "rulesheet", "rule", "serializer", "middleware", "stylis", "styles", "compile", "selector", "serialized", "sheet", "shouldCache", "cache", "StyleSheet", "isBrowser", "getRegisteredStyles", "registered", "registeredStyles", "classNames", "rawClassName", "className", "registerStyles", "cache", "serialized", "isStringTag", "insertStyles", "current", "murmur2", "str", "h", "k", "i", "len", "unitlessKeys", "isDevelopment", "hyphenateRegex", "animationRegex", "isCustomProperty", "property", "isProcessableValue", "value", "processStyleName", "memoize", "styleName", "processStyleValue", "key", "match", "p1", "p2", "cursor", "unitlessKeys", "noComponentSelectorMessage", "handleInterpolation", "mergedProps", "registered", "interpolation", "componentSelector", "keyframes", "serializedStyles", "next", "styles", "createStringFromObject", "previousCursor", "result", "asString", "cached", "obj", "string", "i", "_i", "interpolated", "labelPattern", "serializeStyles", "args", "stringMode", "strings", "asTemplateStringsArr", "templateStringsArr", "identifierName", "name", "murmur2", "React", "syncFallback", "create", "useInsertionEffect", "useInsertionEffectAlwaysWithSyncFallback", "isDevelopment", "EmotionCacheContext", "createCache", "CacheProvider", "withEmotionCache", "func", "props", "ref", "cache", "EmotionCacheContext", "ThemeContext", "hasOwn", "typePropName", "createEmotionProps", "type", "props", "newProps", "_key", "Insertion", "_ref", "cache", "serialized", "isStringTag", "registerStyles", "useInsertionEffectAlwaysWithSyncFallback", "insertStyles", "Emotion", "withEmotionCache", "ref", "cssProp", "WrappedComponent", "registeredStyles", "className", "getRegisteredStyles", "serializeStyles", "ThemeContext", "_key2", "isDevelopment", "Emotion$1", "React", "import_hoist_non_react_statics", "jsx", "type", "props", "args", "hasOwn", "argsLength", "createElementArgArray", "Emotion$1", "createEmotionProps", "i", "_jsx", "JSX", "css", "_len", "args", "_key", "serializeStyles", "keyframes", "insertable", "name", "React", "reactPropsRegex", "isPropValid", "memoize", "prop", "isDevelopment", "testOmitPropsOnStringTag", "isPropValid", "testOmitPropsOnComponent", "key", "getDefaultShouldForwardProp", "tag", "composeShouldForwardProps", "options", "isReal", "shouldForwardProp", "optionsShouldForwardProp", "propName", "Insertion", "_ref", "cache", "serialized", "isStringTag", "registerStyles", "useInsertionEffectAlwaysWithSyncFallback", "insertStyles", "createStyled", "baseTag", "identifierName", "targetClassName", "defaultShouldForwardProp", "shouldUseAs", "args", "styles", "templateStringsArr", "len", "i", "Styled", "withEmotionCache", "props", "ref", "FinalTag", "className", "classInterpolations", "mergedProps", "ThemeContext", "getRegisteredStyles", "serializeStyles", "finalShouldForwardProp", "newProps", "_key", "nextTag", "nextOptions", "newStyled", "_extends", "import_react", "tags", "styled", "createStyled", "tagName", "styled", "tag", "options", "styled_engine_default", "internal_mutateStyles", "processor", "wrapper", "internal_serializeStyles", "styles", "serializeStyles", "shape", "shape_default", "createSpacing", "spacingInput", "transform", "createUnarySpacing", "spacing", "argsInput", "argument", "output", "applyStyles", "key", "styles", "theme", "selector", "createTheme", "options", "args", "breakpointsInput", "paletteInput", "spacingInput", "shapeInput", "other", "breakpoints", "createBreakpoints", "spacing", "createSpacing", "muiTheme", "deepmerge", "shape_default", "cssContainerQueries", "applyStyles", "acc", "argument", "defaultSxConfig_default", "props", "styleFunctionSx_default", "createTheme_default", "React", "isObjectEmpty", "obj", "useThemeWithoutDefault", "defaultTheme", "contextTheme", "ThemeContext", "useThemeWithoutDefault_default", "systemDefaultTheme", "createTheme_default", "useTheme", "defaultTheme", "useThemeWithoutDefault_default", "useTheme_default", "defaultGenerator", "componentName", "createClassNameGenerator", "generate", "generator", "ClassNameGenerator", "ClassNameGenerator_default", "globalStateClasses", "generateUtilityClass", "componentName", "slot", "globalStatePrefix", "globalStateClass", "ClassNameGenerator_default", "generateUtilityClasses", "componentName", "slots", "globalStatePrefix", "result", "slot", "generateUtilityClass", "preprocessStyles", "input", "variants", "style", "result", "internal_serializeStyles", "variant", "systemDefaultTheme", "createTheme_default", "shouldForwardProp", "prop", "shallowLayer", "serialized", "layerName", "defaultOverridesResolver", "slot", "_props", "styles", "attachTheme", "props", "themeId", "defaultTheme", "isObjectEmpty", "processStyle", "style", "resolvedStyle", "subStyle", "rootStyle", "variants", "otherStyles", "internal_serializeStyles", "processStyleVariants", "results", "mergedState", "variantLoop", "variant", "key", "createStyled", "input", "rootShouldForwardProp", "slotShouldForwardProp", "styleAttachTheme", "tag", "inputOptions", "internal_mutateStyles", "styleFunctionSx_default", "componentName", "componentSlot", "inputSkipVariantsResolver", "inputSkipSx", "overridesResolver", "lowercaseFirstLetter", "options", "skipVariantsResolver", "skipSx", "shouldForwardPropOption", "isStringTag", "defaultStyledResolver", "styled_engine_default", "generateStyledLabel", "transformStyle", "isPlainObject", "preprocessStyles", "muiStyledResolver", "expressionsInput", "expressionsHead", "expressionsBody", "expressionsTail", "styleOverrides", "resolvedStyleOverrides", "slotKey", "themeVariants", "inputStrings", "placeholdersHead", "placeholdersTail", "outputStrings", "expressions", "Component", "generateStyledLabel", "componentName", "componentSlot", "isStringTag", "tag", "lowercaseFirstLetter", "string", "resolveProps", "defaultProps", "props", "mergeClassNameAndStyle", "output", "key", "propName", "defaultSlotProps", "slotProps", "slotKey", "slotPropName", "defaultSlotPropValue", "slotPropValue", "args", "clsx_default", "React", "useEnhancedEffect", "useEnhancedEffect_default", "clamp", "val", "min", "max", "clamp_default", "clampWrapper", "value", "min", "max", "clamp_default", "hexToRgb", "color", "re", "colors", "index", "decomposeColor", "color", "hexToRgb", "marker", "type", "formatMuiErrorMessage", "values", "colorSpace", "value", "colorChannel", "decomposedColor", "val", "idx", "private_safeColorChannel", "warning", "recomposeColor", "n", "hslToRgb", "color", "decomposeColor", "values", "h", "s", "l", "a", "f", "n", "k", "type", "rgb", "recomposeColor", "getLuminance", "val", "getContrastRatio", "foreground", "background", "lumA", "lumB", "alpha", "value", "clampWrapper", "private_safeAlpha", "warning", "darken", "coefficient", "i", "private_safeDarken", "lighten", "private_safeLighten", "emphasize", "private_safeEmphasize", "React", "import_jsx_runtime", "PropsContext", "getThemeProps", "params", "theme", "name", "props", "config", "resolveProps", "useDefaultProps", "ctx", "PropsContext", "arg", "unstable_memoTheme", "styleFn", "lastValue", "lastTheme", "props", "value", "preprocessStyles", "createGetCssVar", "prefix", "appendVar", "vars", "value", "field", "fallbacks", "prototypePollutingKeys", "assignNestedKeys", "obj", "keys", "value", "arrayKeys", "temp", "index", "k", "walkObjectDeep", "callback", "shouldSkipPaths", "recurse", "object", "parentKeys", "key", "getCssValue", "prop", "cssVarsParser", "theme", "options", "prefix", "shouldSkipGeneratingVar", "css", "vars", "varsWithDefaults", "cssVar", "resolvedValue", "prepareCssVars", "theme", "parserConfig", "getSelector", "defaultGetSelector", "disableCssColorScheme", "selector", "enableContrastVars", "colorSchemes", "components", "defaultColorScheme", "otherTheme", "rootVars", "rootCss", "rootVarsWithDefaults", "cssVarsParser", "themeVars", "colorSchemesMap", "defaultScheme", "otherColorSchemes", "key", "scheme", "vars", "css", "varsWithDefaults", "deepmerge", "colorScheme", "cssObject", "rule", "schemeVars", "stylesheets", "insertStyleSheet", "defaultSchemeVal", "other", "cssColorSheme", "finalCss", "prepareCssVars_default", "createGetColorSchemeSelector", "selector", "colorScheme", "common", "common_default", "grey", "grey_default", "purple", "purple_default", "red", "red_default", "orange", "orange_default", "blue", "blue_default", "lightBlue", "lightBlue_default", "green", "green_default", "getLight", "common_default", "light", "getDark", "dark", "addLightOrDark", "intent", "direction", "shade", "tonalOffset", "tonalOffsetLight", "tonalOffsetDark", "lighten", "darken", "mixLightOrDark", "colorSpace", "getDefaultPrimary", "mode", "blue_default", "getDefaultSecondary", "purple_default", "getDefaultError", "red_default", "getDefaultInfo", "lightBlue_default", "getDefaultSuccess", "green_default", "getDefaultWarning", "orange_default", "contrastColor", "background", "createPalette", "palette", "contrastThreshold", "other", "primary", "secondary", "error", "info", "success", "warning", "getContrastText", "getContrastRatio", "augmentColor", "color", "name", "mainShade", "lightShade", "darkShade", "formatMuiErrorMessage", "modeHydrated", "deepmerge", "grey_default", "focusVisibleOffsetVar", "focusVisibleBehaviorVar", "focusVisibleShadowVar", "offsetValue", "behaviorValue", "outsetFocusRing", "applyChildrenFocusVisible", "color", "mergeFocusVisibleInput", "optionsFocusVisible", "args", "acc", "arg", "deepmerge", "isResolvedFocusVisible", "input", "focusVisibleOffsetVar", "resolveFocusVisible", "outlineColor", "wireFocusVisibleVars", "focusVisibleShadowVar", "resolved", "offset", "offsetPx", "offsetValue", "standaloneBoxShadows", "focusVisibleBehaviorVar", "behaviorValue", "prepareTypographyVars", "typography", "vars", "entry", "key", "value", "createMixins", "breakpoints", "mixins", "round", "value", "caseAllCaps", "defaultFontFamily", "createTypography", "palette", "typography", "fontFamily", "fontSize", "fontWeightLight", "fontWeightRegular", "fontWeightMedium", "fontWeightBold", "htmlFontSize", "allVariants", "pxToRem2", "other", "coef", "pxToRem", "size", "buildVariant", "fontWeight", "lineHeight", "letterSpacing", "casing", "variants", "deepmerge", "createShadow", "px", "shadows", "shadows_default", "DEFAULT_TRANSITION_PROPS", "EMPTY_OPTIONS", "easing", "duration", "formatMs", "milliseconds", "getAutoHeightDuration", "height", "constant", "createTransitions", "inputTransitions", "transitions", "mergedEasing", "mergedDuration", "createTransitionValue", "props", "options", "durationOption", "easingOption", "delay", "other", "animatedProp", "create", "EMPTY_MOTION", "createMotion", "inputMotion", "zIndex", "zIndex_default", "isSerializable", "val", "isPlainObject", "stringifyTheme", "baseTheme", "serializableTheme", "serializeTheme", "object", "array", "index", "key", "value", "coefficientToPercentage", "coefficient", "parseAddition", "str", "numbers", "sum", "i", "toRgb", "color", "hslToRgb", "toChannelVar", "match", "name", "fallback", "channel", "colorChannel", "attachColorManipulators", "theme", "obj", "alphaValue", "private_safeColorChannel", "alpha", "lighten", "darken", "createThemeNoVars", "options", "args", "breakpointsInput", "mixinsInput", "spacingInput", "paletteInput", "motionInput", "transitionsInput", "typographyInput", "shapeInput", "colorSpace", "other", "formatMuiErrorMessage", "palette", "createPalette", "systemTheme", "createTheme_default", "muiTheme", "deepmerge", "createMixins", "shadows_default", "createTypography", "createMotion", "createTransitions", "zIndex_default", "acc", "argument", "resolveFocusVisible", "defaultSxConfig_default", "props", "styleFunctionSx_default", "stringifyTheme", "createThemeNoVars_default", "getOverlayAlpha", "elevation", "alphaValue", "defaultDarkOverlays", "_", "index", "overlay", "getOverlayAlpha", "getOpacity", "mode", "getOverlays", "createColorScheme", "options", "paletteInput", "opacity", "overlays", "colorSpace", "other", "palette", "createPalette", "shouldSkipGeneratingVar", "keys", "excludeVariablesFromRoot", "cssVarPrefix", "_", "index", "excludeVariablesFromRoot_default", "createGetSelector_default", "theme", "colorScheme", "css", "root", "selector", "rule", "excludedVariables", "excludeVariablesFromRoot_default", "cssVar", "assignNode", "obj", "keys", "k", "setColor", "key", "defaultValue", "toRgb", "color", "hslToRgb", "setColorChannel", "private_safeColorChannel", "getSpacingVal", "spacingInput", "silent", "fn", "createGetCssVar", "cssVarPrefix", "attachColorScheme", "colorSpace", "colorSchemes", "scheme", "restTheme", "colorScheme", "mode", "createColorScheme", "palette", "muiTheme", "createThemeNoVars_default", "getOpacity", "getOverlays", "createThemeWithVars", "options", "args", "colorSchemesInput", "defaultColorSchemeInput", "disableCssColorScheme", "nativeColor", "shouldSkipGeneratingVar", "selector", "rootSelector", "input", "firstColorScheme", "defaultColorScheme", "getCssVar", "defaultSchemeInput", "builtInLight", "builtInDark", "customColorSchemes", "defaultScheme", "formatMuiErrorMessage", "theme", "prepareTypographyVars", "setCssVarColor", "cssVar", "tokens", "colorToken", "colorMix", "method", "coefficient", "mixer", "private_safeAlpha", "private_safeDarken", "private_safeLighten", "snackbarContentBackground", "private_safeEmphasize", "dark", "light", "colors", "acc", "argument", "deepmerge", "focusVisibleInput", "mergeFocusVisibleInput", "resolveFocusVisible", "parserConfig", "createGetSelector_default", "vars", "generateThemeVars", "generateStyleSheets", "prepareCssVars_default", "value", "createSpacing", "createUnarySpacing", "createGetColorSchemeSelector", "defaultSxConfig_default", "props", "styleFunctionSx_default", "stringifyTheme", "attachColorScheme", "theme", "scheme", "colorScheme", "createPalette", "createTheme", "options", "args", "palette", "cssVariables", "initialColorSchemes", "initialDefaultColorScheme", "other", "defaultColorSchemeInput", "defaultScheme", "colorSchemesInput", "createThemeNoVars_default", "paletteOptions", "focusVisibleInput", "rawFocusVisible", "mergeFocusVisibleInput", "authoredColor", "isResolvedFocusVisible", "outlineColor", "rest", "schemePalette", "resolveFocusVisible", "createThemeWithVars", "defaultTheme", "createTheme", "defaultTheme_default", "identifier_default", "useTheme", "theme", "useTheme_default", "defaultTheme_default", "identifier_default", "import_jsx_runtime", "slotShouldForwardProp", "prop", "slotShouldForwardProp_default", "rootShouldForwardProp", "prop", "slotShouldForwardProp_default", "rootShouldForwardProp_default", "styled", "createStyled", "identifier_default", "defaultTheme_default", "rootShouldForwardProp_default", "styled_default", "memoTheme", "unstable_memoTheme", "memoTheme_default", "React", "import_jsx_runtime", "useDefaultProps", "params", "capitalize_default", "capitalize", "hasCorrectMainProperty", "obj", "checkSimplePaletteColorValues", "additionalPropertiesToCheck", "value", "createSimplePaletteValueFilter", "React", "getPaperUtilityClass", "slot", "generateUtilityClass", "paperClasses", "generateUtilityClasses", "defaultStyles", "resolveReducedMotionStyles", "reducedMotion", "styles", "EMPTY_STYLE", "DEFAULT_TRANSITION_PROPS", "EMPTY_OPTIONS", "getReducedMotionStyles", "theme", "styles", "resolvedStyles", "defaultStyles", "resolveReducedMotionStyles", "getTransitionStyles", "props", "DEFAULT_TRANSITION_PROPS", "options", "EMPTY_OPTIONS", "transition", "reducedMotionStyles", "EMPTY_STYLE", "transitionStyles", "import_jsx_runtime", "useUtilityClasses", "ownerState", "square", "elevation", "variant", "classes", "slots", "composeClasses", "getPaperUtilityClass", "PaperRoot", "styled_default", "props", "styles", "memoTheme_default", "theme", "getTransitionStyles", "Paper", "inProps", "ref", "useDefaultProps", "useTheme", "className", "component", "other", "_jsx", "clsx_default", "alpha", "getOverlayAlpha", "Paper_default", "getAppBarUtilityClass", "slot", "generateUtilityClass", "appBarClasses", "generateUtilityClasses", "import_jsx_runtime", "useUtilityClasses", "ownerState", "color", "position", "classes", "slots", "capitalize_default", "composeClasses", "getAppBarUtilityClass", "joinVars", "var1", "var2", "AppBarRoot", "styled_default", "Paper_default", "props", "styles", "memoTheme_default", "theme", "createSimplePaletteValueFilter", "applyChildrenFocusVisible", "AppBar", "inProps", "ref", "useDefaultProps", "className", "enableColorOnDark", "other", "_jsx", "clsx_default", "AppBar_default", "import_mobx_react", "import_react", "import_ui", "import_tss_react", "import_material", "import_mobx_react", "useStyles", "StatusMessage", "model", "variant", "status", "classes", "message", "onCancel", "React", "StatusMessage_default", "import_react", "import_tss_react", "import_material", "import_mobx_react", "useStyles", "HeaderInfoArea", "model", "mouseOverRowName", "mouseCol", "classes", "mid", "pos", "letter", "React", "HeaderInfoArea_default", "import_react", "import_material", "import_mobx_react", "GapThresholdDialog", "HiddenColumnsChip", "model", "n", "React", "onClose", "HiddenColumnsChip_default", "import_react", "import_jsx_runtime", "Warning_default", "_jsx", "import_material", "import_mobx_react", "LoadWarnings", "model", "warnings", "React", "Warning_default", "LoadWarnings_default", "import_react", "import_CascadingMenuButton", "import_jsx_runtime", "Build_default", "_jsx", "import_jsx_runtime", "InsertDriveFile_default", "_jsx", "import_jsx_runtime", "Visibility_default", "_jsx", "import_material", "import_mobx_react", "import_react", "import_react", "import_material", "import_mobx_react", "scrollZoomLabel", "scrollZoomHelp", "ScrollZoomCheckbox", "model", "React", "ScrollZoomCheckbox_default", "schemes", "catalogedSchemeNames", "s", "colorSchemeMenuItems", "model", "colorSchemeName", "customColorScheme", "sequenceType", "alphabet", "radio", "entry", "top", "e", "import_react", "FeatureFilterDialog", "AnnotationFileDialog", "openAnnotationFileItem", "model", "handleClose", "annotationsSubMenu", "showDomains", "actuallyShowDomains", "subFeatureRows", "typeItems", "inlineTypes", "types", "accession", "name", "onClose", "AboutDialog", "ExportSVGDialog", "GapThresholdDialog", "GoToDialog", "HelpDialog", "MetadataDialog", "tutorialsUrl", "radio", "label", "checked", "onClick", "toggle", "set", "action", "disabled", "subMenu", "items", "display", "when", "cond", "fileMenuItems", "model", "openAnnotationFileItem", "onClose", "zoomSubMenu", "scrollZoomLabel", "arg", "gapPresets", "gapsSubMenu", "hideGaps", "allowedGappyness", "custom", "pct", "treeOrderLabels", "outgroupLabel", "outgroup", "first", "rest", "treeSubMenu", "drawTree", "showBranchLen", "labelsAlignRight", "drawNodeLabels", "drawLabels", "treeAreaWidth", "showTreeOverview", "showTreeScaleBar", "treeOrder", "treeRoot", "rotated", "treeOrders", "order", "viewMenuItems", "canGoTo", "trackSettingsItems", "alignmentSettingsItems", "colorSettingsItems", "cellFill", "filteredAnnotations", "colorSchemeMenuItems", "neighborJoiningItem", "rows", "tooManyRows", "maxNeighborJoiningRows", "e", "toolsMenuItems", "helpMenuItems", "menuButtonSx", "menus", "fileMenuItems", "React", "InsertDriveFile_default", "viewMenuItems", "Visibility_default", "toolsMenuItems", "Build_default", "helpMenuItems", "Help_default", "MenuBar", "model", "embeddedMode", "name", "items", "icon", "button", "CascadingMenuButton", "MenuBar_default", "import_react", "import_material", "import_mobx_react", "MultiAlignmentSelector", "model", "currentAlignment", "alignmentNames", "seen", "React", "event", "option", "index", "n", "MultiAlignmentSelector_default", "import_react", "import_jsx_runtime", "Clear_default", "_jsx", "import_jsx_runtime", "ContentCopy_default", "_jsx", "import_jsx_runtime", "ZoomIn_default", "_jsx", "import_material", "import_mobx_react", "count", "n", "noun", "SelectionMenu", "model", "anchorEl", "setAnchorEl", "selectionSize", "selectionFileSpan", "label", "items", "ContentCopy_default", "copy", "ZoomIn_default", "Clear_default", "React", "ArrowDropDown_default", "event", "text", "Icon", "act", "SelectionMenu_default", "import_react", "import_tss_react", "import_jsx_runtime", "LinkOff_default", "_jsx", "import_material", "import_mobx_react", "useStyles", "theme", "size", "bytes", "UnshareableDataWarning", "model", "unshareableData", "classes", "what", "React", "LinkOff_default", "UnshareableDataWarning_default", "import_react", "import_jsx_runtime", "FitScreen_default", "_jsx", "import_jsx_runtime", "RestartAlt_default", "_jsx", "import_jsx_runtime", "ZoomOut_default", "_jsx", "import_material", "import_mobx_react", "ZoomControls", "model", "React", "ZoomIn_default", "ZoomOut_default", "FitScreen_default", "RestartAlt_default", "ZoomControls_default", "Header", "model", "toolbarStart", "toolbarEnd", "ref", "height", "useMeasure", "React", "AppBar_default", "MenuBar_default", "Tune_default", "ZoomControls_default", "ScrollZoomCheckbox_default", "HiddenColumnsChip_default", "MultiAlignmentSelector_default", "SelectionMenu_default", "HeaderInfoArea_default", "LoadWarnings_default", "UnshareableDataWarning_default", "StatusMessage_default", "Header_default", "import_react", "import_mobx_react", "Minimap", "model", "minimapHeight", "msaCanvasWidth", "highResScaleFactor", "theme", "useCanvasTheme", "unit", "s", "w", "polygonHeight", "polygonPoints", "getMinimapLayout", "barWidth", "barHeight", "ref", "useCanvasAutorun", "ctx", "thumbnail", "msaThumbnail", "r", "minimapDomainRects", "onDrag", "delta", "startScroll", "React", "event", "x", "DragHandle", "scrollbarThumbFill", "Minimap_default", "import_react", "import_mobx_react", "import_react", "import_jsx_runtime", "ExpandLess_default", "_jsx", "import_material", "import_mobx_react", "AnnotationLegend", "model", "legends", "expanded", "rows", "legendRows", "ExpandIcon", "ExpandLess_default", "ExpandMore_default", "React", "legendZIndex", "row", "i", "AnnotationLegend_default", "import_react", "import_mobx_react", "calculateBlocks", "mapSize", "blockSize", "viewportPos", "viewportSize", "clamped", "end", "minTile", "maxTile", "blocks", "tile", "maxStretch", "margin", "blocksAt", "view", "axis", "scale", "marginFraction", "size", "pos", "map", "pad", "calculateBlocks", "within", "need", "have", "takeZoomSnapshot", "withMargin", "m", "zoomSnapshotScale", "snap", "zoomSnapshotCovers", "sx", "sy", "import_react", "import_material", "Loading", "React", "import_react", "import_BaseTooltip", "import_mobx_react", "import_react", "useMsaBlockMouse", "model", "offsetX", "offsetY", "anchor", "hoverAt", "clearAnchor", "useHoverAnchor", "downAt", "cellMapper", "el", "left", "top", "scrollX", "scrollY", "clientX", "clientY", "colRow", "event", "inBounds", "col", "row", "onMouseMove", "pos", "hit", "hasTooltip", "onMouseDown", "dragSelection", "onClick", "down", "maxClickTravel", "mouseClickCol", "mouseClickRow", "same", "keep", "onMouseLeave", "MSACanvasBlock", "model", "offsetX", "offsetY", "blockSize", "highResScaleFactor", "theme", "useCanvasTheme", "anchor", "onMouseMove", "onMouseDown", "onClick", "onMouseLeave", "useMsaBlockMouse", "canvasSize", "drawnAt", "ref", "useCanvasAutorun", "ctx", "snap", "rasterTiles", "rasterApplies", "drawMsaRaster", "renderMSABlock", "hoveredInsertion", "mouseOverDomains", "React", "event", "BaseTooltip", "d", "MSACanvasBlock_default", "import_react", "import_material", "hinted", "zoomKey", "useWheelZoomHint", "model", "visible", "setVisible", "timer", "onWheelScroll", "event", "WheelZoomHint", "React", "MSACanvas", "model", "MSA", "msaFilehandle", "height", "msaCanvasWidth", "blocks2d", "scrollX", "scrollY", "zoomSnapshot", "blocks", "by", "bx", "scale", "zoomSnapshotScale", "ref", "hint", "useWheelZoomHint", "onPointerDown", "touchAction", "useWheelScroll", "React", "alignmentAriaLabel", "event", "onMsaKey", "MSACanvasBlock_default", "Loading", "WheelZoomHint", "MSACanvas_default", "import_react", "import_mobx_state_tree", "import_mobx_react", "renderMouseover", "ctx", "model", "theme", "mouseCol", "colWidth", "width", "height", "rowHeight", "scrollX", "scrollY", "mouseRow", "mouseClickRow", "mouseClickCol", "highResScaleFactor", "hoveredRowIndices", "rowBand", "index", "colBand", "renderPersistentHighlights", "renderSelection", "multiRowHoverColor", "rowIndex", "hoverColor", "clickColor", "MSAMouseoverCanvas", "model", "height", "width", "highResScaleFactor", "theme", "useCanvasTheme", "canvasWidth", "canvasHeight", "ref", "useCanvasAutorun", "ctx", "renderMouseover", "React", "msaOverlayZIndex", "MSAMouseoverCanvas_default", "MSAPanel", "model", "React", "MSACanvas_default", "MSAMouseoverCanvas_default", "AnnotationLegend_default", "MSAPanel_default", "import_react", "import_mobx_react", "RowPanelHeaders", "model", "resolvedRowPanels", "rowPanelsHeaderHeight", "fontSize", "React", "panel", "across", "headerRunsAcross", "RowPanelHeaders_default", "import_react", "import_mobx_react", "import_react", "import_BaseTooltip", "import_mobx_react", "featureField", "annotation", "field", "value", "featureName", "hoverLines", "model", "panel", "name", "x", "span", "s", "annotation", "strand", "value", "featureField", "featureName", "RowPanelBlock", "offsetY", "anchor", "hoverAt", "clearAnchor", "useHoverAnchor", "theme", "useCanvasTheme", "blockSize", "highResScaleFactor", "rowHeight", "width", "height", "canvasWidth", "canvasHeight", "ref", "useCanvasAutorun", "ctx", "renderRowPanel", "React", "event", "left", "top", "row", "lines", "BaseTooltip", "line", "RowPanelBlock_default", "RowPanel", "model", "panel", "ref", "height", "blocksY", "scrollY", "onPointerDown", "touchAction", "useWheelScroll", "React", "block", "RowPanelBlock_default", "RowPanels", "resolvedRowPanels", "RowPanels_default", "import_react", "import_jsx_runtime", "ArrowRight_default", "_jsx", "import_material", "React", "isFocusVisible", "element", "React", "useForkRef", "refs", "cleanupRef", "refEffect", "instance", "cleanups", "ref", "refCallback", "refCleanup", "value", "useForkRef_default", "useForkRef", "React", "useEventCallback", "fn", "ref", "useEnhancedEffect_default", "args", "useEventCallback_default", "useEventCallback_default", "React", "React", "useFocusableWhenDisabled", "parameters", "focusableWhenDisabled", "disabled", "composite", "tabIndexProp", "isNativeButton", "isFocusableComposite", "isNonFocusableComposite", "additionalProps", "event", "EMPTY", "useButtonBase", "parameters", "nativeButton", "nativeButtonProp", "internalNativeButton", "allowInferredHostMismatch", "disabled", "type", "hasFormAction", "tabIndex", "focusableWhenDisabledParam", "stopEventPropagation", "onBeforeKeyDown", "onBeforeKeyUp", "rootRef", "focusableWhenDisabled", "focusableWhenDisabledProps", "useFocusableWhenDisabled", "hasNativeKeyboardActivation", "root", "buttonProps", "resolvedButtonProps", "externalProps", "externalOnClick", "externalOnKeyDown", "externalOnKeyUp", "otherExternalProps", "event", "React", "React", "UNINITIALIZED", "useLazyRef", "init", "initArg", "ref", "LazyRipple", "_LazyRipple", "ripple", "useLazyRef", "shouldMount", "setShouldMount", "createControlledPromise", "args", "useLazyRipple", "resolve", "reject", "p", "resolveFn", "rejectFn", "React", "React", "EMPTY", "useOnMount", "fn", "Timeout", "_Timeout", "delay", "fn", "useTimeout", "timeout", "useLazyRef", "useOnMount", "React", "import_jsx_runtime", "Ripple", "props", "className", "classes", "pulsate", "rippleX", "rippleY", "rippleSize", "inProp", "onExited", "timeout", "leaving", "setLeaving", "exitTimer", "useTimeout", "exitTimerStartedRef", "onExitedRef", "hasExitedCallback", "rippleClassName", "clsx_default", "rippleStyles", "childClassName", "_jsx", "Ripple_default", "touchRippleClasses", "generateUtilityClasses", "touchRippleClasses_default", "React", "MEDIA_QUERY", "REDUCED_MOTION_DURATION", "REDUCED_MOTION_DELAY", "NOOP", "getDefaultSnapshot", "getReducedMotionSnapshot", "subscribeNoop", "useReducedMotionMediaQueryOld", "enabled", "queryState", "setQueryState", "matches", "useEnhancedEffect_default", "setResolvedMatches", "nextMatches", "previousState", "mediaQueryList", "update", "safeReact", "React", "maybeReactUseSyncExternalStore", "useReducedMotionMediaQueryNew", "getServerSnapshot", "getSnapshot", "subscribe", "notify", "useReducedMotionMediaQuery", "useReducedMotion", "mode", "disablePrefersReducedMotion", "prefersReducedMotion", "shouldReduceMotion", "timing", "import_jsx_runtime", "DURATION", "DELAY_RIPPLE", "EMPTY_OBJ", "EMPTY_ARRAY", "NOOP", "mergeRippleOrder", "prevOrder", "nextActiveKeys", "nextKeySet", "nextKeysPending", "pendingKeys", "prevKey", "nextOrder", "nextKey", "pendingBefore", "computeRippleState", "event", "element", "center", "rect", "rippleX", "rippleY", "clientX", "clientY", "rippleSize", "sizeX", "sizeY", "enterKeyframe", "keyframes", "exitKeyframe", "pulsateKeyframe", "getAnimationStyles", "theme", "styles", "css", "touchRippleClasses_default", "TouchRippleRoot", "styled_default", "TouchRippleRipple", "Ripple_default", "TouchRipple", "inProps", "ref", "props", "useDefaultProps", "useTheme", "reducedMotion", "useReducedMotion", "centerProp", "classes", "className", "other", "rippleState", "setRippleState", "ripples", "rippleCallback", "mountedRef", "useOnMount", "ignoringMouseDown", "startTimer", "useTimeout", "startTimerCommit", "container", "handleExited", "useEventCallback_default", "key", "prevState", "nextItems", "ripple", "rippleKey", "startCommit", "params", "pulsate", "cb", "start", "options", "fakeElement", "stop", "firstActiveIndex", "rippleByKey", "orderedRipples", "_jsx", "clsx_default", "TouchRipple_default", "getButtonBaseUtilityClass", "slot", "generateUtilityClass", "buttonBaseClasses", "generateUtilityClasses", "buttonBaseClasses_default", "import_jsx_runtime", "useUtilityClasses", "ownerState", "disabled", "focusVisible", "focusVisibleClassName", "suppressFocusVisible", "classes", "composedClasses", "composeClasses", "getButtonBaseUtilityClass", "ButtonBaseRoot", "styled_default", "memoTheme_default", "theme", "buttonBaseClasses_default", "outsetFocusRing", "ButtonBase", "inProps", "ref", "props", "useDefaultProps", "action", "centerRipple", "children", "className", "component", "disableRipple", "disableTouchRipple", "focusRipple", "focusableWhenDisabled", "internalNativeButtonProp", "internalDisabledThemeFocusVisible", "LinkComponent", "nativeButtonProp", "onBlur", "onClickProp", "onContextMenu", "onDragLeave", "onFocus", "onFocusVisible", "onKeyDownProp", "onKeyUpProp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "tabIndex", "TouchRippleProps", "touchRippleRef", "type", "other", "isLink", "hasFormAction", "ComponentProp", "internalNativeButton", "nativeButton", "ripple", "useLazyRipple", "handleRippleRef", "useForkRef_default", "setFocusVisible", "handleBeforeKeyDown", "useEventCallback_default", "event", "handleBeforeKeyUp", "getButtonProps", "buttonRef", "useButtonBase", "onClick", "onKeyDown", "onKeyUp", "buttonProps", "enableTouchRipple", "handleMouseDown", "useRippleHandler", "handleContextMenu", "handleDragLeave", "handleMouseUp", "handleMouseLeave", "handleTouchStart", "handleTouchEnd", "handleTouchMove", "handleBlur", "isFocusVisible", "handleFocus", "linkProps", "handleRef", "_jsxs", "clsx_default", "_jsx", "TouchRipple_default", "rippleAction", "eventCallback", "skipRippleAction", "ButtonBase_default", "import_mobx_react", "import_react", "import_material", "radios", "items", "i", "Caption", "children", "React", "Segmented", "label", "options", "value", "o", "_event", "Select", "MuiMenuItem", "inlineUpTo", "SubSection", "item", "open", "setOpen", "display", "rest", "Control", "MenuItemsForm", "ArrowDropDown_default", "ArrowRight_default", "key", "onClick", "import_react", "import_material", "import_mobx_react", "trackGroups", "model", "computed", "t", "computedEntries", "alignmentEntries", "referenceEntries", "g", "filterFrom", "TrackList", "filter", "setFilter", "shown", "all", "needle", "groups", "e", "matching", "long", "n", "React", "event", "title", "entries", "id", "label", "TrackList_default", "collapsedKey", "readCollapsed", "parsed", "writeCollapsed", "collapsed", "Section", "title", "onToggle", "children", "Arrow", "ArrowRight_default", "ArrowDropDown_default", "React", "ButtonBase_default", "SettingsPanel", "model", "height", "noTree", "noDomains", "setCollapsed", "section", "next", "settingsPanelWidth", "Close_default", "MenuItemsForm", "colorSettingsItems", "treeSubMenu", "alignmentSettingsItems", "gapsSubMenu", "annotationsSubMenu", "TrackList_default", "trackSettingsItems", "SettingsPanel_default", "import_react", "import_mobx_react", "TreeOverview", "model", "effectiveTreeAreaWidth", "overviewHeight", "highResScaleFactor", "theme", "useCanvasTheme", "hover", "setHover", "width", "height", "ref", "useCanvasAutorun", "ctx", "image", "treeOverviewImage", "box", "drawTreeOverview", "drawTreeOverviewBox", "focus", "React", "event", "hit", "prev", "TreeOverview_default", "import_react", "import_mobx_react", "import_react", "import_mobx_state_tree", "import_mobx_react", "import_react", "import_material", "import_mobx_react", "CladeLabels", "model", "theme", "fontSize", "React", "cladeLabelBoxes", "box", "CladeLabels_default", "import_react", "import_BaseTooltip", "import_tss_react", "import_mobx_react", "import_react", "import_material", "import_mobx_react", "TreeNodeInfoDialog", "TreeMenu", "node", "model", "onClose", "collapsed", "showOnly", "relativeTo", "name", "id", "leaf", "isCollapsed", "isRoot", "noun", "React", "TreeMenu_default", "import_react", "FlatQueue", "capacity", "ValuesArray", "IdsArray", "fixed", "item", "priority", "pos", "parent", "parentValue", "ids", "values", "top", "last", "id", "value", "halfLen", "left", "right", "child", "ARRAY_TYPES", "VERSION", "Flatbush", "_Flatbush", "data", "byteOffset", "magic", "versionAndType", "version", "ArrayType", "nodeSize", "numItems", "ArrayBufferType", "n", "numNodes", "arrayTypeIndex", "nodesByteSize", "BoxCtor", "IdxCtor", "FlatQueue", "minX", "minY", "maxX", "maxY", "pos", "index", "boxes", "indices", "levelBounds", "width", "height", "hilbertValues", "hilbertMax", "sx", "sy", "i", "itemMinX", "itemMinY", "itemMaxX", "itemMaxY", "x", "y", "hilbert", "sort", "readPos", "end", "nodeIndex", "nodeMinX", "nodeMinY", "nodeMaxX", "nodeMaxY", "j", "filterFn", "numItems4", "level", "q", "results", "contained", "isNode", "x0", "y0", "x1", "y1", "c", "l", "leafEnd", "maxResults", "maxDistance", "nodeSize4", "maxDistSquared", "trackNearest", "bound", "top", "isLeafLevel", "upperBound", "dx", "dy", "dist", "childIndex", "value", "arr", "m", "values", "left", "right", "stack", "r", "a", "b", "pivot", "swap", "temp", "k", "d", "e", "A", "B", "C", "D", "ClickMapIndex", "entry", "Flatbush", "box", "i", "useTreeHover", "model", "offsetY", "clickMap", "ClickMapIndex", "anchor", "hoverAt", "clearAnchor", "useHoverAnchor", "hitTest", "event", "x", "y", "entries", "entry", "onMouseMove", "onMouseLeave", "useStyles", "theme", "TreeCanvasBlock", "model", "offsetY", "classes", "useCanvasTheme", "menu", "setMenu", "clickMap", "anchor", "hitTest", "onMouseMove", "onMouseLeave", "useTreeHover", "hovered", "effectiveTreeAreaWidth", "blockSize", "highResScaleFactor", "width", "height", "canvasWidth", "canvasHeight", "ref", "useCanvasAutorun", "ctx", "renderTreeCanvas", "style", "React", "TreeMenu_default", "event", "entry", "BaseTooltip", "TreeCanvasBlock_default", "renderTreeMouseover", "ctx", "model", "rowHeight", "width", "height", "scrollY", "mouseRow", "referenceRowIndex", "hoveredRowIndices", "highResScaleFactor", "rowBand", "index", "treeHoverColor", "TreeCanvas", "model", "ref", "height", "blocksY", "effectiveTreeAreaWidth", "scrollY", "highResScaleFactor", "onPointerDown", "touchAction", "useWheelScroll", "canvasWidth", "canvasHeight", "mouseoverRef", "useCanvasAutorun", "ctx", "renderTreeMouseover", "React", "block", "TreeCanvasBlock_default", "CladeLabels_default", "TreeCanvas_default", "TreePanel", "model", "effectiveTreeAreaWidth", "React", "TreeCanvas_default", "TreePanel_default", "import_react", "import_material", "import_mobx_react", "TreeRuler", "model", "effectiveTreeAreaWidth", "marginLeft", "bar", "theme", "React", "treeScaleBarHeight", "ScaleBarSVG", "TreeRuler_default", "TopArea", "model", "showHorizontalScrollbar", "showTreeOverview", "resizeHandleWidth", "React", "TreeOverview_default", "TreeRuler_default", "RowPanelHeaders_default", "Minimap_default", "TrackColumnIndicator", "mouseCol", "mouseClickCol", "colWidth", "scrollX", "effectiveTreeAreaWidth", "rowPanelsWidth", "totalTrackAreaHeight", "msaCanvasWidth", "resolvedSelection", "bands", "selectionFill", "hoverColor", "clickColor", "start", "end", "color", "TrackArea", "turnedOnTracks", "track", "Track_default", "MainArea", "showVerticalScrollbar", "TreePanel_default", "RowPanels_default", "VerticalResizeHandle", "MSAPanel_default", "VerticalScrollbar_default", "View", "MSAView", "slots", "height", "headerHeight", "hideHeader", "settingsOpen", "viewInitialized", "DialogComponent", "DialogProps", "Header_default", "SettingsPanel_default", "HorizontalResizeHandle", "MSAView_default", "import_react", "import_ui", "import_material", "import_mobx_react", "import_react", "import_material", "import_mobx_react", "smallMSA", "smallTree", "load", "model", "msaFile", "treeFile", "gffFile", "BASE", "TREES", "DEMO", "examples", "smallMSA", "smallTree", "uri", "url", "ImportFormExamples", "model", "React", "label", "msa", "tree", "gff", "inline", "event", "load", "e", "ImportFormExamples_default", "phone", "ImportForm", "model", "msaFile", "setMsaFile", "treeFile", "setTreeFile", "gffFile", "setGffFile", "error", "React", "load", "e", "ImportFormExamples_default", "ImportForm_default", "Reset", "model", "error", "React", "Loading", "slots", "isLoading", "dataInitialized", "data", "resetCount", "msaFilehandle", "treeFilehandle", "importForm", "hasData", "loading", "e", "StatusMessage_default", "MSAView_default", "ImportForm_default", "Loading_default", "import_react", "import_useMeasure", "import_mobx_state_tree", "import_styles", "import_mobx", "import_util", "import_mst", "import_mobx_state_tree", "import_mobx", "blockFasta", "rows", "start", "end", "width", "name", "seq", "BLUE", "RED", "MAGENTA_E", "MAGENTA_D", "GREEN", "GREEN_ST", "PINK", "ORANGE", "YELLOW", "CYAN", "clustalXColumnColors", "counts", "col", "total", "count", "letter", "W", "L", "V", "I", "M", "A", "F", "C", "H", "P", "R", "K", "Q", "E", "D", "S", "G", "Y", "N", "hydrophobic", "KR", "QE", "ED", "TS", "p", "subtotal", "colors", "dna", "green_default", "blue_default", "orange_default", "red_default", "colorSchemes", "colorSchemes_default", "transform", "key", "val", "letter", "color", "A", "letterTables", "letterColorTable", "map", "table", "columnStats", "col", "colStats", "conservation", "propertyConservation", "total", "gaps", "distribution", "a", "b", "consensus", "packDomainLanes", "bands", "laneEnds", "lanes", "byStart", "_", "a", "b", "i", "startCol", "endCol", "found", "end", "lane", "band", "scaleBarLength", "pxPerUnit", "maxPx", "target", "magnitude", "mantissa", "step", "px", "palettes", "ggplotPalettes_default", "namedPalettes", "aliases", "paletteNamed", "name", "createPaletteMap", "keys", "palette", "n", "colors", "ggplotPalettes_default", "key", "A", "exportFileName", "location", "extension", "fallback", "loc", "UNSCALED_FEATURE", "laneOverlap", "rowPanelWidth", "panel", "view", "defaultFeaturePanelWidth", "stringFields", "row", "fields", "field", "value", "colorByRow", "rowData", "colorOf", "colors", "name", "color", "featureColorMap", "annotations", "encoding", "fillPalette", "strokes", "strokeOf", "fill", "hit", "stroke", "outlineColor", "annotation", "featureField", "featureLabelMap", "labels", "strandpileLanes", "rows", "piled", "bands", "reverse", "packDomainLanes", "b", "forward", "up", "p", "down", "laneCount", "panelLanes", "featurePanelSpans", "width", "colWidth", "domainBands", "annotationsByRow", "shifts", "band", "shifted", "shift", "min", "max", "features", "start", "end", "drawable", "scale", "placement", "converted", "featuresToAnnotations", "features", "feature", "cached", "annotation", "featureAnnotation", "row", "start", "end", "name", "description", "type", "strand", "color", "accession", "attributes", "key", "value", "import_io", "import_mobx_state_tree", "import_mobx", "import_util", "statusMessageText", "status", "fetchTextWithProgress", "loc", "setStatus", "fetcher", "controller", "msg", "isAbortError", "createAbortRotation", "self", "current", "running", "mine", "installFilehandleLoader", "what", "getFilehandle", "onLoad", "setLoading", "clearFilehandle", "optional", "rotation", "cancel", "filehandle", "controller", "isCurrent", "end", "text", "fetchTextWithProgress", "status", "e", "isAbortError", "import_mobx_state_tree", "DataModelF", "maxInlineBytes", "maxInlineSnapshotBytes", "self", "tree", "msa", "treeMetadata", "gff", "snap", "key", "text", "import_mobx_state_tree", "DialogQueueSessionMixin", "self", "cb", "component", "props", "import_mobx_state_tree", "import_mobx_state_tree", "stripDefault", "type", "defaultValue", "msaFormats", "MSAModelF", "stripDefault", "defaultBgColor", "defaultColorSchemeName", "defaultShowColumnStats", "self", "name", "map", "arg", "import_mobx_state_tree", "TreeModelF", "stripDefault", "defaultDrawLabels", "defaultLabelsAlignRight", "defaultShowBranchLen", "treeOrders", "defaultTreeOrder", "defaultDrawTree", "defaultDrawNodeBubbles", "defaultDrawNodeLabels", "defaultShowTreeOverview", "defaultShowTreeScaleBar", "defaultOverviewHeight", "self", "n", "arg", "order", "BLOSUM62_KEYS", "BLOSUM62_DATA", "NUM_SYMBOLS", "BLOSUM62", "symbolOfCode", "i", "key", "GAP", "symbolAt", "seq", "i", "code", "symbolOfCode", "blosumScore", "a", "b", "BLOSUM62", "NUM_SYMBOLS", "computePairwiseDistance", "seq1", "seq2", "len", "compared", "totalScore", "maxPossibleScore", "aGap", "bGap", "normalizedScore", "clampedScore", "computeDistanceMatrix", "rows", "n", "distances", "j", "neighborJoining", "names", "d", "D", "nodes", "name", "remaining", "active", "r", "sum", "minQ", "minI", "minJ", "ai", "aj", "q", "dij", "ri", "rj", "limbI", "limbJ", "newNode", "k", "newDist", "finalActive", "withBranchLength", "newick", "branchLength", "nodeToNewick", "root", "postOrder", "stack", "node", "newickByNode", "left", "right", "calculateNeighborJoiningTree", "tree", "aminoPropertyClass", "propertyClasses", "maxPropertyEntropy", "classOfSlot", "numResidueSlots", "letter", "cls", "residueSlotOfLetter", "calculatePropertyConservation", "counts", "classCounts", "_", "col", "total", "score", "nonGapTotal", "slot", "count", "entropy", "freq", "gapFraction", "preorder", "root", "parents", "order", "stack", "node", "child", "hasLengths", "n", "mergedSibling", "target", "c", "rerootTree", "offset", "lengths", "sibling", "branch", "at", "length", "path", "above", "i", "below", "children", "only", "midpointRoot", "tips", "weight", "reach", "from", "dist", "via", "d", "parent", "farthest", "best", "tip", "a", "b", "half", "next", "partitionPoint", "len", "pred", "left", "right", "mid", "visibleColToGlobalCol", "blanks", "visibleCol", "i", "globalColToVisibleCol", "globalCol", "blanksBefore", "countBlanksBefore", "visibleColsBefore", "seqPosOfGlobalCol", "index", "seqPos", "NUMERIC", "DIGIT_RUNS", "compareRuns", "a", "b", "runsA", "runsB", "shared", "x", "y", "nx", "ny", "compareGroupKeys", "numA", "numB", "diff", "rangeList", "range", "paletteNamed", "colors", "c", "A", "rangeColors", "order", "list", "value", "i", "createPaletteMap", "resolveScale", "spec", "values", "present", "listed", "v", "compareGroupKeys", "declarationKey", "field", "table", "scale", "domain", "title", "resolveShared", "uses", "groups", "use", "key", "group", "resolved", "u", "shown", "entry", "readColor", "record", "legend", "rest", "lifted", "readEncoding", "encoding", "readRowPanel", "panel", "color", "readColumnTrack", "track", "max", "colorTable", "e", "letterColors", "scheme", "buildSeqPosIndex", "row", "index", "n", "col", "AMINO_ACIDS", "HUE", "SATURATION", "LIGHTEST", "DARKEST", "normalized", "NUM_SYMBOLS", "a", "min", "max", "b", "score", "BLOSUM62", "scaled", "symbolOfSlot", "numResidueSlots", "_", "slot", "letter", "letterOfResidueSlot", "symbolOfCode", "shade", "similarity", "lightness", "shadeColumn", "counts", "col", "measure", "counted", "shaded", "present", "total", "count", "colors", "sum", "blosum62", "identity", "blosum62ColumnColors", "identityColumnColors", "measuredLabels", "treeTips", "tree", "names", "depth", "stack", "entry", "node", "level", "children", "child", "widestLabel", "labels", "fontSize", "counts", "label", "shortest", "seen", "widest", "ties", "measureTextCanvas", "flatToTree", "items", "nodeMap", "item", "length", "root", "node", "parent", "remap", "afterMatchingBrace", "str", "openIdx", "depth", "pos", "extractBracedBlocks", "blocks", "end", "findBracedContent", "after", "parseAsn1", "asnString", "normalized", "sections", "extractSections", "fdict", "nodes", "dict", "block", "entry", "parseDictEntry", "node", "parseNode", "features", "rest", "f", "content", "nameStart", "name", "entryString", "idMatch", "nameMatch", "nodeString", "parentMatch", "featuresIdx", "featuresContent", "parseFeature", "featureString", "featureidMatch", "valueMatch", "parseTreeText", "text", "flatToTree", "parseAsn1", "parse", "parseEmfTree", "seedingMarks", "tipRows", "root", "rows", "row", "pushReversed", "stack", "nodes", "i", "node", "hidden", "tip", "kids", "cladeRows", "clade", "index", "tips", "a", "b", "name", "first", "last", "mrca", "nodeTips", "leaves", "resolveClades", "clades", "displayed", "leafIndex", "resolved", "seeding", "withAlpha", "cladeHighlightColor", "cladeHighlightAlpha", "childOrders", "buildTreeRoot", "tree", "collapsed", "rotated", "order", "showOnly", "hier", "hierarchy", "d", "sum", "compare", "sort", "flip", "forEachDescendant", "n", "res", "find", "collapsedId", "collapse", "outgroupNode", "outgroup", "out", "rest", "other", "rootTree", "treeRoot", "plain", "preorder", "c", "input", "generateNodeIds", "midpointRoot", "target", "rerootTree", "tipRange", "needsQuotes", "quote", "name", "writeNewick", "root", "written", "node", "descendants", "id", "length", "text", "c", "child", "closeToOpen", "opens", "parseWuss", "ss", "stacks", "pairs", "push", "key", "col", "stack", "pop", "pseudoknot", "start", "ch", "opener", "a", "b", "defaultTrackHeights", "resizableKinds", "defaultOffTracks", "ownHeightKey", "id", "HELIX_ARC", "PSEUDOKNOT_ARC", "columnTrackBytes", "columnTrackSize", "track", "bytes", "columnTrackSizes", "tracks", "smallColumnTracks", "maxInlineSnapshotBytes", "sizes", "kept", "_t", "preservedOnReset", "trackIsOff", "turnedOffTracks", "noDomains", "noClades", "featureChannels", "annotationRowName", "rowNames", "underscored", "seqPosIndexCache", "sameLength", "segment", "zoomDetent", "detentZoom", "value", "scale", "home", "held", "min", "canHold", "total", "maxCellSize", "next", "overflows", "content", "viewport", "inRanges", "ranges", "position", "start", "end", "consecutiveRuns", "sorted", "runs", "n", "last", "sharedValue", "values", "first", "v", "stateModelFactory", "DialogQueueSessionMixin", "TreeModelF", "MSAModelF", "stripDefault", "defaultDrawMsaLetters", "defaultScrollZoom", "scrollZoomAxes", "defaultScrollZoomAxis", "readColumnTrack", "DataModelF", "readEncoding", "readRowPanel", "self", "arg", "height", "error", "warning", "col", "row", "columns", "region", "highlights", "features", "selection", "clades", "owner", "_dropped", "rest", "mode", "node", "treeRoot", "data", "msaFilehandle", "treeFilehandle", "treeMetadataFilehandle", "gffFilehandle", "result", "settingsPanelWidth", "customColorScheme", "colorSchemeName", "letterColorTable", "colorSchemes_default", "defaultColorSchemeName", "trackBytes", "a", "b", "what", "text", "filehandle", "parsed", "name", "stringFields", "e", "fields", "field", "parseMSA", "inline", "featuresToAnnotations", "generateNodeIds", "parseTreeText", "tree", "rootTree", "leaf", "index", "resolveClades", "hierarchy", "d", "cladeGutterWidth", "treeTips", "widestLabel", "labelFitFontSize", "chrome", "pxPerTreeDepth", "minTreeWidth", "maxFitTreeWidth", "fit", "room", "maxTreeAreaShare", "cap", "labels", "minLetterRowHeight", "mouseRow", "mouseCol", "rowName", "insertion", "ins", "buildTreeRoot", "writeNewick", "layout", "layoutTree", "find", "tipRange", "y", "root", "numTips", "perPixel", "nodeCoveringRows", "p", "rowPanelWidth", "rowPanelHeaderHeight", "hideGapsEffective", "allowedGappyness", "strs", "numCols", "numRows", "threshold", "blankCounts", "j", "str", "len", "i", "blanks", "rows", "seq", "insertions", "computeRowInsertions", "MSA", "f", "cache", "buildSeqPosIndex", "columns2d", "skipBlanks", "fontSizeFor", "columnCountsFromRows", "letters", "ambiguous", "dna", "rna", "isDna", "isRna", "colStats", "_", "maxCount", "letter", "slot", "count", "letterOfResidueSlot", "proportion", "clustalXColumnColors", "sequenceType", "columnColors", "blosum62ColumnColors", "identityColumnColors", "alphabetMaxBits", "gapCount", "maxBitsFor", "calculatePropertyConservation", "treeWidth", "max", "minLetterColWidth", "columnTrackModels", "width", "project", "items", "fill", "out", "item", "seqPos", "skip", "dropBlanks", "resolve", "pos", "visibleColsBefore", "arcs", "arc", "kind", "heightKey", "given", "computedModel", "colorTable", "ss", "parseWuss", "pseudoknot", "t", "rowHeight", "model", "relativeTo", "visibleCol", "seqPosOfGlobalCol", "val", "globalCol", "globalColToVisibleCol", "visibleColToGlobalCol", "rawStart", "rawEnd", "startGlobal", "endGlobal", "rowStart", "rowEnd", "startCol", "endCol", "problems", "mapping", "where", "residues", "overrun", "unusable", "problem", "m", "structureId", "hits", "seg", "asymId", "scaleBarLength", "treeScaleBarHeight", "types", "annot", "accession", "rowNamesSet", "r", "calculateBlocks", "by", "bx", "annotations", "w", "nodeId", "leaves", "maxNeighborJoiningRows", "calculateNeighborJoiningTree", "shown", "outgroupNode", "tips", "newick", "scaleFactor", "axis", "offsetX", "offsetY", "colInView", "rowInView", "minColWidth", "minRowHeight", "anchoredScrollY", "overflow", "visibleHeight", "topBias", "takeZoomSnapshot", "zoomSnapshotCovers", "deltaY", "gffText", "gffToAnnotations", "parseGFF", "deltaX", "rowData", "encodings", "panels", "mappings", "ids", "status", "rowIndex", "column", "mouseClickCol", "mouseClickRow", "scrollX", "colWidth", "numColumns", "viewInitialized", "xStart", "xEnd", "visibleColRange", "segmentFeatureTypes", "segments", "segmentShades", "categorical", "createPaletteMap", "featureColorMap", "encoding", "featureLabelMap", "featureFillEncoding", "fillPalette", "visibleDomainTypes", "byKey", "add", "key", "title", "entries", "overlay", "k", "base", "channel", "legend", "legendKey", "legendTitle", "bands", "rowBands", "annotation", "band", "stackIndex", "packDomainLanes", "hoveredTreeNode", "label", "residue", "transientHighlights", "color", "rowIndices", "span", "rowRuns", "resolved", "blockFasta", "conservation", "propertyConservation", "columnStats", "featureValues", "list", "featureField", "use", "table", "resolveShared", "panel", "declarationKey", "featureLabels", "colorOf", "colorByRow", "scales", "align", "featurePanelSpans", "names", "on", "hit", "featureName", "colors", "withAlpha", "rowTintAlpha", "order", "preorder", "child", "focus", "inside", "opts", "renderToSvg", "html", "blob", "saveAs", "exportFileName", "pass", "maxRowHeight", "resolvedSelection", "anchor", "head", "ordered", "x", "firstRow", "lastRow", "everyRow", "maxColWidth", "awaitingTree", "seed", "mark", "query", "mql", "onChange", "installFilehandleLoader", "appliedGFF", "readComputed", "columnTracks", "model_default", "import_theme", "colorSchemeSnapshot", "scheme", "letterColors", "columnHighlights", "columns", "sorted", "a", "b", "runs", "column", "last", "viewerHighlights", "highlights", "highlightColumns", "urlLocation", "uri", "fileLocations", "msaFilehandle", "treeFilehandle", "gffFilehandle", "msaUrl", "treeUrl", "gffUrl", "resolveTheme", "theme", "viewerSnapshot", "props", "msa", "tree", "gff", "rowData", "colorScheme", "height", "colWidth", "rowHeight", "allowedGappyness", "features", "selection", "clades", "relativeTo", "columnTracks", "residueMappings", "encodings", "rowPanels", "drawTree", "treeAreaWidth", "showBranchLen", "treeOrder", "treeRoot", "region", "residueEncoding", "sameSource", "a", "b", "MSAViewer", "props", "ref", "resolved", "fileLocations", "msa", "tree", "msaFilehandle", "treeFilehandle", "source", "shown", "setShown", "React", "Viewer", "MSAViewer_default", "useModelReaction", "model", "key", "handler", "latest", "listening", "value", "synced", "read", "apply", "inSnapshot", "ifSet", "set", "syncedProps", "p", "m", "v", "location", "gff", "scheme", "letterColors", "viewerHighlights", "table", "useSyncedProps", "applied", "keys", "i", "last", "modelRef", "region", "theme", "onCellHover", "onCellClick", "onViewportChange", "onSelectionChange", "onModel", "model_default", "viewerSnapshot", "destroyTimer", "width", "useMeasure", "regionKey", "target", "latestOnModel", "resolveTheme", "Loading_default", "schemeResidueColor", "model", "colorAt", "tileColorFn", "columns", "hexes", "toHex", "color", "parsed", "A", "rowName", "seqPos", "col", "letter", "import_react", "import_client", "mount", "el", "props", "root", "current", "React", "MSAViewer_default", "next", "import_mobx", "dataProperties", "ownAttributes", "lazyMargin", "nightingaleAttributes", "numberAttribute", "value", "n", "parseHighlight", "row", "span", "start", "end", "residueAtColumn", "model", "column", "visible", "residueRange", "viewport", "c", "defineMsaElement", "tagName", "existing", "MsaElement", "#viewer", "#nearby", "#model", "#manager", "#cancelRange", "#rangePending", "#reported", "#data", "key", "#setData", "#referenceRow", "data", "#props", "theme", "cell", "#emit", "#reportHover", "#reportRange", "selection", "#followRange", "#followHighlight", "type", "detail", "#nightingaleChange", "position", "range", "shownStart", "shownEnd", "echo", "reported", "spans", "#lazy", "height", "entries", "entry", "#mount", "manager", "mount", "name", "import_react", "import_theme", "import_mobx_state_tree", "import_mobx", "useMsaSvgFigure", "model", "theme", "includeTracks", "delay", "figure", "setFigure", "latest", "dispose", "key", "draw", "renderToSvg", "svg", "error"]
|
|
7
|
+
}
|