Mercurial > repos > fubar > jbrowse2
view x/static/js/2047.b1e80504.chunk.js.map @ 125:49f3d3878413 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 5ea1f9c1eef1de76232e69aa6d34cda77d90d566
author | fubar |
---|---|
date | Sat, 05 Oct 2024 23:58:05 +0000 |
parents | |
children |
line wrap: on
line source
{"version":3,"file":"static/js/2047.b1e80504.chunk.js","mappings":"UAAIA,ECCAC,EADAC,ECAAC,E,4aCiBJ,IAAIC,EAAkD,CAAC,EAchDC,eAAeC,EACpBC,EACAC,EACAC,GAGA,MAAMC,EA7BD,SAA+BC,EAAgC,CAAC,GACrE,MAAO,IAAGC,EAAAA,EAAAA,GAAQD,IACpB,CA2BmBE,CAAsBJ,GACvC,IAAKL,EAAaM,GAAW,CAC3B,MAAMI,EAAcL,GAAuBM,KAE3C,IAAKD,EACH,MAAM,IAAIE,MACR,iEAAiEC,KAAKC,UACpET,MAIN,MAAMU,EAAkBZ,EAAca,eAAeN,GACrD,IAAKK,EACH,MAAM,IAAIH,MAAM,6BAA6BF,KAK/C,MAAMO,EAAgBF,EAAgBG,aAAaC,OACjDd,EACA,CAAEF,kBAGEiB,EAAgBlB,EAAWmB,KAAK,KAAMlB,EAAeC,GAErDkB,EAAc,UADAP,EAAgBQ,mBACNN,EAAeG,EAAejB,GAG5DH,EAAaM,GAAY,CACvBgB,cACAE,WAAY,IAAIC,IAAI,CAACrB,IAEzB,CAEA,MAAMsB,EAAa1B,EAAaM,GAGhC,OAFAoB,EAAWF,WAAWG,IAAIvB,GAEnBsB,CACT,CAWO,SAASE,EAAqBC,GACnC,IAAIC,EAAc,EAClB,MAAMC,EAAWC,OAAOC,KAAKJ,GAI7B,GAAwB,IAApBE,EAASG,QAAgC,cAAhBH,EAAS,GAAoB,CACxD,MAAM,UAAE3B,GAAcyB,EACtBG,OAAOG,QAAQnC,GAAcoC,SAAQ,EAAE9B,EAAUoB,MAC/CA,EAAWF,WAAWa,OAAOjC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S,EAClB0hB,GAAK,KAAO6f,IAAc,aAAa1sB,KAAK0sB,KAAaA,EAAYsF,EAAQnlB,KAAK+f,GAE3F,CAID,IAAKF,EAAW,MAAM,IAAI7iC,MAAM,yDAChC6iC,EAAYA,EAAUjb,QAAQ,OAAQ,IAAIA,QAAQ,QAAS,IAAIA,QAAQ,YAAa,KACpF0e,EAAoB5B,EAAI7B,EAAY,Q,WCdpC,IAAIwF,EAAkB,CACrB,KAAM,GAgBP/B,EAAoBloB,EAAE4E,EAAI,CAAC2kB,EAASC,KAE/BS,EAAgBV,IAElBtE,cAAciD,EAAoB5B,EAAI4B,EAAoBuB,EAAEF,GAE9D,EAGD,IAAIW,EAAqBxF,WAAqC,yBAAIA,WAAqC,0BAAK,GACxGyF,EAA6BD,EAAmB7O,KAAKh5B,KAAK6nC,GAC9DA,EAAmB7O,KAvBCjN,IACnB,IAAKoa,EAAU4B,EAAaC,GAAWjc,EACvC,IAAI,IAAI+Z,KAAYiC,EAChBlC,EAAoBkB,EAAEgB,EAAajC,KACrCD,EAAoBjgC,EAAEkgC,GAAYiC,EAAYjC,IAIhD,IADGkC,GAASA,EAAQnC,GACdM,EAAStlC,QACd+mC,EAAgBzB,EAAS9M,OAAS,EACnCyO,EAA2B/b,EAAK,C,KCnBjC8Z,EAAoBoC,QAAK5mC,EvCArB3C,EAAOmnC,EAAoBhc,EAC/Bgc,EAAoBhc,EAAI,IAChBgD,QAAQC,IAAI,CAAC,KAAK,KAAK,MAAM5mB,IAAI2/B,EAAoBxzB,EAAGwzB,IAAsBe,KAAKloC,GwCDjEmnC,EAAoBhc,G","sources":["../webpack/runtime/chunk loaded","../webpack/runtime/create fake namespace object","../webpack/runtime/startup chunk dependencies","../../../packages/core/data_adapters/dataAdapterCache.ts","../../../packages/core/rpc/remoteAbortSignals.ts","../../../packages/core/ui/CascadingMenu.tsx","../../../packages/core/ui/Dialog.tsx","../../../packages/core/ui/EditableTypography.tsx","../../../packages/core/ui/ErrorMessage.tsx","../../../packages/core/ui/FactoryResetDialog.tsx","../../../packages/core/ui/Icons.tsx","../../../packages/core/ui/Logo.tsx","../../../packages/core/ui/Menu.tsx","../../../packages/core/ui/ResizeHandle.tsx","../../../packages/core/ui/ReturnToImportFormDialog.tsx","../../../packages/core/ui/SanitizedHTML.tsx","../../../packages/core/ui/theme.ts","../../../packages/core/ui/AssemblySelector.tsx","../../../packages/core/ui/FileSelector/FileSelector.tsx","../../../packages/core/ui/PrerenderedCanvas.tsx","../../../packages/core/util/QuickLRU.js","../../../packages/core/util/index.ts","../../../packages/core/util/tracks.ts","../../../packages/core/util/types/mst.ts","../../../plugins/data-management/src/index.ts","../../../packages/core/PluginLoader.ts","rpcWorker.ts","../../../packages/product-core/src/rpcWorker.ts","workerPolyfill.js","../webpack/bootstrap","../webpack/runtime/compat get default export","../webpack/runtime/define property getters","../webpack/runtime/ensure chunk","../webpack/runtime/get javascript chunk filename","../webpack/runtime/get mini-css chunk filename","../webpack/runtime/global","../webpack/runtime/hasOwnProperty shorthand","../webpack/runtime/make namespace object","../webpack/runtime/runtimeId","../webpack/runtime/publicPath","../webpack/runtime/importScripts chunk loading","../webpack/runtime/nonce","../webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","var next = __webpack_require__.x;\n__webpack_require__.x = () => {\n\treturn Promise.all([5255,3301,6837].map(__webpack_require__.e, __webpack_require__)).then(next);\n};","import { SnapshotIn } from 'mobx-state-tree'\nimport PluginManager from '../PluginManager'\nimport { AnyConfigurationSchemaType } from '../configuration'\nimport { AnyDataAdapter } from './BaseAdapter'\nimport idMaker from '../util/idMaker'\n\ntype ConfigSnap = SnapshotIn<AnyConfigurationSchemaType>\n\nexport function adapterConfigCacheKey(conf: Record<string, unknown> = {}) {\n return `${idMaker(conf)}`\n}\n\ninterface AdapterCacheEntry {\n dataAdapter: AnyDataAdapter\n sessionIds: Set<string>\n}\n\nlet adapterCache: Record<string, AdapterCacheEntry> = {}\n\n/**\n * instantiate a data adapter, or return an already-instantiated one if we have\n * one with the same configuration\n *\n * @param pluginManager\n *\n * @param sessionId - session ID of the associated worker session. used for\n * reference counting\n *\n * @param adapterConfigSnapshot - plain-JS configuration snapshot for the\n * adapter\n */\nexport async function getAdapter(\n pluginManager: PluginManager,\n sessionId: string,\n adapterConfigSnapshot: SnapshotIn<AnyConfigurationSchemaType>,\n): Promise<AdapterCacheEntry> {\n // cache the adapter object\n const cacheKey = adapterConfigCacheKey(adapterConfigSnapshot)\n if (!adapterCache[cacheKey]) {\n const adapterType = adapterConfigSnapshot?.type\n\n if (!adapterType) {\n throw new Error(\n `could not determine adapter type from adapter config snapshot ${JSON.stringify(\n adapterConfigSnapshot,\n )}`,\n )\n }\n const dataAdapterType = pluginManager.getAdapterType(adapterType)\n if (!dataAdapterType) {\n throw new Error(`unknown data adapter type ${adapterType}`)\n }\n\n // instantiate the data adapter's config schema so it gets its defaults,\n // callbacks, etc\n const adapterConfig = dataAdapterType.configSchema.create(\n adapterConfigSnapshot,\n { pluginManager },\n )\n\n const getSubAdapter = getAdapter.bind(null, pluginManager, sessionId)\n const CLASS = await dataAdapterType.getAdapterClass()\n const dataAdapter = new CLASS(adapterConfig, getSubAdapter, pluginManager)\n\n // store it in our cache\n adapterCache[cacheKey] = {\n dataAdapter,\n sessionIds: new Set([sessionId]),\n }\n }\n\n const cacheEntry = adapterCache[cacheKey]\n cacheEntry.sessionIds.add(sessionId)\n\n return cacheEntry\n}\n\n/**\n * this is a callback that is passed to adapters that\n * allows them to get any sub-adapters that they need\n * internally, staying with the same worker session ID\n */\nexport type getSubAdapterType = (\n adapterConfigSnap: ConfigSnap,\n) => ReturnType<typeof getAdapter>\n\nexport function freeAdapterResources(specification: Record<string, any>) {\n let deleteCount = 0\n const specKeys = Object.keys(specification)\n\n // if we don't specify a range, delete any adapters that are only associated\n // with that session\n if (specKeys.length === 1 && specKeys[0] === 'sessionId') {\n const { sessionId } = specification\n Object.entries(adapterCache).forEach(([cacheKey, cacheEntry]) => {\n cacheEntry.sessionIds.delete(sessionId)\n if (cacheEntry.sessionIds.size === 0) {\n deleteCount += 1\n delete adapterCache[cacheKey]\n }\n })\n } else {\n // otherwise call freeResources on all the cached data adapters\n Object.values(adapterCache).forEach(cacheEntry => {\n const regions =\n specification.regions ||\n (specification.region ? [specification.region] : [])\n for (const region of regions) {\n if (region.refName !== undefined) {\n cacheEntry.dataAdapter.freeResources(region)\n }\n }\n })\n }\n\n return deleteCount\n}\n\nexport function clearAdapterCache() {\n adapterCache = {}\n}\n","/* ---------------- for the RPC client ----------------- */\n\nlet abortSignalCounter = 0\nexport interface RemoteAbortSignal {\n abortSignalId: number\n}\nconst abortSignalIds = new WeakMap<AbortSignal, number>() // map of abortsignal => numerical ID\n\n/**\n * assign an ID to the given abort signal and return a plain object\n * representation\n *\n * @param signal - the signal to serialize\n * @param callfunc - function used to call\n * a remote method, will be called like callfunc('signalAbort', signalId)\n */\nexport function serializeAbortSignal(\n signal: AbortSignal,\n callfunc: (name: string, abortSignalId: number) => void,\n): RemoteAbortSignal {\n let abortSignalId = abortSignalIds.get(signal)\n if (!abortSignalId) {\n abortSignalCounter += 1\n abortSignalIds.set(signal, abortSignalCounter)\n abortSignalId = abortSignalCounter\n signal.addEventListener('abort', () => {\n const signalId = abortSignalIds.get(signal)\n if (signalId !== undefined) {\n callfunc('signalAbort', signalId)\n }\n })\n }\n return { abortSignalId }\n}\n\n/* ---------------- for the RPC server ----------------- */\n\n/**\n * test whether a given object\n * @param thing - the thing to test\n * @returns true if the thing is a remote abort signal\n */\nexport function isRemoteAbortSignal(\n thing: unknown,\n): thing is RemoteAbortSignal {\n return (\n typeof thing === 'object' &&\n thing !== null &&\n 'abortSignalId' in thing &&\n typeof thing.abortSignalId === 'number'\n )\n}\n\n// the server side keeps a set of surrogate abort controllers that can be\n// aborted based on ID\nconst surrogateAbortControllers = new Map<number, AbortController>() // numerical ID => surrogate abort controller\n\n/**\n * deserialize the result of serializeAbortSignal into an AbortSignal\n *\n * @param signal -\n * @returns an abort signal that corresponds to the given ID\n */\nexport function deserializeAbortSignal({\n abortSignalId,\n}: RemoteAbortSignal): AbortSignal {\n let surrogateAbortController = surrogateAbortControllers.get(abortSignalId)\n if (!surrogateAbortController) {\n surrogateAbortController = new AbortController()\n surrogateAbortControllers.set(abortSignalId, surrogateAbortController)\n }\n return surrogateAbortController.signal\n}\n\n/**\n * fire an abort signal from a remote abort signal ID\n *\n * @param abortSignalId -\n */\nexport function remoteAbort(props: { signalId: number }) {\n const { signalId: abortSignalId } = props\n const surrogateAbortController = surrogateAbortControllers.get(abortSignalId)\n\n if (surrogateAbortController) {\n surrogateAbortController.abort()\n }\n}\n\nexport function remoteAbortRpcHandler() {\n return {\n signalAbort: remoteAbort,\n }\n}\n","/* eslint-disable @typescript-eslint/no-unsafe-function-type */\nimport React, { useContext, useMemo } from 'react'\nimport {\n Divider,\n ListItemIcon,\n ListItemText,\n ListSubheader,\n Menu,\n MenuItem,\n PopoverOrigin,\n SvgIconProps,\n} from '@mui/material'\nimport { MenuItem as JBMenuItem, MenuItemEndDecoration } from './Menu'\nimport {\n bindHover,\n bindFocus,\n bindMenu,\n usePopupState,\n PopupState,\n} from 'material-ui-popup-state/hooks'\nimport HoverMenu from 'material-ui-popup-state/HoverMenu'\nimport ChevronRight from '@mui/icons-material/ChevronRight'\n\nconst CascadingContext = React.createContext({\n parentPopupState: null,\n rootPopupState: null,\n} as { parentPopupState: PopupState | null; rootPopupState: PopupState | null })\n\nfunction CascadingMenuItem({\n onClick,\n closeAfterItemClick,\n ...props\n}: {\n closeAfterItemClick: boolean\n onClick?: Function\n disabled?: boolean\n children: React.ReactNode\n}) {\n const { rootPopupState } = useContext(CascadingContext)\n if (!rootPopupState) {\n throw new Error('must be used inside a CascadingMenu')\n }\n\n return (\n <MenuItem\n {...props}\n onClick={event => {\n if (closeAfterItemClick) {\n rootPopupState.close()\n }\n onClick?.(event)\n }}\n />\n )\n}\n\nfunction CascadingSubmenu({\n title,\n Icon,\n inset,\n popupId,\n ...props\n}: {\n children: React.ReactNode\n title: React.ReactNode\n onMenuItemClick: Function\n Icon: React.ComponentType<SvgIconProps> | undefined\n\n inset: boolean\n menuItems: JBMenuItem[]\n popupId: string\n}) {\n const { parentPopupState } = useContext(CascadingContext)\n const popupState = usePopupState({\n popupId,\n variant: 'popover',\n parentPopupState,\n })\n return (\n <>\n <MenuItem {...bindHover(popupState)} {...bindFocus(popupState)}>\n {Icon ? (\n <ListItemIcon>\n <Icon />\n </ListItemIcon>\n ) : null}\n <ListItemText primary={title} inset={inset} />\n <ChevronRight />\n </MenuItem>\n <CascadingSubmenuHover\n {...props}\n anchorOrigin={{ vertical: 'top', horizontal: 'right' }}\n transformOrigin={{ vertical: 'top', horizontal: 'left' }}\n popupState={popupState}\n />\n </>\n )\n}\n\nfunction CascadingSubmenuHover({\n popupState,\n onMenuItemClick,\n menuItems,\n classes,\n ...props\n}: {\n classes?: Record<string, string>\n popupState: PopupState\n anchorOrigin: PopoverOrigin\n transformOrigin: PopoverOrigin\n onMenuItemClick: Function\n menuItems: JBMenuItem[]\n}) {\n const { rootPopupState } = useContext(CascadingContext)\n const context = useMemo(\n () => ({\n rootPopupState: rootPopupState || popupState,\n parentPopupState: popupState,\n }),\n [rootPopupState, popupState],\n )\n\n return (\n <CascadingContext.Provider value={context}>\n <HoverMenu {...props} {...bindMenu(popupState)} />\n </CascadingContext.Provider>\n )\n}\n\nfunction CascadingMenu({\n popupState,\n onMenuItemClick,\n menuItems,\n ...props\n}: {\n popupState: PopupState\n onMenuItemClick: Function\n menuItems: JBMenuItem[]\n}) {\n const { rootPopupState } = useContext(CascadingContext)\n const context = useMemo(\n () => ({\n rootPopupState: rootPopupState || popupState,\n parentPopupState: popupState,\n }),\n [rootPopupState, popupState],\n )\n\n return (\n <CascadingContext.Provider value={context}>\n <Menu {...props} {...bindMenu(popupState)} />\n </CascadingContext.Provider>\n )\n}\n\nfunction EndDecoration({ item }: { item: JBMenuItem }) {\n if ('subMenu' in item) {\n return <MenuItemEndDecoration type=\"subMenu\" />\n } else if (item.type === 'checkbox' || item.type === 'radio') {\n return (\n <MenuItemEndDecoration\n type={item.type}\n checked={item.checked}\n disabled={item.disabled}\n />\n )\n }\n return null\n}\n\nfunction CascadingMenuList({\n onMenuItemClick,\n closeAfterItemClick,\n menuItems,\n ...props\n}: {\n menuItems: JBMenuItem[]\n closeAfterItemClick: boolean\n onMenuItemClick: Function\n}) {\n function handleClick(callback: Function) {\n return (event: React.MouseEvent<HTMLLIElement>) => {\n onMenuItemClick(event, callback)\n }\n }\n\n const hasIcon = menuItems.some(m => 'icon' in m && m.icon)\n return (\n <>\n {menuItems\n .sort((a, b) => (b.priority || 0) - (a.priority || 0))\n .map((item, idx) => {\n return 'subMenu' in item ? (\n <CascadingSubmenu\n key={`subMenu-${item.label}-${idx}`}\n popupId={`subMenu-${item.label}`}\n title={item.label}\n Icon={item.icon}\n inset={hasIcon && !item.icon}\n onMenuItemClick={onMenuItemClick}\n menuItems={item.subMenu}\n >\n <CascadingMenuList\n {...props}\n closeAfterItemClick={closeAfterItemClick}\n onMenuItemClick={onMenuItemClick}\n menuItems={item.subMenu}\n />\n </CascadingSubmenu>\n ) : item.type === 'divider' ? (\n <Divider\n key={`divider-${JSON.stringify(item)}-${idx}`}\n component=\"li\"\n />\n ) : item.type === 'subHeader' ? (\n <ListSubheader key={`subHeader-${item.label}-${idx}`}>\n {item.label}\n </ListSubheader>\n ) : (\n <CascadingMenuItem\n key={`${item.label}-${idx}`}\n closeAfterItemClick={closeAfterItemClick}\n onClick={\n 'onClick' in item ? handleClick(item.onClick) : undefined\n }\n disabled={Boolean(item.disabled)}\n >\n {item.icon ? (\n <ListItemIcon>\n <item.icon />\n </ListItemIcon>\n ) : null}{' '}\n <ListItemText\n primary={item.label}\n secondary={item.subLabel}\n inset={hasIcon && !item.icon}\n />\n <div style={{ flexGrow: 1, minWidth: 10 }} />\n <EndDecoration item={item} />\n </CascadingMenuItem>\n )\n })}\n </>\n )\n}\n\nfunction CascadingMenuChildren(props: {\n onMenuItemClick: Function\n closeAfterItemClick?: boolean\n menuItems: JBMenuItem[]\n popupState: PopupState\n}) {\n const { closeAfterItemClick = true, ...rest } = props\n return (\n <CascadingMenu {...rest}>\n <CascadingMenuList {...rest} closeAfterItemClick={closeAfterItemClick} />\n </CascadingMenu>\n )\n}\n\nexport default CascadingMenuChildren\n","import React from 'react'\nimport {\n Dialog as MUIDialog,\n DialogTitle,\n DialogProps,\n Divider,\n IconButton,\n ScopedCssBaseline,\n ThemeProvider,\n createTheme,\n useTheme,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { makeStyles } from 'tss-react/mui'\nimport { ErrorBoundary } from 'react-error-boundary'\n\n// icons\nimport CloseIcon from '@mui/icons-material/Close'\n// locals\nimport ErrorMessage from './ErrorMessage'\nimport SanitizedHTML from './SanitizedHTML'\n\nconst useStyles = makeStyles()(theme => ({\n closeButton: {\n position: 'absolute',\n right: theme.spacing(1),\n top: theme.spacing(1),\n color: theme.palette.grey[500],\n },\n}))\n\nfunction DialogError({ error }: { error: unknown }) {\n return (\n <div style={{ width: 800, margin: 40 }}>\n <ErrorMessage error={error} />\n </div>\n )\n}\n\ninterface Props extends DialogProps {\n header?: React.ReactNode\n}\n\nconst Dialog = observer(function (props: Props) {\n const { classes } = useStyles()\n const { title, header, children, onClose } = props\n const theme = useTheme()\n\n return (\n <MUIDialog {...props}>\n <ScopedCssBaseline>\n {React.isValidElement(header) ? (\n header\n ) : (\n <DialogTitle>\n <SanitizedHTML html={title || ''} />\n {onClose ? (\n <IconButton\n className={classes.closeButton}\n onClick={() => {\n // @ts-expect-error\n onClose()\n }}\n >\n <CloseIcon />\n </IconButton>\n ) : null}\n </DialogTitle>\n )}\n <Divider />\n\n <ErrorBoundary FallbackComponent={DialogError}>\n <ThemeProvider\n theme={createTheme(theme, {\n components: {\n MuiInputBase: {\n styleOverrides: {\n input: {\n // xref https://github.com/GMOD/jbrowse-components/pull/3666\n boxSizing: 'content-box!important' as 'content-box',\n },\n },\n },\n },\n })}\n >\n {children}\n </ThemeProvider>\n </ErrorBoundary>\n </ScopedCssBaseline>\n </MUIDialog>\n )\n})\n\nexport default Dialog\n","import React, { useEffect, useState } from 'react'\nimport { InputBase, Typography, TypographyProps, useTheme } from '@mui/material'\nimport { makeStyles } from 'tss-react/mui'\nimport useMeasure from '@jbrowse/core/util/useMeasure'\n\ntype Variant = TypographyProps['variant']\n\ntype EditableTypographyClassKey =\n | 'input'\n | 'inputBase'\n | 'inputRoot'\n | 'inputFocused'\n\nconst useStyles = makeStyles()(theme => ({\n input: {},\n inputBase: {},\n typography: {\n top: 6,\n left: 2,\n position: 'absolute',\n whiteSpace: 'nowrap',\n visibility: 'hidden',\n },\n inputRoot: {\n padding: theme.spacing(0.5),\n },\n inputFocused: {\n borderStyle: 'solid',\n borderWidth: 2,\n },\n}))\n\ninterface Props {\n value: string\n setValue: (value: string) => void\n variant: Variant\n classes?: Partial<Record<EditableTypographyClassKey, string>>\n}\n\n// using forwardRef so that MUI Tooltip can wrap this component\nconst EditableTypography = React.forwardRef<HTMLDivElement, Props>(\n function EditableTypography2(props, ref) {\n const { value, setValue, variant, ...other } = props\n const [ref2, { width }] = useMeasure()\n const [editedValue, setEditedValue] = useState<string>()\n const [inputNode, setInputNode] = useState<HTMLInputElement | null>(null)\n const [blur, setBlur] = useState(false)\n\n useEffect(() => {\n if (blur) {\n inputNode?.blur()\n setBlur(false)\n }\n }, [blur, inputNode])\n\n // possibly tss-react does not understand the passing of props to\n // useStyles, but it appears to work\n // @ts-expect-error\n const { classes } = useStyles(props, { props })\n const theme = useTheme()\n\n const val = editedValue === undefined ? value : editedValue\n\n return (\n <div {...other} ref={ref}>\n <div style={{ position: 'relative' }}>\n <Typography\n ref={ref2}\n component=\"span\"\n variant={variant}\n className={classes.typography}\n >\n {val}\n </Typography>\n </div>\n <InputBase\n inputRef={node => {\n setInputNode(node)\n }}\n className={classes.inputBase}\n inputProps={{\n style: {\n width,\n ...(variant && variant !== 'inherit'\n ? theme.typography[variant]\n : {}),\n },\n }}\n classes={{\n input: classes.input,\n root: classes.inputRoot,\n focused: classes.inputFocused,\n }}\n value={val}\n onChange={event => {\n setEditedValue(event.target.value)\n }}\n onKeyDown={event => {\n if (event.key === 'Enter') {\n inputNode?.blur()\n } else if (event.key === 'Escape') {\n setEditedValue(undefined)\n setBlur(true)\n }\n }}\n onBlur={() => {\n setValue(editedValue || value || '')\n setEditedValue(undefined)\n }}\n />\n </div>\n )\n },\n)\n\nexport default EditableTypography\n","import React, { Suspense, lazy, useState } from 'react'\nimport { IconButton, Tooltip } from '@mui/material'\nimport { makeStyles } from 'tss-react/mui'\n\n// locals\nimport RedErrorMessageBox from './RedErrorMessageBox'\n\n// icons\nimport RefreshIcon from '@mui/icons-material/Refresh'\nimport ReportIcon from '@mui/icons-material/Report'\n\n// lazies\nconst ErrorMessageStackTraceDialog = lazy(\n () => import('./ErrorMessageStackTraceDialog'),\n)\n\nconst useStyles = makeStyles()(theme => ({\n bg: {\n background: theme.palette.divider,\n border: '1px solid black',\n margin: 20,\n },\n iconFloat: {\n float: 'right',\n marginLeft: 100,\n },\n}))\n\nfunction parseError(str: string) {\n let snapshotError = ''\n const findStr = 'is not assignable'\n const idx = str.indexOf(findStr)\n if (idx !== -1) {\n const trim = str.slice(0, idx + findStr.length)\n // best effort to make a better error message than the default\n // mobx-state-tree\n\n // case 1. element has a path\n const match = /.*at path \"(.*)\" snapshot `(.*)` is not assignable/m.exec(\n trim,\n )\n if (match) {\n str = `Failed to load element at ${match[1]}...Failed element had snapshot`\n snapshotError = match[2]!\n }\n\n // case 2. element has no path\n const match2 = /.*snapshot `(.*)` is not assignable/.exec(trim)\n if (match2) {\n str = 'Failed to load element...Failed element had snapshot'\n snapshotError = match2[1]!\n }\n }\n return snapshotError\n}\n\nfunction ErrorButtons({\n error,\n onReset,\n}: {\n error: unknown\n onReset?: () => void\n}) {\n const { classes } = useStyles()\n const [showStack, setShowStack] = useState(false)\n return (\n <div className={classes.iconFloat}>\n {typeof error === 'object' && error && 'stack' in error ? (\n <Tooltip title=\"Get stack trace\">\n <IconButton\n onClick={() => {\n setShowStack(true)\n }}\n color=\"primary\"\n >\n <ReportIcon />\n </IconButton>\n </Tooltip>\n ) : null}\n {onReset ? (\n <Tooltip title=\"Retry\">\n <IconButton onClick={onReset} color=\"primary\">\n <RefreshIcon />\n </IconButton>\n </Tooltip>\n ) : null}\n {showStack ? (\n <Suspense fallback={null}>\n <ErrorMessageStackTraceDialog\n error={error}\n onClose={() => {\n setShowStack(false)\n }}\n />\n </Suspense>\n ) : null}\n </div>\n )\n}\n\nfunction ErrorMessage({\n error,\n onReset,\n}: {\n error: unknown\n onReset?: () => void\n}) {\n const { classes } = useStyles()\n const str = `${error}`\n const str2 = str.indexOf('expected an instance of')\n const str3 = str2 !== -1 ? str.slice(0, str2) : str\n const snapshotError = parseError(str)\n return (\n <RedErrorMessageBox>\n {str3.slice(0, 10000)}\n <ErrorButtons error={error} onReset={onReset} />\n {snapshotError ? (\n <pre className={classes.bg}>\n {JSON.stringify(JSON.parse(snapshotError), null, 2)}\n </pre>\n ) : null}\n </RedErrorMessageBox>\n )\n}\n\nexport default ErrorMessage\n","import React from 'react'\nimport {\n Button,\n DialogContent,\n DialogContentText,\n DialogActions,\n} from '@mui/material'\nimport Dialog from '@jbrowse/core/ui/Dialog'\n\nexport default function FactoryResetDialog({\n onClose,\n open,\n onFactoryReset,\n}: {\n onClose: () => void\n open: boolean\n onFactoryReset: () => void\n}) {\n function handleDialogClose(action?: string) {\n if (action === 'reset') {\n onFactoryReset()\n }\n onClose()\n }\n\n return (\n <Dialog\n title=\"Reset\"\n onClose={() => {\n handleDialogClose()\n }}\n open={open}\n >\n <DialogContent>\n <DialogContentText>\n Are you sure you want to reset? This will restore the default\n configuration.\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button\n onClick={() => {\n handleDialogClose()\n }}\n color=\"primary\"\n >\n Cancel\n </Button>\n <Button\n onClick={() => {\n handleDialogClose('reset')\n }}\n color=\"primary\"\n variant=\"contained\"\n >\n OK\n </Button>\n </DialogActions>\n </Dialog>\n )\n}\n","import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'\nimport React from 'react'\n\n// Icons below come from https://material.io/resources/icons/?icon=line_style&style=baseline\nexport function ContentCopy(props: SvgIconProps) {\n return (\n <SvgIcon {...props}>\n <path d=\"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z\" />\n </SvgIcon>\n )\n}\n\n// https://materialdesignicons.com/ text-search icon\nexport function Indexing(props: SvgIconProps) {\n return (\n <SvgIcon {...props}>\n <path d=\"M19.31 18.9L22.39 22L21 23.39L17.88 20.32C17.19 20.75 16.37 21 15.5 21C13 21 11 19 11 16.5C11 14 13 12 15.5 12C18 12 20 14 20 16.5C20 17.38 19.75 18.21 19.31 18.9M15.5 19C16.88 19 18 17.88 18 16.5C18 15.12 16.88 14 15.5 14C14.12 14 13 15.12 13 16.5C13 17.88 14.12 19 15.5 19M21 4V6H3V4H21M3 16V14H9V16H3M3 11V9H21V11H18.97C17.96 10.37 16.77 10 15.5 10C14.23 10 13.04 10.37 12.03 11H3Z\" />\n </SvgIcon>\n )\n}\n\nexport function ContentCut(props: SvgIconProps) {\n return (\n <SvgIcon {...props}>\n <path d=\"M19,3L13,9L15,11L22,4V3M12,12.5A0.5,0.5 0 0,1 11.5,12A0.5,0.5 0 0,1 12,11.5A0.5,0.5 0 0,1 12.5,12A0.5,0.5 0 0,1 12,12.5M6,20A2,2 0 0,1 4,18C4,16.89 4.9,16 6,16A2,2 0 0,1 8,18C8,19.11 7.1,20 6,20M6,8A2,2 0 0,1 4,6C4,4.89 4.9,4 6,4A2,2 0 0,1 8,6C8,7.11 7.1,8 6,8M9.64,7.64C9.87,7.14 10,6.59 10,6A4,4 0 0,0 6,2A4,4 0 0,0 2,6A4,4 0 0,0 6,10C6.59,10 7.14,9.87 7.64,9.64L10,12L7.64,14.36C7.14,14.13 6.59,14 6,14A4,4 0 0,0 2,18A4,4 0 0,0 6,22A4,4 0 0,0 10,18C10,17.41 9.87,16.86 9.64,16.36L12,14L19,21H22V20L9.64,7.64Z\" />\n </SvgIcon>\n )\n}\n\nexport function ContentPaste(props: SvgIconProps) {\n return (\n <SvgIcon {...props}>\n <path d=\"M19,20H5V4H7V7H17V4H19M12,2A1,1 0 0,1 13,3A1,1 0 0,1 12,4A1,1 0 0,1 11,3A1,1 0 0,1 12,2M19,2H14.82C14.4,0.84 13.3,0 12,0C10.7,0 9.6,0.84 9.18,2H5A2,2 0 0,0 3,4V20A2,2 0 0,0 5,22H19A2,2 0 0,0 21,20V4A2,2 0 0,0 19,2Z\" />\n </SvgIcon>\n )\n}\n\n// format-list-checkbox from https://materialdesignicons.com/\nexport function TrackSelector(props: SvgIconProps) {\n return (\n <SvgIcon {...props}>\n <path d=\"M21 19v-2H8v2h13m0-6v-2H8v2h13M8 7h13V5H8v2M4 5v2h2V5H4M3 5a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 01-1 1H4a1 1 0 01-1-1V5m1 6v2h2v-2H4m-1 0a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 01-1 1H4a1 1 0 01-1-1v-2m1 6v2h2v-2H4m-1 0a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 01-1 1H4a1 1 0 01-1-1v-2z\" />\n </SvgIcon>\n )\n}\n\n// content-save-edit from https://materialdesignicons.com/\nexport function SaveAs(props: SvgIconProps) {\n return (\n <SvgIcon {...props}>\n <path\n fill=\"currentColor\"\n d=\"M10,19L10.14,18.86C8.9,18.5 8,17.36 8,16A3,3 0 0,1 11,13C12.36,13 13.5,13.9 13.86,15.14L20,9V7L16,3H4C2.89,3 2,3.9 2,5V19A2,2 0 0,0 4,21H10V19M4,5H14V9H4V5M20.04,12.13C19.9,12.13 19.76,12.19 19.65,12.3L18.65,13.3L20.7,15.35L21.7,14.35C21.92,14.14 21.92,13.79 21.7,13.58L20.42,12.3C20.31,12.19 20.18,12.13 20.04,12.13M18.07,13.88L12,19.94V22H14.06L20.12,15.93L18.07,13.88Z\"\n />\n </SvgIcon>\n )\n}\n\n// content-save from https://materialdesignicons.com/\nexport function Save(props: SvgIconProps) {\n return (\n <SvgIcon {...props}>\n <path\n fill=\"currentColor\"\n d=\"M15,9H5V5H15M12,19A3,3 0 0,1 9,16A3,3 0 0,1 12,13A3,3 0 0,1 15,16A3,3 0 0,1 12,19M17,3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V7L17,3Z\"\n />\n </SvgIcon>\n )\n}\n\n// dna from https://materialdesignicons.com/\nexport function DNA(props: SvgIconProps) {\n return (\n <SvgIcon {...props}>\n <path\n fill=\"currentColor\"\n d=\"M4,2H6V4C6,5.44 6.68,6.61 7.88,7.78C8.74,8.61 9.89,9.41 11.09,10.2L9.26,11.39C8.27,10.72 7.31,10 6.5,9.21C5.07,7.82 4,6.1 4,4V2M18,2H20V4C20,6.1 18.93,7.82 17.5,9.21C16.09,10.59 14.29,11.73 12.54,12.84C10.79,13.96 9.09,15.05 7.88,16.22C6.68,17.39 6,18.56 6,20V22H4V20C4,17.9 5.07,16.18 6.5,14.79C7.91,13.41 9.71,12.27 11.46,11.16C13.21,10.04 14.91,8.95 16.12,7.78C17.32,6.61 18,5.44 18,4V2M14.74,12.61C15.73,13.28 16.69,14 17.5,14.79C18.93,16.18 20,17.9 20,20V22H18V20C18,18.56 17.32,17.39 16.12,16.22C15.26,15.39 14.11,14.59 12.91,13.8L14.74,12.61M7,3H17V4L16.94,4.5H7.06L7,4V3M7.68,6H16.32C16.08,6.34 15.8,6.69 15.42,7.06L14.91,7.5H9.07L8.58,7.06C8.2,6.69 7.92,6.34 7.68,6M9.09,16.5H14.93L15.42,16.94C15.8,17.31 16.08,17.66 16.32,18H7.68C7.92,17.66 8.2,17.31 8.58,16.94L9.09,16.5M7.06,19.5H16.94L17,20V21H7V20L7.06,19.5Z\"\n />\n </SvgIcon>\n )\n}\n\nexport function Cable(props: SvgIconProps) {\n return (\n <SvgIcon {...props}>\n <path d=\"M20 5V4c0-.55-.45-1-1-1h-2c-.55 0-1 .45-1 1v1h-1v4c0 .55.45 1 1 1h1v7c0 1.1-.9 2-2 2s-2-.9-2-2V7c0-2.21-1.79-4-4-4S5 4.79 5 7v7H4c-.55 0-1 .45-1 1v4h1v1c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-1h1v-4c0-.55-.45-1-1-1H7V7c0-1.1.9-2 2-2s2 .9 2 2v10c0 2.21 1.79 4 4 4s4-1.79 4-4v-7h1c.55 0 1-.45 1-1V5h-1z\" />\n </SvgIcon>\n )\n}\n","import React from 'react'\n\ntype LogoVariant = 'color' | 'black' | 'white'\n\ninterface LogoProps {\n variant?: LogoVariant\n}\n\nfunction getColors(variant?: LogoVariant) {\n if (variant === 'black') {\n return {\n midnight: '#808080',\n forrest: '#666666',\n grape: '#4d4d4d',\n mandarin: '#333333',\n gray: '#1a1a1a',\n }\n }\n if (variant === 'white') {\n return {\n midnight: '#ffffff',\n forrest: '#e6e6e6',\n grape: '#cccccc',\n mandarin: '#b3b3b3',\n gray: '#999999',\n }\n }\n return {\n midnight: '#0d233f',\n forrest: '#135560',\n grape: '#721e63',\n mandarin: '#ffb11d',\n gray: '#dadada',\n }\n}\n\nexport function Logomark({ variant }: LogoProps) {\n return (\n <svg viewBox=\"0 0 175 175\">\n <Icon variant={variant} />\n </svg>\n )\n}\n\nexport function LogoFull({ variant }: LogoProps) {\n return (\n <svg viewBox=\"0 0 641 175\">\n <Text variant={variant} />\n <Icon variant={variant} />\n </svg>\n )\n}\n\nfunction Icon({ variant }: LogoProps) {\n const colors = getColors(variant)\n return (\n <>\n <path\n style={{ fill: colors.midnight }}\n d=\"M120.5,57.5c.168,0,.333.012.5.013V40.506c-.167,0-.333-.006-.5-.006a98.325,98.325,0,0,0-77.4,37.565q-2.664,3.378-5.023,6.994l14.206,9.327Q54.043,91.709,56,89.179A81.363,81.363,0,0,1,120.5,57.5Z\"\n />\n <path\n style={{ fill: colors.forrest }}\n d=\"M148.668,86.223c.308.133.6.283.908.42l6.746-15.618c-.153-.067-.3-.143-.454-.21a81.36,81.36,0,0,0-71.777,3.5q-2.8,1.544-5.469,3.309l9.249,14.054A63.93,63.93,0,0,1,148.668,86.223Z\"\n />\n <path\n style={{ fill: colors.grape }}\n d=\"M170.894,109.37A63.929,63.929,0,0,0,113.4,88.861l2.336,15.474a48.456,48.456,0,0,1,44.322,15.42c.111.125.214.255.324.381l11.16-10C171.323,109.879,171.118,109.62,170.894,109.37Z\"\n />\n <path\n style={{ fill: colors.mandarin }}\n d=\"M150.921,150.314c.04.163.07.326.107.489l16.509-4.058c-.039-.163-.067-.326-.107-.489A48.457,48.457,0,0,0,135.575,111.8l-5.515,15.591A32.466,32.466,0,0,1,150.921,150.314Z\"\n />\n <path\n style={{ fill: colors.gray }}\n d=\"M134.1,138.129l-9.779,13.213a32.486,32.486,0,0,1,7.823,14.463l15.147.852c.012-.166.032-.331.041-.5A32.464,32.464,0,0,0,134.1,138.129Z\"\n />\n </>\n )\n}\n\nfunction Text({ variant }: LogoProps) {\n const colors = getColors(variant)\n return (\n <g\n aria-label=\"JBrowse\"\n transform=\"translate(213.084 144.241)\"\n style={{ fill: colors.midnight }}\n >\n <path d=\"m 26.355,-71.505 v 54.075 2.835 q 0,6.825 -0.42,10.185 -0.735,5.67 -2.835,9.135 -3.255,5.355 -8.505,8.4 -4.83,2.73 -11.55,3.57 L 1.47,11.76 Q 7.35,10.185 9.24,4.2 10.605,-0.105 10.605,-9.975 v -5.565 -55.965 q 1.785,0 4.62,0.315 2.835,0.21 3.255,0.21 1.785,0 2.94,-0.105 4.515,-0.42 4.935,-0.42 z\" />\n <path d=\"m 60.68836,-65.415 v 24.78 h 3.255 q 2.94,0 4.935,-0.525 2.1,-0.525 3.885,-2.1 2.31,-1.995 3.36,-4.83 1.155,-2.835 1.155,-6.09 0,-5.565 -2.94,-8.61 -2.94,-3.045 -8.295,-3.045 -2.52,0 -5.355,0.42 z m 0,30.87 V -6.09 h 5.25 q 4.725,0 8.505,-3.675 3.885,-3.78 3.885,-10.08 0,-8.19 -4.62,-11.655 -4.095,-3.045 -13.02,-3.045 z M 44.93836,0 v -71.505 h 27.09 q 9.135,0 14.385,3.255 6.51,3.99 6.51,12.6 0,7.035 -5.25,11.655 -4.62,4.095 -11.97,5.145 v 0.945 q 7.56,0.735 12.285,3.99 6.615,4.62 6.615,13.335 0,10.185 -7.98,15.75 -6.93,4.83 -17.43,4.83 z\" />\n <path d=\"M 109.44281,0.525 V -50.4 q 1.785,0.21 3.99,0.42 2.31,0.105 3.255,0.105 2.31,0 4.2,-0.21 1.89,-0.21 3.045,-0.315 v 13.02 q 1.89,-6.51 5.46,-9.87 4.41,-4.095 11.655,-4.095 -0.315,2.73 -0.42,6.825 -0.105,3.99 -0.105,7.455 l -0.945,0.84 q -0.945,-0.735 -2.415,-1.05 -1.47,-0.315 -2.94,-0.315 -3.57,0 -6.195,1.89 -2.52,1.785 -3.465,5.04 -0.42,1.155 -0.525,3.15 -0.105,1.89 -0.105,4.515 v 4.515 19.005 q -1.785,-0.21 -2.625,-0.21 -3.675,-0.315 -4.62,-0.315 -2.31,0 -4.2,0.21 -1.89,0.21 -3.045,0.315 z\" />\n <path d=\"m 173.77337,1.47 q -11.655,0 -18.585,-6.825 -6.93,-6.825 -6.93,-18.48 0,-12.6 6.72,-20.055 6.825,-7.455 18.9,-7.455 11.97,0 18.9,6.72 6.93,6.72 6.93,18.48 0,12.285 -6.72,19.74 -7.14,7.875 -19.215,7.875 z m 0.735,-48.09 q -5.88,0 -8.505,6.51 -2.205,5.565 -2.205,15.96 0,8.19 1.47,12.915 2.415,7.98 8.505,7.98 5.565,0 8.19,-7.875 2.205,-6.51 2.205,-16.695 0,-8.505 -2.1,-13.23 -2.52,-5.565 -7.56,-5.565 z\" />\n <path d=\"m 222.03563,-50.4 10.5,36.015 q 3.675,-11.235 5.67,-17.85 2.415,-8.085 5.04,-18.165 1.05,0.105 3.045,0.315 2.1,0.21 2.835,0.21 1.995,0 3.15,-0.105 1.26,-0.21 2.73,-0.42 l 10.71,36.015 q 5.88,-17.43 10.71,-36.015 l 4.2,0.315 4.095,-0.315 q -5.145,13.125 -9.135,24.57 -5.04,14.28 -8.505,26.355 -1.89,-0.21 -3.36,-0.42 -1.365,-0.105 -2.205,-0.105 -1.89,0 -3.36,0.21 -1.365,0.21 -2.31,0.315 l -10.605,-34.755 q -4.41,13.65 -6.72,21.105 -2.31,7.35 -4.095,13.65 -1.89,-0.21 -3.36,-0.42 -1.365,-0.105 -2.31,-0.105 -1.995,0 -3.465,0.21 -1.365,0.21 -2.31,0.315 -3.78,-12.81 -5.04,-17.01 -2.205,-7.245 -5.46,-17.01 -2.835,-8.4 -5.88,-16.905 1.575,0 4.305,0.315 2.73,0.21 3.36,0.21 1.47,0 4.305,-0.21 2.835,-0.315 3.465,-0.315 z\" />\n <path d=\"m 292.84172,-12.81 h 2.625 q 1.47,4.095 4.62,6.51 3.15,2.415 7.35,2.415 2.94,0 5.46,-1.785 2.625,-1.89 2.625,-4.62 0,-3.885 -6.195,-6.615 -10.395,-4.62 -11.655,-5.46 -6.405,-4.515 -6.405,-12.285 0,-7.77 5.25,-12.18 5.25,-4.515 12.81,-4.515 3.99,0 8.085,1.365 4.095,1.26 7.14,3.57 l -2.52,9.24 h -2.94 q -0.63,-3.57 -3.57,-6.195 -2.835,-2.625 -6.405,-2.625 -3.15,0 -5.46,1.575 -2.31,1.47 -2.31,4.515 0,3.885 6.405,6.51 10.185,4.095 11.865,5.25 6.405,4.41 6.405,12.81 0,7.455 -5.46,12.18 -5.355,4.62 -14.805,4.62 -8.19,0 -14.49,-4.305 z\" />\n <path d=\"m 349.61228,-29.925 h 15.54 q 0,-6.51 -1.05,-10.395 -1.68,-6.3 -5.88,-6.3 -5.04,0 -7.14,6.195 -1.47,4.305 -1.47,10.5 z m 30.03,5.04 h -30.03 q 0,9.135 3.045,13.86 3.57,5.67 11.55,5.67 3.255,0 6.405,-1.26 3.15,-1.26 5.88,-3.465 l 1.26,0.945 -2.31,5.88 q -6.72,4.725 -15.015,4.725 -12.915,0 -19.635,-7.245 -6.72,-7.245 -6.72,-20.37 0,-11.235 6.405,-18.165 6.51,-7.035 17.64,-7.035 11.655,0 16.905,7.56 4.62,6.615 4.62,18.9 z\" />\n </g>\n )\n}\n","import React, { useEffect, useRef, useState } from 'react'\nimport {\n Divider,\n ListItemIcon,\n ListItemText,\n ListSubheader,\n MenuProps as MUIMenuProps,\n MenuItem as MUIMenuItem,\n MenuItemProps,\n MenuList,\n Paper,\n Popover,\n PopoverProps,\n SvgIconProps,\n Grow,\n} from '@mui/material'\nimport { makeStyles } from 'tss-react/mui'\n// icons\nimport ArrowRightIcon from '@mui/icons-material/ArrowRight'\nimport CheckBoxIcon from '@mui/icons-material/CheckBox'\nimport CheckBoxOutlineBlankIcon from '@mui/icons-material/CheckBoxOutlineBlank'\nimport RadioButtonCheckedIcon from '@mui/icons-material/RadioButtonChecked'\nimport RadioButtonUncheckedIcon from '@mui/icons-material/RadioButtonUnchecked'\n\n// other\nimport { findLastIndex } from '../util'\n\nconst useStyles = makeStyles()({\n paper: {\n position: 'fixed',\n overflowY: 'auto',\n overflowX: 'hidden',\n // So we see the popover when it's empty.\n minWidth: 16,\n minHeight: 16,\n maxWidth: 'calc(100% - 32px)',\n maxHeight: 'calc(100% - 32px)',\n top: 0,\n left: 0,\n // We disable the focus ring for mouse, touch and keyboard users.\n outline: 0,\n },\n menuItemEndDecoration: {\n padding: 0,\n margin: 0,\n height: 16,\n },\n})\n\ninterface MenuItemEndDecorationSubMenuProps {\n type: 'subMenu'\n}\n\ninterface MenuItemEndDecorationSelectorProps {\n type: 'checkbox' | 'radio'\n checked: boolean\n disabled?: boolean\n}\n\ntype MenuItemEndDecorationProps =\n | MenuItemEndDecorationSubMenuProps\n | MenuItemEndDecorationSelectorProps\n\nexport function MenuItemEndDecoration(props: MenuItemEndDecorationProps) {\n const { classes } = useStyles()\n const { type } = props\n let checked: boolean | undefined\n let disabled: boolean | undefined\n if ('checked' in props) {\n ;({ checked, disabled } = props)\n }\n let icon: React.ReactElement\n switch (type) {\n case 'subMenu': {\n icon = <ArrowRightIcon color=\"action\" />\n break\n }\n case 'checkbox': {\n if (checked) {\n const color = disabled ? 'inherit' : undefined\n icon = <CheckBoxIcon color={color} />\n } else {\n icon = <CheckBoxOutlineBlankIcon color=\"action\" />\n }\n break\n }\n case 'radio': {\n if (checked) {\n const color = disabled ? 'inherit' : undefined\n icon = <RadioButtonCheckedIcon color={color} />\n } else {\n icon = <RadioButtonUncheckedIcon color=\"action\" />\n }\n break\n }\n // No default\n }\n return <div className={classes.menuItemEndDecoration}>{icon}</div>\n}\n\nexport interface MenuDivider {\n priority?: number\n type: 'divider'\n}\n\nexport interface MenuSubHeader {\n type: 'subHeader'\n priority?: number\n label: string\n}\n\nexport interface BaseMenuItem {\n id?: string // used as react key if provided\n label: React.ReactNode\n priority?: number\n subLabel?: string\n icon?: React.ComponentType<SvgIconProps>\n disabled?: boolean\n}\n\nexport interface NormalMenuItem extends BaseMenuItem {\n type?: 'normal'\n onClick: (...args: any[]) => void\n}\n\nexport interface CheckboxMenuItem extends BaseMenuItem {\n type: 'checkbox'\n checked: boolean\n onClick: (...args: any[]) => void\n}\n\nexport interface RadioMenuItem extends BaseMenuItem {\n type: 'radio'\n checked: boolean\n onClick: (...args: any[]) => void\n}\n\nexport interface SubMenuItem extends BaseMenuItem {\n type?: 'subMenu'\n subMenu: MenuItem[]\n}\n\nexport type MenuItem =\n | MenuDivider\n | MenuSubHeader\n | NormalMenuItem\n | CheckboxMenuItem\n | RadioMenuItem\n | SubMenuItem\n\ntype AnchorElProp = MUIMenuProps['anchorEl']\ntype OpenProp = MUIMenuProps['open']\ntype OnCloseProp = MUIMenuProps['onClose']\n\ninterface MenuPageProps {\n menuItems: MenuItem[]\n onMenuItemClick: (\n event: React.MouseEvent<HTMLLIElement>,\n callback: (...args: any[]) => void,\n ) => void\n anchorEl?: AnchorElProp\n open: OpenProp\n onClose: OnCloseProp\n top?: boolean\n}\n\ntype MenuItemStyleProp = MenuItemProps['style']\n\nfunction checkIfValid(m: MenuItem) {\n return m.type !== 'divider' && m.type !== 'subHeader' && !m.disabled\n}\nfunction findNextValidIdx(menuItems: MenuItem[], currentIdx: number) {\n const idx = menuItems.slice(currentIdx + 1).findIndex(checkIfValid)\n if (idx === -1) {\n return idx\n }\n return currentIdx + 1 + idx\n}\n\nfunction findPreviousValidIdx(menuItems: MenuItem[], currentIdx: number) {\n return findLastIndex(menuItems.slice(0, currentIdx), checkIfValid)\n}\n\nconst MenuPage = React.forwardRef<HTMLDivElement, MenuPageProps>(\n function MenuPage2(props, ref) {\n const [subMenuAnchorEl, setSubMenuAnchorEl] = useState<HTMLElement>()\n const [openSubMenuIdx, setOpenSubMenuIdx] = useState<number>()\n const [isSubMenuOpen, setIsSubMenuOpen] = useState(false)\n const [selectedMenuItemIdx, setSelectedMenuItemIdx] = useState<number>()\n const [position, setPosition] = useState<{\n top?: number\n left?: number\n }>()\n const paperRef = useRef<HTMLDivElement | null>(null)\n const { classes } = useStyles()\n\n const {\n menuItems,\n onMenuItemClick,\n open,\n onClose,\n anchorEl,\n top = false,\n } = props\n\n useEffect(() => {\n if (!open) {\n setSubMenuAnchorEl(undefined)\n setOpenSubMenuIdx(undefined)\n }\n }, [open])\n\n useEffect(() => {\n const shouldSubMenuBeOpen = open && Boolean(subMenuAnchorEl)\n let timer: ReturnType<typeof setTimeout>\n if (shouldSubMenuBeOpen && !isSubMenuOpen) {\n timer = setTimeout(() => {\n setIsSubMenuOpen(true)\n }, 300)\n } else if (!shouldSubMenuBeOpen && isSubMenuOpen) {\n timer = setTimeout(() => {\n setIsSubMenuOpen(false)\n }, 300)\n }\n return () => {\n clearTimeout(timer)\n }\n }, [isSubMenuOpen, open, subMenuAnchorEl])\n\n useEffect(() => {\n if (anchorEl) {\n const rect = (anchorEl as HTMLElement).getBoundingClientRect()\n if (position) {\n if (\n rect.top !== position.top ||\n rect.left + rect.width !== position.left\n ) {\n setPosition({ top: rect.top, left: rect.left + rect.width })\n }\n } else {\n setPosition({ top: rect.top, left: rect.left + rect.width })\n }\n } else if (!position) {\n setPosition({})\n }\n }, [position, anchorEl])\n\n const hasIcon = menuItems.some(\n menuItem => 'icon' in menuItem && menuItem.icon,\n )\n const menuItemStyle: MenuItemStyleProp = {}\n\n function handleClick(callback: (...args: any[]) => void) {\n return (event: React.MouseEvent<HTMLLIElement>) => {\n onMenuItemClick(event, callback)\n }\n }\n\n const ListContents = (\n <>\n <MenuList autoFocusItem={open && !isSubMenuOpen} dense>\n {menuItems\n .sort((a, b) => (b.priority || 0) - (a.priority || 0))\n .map((menuItem, idx) => {\n if (menuItem.type === 'divider') {\n return (\n <Divider\n key={`divider-${JSON.stringify(menuItem)}-${idx}`}\n component=\"li\"\n />\n )\n }\n if (menuItem.type === 'subHeader') {\n return (\n <ListSubheader key={`subHeader-${menuItem.label}-${idx}`}>\n {menuItem.label}\n </ListSubheader>\n )\n }\n let icon = null\n let endDecoration = null\n if (menuItem.icon) {\n const Icon = menuItem.icon\n icon = (\n <ListItemIcon>\n <Icon />\n </ListItemIcon>\n )\n }\n if ('subMenu' in menuItem) {\n endDecoration = <MenuItemEndDecoration type=\"subMenu\" />\n } else if (\n menuItem.type === 'checkbox' ||\n menuItem.type === 'radio'\n ) {\n endDecoration = (\n <MenuItemEndDecoration\n type={menuItem.type}\n checked={menuItem.checked}\n disabled={menuItem.disabled}\n />\n )\n }\n const onClick =\n 'onClick' in menuItem\n ? handleClick(menuItem.onClick)\n : undefined\n return (\n <MUIMenuItem\n key={menuItem.id || String(menuItem.label)}\n style={menuItemStyle}\n selected={idx === selectedMenuItemIdx}\n onClick={onClick}\n onMouseMove={e => {\n if (e.currentTarget !== document.activeElement) {\n e.currentTarget.focus()\n setSelectedMenuItemIdx(idx)\n }\n if ('subMenu' in menuItem) {\n if (openSubMenuIdx !== idx) {\n setSubMenuAnchorEl(e.currentTarget)\n setOpenSubMenuIdx(idx)\n }\n } else {\n setSubMenuAnchorEl(undefined)\n setOpenSubMenuIdx(undefined)\n }\n }}\n onKeyDown={e => {\n switch (e.key) {\n case 'ArrowLeft':\n case 'Escape': {\n onClose?.(e, 'escapeKeyDown')\n\n break\n }\n case 'ArrowUp': {\n setSelectedMenuItemIdx(\n findPreviousValidIdx(menuItems, idx),\n )\n\n break\n }\n case 'ArrowDown': {\n const a = findNextValidIdx(menuItems, idx)\n setSelectedMenuItemIdx(a)\n\n break\n }\n default: {\n if (\n 'subMenu' in menuItem &&\n (e.key === 'ArrowRight' || e.key === 'Enter')\n ) {\n setSubMenuAnchorEl(e.currentTarget)\n setOpenSubMenuIdx(idx)\n setIsSubMenuOpen(true)\n }\n }\n }\n }}\n disabled={Boolean(menuItem.disabled)}\n >\n {icon}\n <ListItemText\n primary={menuItem.label}\n secondary={menuItem.subLabel}\n inset={hasIcon && !menuItem.icon}\n />\n {endDecoration}\n </MUIMenuItem>\n )\n })}\n </MenuList>\n {menuItems.map((menuItem, idx) => {\n let subMenu = null\n if ('subMenu' in menuItem) {\n subMenu = (\n <MenuPage\n key={menuItem.id || String(menuItem.label)}\n anchorEl={subMenuAnchorEl}\n open={isSubMenuOpen && openSubMenuIdx === idx}\n onClose={() => {\n setIsSubMenuOpen(false)\n setSubMenuAnchorEl(undefined)\n }}\n onMenuItemClick={onMenuItemClick}\n menuItems={menuItem.subMenu}\n />\n )\n }\n return subMenu\n })}\n </>\n )\n\n return top ? (\n ListContents\n ) : (\n // Grow is required for cascading sub-menus\n <Grow in={open} style={{ transformOrigin: '0 0 0' }} ref={ref}>\n <Paper\n elevation={8}\n ref={paperRef}\n className={classes.paper}\n style={{ ...position }}\n >\n {ListContents}\n </Paper>\n </Grow>\n )\n },\n)\n\ninterface MenuProps extends PopoverProps {\n menuItems: MenuItem[]\n onMenuItemClick: (\n event: React.MouseEvent<HTMLLIElement>,\n callback: (...args: any[]) => void,\n ) => void\n}\n\nfunction Menu(props: MenuProps) {\n const { open, onClose, menuItems, onMenuItemClick, ...other } = props\n\n return (\n <Popover\n open={open}\n onClose={onClose}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'right',\n ...other.anchorOrigin,\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'left',\n ...other.transformOrigin,\n }}\n {...other}\n >\n <MenuPage\n open={open}\n onClose={onClose}\n menuItems={menuItems}\n onMenuItemClick={onMenuItemClick}\n top\n />\n </Popover>\n )\n}\n\nexport default Menu\n","import React, { useEffect, useState, useRef } from 'react'\nimport { makeStyles } from 'tss-react/mui'\n\nconst useStyles = makeStyles()({\n horizontalHandle: {\n cursor: 'row-resize',\n width: '100%',\n },\n verticalHandle: {\n cursor: 'col-resize',\n height: '100%',\n },\n flexbox_verticalHandle: {\n cursor: 'col-resize',\n alignSelf: 'stretch', // the height: 100% is actually unable to function inside flexbox\n },\n flexbox_horizontalHandle: {\n cursor: 'row-resize',\n alignSelf: 'stretch', // similar to above\n },\n})\n\nfunction ResizeHandle({\n onDrag,\n vertical = false,\n flexbox = false,\n className: originalClassName,\n onMouseDown,\n ...props\n}: {\n onDrag: (\n lastFrameDistance: number,\n totalDistance: number,\n ) => number | undefined\n onMouseDown?: (event: React.MouseEvent) => void\n vertical?: boolean\n flexbox?: boolean\n className?: string\n [props: string]: unknown\n}) {\n const [mouseDragging, setMouseDragging] = useState(false)\n const initialPosition = useRef(0)\n const prevPos = useRef(0)\n const { classes, cx } = useStyles()\n\n useEffect(() => {\n function mouseMove(event: MouseEvent) {\n event.preventDefault()\n const pos = vertical ? event.clientX : event.clientY\n const totalDistance = initialPosition.current - pos\n const lastFrameDistance = pos - prevPos.current\n prevPos.current = pos\n onDrag(lastFrameDistance, totalDistance)\n }\n\n function mouseUp() {\n setMouseDragging(false)\n }\n if (mouseDragging) {\n window.addEventListener('mousemove', mouseMove, true)\n window.addEventListener('mouseup', mouseUp, true)\n return () => {\n window.removeEventListener('mousemove', mouseMove, true)\n window.removeEventListener('mouseup', mouseUp, true)\n }\n }\n return () => {}\n }, [mouseDragging, onDrag, vertical])\n\n let className: string\n if (flexbox) {\n className = vertical\n ? classes.flexbox_verticalHandle\n : classes.flexbox_horizontalHandle\n } else if (vertical) {\n className = classes.verticalHandle\n } else {\n className = classes.horizontalHandle\n }\n\n return (\n <div\n data-resizer=\"true\"\n onMouseDown={event => {\n event.preventDefault()\n const pos = vertical ? event.clientX : event.clientY\n initialPosition.current = pos\n prevPos.current = pos\n setMouseDragging(true)\n onMouseDown?.(event)\n }}\n className={cx(className, originalClassName)}\n {...props}\n />\n )\n}\n\nexport default ResizeHandle\n","import React from 'react'\nimport { observer } from 'mobx-react'\nimport { Button, DialogActions, DialogContent, Typography } from '@mui/material'\nimport Dialog from './Dialog'\n\nconst ReturnToImportFormDialog = observer(function ({\n model,\n handleClose,\n}: {\n model: { clearView: () => void }\n handleClose: () => void\n}) {\n return (\n <Dialog maxWidth=\"xl\" open onClose={handleClose} title=\"Reference sequence\">\n <DialogContent>\n <Typography>\n Are you sure you want to return to the import form? This will lose\n your current view\n </Typography>\n </DialogContent>\n <DialogActions>\n <Button\n onClick={() => {\n model.clearView()\n handleClose()\n }}\n variant=\"contained\"\n color=\"primary\"\n autoFocus\n >\n OK\n </Button>\n <Button\n onClick={() => {\n handleClose()\n }}\n color=\"secondary\"\n variant=\"contained\"\n >\n Cancel\n </Button>\n </DialogActions>\n </Dialog>\n )\n})\n\nexport default ReturnToImportFormDialog\n","import React from 'react'\nimport escapeHTML from 'escape-html'\nimport dompurify from 'dompurify'\nimport { linkify } from '../util'\n\n// source https://github.com/sindresorhus/html-tags/blob/master/html-tags.json\n// with some random uncommon ones removed. note: we just use this to run the content\n// through dompurify without escaping if we see an htmlTag from this list\n// otherwise we escape angle brackets and things prematurely because it might be\n// something like <TRA> in VCF. Ref #657\nconst htmlTags = [\n 'a',\n 'b',\n 'br',\n 'code',\n 'div',\n 'em',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'i',\n 'img',\n 'li',\n 'p',\n 'pre',\n 'span',\n 'small',\n 'strong',\n 'table',\n 'tbody',\n 'sup',\n 'sub',\n 'td',\n 'tfoot',\n 'th',\n 'thead',\n 'tr',\n 'u',\n 'ul',\n]\n\nlet added = false\n\n// adapted from is-html\n// https://github.com/sindresorhus/is-html/blob/master/index.js\nconst full = new RegExp(htmlTags.map(tag => `<${tag}\\\\b[^>]*>`).join('|'), 'i')\nfunction isHTML(str: string) {\n return full.test(str)\n}\n\n// note this is mocked during testing, see\n// packages/__mocks__/@jbrowse/core/ui/SanitizedHTML something about dompurify\n// behavior causes errors during tests, was seen in\n// products/jbrowse-web/src/tests/Connection.test.tsx test (can delete mock to\n// see)\n//\nexport default function SanitizedHTML({\n html: pre,\n className,\n}: {\n className?: string\n html: string\n}) {\n // try to add links to the text first\n const html = linkify(pre)\n const value = isHTML(html) ? html : escapeHTML(html)\n if (!added) {\n added = true\n // see https://github.com/cure53/DOMPurify/issues/317\n // only have to add this once, and can't do it globally because dompurify\n // not yet initialized at global scope\n dompurify.addHook(\n 'afterSanitizeAttributes',\n (node: {\n tagName: string\n setAttribute: (arg0: string, arg1: string) => void\n }) => {\n if (node.tagName === 'A') {\n node.setAttribute('rel', 'noopener noreferrer')\n node.setAttribute('target', '_blank')\n }\n },\n )\n }\n\n return (\n <span\n className={className}\n dangerouslySetInnerHTML={{\n __html: dompurify.sanitize(value),\n }}\n />\n )\n}\n","import { blue, green, red, grey, orange } from '@mui/material/colors'\nimport { createTheme, ThemeOptions } from '@mui/material/styles'\nimport type {\n PaletteAugmentColorOptions,\n PaletteColor,\n} from '@mui/material/styles/createPalette'\nimport deepmerge from 'deepmerge'\n\ndeclare module '@mui/material/styles/createPalette' {\n interface Palette {\n tertiary: Palette['primary']\n quaternary: Palette['primary']\n highlight: Palette['primary']\n stopCodon?: string\n startCodon?: string\n bases: {\n A: Palette['primary']\n C: Palette['primary']\n G: Palette['primary']\n T: Palette['primary']\n }\n frames: [\n null,\n Palette['primary'] | undefined,\n Palette['primary'] | undefined,\n Palette['primary'] | undefined,\n Palette['primary'] | undefined,\n Palette['primary'] | undefined,\n Palette['primary'] | undefined,\n ]\n framesCDS: [\n null,\n Palette['primary'] | undefined,\n Palette['primary'] | undefined,\n Palette['primary'] | undefined,\n Palette['primary'] | undefined,\n Palette['primary'] | undefined,\n Palette['primary'] | undefined,\n ]\n }\n interface PaletteOptions {\n tertiary?: PaletteOptions['primary']\n quaternary?: PaletteOptions['primary']\n highlight?: PaletteOptions['primary']\n stopCodon?: string\n startCodon?: string\n bases?: {\n A?: PaletteOptions['primary']\n C?: PaletteOptions['primary']\n G?: PaletteOptions['primary']\n T?: PaletteOptions['primary']\n }\n framesCDS?: [\n null,\n Palette['primary'] | undefined,\n Palette['primary'] | undefined,\n Palette['primary'] | undefined,\n Palette['primary'] | undefined,\n Palette['primary'] | undefined,\n Palette['primary'] | undefined,\n ]\n frames?: [\n null,\n Palette['primary'] | undefined,\n Palette['primary'] | undefined,\n Palette['primary'] | undefined,\n Palette['primary'] | undefined,\n Palette['primary'] | undefined,\n Palette['primary'] | undefined,\n ]\n }\n}\n\ntype Frames = [\n null,\n PaletteColor,\n PaletteColor,\n PaletteColor,\n PaletteColor,\n PaletteColor,\n PaletteColor,\n]\n\nconst refTheme = createTheme()\nconst midnight = '#0D233F'\nconst grape = '#721E63'\nconst forest = refTheme.palette.augmentColor({ color: { main: '#135560' } })\nconst mandarin = refTheme.palette.augmentColor({ color: { main: '#FFB11D' } })\nconst bases = {\n A: refTheme.palette.augmentColor({ color: green }),\n C: refTheme.palette.augmentColor({ color: blue }),\n G: refTheme.palette.augmentColor({ color: orange }),\n T: refTheme.palette.augmentColor({ color: red }),\n}\nconst framesCDS = [\n null,\n refTheme.palette.augmentColor({ color: { main: '#FF8080' } }),\n refTheme.palette.augmentColor({ color: { main: '#80FF80' } }),\n refTheme.palette.augmentColor({ color: { main: '#8080FF' } }),\n refTheme.palette.augmentColor({ color: { main: '#8080FF' } }),\n refTheme.palette.augmentColor({ color: { main: '#80FF80' } }),\n refTheme.palette.augmentColor({ color: { main: '#FF8080' } }),\n] as Frames\nconst frames = [\n null,\n refTheme.palette.augmentColor({ color: { main: '#8f8f8f' } }),\n refTheme.palette.augmentColor({ color: { main: '#adadad' } }),\n refTheme.palette.augmentColor({ color: { main: '#d8d8d8' } }),\n refTheme.palette.augmentColor({ color: { main: '#d8d8d8' } }),\n refTheme.palette.augmentColor({ color: { main: '#adadad' } }),\n refTheme.palette.augmentColor({ color: { main: '#8f8f8f' } }),\n] as Frames\nconst stopCodon = '#e22'\nconst startCodon = '#3e3'\n\nfunction stockTheme() {\n return {\n palette: {\n mode: undefined,\n primary: { main: midnight },\n secondary: { main: grape },\n tertiary: forest,\n quaternary: mandarin,\n highlight: mandarin,\n stopCodon,\n startCodon,\n bases,\n frames,\n framesCDS,\n },\n components: {\n MuiLink: {\n styleOverrides: {\n // the default link color uses theme.palette.primary.main which is\n // very bad with dark mode+midnight primary\n root: ({ theme }) => ({\n color: theme.palette.tertiary.main,\n }),\n },\n },\n },\n } satisfies ThemeOptions\n}\n\nfunction getDefaultTheme() {\n return {\n ...stockTheme(),\n name: 'Default (from config)',\n }\n}\n\nfunction getLightStockTheme() {\n return {\n ...stockTheme(),\n name: 'Light (stock)',\n }\n}\n\nfunction getDarkStockTheme() {\n return {\n name: 'Dark (stock)',\n palette: {\n mode: 'dark',\n primary: { main: midnight },\n secondary: { main: grape },\n tertiary: forest,\n quaternary: mandarin,\n highlight: mandarin,\n stopCodon,\n startCodon,\n bases,\n frames,\n framesCDS,\n },\n components: {\n MuiAppBar: {\n defaultProps: {\n enableColorOnDark: true,\n },\n styleOverrides: {\n root: ({ theme }) => {\n return theme.palette.primary.main\n },\n },\n },\n },\n } satisfies ThemeOptions & { name: string }\n}\n\nfunction getDarkMinimalTheme() {\n return {\n name: 'Dark (minimal)',\n palette: {\n mode: 'dark' as const,\n primary: { main: grey[700] },\n secondary: { main: grey[800] },\n tertiary: refTheme.palette.augmentColor({ color: { main: grey[900] } }),\n quaternary: mandarin,\n highlight: mandarin,\n stopCodon,\n startCodon,\n bases,\n frames,\n framesCDS,\n },\n } satisfies ThemeOptions & { name: string }\n}\n\nfunction getMinimalTheme() {\n return {\n name: 'Light (minimal)',\n palette: {\n primary: { main: grey[900] },\n secondary: { main: grey[800] },\n tertiary: refTheme.palette.augmentColor({ color: { main: grey[900] } }),\n quaternary: mandarin,\n highlight: mandarin,\n stopCodon,\n startCodon,\n bases,\n frames,\n framesCDS,\n },\n } satisfies ThemeOptions & { name: string }\n}\n\nexport const defaultThemes = {\n default: getDefaultTheme(),\n lightStock: getLightStockTheme(),\n lightMinimal: getMinimalTheme(),\n darkMinimal: getDarkMinimalTheme(),\n darkStock: getDarkStockTheme(),\n} as ThemeMap\n\nfunction overwriteArrayMerge(_: unknown, sourceArray: unknown[]) {\n return sourceArray\n}\n\nexport function createJBrowseBaseTheme(theme?: ThemeOptions): ThemeOptions {\n const themeP: ThemeOptions = {\n palette: theme?.palette,\n typography: {\n fontSize: 12,\n },\n spacing: 4,\n components: {\n MuiButton: {\n defaultProps: {\n size: 'small' as const,\n },\n styleOverrides: {\n // the default button, especially when not using variant=contained,\n // uses theme.palette.primary.main for text which is very bad with\n // dark mode+midnight primary\n //\n // keeps text secondary for darkmode, uses\n // a text-like coloring to ensure contrast\n // xref https://stackoverflow.com/a/72546130/2129219\n root: ({ theme }) =>\n theme.palette.mode === 'dark'\n ? {\n color: theme.palette.text.primary,\n }\n : undefined,\n },\n },\n MuiAccordion: {\n defaultProps: {\n disableGutters: true,\n slotProps: {\n transition: {\n timeout: 150,\n unmountOnExit: true,\n },\n },\n },\n },\n MuiFilledInput: {\n defaultProps: {\n margin: 'dense' as const,\n },\n },\n MuiFormControl: {\n defaultProps: {\n margin: 'dense' as const,\n size: 'small' as const,\n },\n },\n MuiFormHelperText: {\n defaultProps: {\n margin: 'dense' as const,\n },\n },\n\n MuiIconButton: {\n defaultProps: {\n size: 'small' as const,\n },\n },\n MuiInputBase: {\n defaultProps: {\n margin: 'dense' as const,\n },\n },\n MuiAutocomplete: {\n defaultProps: {\n size: 'small' as const,\n },\n },\n MuiInputLabel: {\n defaultProps: {\n margin: 'dense' as const,\n },\n },\n MuiToolbar: {\n defaultProps: {\n variant: 'dense' as const,\n },\n },\n MuiListItem: {\n defaultProps: {\n dense: true,\n },\n },\n MuiOutlinedInput: {\n defaultProps: {\n margin: 'dense' as const,\n },\n },\n MuiFab: {\n defaultProps: {\n size: 'small' as const,\n },\n styleOverrides: {\n secondary: {\n // @ts-expect-error\n backgroundColor: theme?.palette?.quaternary?.main,\n },\n },\n },\n MuiTable: {\n defaultProps: {\n size: 'small' as const,\n },\n },\n MuiPopover: {\n defaultProps: {\n transitionDuration: 0,\n },\n },\n MuiMenu: {\n defaultProps: {\n transitionDuration: 0,\n },\n },\n MuiMenuItem: {\n defaultProps: {\n dense: true,\n },\n },\n\n MuiTextField: {\n defaultProps: {\n margin: 'dense' as const,\n variant: 'standard' as const,\n },\n },\n MuiLink: {\n styleOverrides: {\n // the default link color uses theme.palette.primary.main which is\n // very bad with dark mode+midnight primary\n root: ({ theme }) => ({\n color: theme.palette.text.secondary,\n }),\n },\n },\n MuiCheckbox: {\n styleOverrides: {\n // the default checkbox-when-checked color uses\n // theme.palette.primary.main which is very bad with dark\n // mode+midnight primary\n //\n // keeps the forest-green checkbox by default but for darkmode, uses\n // a text-like coloring to ensure contrast xref\n // https://stackoverflow.com/a/72546130/2129219\n root: ({ theme }) =>\n theme.palette.mode === 'dark'\n ? {\n color: theme.palette.text.secondary,\n '&.Mui-checked': {\n color: theme.palette.text.secondary,\n },\n }\n : undefined,\n },\n },\n MuiRadio: {\n styleOverrides: {\n // the default checkbox-when-checked color uses\n // theme.palette.primary.main which is very bad with dark\n // mode+midnight primary\n //\n // keeps the forest-green checkbox by default but for darkmode, uses\n // a text-like coloring to ensure contrast\n // xref https://stackoverflow.com/a/72546130/2129219\n root: ({ theme }) =>\n theme.palette.mode === 'dark'\n ? {\n color: theme.palette.text.secondary,\n '&.Mui-checked': {\n color: theme.palette.text.secondary,\n },\n }\n : undefined,\n },\n },\n MuiFormLabel: {\n styleOverrides: {\n // the default checkbox-when-checked color uses\n // theme.palette.primary.main which is very bad with dark\n // mode+midnight primary\n //\n // keeps the forest-green checkbox by default but for darkmode, uses\n // a text-like coloring to ensure contrast\n // xref https://stackoverflow.com/a/72546130/2129219\n //\n\n root: ({ theme }) =>\n theme.palette.mode === 'dark'\n ? {\n color: theme.palette.text.secondary,\n '&.Mui-focused': {\n color: theme.palette.text.secondary,\n },\n }\n : undefined,\n },\n },\n MuiAccordionSummary: {\n styleOverrides: {\n root: {\n // @ts-expect-error\n backgroundColor: theme?.palette?.tertiary?.main,\n },\n content: {\n // @ts-expect-error\n color: theme?.palette?.tertiary?.contrastText,\n },\n },\n },\n MuiToggleButtonGroup: {\n defaultProps: {\n size: 'small' as const,\n },\n },\n },\n }\n return deepmerge(themeP, theme || {}, { arrayMerge: overwriteArrayMerge })\n}\n\ntype ThemeMap = Record<string, ThemeOptions>\n\nexport function createJBrowseTheme(\n configTheme: ThemeOptions = {},\n themes = defaultThemes,\n themeName = 'default',\n) {\n return createTheme(\n createJBrowseBaseTheme(\n themeName === 'default'\n ? deepmerge(themes.default!, augmentTheme(configTheme), {\n arrayMerge: overwriteArrayMerge,\n })\n : augmentThemePlus(themes[themeName]),\n ),\n )\n}\n\nfunction augmentTheme(theme: ThemeOptions = {}) {\n if (theme.palette?.tertiary) {\n theme = deepmerge(theme, {\n palette: {\n tertiary: refTheme.palette.augmentColor(\n 'color' in theme.palette.tertiary\n ? (theme.palette.tertiary as PaletteAugmentColorOptions)\n : { color: theme.palette.tertiary },\n ),\n },\n })\n }\n\n if (theme.palette?.quaternary) {\n theme = deepmerge(theme, {\n palette: {\n quaternary: refTheme.palette.augmentColor(\n 'color' in theme.palette.quaternary\n ? (theme.palette.quaternary as PaletteAugmentColorOptions)\n : { color: theme.palette.quaternary },\n ),\n },\n })\n }\n\n return theme\n}\n\n// creates some blank quaternary/tertiary colors if unsupplied by a user theme\nfunction augmentThemePlus(theme: ThemeOptions = {}) {\n theme = augmentTheme(theme)\n if (!theme.palette?.quaternary) {\n theme = deepmerge(theme, {\n palette: {\n quaternary: refTheme.palette.augmentColor({\n color: {\n main: '#aaa',\n },\n }),\n },\n })\n }\n if (!theme.palette?.tertiary) {\n theme = deepmerge(theme, {\n palette: {\n tertiary: refTheme.palette.augmentColor({\n color: {\n main: '#aaa',\n },\n }),\n },\n })\n }\n return theme\n}\n","import React, { useState, useEffect } from 'react'\nimport {\n TextField,\n MenuItem,\n InputProps as IIP,\n TextFieldProps as TFP,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { makeStyles } from 'tss-react/mui'\n\n// locals\nimport { getConf } from '../configuration'\nimport { useLocalStorage, AbstractSessionModel } from '../util'\n\nconst useStyles = makeStyles()({\n importFormEntry: {\n minWidth: 180,\n },\n})\n\nconst AssemblySelector = observer(function ({\n session,\n onChange,\n selected,\n InputProps,\n TextFieldProps,\n localStorageKey,\n helperText = 'Select assembly to view',\n}: {\n session: AbstractSessionModel\n helperText?: string\n onChange: (arg: string) => void\n selected?: string\n localStorageKey?: string\n InputProps?: IIP\n TextFieldProps?: TFP\n}) {\n const { classes } = useStyles()\n const { assemblyNames, assemblyManager } = session\n\n // constructs a localstorage key based on host/path/config to help\n // remember. non-config assists usage with e.g. embedded apps\n const config = new URLSearchParams(window.location.search).get('config')\n const [lastSelected, setLastSelected] =\n typeof jest === 'undefined' && localStorageKey\n ? useLocalStorage(\n `lastAssembly-${[\n window.location.host + window.location.pathname,\n config,\n localStorageKey,\n ].join('-')}`,\n selected,\n )\n : useState(selected)\n\n const selection = assemblyNames.includes(lastSelected || '')\n ? lastSelected\n : selected\n\n useEffect(() => {\n if (selection && selection !== selected) {\n onChange(selection)\n }\n }, [selection, onChange, selected])\n\n const error = assemblyNames.length ? '' : 'No configured assemblies'\n return (\n <TextField\n select\n label=\"Assembly\"\n variant=\"outlined\"\n helperText={error || helperText}\n value={selection || ''}\n inputProps={{ 'data-testid': 'assembly-selector' }}\n onChange={event => {\n setLastSelected(event.target.value)\n }}\n error={!!error}\n InputProps={InputProps}\n disabled={!!error}\n className={classes.importFormEntry}\n {...TextFieldProps}\n >\n {assemblyNames.map(name => {\n const assembly = assemblyManager.get(name)\n const displayName = assembly ? getConf(assembly, 'displayName') : ''\n return (\n <MenuItem key={name} value={name}>\n {displayName || name}\n </MenuItem>\n )\n })}\n </TextField>\n )\n})\n\nexport default AssemblySelector\n","import React, { useCallback, useEffect, useState } from 'react'\nimport { observer } from 'mobx-react'\nimport {\n Box,\n FormHelperText,\n InputLabel,\n Menu,\n MenuItem,\n Tooltip,\n ToggleButtonGroup,\n ToggleButton,\n ToggleButtonProps,\n} from '@mui/material'\n\n// locals\nimport {\n FileLocation,\n AbstractRootModel,\n isUriLocation,\n isAppRootModel,\n} from '../../util/types'\nimport LocalFileChooser from './LocalFileChooser'\nimport UrlChooser from './UrlChooser'\nimport { notEmpty, useLocalStorage } from '../../util'\n\n// icons\nimport ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown'\n\nconst NUM_SHOWN = 2\n\nfunction ToggleButtonWithTooltip(props: ToggleButtonProps) {\n const { title, children, ...other } = props\n return (\n <Tooltip title={title || ''}>\n <ToggleButton {...other}>{children}</ToggleButton>\n </Tooltip>\n )\n}\n\nfunction shorten(str: string, len: number) {\n if (typeof str === 'string' && str.length > len) {\n return `${str.slice(0, Math.max(0, len))}…`\n }\n return str\n}\n\nconst FileSelector = observer(function (props: {\n location?: FileLocation\n setLocation: (param: FileLocation) => void\n setName?: (str: string) => void\n name?: string\n description?: string\n rootModel?: AbstractRootModel\n}) {\n const { location, name, description, rootModel, setLocation } = props\n const fileOrUrl = !location || isUriLocation(location) ? 'url' : 'file'\n const [toggleButtonValue, setToggleButtonValue] = useState(\n location && 'internetAccountId' in location && location.internetAccountId\n ? location.internetAccountId\n : fileOrUrl,\n )\n const accounts = isAppRootModel(rootModel)\n ? rootModel.internetAccounts.filter(\n f => f.type !== 'HTTPBasicInternetAccount',\n )\n : []\n\n const [recentlyUsedInternetAccounts, setRecentlyUsedInternetAccounts] =\n useLocalStorage('fileSelector-recentlyUsedInternetAccounts', [] as string[])\n\n const map = Object.fromEntries(accounts.map(a => [a.internetAccountId, a]))\n const arr = [...new Set(accounts.map(s => s.internetAccountId))].sort(\n (a, b) =>\n recentlyUsedInternetAccounts.indexOf(a) -\n recentlyUsedInternetAccounts.indexOf(b),\n )\n const shownAccounts = arr.slice(0, NUM_SHOWN)\n const hiddenAccounts = arr.slice(NUM_SHOWN)\n const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null)\n const selectedAccount = map[toggleButtonValue]\n\n const setLocationWithAccount = useCallback(\n (location: FileLocation) => {\n setLocation({\n ...location,\n ...(selectedAccount && isUriLocation(location)\n ? { internetAccountId: selectedAccount.internetAccountId }\n : {}),\n })\n },\n [setLocation, selectedAccount],\n )\n\n useEffect(() => {\n // if you swap account selection after inputting url\n if (\n selectedAccount &&\n isUriLocation(location) &&\n location.internetAccountId !== selectedAccount.internetAccountId\n ) {\n setLocationWithAccount(location)\n }\n }, [location, selectedAccount, setLocationWithAccount])\n\n let locationInput = (\n <UrlChooser\n {...props}\n setLocation={setLocationWithAccount}\n label={selectedAccount?.selectorLabel}\n />\n )\n if (toggleButtonValue === 'file') {\n locationInput = <LocalFileChooser {...props} />\n }\n if (selectedAccount?.SelectorComponent) {\n const { SelectorComponent } = selectedAccount\n locationInput = (\n <SelectorComponent {...props} setLocation={setLocationWithAccount} />\n )\n }\n\n return (\n <>\n <Box display=\"flex\">\n <InputLabel shrink>{name}</InputLabel>\n </Box>\n <Box display=\"flex\" flexDirection=\"row\">\n <Box>\n <ToggleButtonGroup\n value={toggleButtonValue}\n exclusive\n onChange={(_event, newState) => {\n setRecentlyUsedInternetAccounts([\n ...new Set(\n [newState, ...recentlyUsedInternetAccounts].filter(notEmpty),\n ),\n ])\n if (newState) {\n setToggleButtonValue(newState)\n }\n if (isUriLocation(location)) {\n setLocationWithAccount(location)\n }\n }}\n aria-label=\"file, url, or account picker\"\n >\n {new URLSearchParams(window.location.search).get(\n 'adminKey',\n ) ? null : (\n <ToggleButton value=\"file\" aria-label=\"local file\">\n File\n </ToggleButton>\n )}\n <ToggleButton value=\"url\" aria-label=\"url\">\n URL\n </ToggleButton>\n {shownAccounts.map(id => {\n const { internetAccountId, name, toggleContents } = map[id]!\n return (\n <ToggleButtonWithTooltip\n key={id}\n value={internetAccountId}\n title={name}\n >\n {typeof toggleContents === 'string'\n ? shorten(toggleContents, 5)\n : toggleContents || shorten(name, 5)}\n </ToggleButtonWithTooltip>\n )\n })}\n {hiddenAccounts.length > 0 ? (\n // @ts-expect-error\n <ToggleButton\n onClick={event => {\n setAnchorEl(event.target as HTMLElement)\n }}\n selected={false}\n >\n More\n <ArrowDropDownIcon />\n </ToggleButton>\n ) : null}\n </ToggleButtonGroup>\n\n <Menu\n open={Boolean(anchorEl)}\n anchorEl={anchorEl}\n onClose={() => {\n setAnchorEl(null)\n }}\n anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }}\n transformOrigin={{ vertical: 'top', horizontal: 'center' }}\n >\n {hiddenAccounts.map(id => {\n const { internetAccountId, name } = map[id]!\n return (\n <MenuItem\n key={id}\n value={internetAccountId}\n onClick={() => {\n setRecentlyUsedInternetAccounts([\n ...new Set(\n [\n internetAccountId,\n ...recentlyUsedInternetAccounts,\n ].filter(notEmpty),\n ),\n ])\n\n setToggleButtonValue(internetAccountId)\n setAnchorEl(null)\n }}\n >\n {name}\n </MenuItem>\n )\n })}\n </Menu>\n </Box>\n </Box>\n {locationInput}\n <FormHelperText>{description}</FormHelperText>\n </>\n )\n})\n\nexport default FileSelector\n","import React, { useState, useRef, useEffect } from 'react'\nimport { drawImageOntoCanvasContext } from '../util/offscreenCanvasPonyfill'\n\nfunction PrerenderedCanvas(props: {\n width: number\n height: number\n highResolutionScaling?: number\n style?: any\n imageData?: any\n showSoftClip?: boolean\n blockKey?: string\n}) {\n const {\n width,\n height,\n highResolutionScaling = 1,\n style = {},\n imageData,\n blockKey,\n showSoftClip,\n } = props\n const [done, setDone] = useState(false)\n\n const featureCanvas = useRef<HTMLCanvasElement>(null)\n\n useEffect(() => {\n if (!imageData) {\n return\n }\n const canvas = featureCanvas.current\n if (!canvas) {\n return\n }\n const context = canvas.getContext('2d')\n if (!context) {\n return\n }\n drawImageOntoCanvasContext(imageData, context)\n setDone(true)\n }, [imageData])\n\n return (\n <canvas\n data-testid={[\n 'prerendered_canvas',\n showSoftClip ? 'softclipped' : '',\n blockKey,\n done ? 'done' : '',\n ]\n .filter(f => !!f)\n .join('_')}\n ref={featureCanvas}\n width={width * highResolutionScaling}\n height={height * highResolutionScaling}\n style={{ width, height, ...style }}\n />\n )\n}\n\nexport default PrerenderedCanvas\n","// vendored from quick-lru@6.1.1, didn't like being compiled as a 'pure-esm' nodejs dependency\n// the license is reproduced below https://github.com/sindresorhus/quick-lru/blob/main/license\n// MIT License\n\n// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\nexport default class QuickLRU extends Map {\n constructor(options = {}) {\n super()\n\n if (!(options.maxSize && options.maxSize > 0)) {\n throw new TypeError('`maxSize` must be a number greater than 0')\n }\n\n if (typeof options.maxAge === 'number' && options.maxAge === 0) {\n throw new TypeError('`maxAge` must be a number greater than 0')\n }\n\n // TODO: Use private class fields when ESLint supports them.\n this.maxSize = options.maxSize\n this.maxAge = options.maxAge || Number.POSITIVE_INFINITY\n this.onEviction = options.onEviction\n this.cache = new Map()\n this.oldCache = new Map()\n this._size = 0\n }\n\n // TODO: Use private class methods when targeting Node.js 16.\n _emitEvictions(cache) {\n if (typeof this.onEviction !== 'function') {\n return\n }\n\n for (const [key, item] of cache) {\n this.onEviction(key, item.value)\n }\n }\n\n _deleteIfExpired(key, item) {\n if (typeof item.expiry === 'number' && item.expiry <= Date.now()) {\n if (typeof this.onEviction === 'function') {\n this.onEviction(key, item.value)\n }\n\n return this.delete(key)\n }\n\n return false\n }\n\n _getOrDeleteIfExpired(key, item) {\n const deleted = this._deleteIfExpired(key, item)\n if (!deleted) {\n return item.value\n }\n }\n\n _getItemValue(key, item) {\n return item.expiry ? this._getOrDeleteIfExpired(key, item) : item.value\n }\n\n _peek(key, cache) {\n const item = cache.get(key)\n\n return this._getItemValue(key, item)\n }\n\n _set(key, value) {\n this.cache.set(key, value)\n this._size++\n\n if (this._size >= this.maxSize) {\n this._size = 0\n this._emitEvictions(this.oldCache)\n this.oldCache = this.cache\n this.cache = new Map()\n }\n }\n\n _moveToRecent(key, item) {\n this.oldCache.delete(key)\n this._set(key, item)\n }\n\n *_entriesAscending() {\n for (const item of this.oldCache) {\n const [key, value] = item\n if (!this.cache.has(key)) {\n const deleted = this._deleteIfExpired(key, value)\n if (!deleted) {\n yield item\n }\n }\n }\n\n for (const item of this.cache) {\n const [key, value] = item\n const deleted = this._deleteIfExpired(key, value)\n if (!deleted) {\n yield item\n }\n }\n }\n\n get(key) {\n if (this.cache.has(key)) {\n const item = this.cache.get(key)\n\n return this._getItemValue(key, item)\n }\n\n if (this.oldCache.has(key)) {\n const item = this.oldCache.get(key)\n if (!this._deleteIfExpired(key, item)) {\n this._moveToRecent(key, item)\n return item.value\n }\n }\n }\n\n set(key, value, { maxAge = this.maxAge } = {}) {\n const expiry =\n typeof maxAge === 'number' && maxAge !== Number.POSITIVE_INFINITY\n ? Date.now() + maxAge\n : undefined\n if (this.cache.has(key)) {\n this.cache.set(key, {\n value,\n expiry,\n })\n } else {\n this._set(key, { value, expiry })\n }\n }\n\n has(key) {\n if (this.cache.has(key)) {\n return !this._deleteIfExpired(key, this.cache.get(key))\n }\n\n if (this.oldCache.has(key)) {\n return !this._deleteIfExpired(key, this.oldCache.get(key))\n }\n\n return false\n }\n\n peek(key) {\n if (this.cache.has(key)) {\n return this._peek(key, this.cache)\n }\n\n if (this.oldCache.has(key)) {\n return this._peek(key, this.oldCache)\n }\n }\n\n delete(key) {\n const deleted = this.cache.delete(key)\n if (deleted) {\n this._size--\n }\n\n return this.oldCache.delete(key) || deleted\n }\n\n clear() {\n this.cache.clear()\n this.oldCache.clear()\n this._size = 0\n }\n\n resize(newSize) {\n if (!(newSize && newSize > 0)) {\n throw new TypeError('`maxSize` must be a number greater than 0')\n }\n\n const items = [...this._entriesAscending()]\n const removeCount = items.length - newSize\n if (removeCount < 0) {\n this.cache = new Map(items)\n this.oldCache = new Map()\n this._size = items.length\n } else {\n if (removeCount > 0) {\n this._emitEvictions(items.slice(0, removeCount))\n }\n\n this.oldCache = new Map(items.slice(removeCount))\n this.cache = new Map()\n this._size = 0\n }\n\n this.maxSize = newSize\n }\n\n *keys() {\n for (const [key] of this) {\n yield key\n }\n }\n\n *values() {\n for (const [, value] of this) {\n yield value\n }\n }\n\n *[Symbol.iterator]() {\n for (const item of this.cache) {\n const [key, value] = item\n const deleted = this._deleteIfExpired(key, value)\n if (!deleted) {\n yield [key, value.value]\n }\n }\n\n for (const item of this.oldCache) {\n const [key, value] = item\n if (!this.cache.has(key)) {\n const deleted = this._deleteIfExpired(key, value)\n if (!deleted) {\n yield [key, value.value]\n }\n }\n }\n }\n\n *entriesDescending() {\n let items = [...this.cache]\n for (let i = items.length - 1; i >= 0; --i) {\n const item = items[i]\n const [key, value] = item\n const deleted = this._deleteIfExpired(key, value)\n if (!deleted) {\n yield [key, value.value]\n }\n }\n\n items = [...this.oldCache]\n for (let i = items.length - 1; i >= 0; --i) {\n const item = items[i]\n const [key, value] = item\n if (!this.cache.has(key)) {\n const deleted = this._deleteIfExpired(key, value)\n if (!deleted) {\n yield [key, value.value]\n }\n }\n }\n }\n\n *entriesAscending() {\n for (const [key, value] of this._entriesAscending()) {\n yield [key, value.value]\n }\n }\n\n get size() {\n if (!this._size) {\n return this.oldCache.size\n }\n\n let oldCacheSize = 0\n for (const key of this.oldCache.keys()) {\n if (!this.cache.has(key)) {\n oldCacheSize++\n }\n }\n\n return Math.min(this._size + oldCacheSize, this.maxSize)\n }\n\n entries() {\n return this.entriesAscending()\n }\n\n forEach(callbackFunction, thisArgument = this) {\n for (const [key, value] of this.entriesAscending()) {\n callbackFunction.call(thisArgument, value, key, this)\n }\n }\n\n get [Symbol.toStringTag]() {\n return JSON.stringify([...this.entriesAscending()])\n }\n}\n","import React, { useEffect, useRef, useState } from 'react'\nimport isObject from 'is-object'\nimport PluginManager from '../PluginManager'\nimport type { Buffer } from 'buffer'\nimport {\n addDisposer,\n getParent,\n getSnapshot,\n getEnv as getEnvMST,\n isAlive,\n isStateTreeNode,\n hasParent,\n IAnyStateTreeNode,\n IStateTreeNode,\n Instance,\n} from 'mobx-state-tree'\nimport { reaction, IReactionPublic, IReactionOptions } from 'mobx'\nimport { Feature } from './simpleFeature'\nimport {\n isSessionModel,\n isDisplayModel,\n isViewModel,\n isTrackModel,\n AssemblyManager,\n Region,\n TypeTestedByPredicate,\n} from './types'\nimport type { Region as MUIRegion } from './types/mst'\nimport { isAbortException, checkAbortSignal } from './aborting'\nimport { BaseBlock } from './blockTypes'\nimport { isUriLocation } from './types'\n\n// has to be the full path and not the relative path to get the jest mock\nimport useMeasure from '@jbrowse/core/util/useMeasure'\nimport { colord } from './colord'\n// eslint-disable-next-line react/no-deprecated\nimport { flushSync, render } from 'react-dom'\nexport * from './types'\nexport * from './aborting'\nexport * from './when'\nexport * from './range'\nexport * from './dedupe'\n\nexport * from './offscreenCanvasPonyfill'\nexport * from './offscreenCanvasUtils'\n\nexport function useDebounce<T>(value: T, delay: number) {\n const [debouncedValue, setDebouncedValue] = useState(value)\n\n useEffect(() => {\n const handle = setTimeout(() => {\n setDebouncedValue(value)\n }, delay)\n return () => {\n clearTimeout(handle)\n }\n }, [value, delay])\n\n return debouncedValue\n}\n\n// used in ViewContainer files to get the width\nexport function useWidthSetter(\n view: { setWidth: (arg: number) => void },\n padding: string,\n) {\n const [ref, { width }] = useMeasure()\n useEffect(() => {\n if (width && isAlive(view)) {\n // sets after a requestAnimationFrame\n // https://stackoverflow.com/a/58701523/2129219\n // avoids ResizeObserver loop error being shown during development\n requestAnimationFrame(() => {\n view.setWidth(width - Number.parseInt(padding, 10) * 2)\n })\n }\n }, [padding, view, width])\n return ref\n}\n\n// https://stackoverflow.com/questions/56283920/\nexport function useDebouncedCallback<T>(\n callback: (...args: T[]) => void,\n wait = 400,\n) {\n // track args & timeout handle between calls\n const argsRef = useRef<T[]>()\n const timeout = useRef<ReturnType<typeof setTimeout>>()\n\n // make sure our timeout gets cleared if our consuming component gets\n // unmounted\n useEffect(() => {\n if (timeout.current) {\n clearTimeout(timeout.current)\n }\n }, [])\n\n return function debouncedCallback(...args: T[]) {\n // capture latest args\n argsRef.current = args\n\n // clear debounce timer\n if (timeout.current) {\n clearTimeout(timeout.current)\n }\n\n // start waiting again\n timeout.current = setTimeout(() => {\n if (argsRef.current) {\n callback(...argsRef.current)\n }\n }, wait)\n }\n}\n\n/**\n * find the first node in the hierarchy that matches the given predicate\n */\nexport function findParentThat(\n node: IAnyStateTreeNode,\n predicate: (thing: IAnyStateTreeNode) => boolean,\n) {\n if (!hasParent(node)) {\n throw new Error('node does not have parent')\n }\n let currentNode: IAnyStateTreeNode | undefined = getParent<any>(node)\n while (currentNode && isAlive(currentNode)) {\n if (predicate(currentNode)) {\n return currentNode\n }\n if (hasParent(currentNode)) {\n currentNode = getParent<any>(currentNode)\n } else {\n break\n }\n }\n throw new Error('no matching node found')\n}\n\ninterface Animation {\n lastPosition: number\n lastTime?: number\n lastVelocity?: number\n}\n\n// based on https://github.com/react-spring/react-spring/blob/cd5548a987383b8023efd620f3726a981f9e18ea/src/animated/FrameLoop.ts\nexport function springAnimate(\n fromValue: number,\n toValue: number,\n setValue: (value: number) => void,\n onFinish = () => {},\n precision = 0,\n tension = 400,\n friction = 20,\n clamp = true,\n) {\n const mass = 1\n if (!precision) {\n precision = Math.abs(toValue - fromValue) / 1000\n }\n\n let animationFrameId: number\n\n function update(animation: Animation) {\n const time = Date.now()\n let position = animation.lastPosition\n let lastTime = animation.lastTime || time\n let velocity = animation.lastVelocity || 0\n // If we lost a lot of frames just jump to the end.\n if (time > lastTime + 64) {\n lastTime = time\n }\n // http://gafferongames.com/game-physics/fix-your-timestep/\n const numSteps = Math.floor(time - lastTime)\n for (let i = 0; i < numSteps; ++i) {\n const force = -tension * (position - toValue)\n const damping = -friction * velocity\n const acceleration = (force + damping) / mass\n velocity += (acceleration * 1) / 1000\n position += (velocity * 1) / 1000\n }\n const isVelocity = Math.abs(velocity) <= precision\n const isDisplacement =\n tension !== 0 ? Math.abs(toValue - position) <= precision : true\n const isOvershooting =\n clamp && tension !== 0\n ? fromValue < toValue\n ? position > toValue\n : position < toValue\n : false\n const endOfAnimation = isOvershooting || (isVelocity && isDisplacement)\n if (endOfAnimation) {\n setValue(toValue)\n onFinish()\n } else {\n setValue(position)\n animationFrameId = requestAnimationFrame(() => {\n update({\n lastPosition: position,\n lastTime: time,\n lastVelocity: velocity,\n })\n })\n }\n }\n\n return [\n () => {\n update({ lastPosition: fromValue })\n },\n () => {\n cancelAnimationFrame(animationFrameId)\n },\n ]\n}\n\n/**\n * find the first node in the hierarchy that matches the given 'is' typescript\n * type guard predicate\n */\nexport function findParentThatIs<T extends (a: IAnyStateTreeNode) => boolean>(\n node: IAnyStateTreeNode,\n predicate: T,\n): TypeTestedByPredicate<T> {\n return findParentThat(node, predicate)\n}\n\n/**\n * get the current JBrowse session model, starting at any node in the state\n * tree\n */\nexport function getSession(node: IAnyStateTreeNode) {\n try {\n return findParentThatIs(node, isSessionModel)\n } catch (e) {\n throw new Error('no session model found!')\n }\n}\n\n/**\n * get the state model of the view in the state tree that contains the given\n * node\n */\nexport function getContainingView(node: IAnyStateTreeNode) {\n try {\n return findParentThatIs(node, isViewModel)\n } catch (e) {\n throw new Error('no containing view found')\n }\n}\n\n/**\n * get the state model of the view in the state tree that contains the given\n * node\n */\nexport function getContainingTrack(node: IAnyStateTreeNode) {\n try {\n return findParentThatIs(node, isTrackModel)\n } catch (e) {\n throw new Error('no containing track found')\n }\n}\n\n/**\n * get the state model of the display in the state tree that contains the given\n * node\n */\nexport function getContainingDisplay(node: IAnyStateTreeNode) {\n try {\n return findParentThatIs(node, isDisplayModel)\n } catch (e) {\n throw new Error('no containing display found')\n }\n}\n\n/**\n * Assemble a 1-based \"locString\" from an interbase genomic location\n * @param region - Region\n * @example\n * ```ts\n * assembleLocString({ refName: 'chr1', start: 0, end: 100 })\n * // ↳ 'chr1:1..100'\n * ```\n * @example\n * ```ts\n * assembleLocString({ assemblyName: 'hg19', refName: 'chr1', start: 0, end: 100 })\n * // ↳ '{hg19}chr1:1..100'\n * ```\n * @example\n * ```ts\n * assembleLocString({ refName: 'chr1' })\n * // ↳ 'chr1'\n * ```\n * @example\n * ```ts\n * assembleLocString({ refName: 'chr1', start: 0 })\n * // ↳ 'chr1:1..'\n * ```\n * @example\n * ```ts\n * assembleLocString({ refName: 'chr1', end: 100 })\n * // ↳ 'chr1:1..100'\n * ```\n * @example\n * ```ts\n * assembleLocString({ refName: 'chr1', start: 0, end: 1 })\n * // ↳ 'chr1:1'\n * ```\n */\nexport function assembleLocString(region: ParsedLocString) {\n return assembleLocStringFast(region, toLocale)\n}\n\n// same as assembleLocString above, but does not perform toLocaleString which\n// can slow down the speed of block calculations which use assembleLocString\n// for block.key\nexport function assembleLocStringFast(\n region: ParsedLocString,\n cb = (n: number): string | number => n,\n) {\n const { assemblyName, refName, start, end, reversed } = region\n const assemblyNameString = assemblyName ? `{${assemblyName}}` : ''\n let startString: string\n if (start !== undefined) {\n startString = `:${cb(start + 1)}`\n } else if (end !== undefined) {\n startString = ':1'\n } else {\n startString = ''\n }\n let endString: string\n if (end !== undefined) {\n endString = start !== undefined && start + 1 === end ? '' : `..${cb(end)}`\n } else {\n endString = start !== undefined ? '..' : ''\n }\n let rev = ''\n if (reversed) {\n rev = '[rev]'\n }\n return `${assemblyNameString}${refName}${startString}${endString}${rev}`\n}\n\nexport interface ParsedLocString {\n assemblyName?: string\n refName: string\n start?: number\n end?: number\n reversed?: boolean\n}\n\nexport function parseLocStringOneBased(\n locString: string,\n isValidRefName: (refName: string, assemblyName?: string) => boolean,\n): ParsedLocString {\n if (!locString) {\n throw new Error('no location string provided, could not parse')\n }\n let reversed = false\n if (locString.endsWith('[rev]')) {\n reversed = true\n locString = locString.replace(/\\[rev]$/, '')\n }\n // remove any whitespace\n locString = locString.replace(/\\s/, '')\n // refNames can have colons, refer to\n // https://samtools.github.io/hts-specs/SAMv1.pdf Appendix A\n const assemblyMatch = /({(.+)})?(.+)/.exec(locString)\n if (!assemblyMatch) {\n throw new Error(`invalid location string: \"${locString}\"`)\n }\n const [, , assemblyName2, location2] = assemblyMatch\n const assemblyName = assemblyName2!\n const location = location2!\n if (!assemblyName && location.startsWith('{}')) {\n throw new Error(`no assembly name was provided in location \"${location}\"`)\n }\n const lastColonIdx = location.lastIndexOf(':')\n if (lastColonIdx === -1) {\n if (isValidRefName(location, assemblyName)) {\n return {\n assemblyName,\n refName: location,\n reversed,\n }\n }\n throw new Error(`Unknown reference sequence \"${location}\"`)\n }\n const prefix = location.slice(0, lastColonIdx)\n const suffix = location.slice(lastColonIdx + 1)\n if (\n isValidRefName(prefix, assemblyName) &&\n isValidRefName(location, assemblyName)\n ) {\n throw new Error(`ambiguous location string: \"${locString}\"`)\n } else if (isValidRefName(prefix, assemblyName)) {\n if (suffix) {\n // see if it's a range\n const rangeMatch =\n /^(-?(\\d+|\\d{1,3}(,\\d{3})*))(\\.\\.|-)(-?(\\d+|\\d{1,3}(,\\d{3})*))$/.exec(\n suffix,\n )\n // see if it's a single point\n const singleMatch = /^(-?(\\d+|\\d{1,3}(,\\d{3})*))(\\.\\.|-)?$/.exec(suffix)\n if (rangeMatch) {\n const [, start, , , , end] = rangeMatch\n if (start !== undefined && end !== undefined) {\n return {\n assemblyName,\n refName: prefix,\n start: +start.replaceAll(',', ''),\n end: +end.replaceAll(',', ''),\n reversed,\n }\n }\n } else if (singleMatch) {\n const [, start, , , separator] = singleMatch\n if (start !== undefined) {\n if (separator) {\n // indefinite end\n return {\n assemblyName,\n refName: prefix,\n start: +start.replaceAll(',', ''),\n reversed,\n }\n }\n return {\n assemblyName,\n refName: prefix,\n start: +start.replaceAll(',', ''),\n end: +start.replaceAll(',', ''),\n reversed,\n }\n }\n } else {\n throw new Error(\n `could not parse range \"${suffix}\" on location \"${locString}\"`,\n )\n }\n } else {\n return {\n assemblyName,\n refName: prefix,\n reversed,\n }\n }\n } else if (isValidRefName(location, assemblyName)) {\n return {\n assemblyName,\n refName: location,\n reversed,\n }\n }\n throw new Error(`unknown reference sequence name in location \"${locString}\"`)\n}\n\n/**\n * Parse a 1-based location string into an interbase genomic location\n * @param locString - Location string\n * @param isValidRefName - Function that checks if a refName exists in the set\n * of all known refNames, or in the set of refNames for an assembly if\n * assemblyName is given\n * @example\n * ```ts\n * parseLocString('chr1:1..100', isValidRefName)\n * // ↳ { refName: 'chr1', start: 0, end: 100 }\n * ```\n * @example\n * ```ts\n * parseLocString('chr1:1-100', isValidRefName)\n * // ↳ { refName: 'chr1', start: 0, end: 100 }\n * ```\n * @example\n * ```ts\n * parseLocString(`{hg19}chr1:1..100`, isValidRefName)\n * // ↳ { assemblyName: 'hg19', refName: 'chr1', start: 0, end: 100 }\n * ```\n * @example\n * ```ts\n * parseLocString('chr1', isValidRefName)\n * // ↳ { refName: 'chr1' }\n * ```\n * @example\n * ```ts\n * parseLocString('chr1:1', isValidRefName)\n * // ↳ { refName: 'chr1', start: 0, end: 1 }\n * ```\n * @example\n * ```ts\n * parseLocString('chr1:1..', isValidRefName)\n * // ↳ { refName: 'chr1', start: 0}\n * ```\n */\nexport function parseLocString(\n locString: string,\n isValidRefName: (refName: string, assemblyName?: string) => boolean,\n) {\n const parsed = parseLocStringOneBased(locString, isValidRefName)\n if (typeof parsed.start === 'number') {\n parsed.start -= 1\n }\n return parsed\n}\n\nexport function compareLocs(locA: ParsedLocString, locB: ParsedLocString) {\n const assemblyComp =\n locA.assemblyName || locB.assemblyName\n ? (locA.assemblyName || '').localeCompare(locB.assemblyName || '')\n : 0\n if (assemblyComp) {\n return assemblyComp\n }\n\n const refComp =\n locA.refName || locB.refName\n ? (locA.refName || '').localeCompare(locB.refName || '')\n : 0\n if (refComp) {\n return refComp\n }\n\n if (locA.start !== undefined && locB.start !== undefined) {\n const startComp = locA.start - locB.start\n if (startComp) {\n return startComp\n }\n }\n if (locA.end !== undefined && locB.end !== undefined) {\n const endComp = locA.end - locB.end\n if (endComp) {\n return endComp\n }\n }\n return 0\n}\n\nexport function compareLocStrings(\n a: string,\n b: string,\n isValidRefName: (refName: string, assemblyName?: string) => boolean,\n) {\n const locA = parseLocString(a, isValidRefName)\n const locB = parseLocString(b, isValidRefName)\n return compareLocs(locA, locB)\n}\n\n/**\n * Ensure that a number is at least min and at most max.\n *\n * @param num -\n * @param min -\n * @param max -\n */\nexport function clamp(num: number, min: number, max: number) {\n if (num < min) {\n return min\n }\n if (num > max) {\n return max\n }\n return num\n}\n\nfunction roundToNearestPointOne(num: number) {\n return Math.round(num * 10) / 10\n}\n\n/**\n * @param bp -\n * @param region -\n * @param bpPerPx -\n */\nexport function bpToPx(\n bp: number,\n {\n reversed,\n end = 0,\n start = 0,\n }: { start?: number; end?: number; reversed?: boolean },\n bpPerPx: number,\n) {\n return roundToNearestPointOne((reversed ? end - bp : bp - start) / bpPerPx)\n}\n\nconst oneEightyOverPi = 180 / Math.PI\nconst piOverOneEighty = Math.PI / 180\nexport function radToDeg(radians: number) {\n return (radians * oneEightyOverPi) % 360\n}\nexport function degToRad(degrees: number) {\n return (degrees * piOverOneEighty) % (2 * Math.PI)\n}\n\n/**\n * @returns [x, y]\n */\nexport function polarToCartesian(rho: number, theta: number) {\n return [rho * Math.cos(theta), rho * Math.sin(theta)] as [number, number]\n}\n\n/**\n * @param x - the x\n * @param y - the y\n * @returns [rho, theta]\n */\nexport function cartesianToPolar(x: number, y: number) {\n const rho = Math.sqrt(x * x + y * y)\n const theta = Math.atan(y / x)\n return [rho, theta] as [number, number]\n}\n\nexport function featureSpanPx(\n feature: Feature,\n region: { start: number; end: number; reversed?: boolean },\n bpPerPx: number,\n): [number, number] {\n return bpSpanPx(feature.get('start'), feature.get('end'), region, bpPerPx)\n}\n\nexport function bpSpanPx(\n leftBp: number,\n rightBp: number,\n region: { start: number; end: number; reversed?: boolean },\n bpPerPx: number,\n): [number, number] {\n const start = bpToPx(leftBp, region, bpPerPx)\n const end = bpToPx(rightBp, region, bpPerPx)\n return region.reversed ? [end, start] : [start, end]\n}\n\n// do an array map of an iterable\nexport function iterMap<T, U>(\n iter: Iterable<T>,\n func: (arg: T) => U,\n sizeHint?: number,\n) {\n const results = Array.from<U>({ length: sizeHint || 0 })\n let counter = 0\n for (const item of iter) {\n results[counter] = func(item)\n counter += 1\n }\n return results\n}\n\n/**\n * Returns the index of the last element in the array where predicate is true,\n * and -1 otherwise.\n * Based on https://stackoverflow.com/a/53187807\n *\n * @param array - The source array to search in\n *\n * @param predicate - find calls predicate once for each element of the array, in\n * descending order, until it finds one where predicate returns true.\n *\n * @returns findLastIndex returns element index where predicate is true.\n * Otherwise, findLastIndex returns -1.\n */\nexport function findLastIndex<T>(\n array: T[],\n predicate: (value: T, index: number, obj: T[]) => boolean,\n): number {\n let l = array.length\n while (l--) {\n if (predicate(array[l]!, l, array)) {\n return l\n }\n }\n return -1\n}\n\nexport function findLast<T>(\n array: T[],\n predicate: (value: T, index: number, obj: T[]) => boolean,\n): T | undefined {\n let l = array.length\n while (l--) {\n if (predicate(array[l]!, l, array)) {\n return array[l]\n }\n }\n return undefined\n}\n\n/**\n * makes a mobx reaction with the given functions, that calls actions on the\n * model for each stage of execution, and to abort the reaction function when\n * the model is destroyed.\n *\n * Will call startedFunction(signal), successFunction(result), and\n * errorFunction(error) when the async reaction function starts, completes, and\n * errors respectively.\n *\n * @param self -\n * @param dataFunction -\n * @param asyncReactionFunction -\n * @param reactionOptions -\n * @param startedFunction -\n * @param successFunction -\n * @param errorFunction -\n */\nexport function makeAbortableReaction<T, U, V>(\n self: T,\n dataFunction: (arg: T) => U,\n asyncReactionFunction: (\n arg: U | undefined,\n signal: AbortSignal,\n model: T,\n handle: IReactionPublic,\n ) => Promise<V>,\n // @ts-expect-error\n reactionOptions: IReactionOptions,\n startedFunction: (aborter: AbortController) => void,\n successFunction: (arg: V) => void,\n errorFunction: (err: unknown) => void,\n) {\n let inProgress: AbortController | undefined\n\n function handleError(error: unknown) {\n if (!isAbortException(error)) {\n if (isAlive(self)) {\n errorFunction(error)\n } else {\n console.error(error)\n }\n }\n }\n\n addDisposer(\n self,\n reaction(\n () => {\n try {\n return dataFunction(self)\n } catch (e) {\n handleError(e)\n return undefined\n }\n },\n async (data, mobxReactionHandle) => {\n if (inProgress && !inProgress.signal.aborted) {\n inProgress.abort()\n }\n\n if (!isAlive(self)) {\n return\n }\n inProgress = new AbortController()\n\n const thisInProgress = inProgress\n startedFunction(thisInProgress)\n try {\n const result = await asyncReactionFunction(\n data,\n thisInProgress.signal,\n self,\n // @ts-expect-error\n mobxReactionHandle,\n )\n checkAbortSignal(thisInProgress.signal)\n if (isAlive(self)) {\n successFunction(result)\n }\n } catch (e) {\n if (!thisInProgress.signal.aborted) {\n thisInProgress.abort()\n }\n handleError(e)\n }\n },\n reactionOptions,\n ),\n )\n addDisposer(self, () => {\n if (inProgress && !inProgress.signal.aborted) {\n inProgress.abort()\n }\n })\n}\n\nexport function renameRegionIfNeeded(\n refNameMap: Record<string, string> | undefined,\n region: Region | Instance<typeof MUIRegion>,\n): Region & { originalRefName?: string } {\n if (isStateTreeNode(region) && !isAlive(region)) {\n return region\n }\n\n if (refNameMap?.[region.refName]) {\n // clone the region so we don't modify it\n region = isStateTreeNode(region)\n ? { ...getSnapshot(region) }\n : { ...region }\n\n // modify it directly in the container\n const newRef = refNameMap[region.refName]\n if (newRef) {\n return { ...region, refName: newRef, originalRefName: region.refName }\n }\n }\n return region\n}\n\nexport async function renameRegionsIfNeeded<\n ARGTYPE extends {\n assemblyName?: string\n regions?: Region[]\n signal?: AbortSignal\n adapterConfig: Record<string, unknown>\n sessionId: string\n statusCallback?: (arg: string) => void\n },\n>(assemblyManager: AssemblyManager, args: ARGTYPE) {\n const { regions = [], adapterConfig } = args\n if (!args.sessionId) {\n throw new Error('sessionId is required')\n }\n\n const assemblyNames = regions.map(region => region.assemblyName)\n const assemblyMaps = Object.fromEntries(\n await Promise.all(\n [...new Set(assemblyNames)].map(async assemblyName => {\n return [\n assemblyName,\n await assemblyManager.getRefNameMapForAdapter(\n adapterConfig,\n assemblyName,\n args,\n ),\n ]\n }),\n ),\n )\n\n return {\n ...args,\n regions: regions.map((region, i) =>\n // note: uses assemblyNames defined above since region could be dead now\n renameRegionIfNeeded(assemblyMaps[assemblyNames[i]!], region),\n ),\n }\n}\n\nexport function minmax(a: number, b: number) {\n return [Math.min(a, b), Math.max(a, b)] as const\n}\n\nexport function shorten(name: string, max = 70, short = 30) {\n return name.length > max\n ? `${name.slice(0, short)}...${name.slice(-short)}`\n : name\n}\n\nexport function stringify(\n {\n refName,\n coord,\n assemblyName,\n oob,\n }: {\n assemblyName?: string\n coord: number\n refName?: string\n oob?: boolean\n },\n useAssemblyName?: boolean,\n) {\n return [\n assemblyName && useAssemblyName ? `{${assemblyName}}` : '',\n refName\n ? `${shorten(refName)}:${toLocale(coord)}${oob ? ' (out of bounds)' : ''}`\n : '',\n ].join('')\n}\n\n// this is recommended in a later comment in\n// https://github.com/electron/electron/issues/2288 for detecting electron in a\n// renderer process, which is the one that has node enabled for us\n//\n// const isElectron = process.versions.electron\n// const i2 = process.versions.hasOwnProperty('electron')\nexport const isElectron = /electron/i.test(\n typeof navigator !== 'undefined' ? navigator.userAgent : '',\n)\n\nexport function revcom(seqString: string) {\n return reverse(complement(seqString))\n}\n\nexport function reverse(seqString: string) {\n return seqString.split('').reverse().join('')\n}\n\nexport const complement = (() => {\n const complementRegex = /[ACGT]/gi\n\n // from bioperl: tr/acgtrymkswhbvdnxACGTRYMKSWHBVDNX/tgcayrkmswdvbhnxTGCAYRKMSWDVBHNX/\n // generated with:\n // perl -MJSON -E '@l = split \"\",\"acgtrymkswhbvdnxACGTRYMKSWHBVDNX\"; print to_json({ map { my $in = $_; tr/acgtrymkswhbvdnxACGTRYMKSWHBVDNX/tgcayrkmswdvbhnxTGCAYRKMSWDVBHNX/; $in => $_ } @l})'\n const complementTable = {\n S: 'S',\n w: 'w',\n T: 'A',\n r: 'y',\n a: 't',\n N: 'N',\n K: 'M',\n x: 'x',\n d: 'h',\n Y: 'R',\n V: 'B',\n y: 'r',\n M: 'K',\n h: 'd',\n k: 'm',\n C: 'G',\n g: 'c',\n t: 'a',\n A: 'T',\n n: 'n',\n W: 'W',\n X: 'X',\n m: 'k',\n v: 'b',\n B: 'V',\n s: 's',\n H: 'D',\n c: 'g',\n D: 'H',\n b: 'v',\n R: 'Y',\n G: 'C',\n } as Record<string, string>\n\n return (seqString: string) => {\n return seqString.replaceAll(complementRegex, m => complementTable[m] || '')\n }\n})()\n\n// requires immediate execution in jest environment, because (hypothesis) it\n// otherwise listens for prerendered_canvas but reads empty pixels, and doesn't\n// get the contents of the canvas\nexport const rIC =\n typeof jest === 'undefined'\n ? // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n typeof window !== 'undefined' && window.requestIdleCallback\n ? window.requestIdleCallback\n : (cb: () => void) =>\n setTimeout(() => {\n cb()\n }, 1)\n : (cb: () => void) => {\n cb()\n }\n\n// prettier-ignore\nconst widths = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.2796875,0.2765625,0.3546875,0.5546875,0.5546875,0.8890625,0.665625,0.190625,0.3328125,0.3328125,0.3890625,0.5828125,0.2765625,0.3328125,0.2765625,0.3015625,0.5546875,0.5546875,0.5546875,0.5546875,0.5546875,0.5546875,0.5546875,0.5546875,0.5546875,0.5546875,0.2765625,0.2765625,0.584375,0.5828125,0.584375,0.5546875,1.0140625,0.665625,0.665625,0.721875,0.721875,0.665625,0.609375,0.7765625,0.721875,0.2765625,0.5,0.665625,0.5546875,0.8328125,0.721875,0.7765625,0.665625,0.7765625,0.721875,0.665625,0.609375,0.721875,0.665625,0.94375,0.665625,0.665625,0.609375,0.2765625,0.3546875,0.2765625,0.4765625,0.5546875,0.3328125,0.5546875,0.5546875,0.5,0.5546875,0.5546875,0.2765625,0.5546875,0.5546875,0.221875,0.240625,0.5,0.221875,0.8328125,0.5546875,0.5546875,0.5546875,0.5546875,0.3328125,0.5,0.2765625,0.5546875,0.5,0.721875,0.5,0.5,0.5,0.3546875,0.259375,0.353125,0.5890625]\n\n// xref https://gist.github.com/tophtucker/62f93a4658387bb61e4510c37e2e97cf\nexport function measureText(str: unknown, fontSize = 10) {\n const avg = 0.5279276315789471\n const s = String(str)\n let total = 0\n for (let i = 0; i < s.length; i++) {\n const code = s.charCodeAt(i)\n total += widths[code] ?? avg\n }\n return total * fontSize\n}\n\nexport type Frame = 1 | 2 | 3 | -1 | -2 | -3\n\nexport function getFrame(\n start: number,\n end: number,\n strand: 1 | -1,\n phase: 0 | 1 | 2,\n): Frame {\n return strand === 1\n ? ((((start + phase) % 3) + 1) as 1 | 2 | 3)\n : ((-1 * ((end - phase) % 3) - 1) as -1 | -2 | -3)\n}\n\nexport const defaultStarts = ['ATG']\nexport const defaultStops = ['TAA', 'TAG', 'TGA']\nexport const defaultCodonTable = {\n TCA: 'S',\n TCC: 'S',\n TCG: 'S',\n TCT: 'S',\n TTC: 'F',\n TTT: 'F',\n TTA: 'L',\n TTG: 'L',\n TAC: 'Y',\n TAT: 'Y',\n TAA: '*',\n TAG: '*',\n TGC: 'C',\n TGT: 'C',\n TGA: '*',\n TGG: 'W',\n CTA: 'L',\n CTC: 'L',\n CTG: 'L',\n CTT: 'L',\n CCA: 'P',\n CCC: 'P',\n CCG: 'P',\n CCT: 'P',\n CAC: 'H',\n CAT: 'H',\n CAA: 'Q',\n CAG: 'Q',\n CGA: 'R',\n CGC: 'R',\n CGG: 'R',\n CGT: 'R',\n ATA: 'I',\n ATC: 'I',\n ATT: 'I',\n ATG: 'M',\n ACA: 'T',\n ACC: 'T',\n ACG: 'T',\n ACT: 'T',\n AAC: 'N',\n AAT: 'N',\n AAA: 'K',\n AAG: 'K',\n AGC: 'S',\n AGT: 'S',\n AGA: 'R',\n AGG: 'R',\n GTA: 'V',\n GTC: 'V',\n GTG: 'V',\n GTT: 'V',\n GCA: 'A',\n GCC: 'A',\n GCG: 'A',\n GCT: 'A',\n GAC: 'D',\n GAT: 'D',\n GAA: 'E',\n GAG: 'E',\n GGA: 'G',\n GGC: 'G',\n GGG: 'G',\n GGT: 'G',\n}\n\n/**\n * take CodonTable above and generate larger codon table that includes all\n * permutations of upper and lower case nucleotides\n */\nexport function generateCodonTable(table: any) {\n const tempCodonTable: Record<string, string> = {}\n Object.keys(table).forEach(codon => {\n const aa = table[codon]\n const nucs: string[][] = []\n for (let i = 0; i < 3; i++) {\n const nuc = codon.charAt(i)\n nucs[i] = []\n nucs[i]![0] = nuc.toUpperCase()\n nucs[i]![1] = nuc.toLowerCase()\n }\n for (let i = 0; i < 2; i++) {\n const n0 = nucs[0]![i]!\n for (let j = 0; j < 2; j++) {\n const n1 = nucs[1]![j]!\n for (let k = 0; k < 2; k++) {\n const n2 = nucs[2]![k]!\n const triplet = n0 + n1 + n2\n tempCodonTable[triplet] = aa\n }\n }\n }\n })\n return tempCodonTable\n}\n\n// call statusCallback with current status and clear when finished\nexport async function updateStatus<U>(\n msg: string,\n cb: (arg: string) => void,\n fn: () => U | Promise<U>,\n) {\n cb(msg)\n const res = await fn()\n cb('')\n return res\n}\n\nexport function hashCode(str: string) {\n let hash = 0\n if (str.length === 0) {\n return hash\n }\n for (let i = 0; i < str.length; i++) {\n const chr = str.charCodeAt(i)\n hash = (hash << 5) - hash + chr\n hash |= 0 // Convert to 32bit integer\n }\n return hash\n}\n\nexport function objectHash(obj: Record<string, any>) {\n return `${hashCode(JSON.stringify(obj))}`\n}\n\ninterface VirtualOffset {\n blockPosition: number\n}\ninterface Block {\n minv: VirtualOffset\n maxv: VirtualOffset\n}\n\nexport async function bytesForRegions(\n regions: Region[],\n index: {\n blocksForRange: (\n ref: string,\n start: number,\n end: number,\n ) => Promise<Block[]>\n },\n) {\n const blockResults = await Promise.all(\n regions.map(r => index.blocksForRange(r.refName, r.start, r.end)),\n )\n\n return blockResults\n .flat()\n .map(block => ({\n start: block.minv.blockPosition,\n end: block.maxv.blockPosition + 65535,\n }))\n .reduce((a, b) => a + b.end - b.start, 0)\n}\n\nexport interface ViewSnap {\n bpPerPx: number\n interRegionPaddingWidth: number\n minimumBlockWidth: number\n width: number\n offsetPx: number\n staticBlocks: { contentBlocks: BaseBlock[]; blocks: BaseBlock[] }\n displayedRegions: (IStateTreeNode & {\n start: number\n end: number\n refName: string\n reversed?: boolean\n assemblyName: string\n })[]\n}\n\n// supported adapter types by text indexer ensure that this matches the method\n// found in @jbrowse/text-indexing/util\nexport function isSupportedIndexingAdapter(type = '') {\n return [\n 'Gff3TabixAdapter',\n 'VcfTabixAdapter',\n 'Gff3Adapter',\n 'VcfAdapter',\n ].includes(type)\n}\n\nexport function getBpDisplayStr(totalBp: number) {\n if (Math.floor(totalBp / 1_000_000) > 0) {\n return `${Number.parseFloat((totalBp / 1_000_000).toPrecision(3))}Mbp`\n } else if (Math.floor(totalBp / 1_000) > 0) {\n return `${Number.parseFloat((totalBp / 1_000).toPrecision(3))}Kbp`\n } else {\n return `${toLocale(Math.floor(totalBp))}bp`\n }\n}\n\nexport function toLocale(n: number) {\n return n.toLocaleString('en-US')\n}\n\nexport function getTickDisplayStr(totalBp: number, bpPerPx: number) {\n return Math.floor(bpPerPx / 1_000) > 0\n ? `${toLocale(Number.parseFloat((totalBp / 1_000_000).toFixed(2)))}M`\n : toLocale(Math.floor(totalBp))\n}\n\nexport function getViewParams(model: IAnyStateTreeNode, exportSVG?: boolean) {\n // @ts-expect-error\n const { dynamicBlocks, staticBlocks, offsetPx } = getContainingView(model)\n const b = dynamicBlocks?.contentBlocks[0] || {}\n const staticblock = staticBlocks?.contentBlocks[0] || {}\n const staticblock1 = staticBlocks?.contentBlocks[1] || {}\n return {\n offsetPx: exportSVG ? 0 : offsetPx - staticblock.offsetPx,\n offsetPx1: exportSVG ? 0 : offsetPx - staticblock1.offsetPx,\n start: b.start as number,\n end: b.end as number,\n }\n}\n\nexport function getLayoutId({\n sessionId,\n layoutId,\n}: {\n sessionId: string\n layoutId: string\n}) {\n return `${sessionId}-${layoutId}`\n}\n\n// Hook from https://usehooks.com/useLocalStorage/\nexport function useLocalStorage<T>(key: string, initialValue: T) {\n const [storedValue, setStoredValue] = useState<T>(() => {\n if (typeof window === 'undefined') {\n return initialValue\n }\n try {\n const item = window.localStorage.getItem(key)\n return item ? JSON.parse(item) : initialValue\n } catch (error) {\n console.error(error)\n return initialValue\n }\n })\n const setValue = (value: T | ((val: T) => T)) => {\n try {\n const valueToStore =\n value instanceof Function ? value(storedValue) : value\n setStoredValue(valueToStore)\n if (typeof window !== 'undefined') {\n window.localStorage.setItem(key, JSON.stringify(valueToStore))\n }\n } catch (error) {\n console.error(error)\n }\n }\n return [storedValue, setValue] as const\n}\n\nexport function getUriLink(value: { uri: string; baseUri?: string }) {\n const { uri, baseUri = '' } = value\n let href: string\n try {\n href = new URL(uri, baseUri).href\n } catch (e) {\n href = uri\n }\n return href\n}\n\nexport function getStr(obj: unknown) {\n return isObject(obj)\n ? isUriLocation(obj)\n ? getUriLink(obj)\n : JSON.stringify(obj)\n : String(obj)\n}\n\n// tries to measure grid width without HTML tags included\nexport function coarseStripHTML(s: string) {\n return s.replaceAll(/(<([^>]+)>)/gi, '')\n}\n\n// based on autolink-js, license MIT\n// https://github.com/bryanwoods/autolink-js/blob/1418049970152c56ced73d43dcc62d80b320fb71/autolink.js#L9\nexport function linkify(s: string) {\n const pattern =\n /(^|[\\s\\n]|<[A-Za-z]*\\/?>)((?:https?|ftp):\\/\\/[-A-Z0-9+\\u0026\\u2019@#/%?=()~_|!:,.;]*[-A-Z0-9+\\u0026@#/%=~()_|])/gi\n return s.replaceAll(pattern, '$1<a href=\\'$2\\' target=\"_blank\">$2</a>')\n}\n\n// heuristic measurement for a column of a @mui/x-data-grid, pass in\n// values from a column\nexport function measureGridWidth(\n elements: unknown[],\n args?: {\n minWidth?: number\n fontSize?: number\n maxWidth?: number\n padding?: number\n stripHTML?: boolean\n },\n) {\n const {\n padding = 30,\n minWidth = 80,\n fontSize = 12,\n maxWidth = 1000,\n stripHTML = false,\n } = args || {}\n return max(\n elements\n .map(element => getStr(element))\n .map(str => (stripHTML ? coarseStripHTML(str) : str))\n .map(str => measureText(str, fontSize))\n .map(n => Math.min(Math.max(n + padding, minWidth), maxWidth)),\n )\n}\n\nexport function getEnv(obj: any) {\n return getEnvMST<{ pluginManager: PluginManager }>(obj)\n}\n\nexport function localStorageGetItem(item: string) {\n return typeof localStorage !== 'undefined'\n ? localStorage.getItem(item)\n : undefined\n}\n\nexport function localStorageSetItem(str: string, item: string) {\n if (typeof localStorage !== 'undefined') {\n localStorage.setItem(str, item)\n }\n}\n\nexport function max(arr: number[], init = Number.NEGATIVE_INFINITY) {\n let max = init\n for (const entry of arr) {\n max = entry > max ? entry : max\n }\n return max\n}\n\nexport function min(arr: number[], init = Number.POSITIVE_INFINITY) {\n let min = init\n for (const entry of arr) {\n min = entry < min ? entry : min\n }\n return min\n}\n\nexport function sum(arr: number[]) {\n let sum = 0\n for (const entry of arr) {\n sum += entry\n }\n return sum\n}\n\nexport function avg(arr: number[]) {\n return sum(arr) / arr.length\n}\n\nexport function groupBy<T>(array: Iterable<T>, predicate: (v: T) => string) {\n const result = {} as Record<string, T[]>\n for (const value of array) {\n const t = predicate(value)\n if (!result[t]) {\n result[t] = []\n }\n result[t].push(value)\n }\n return result\n}\n\nexport function notEmpty<T>(value: T | null | undefined): value is T {\n return value !== null && value !== undefined\n}\n\nexport function mergeIntervals<T extends { start: number; end: number }>(\n intervals: T[],\n w = 5000,\n) {\n // test if there are at least 2 intervals\n if (intervals.length <= 1) {\n return intervals\n }\n\n const stack = [] as T[]\n let top = null\n\n // sort the intervals based on their start values\n intervals = intervals.sort((a, b) => a.start - b.start)\n\n // push the 1st interval into the stack\n stack.push(intervals[0]!)\n\n // start from the next interval and merge if needed\n for (let i = 1; i < intervals.length; i++) {\n // get the top element\n top = stack.at(-1)!\n\n // if the current interval doesn't overlap with the\n // stack top element, push it to the stack\n if (top.end + w < intervals[i]!.start - w) {\n stack.push(intervals[i]!)\n }\n // otherwise update the end value of the top element\n // if end of current interval is higher\n else if (top.end < intervals[i]!.end) {\n top.end = Math.max(top.end, intervals[i]!.end)\n stack.pop()\n stack.push(top)\n }\n }\n\n return stack\n}\n\ninterface BasicFeature {\n end: number\n start: number\n refName: string\n assemblyName?: string\n}\n\n// returns new array non-overlapping features\nexport function gatherOverlaps(regions: BasicFeature[], w = 5000) {\n const memo = {} as Record<string, BasicFeature[]>\n for (const x of regions) {\n if (!memo[x.refName]) {\n memo[x.refName] = []\n }\n memo[x.refName]!.push(x)\n }\n\n return Object.values(memo).flatMap(group =>\n mergeIntervals(\n group.sort((a, b) => a.start - b.start),\n w,\n ),\n )\n}\n\nexport function stripAlpha(str: string) {\n return colord(str).alpha(1).toHex()\n}\n\nexport function getStrokeProps(str: string) {\n const c = colord(str)\n return {\n strokeOpacity: c.alpha(),\n stroke: c.alpha(1).toHex(),\n }\n}\n\nexport function getFillProps(str: string) {\n const c = colord(str)\n return {\n fillOpacity: c.alpha(),\n fill: c.alpha(1).toHex(),\n }\n}\n\n// https://react.dev/reference/react-dom/server/renderToString#removing-rendertostring-from-the-client-code\nexport function renderToStaticMarkup(\n node: React.ReactElement,\n createRootFn?: (elt: Element | DocumentFragment) => {\n render: (node: React.ReactElement) => unknown\n },\n) {\n const div = document.createElement('div')\n flushSync(() => {\n if (createRootFn) {\n createRootFn(div).render(node)\n } else {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n render(node, div)\n }\n })\n return div.innerHTML.replaceAll(/\\brgba\\((.+?),[^,]+?\\)/g, 'rgb($1)')\n}\n\nexport function isGzip(buf: Buffer) {\n return buf[0] === 31 && buf[1] === 139 && buf[2] === 8\n}\n\nexport {\n default as SimpleFeature,\n type Feature,\n type SimpleFeatureSerialized,\n isFeature,\n} from './simpleFeature'\n\nexport { blobToDataURL } from './blobToDataURL'\n","import { getParent, isRoot, IAnyStateTreeNode } from 'mobx-state-tree'\nimport { getSession, objectHash, getEnv } from './index'\nimport { PreFileLocation, FileLocation } from './types'\nimport { readConfObject, AnyConfigurationModel } from '../configuration'\n\n/* utility functions for use by track models and so forth */\n\nexport function getTrackAssemblyNames(\n track: IAnyStateTreeNode & { configuration: AnyConfigurationModel },\n) {\n return getConfAssemblyNames(track.configuration)\n}\n\nexport function getConfAssemblyNames(conf: AnyConfigurationModel) {\n const trackAssemblyNames = readConfObject(conf, 'assemblyNames') as\n | string[]\n | undefined\n if (!trackAssemblyNames) {\n // Check if it's an assembly sequence track\n const parent = getParent<any>(conf)\n if ('sequence' in parent) {\n return [readConfObject(parent, 'name') as string]\n } else {\n throw new Error('unknown assembly names')\n }\n }\n return trackAssemblyNames\n}\n\n/**\n * return the rpcSessionId of the highest parent node in the tree that has an\n * rpcSessionId */\n\nexport function getRpcSessionId(thisNode: IAnyStateTreeNode) {\n interface NodeWithRpcSessionId extends IAnyStateTreeNode {\n rpcSessionId: string\n }\n let highestRpcSessionId: string | undefined\n\n for (let node = thisNode; !isRoot(node); node = getParent<any>(node)) {\n if ('rpcSessionId' in node) {\n highestRpcSessionId = (node as NodeWithRpcSessionId).rpcSessionId\n }\n }\n if (!highestRpcSessionId) {\n throw new Error(\n 'getRpcSessionId failed, no parent node in the state tree has an `rpcSessionId` attribute',\n )\n }\n return highestRpcSessionId\n}\n\n/**\n * given an MST node, get the renderprops of the first parent container that\n * has renderProps\n * @param node -\n * @returns renderprops, or empty object if none found\n */\nexport function getParentRenderProps(node: IAnyStateTreeNode) {\n for (\n let currentNode = getParent<any>(node);\n !isRoot(currentNode);\n currentNode = getParent<any>(currentNode)\n ) {\n if ('renderProps' in currentNode) {\n return currentNode.renderProps()\n }\n }\n\n return {}\n}\n\nexport const UNKNOWN = 'UNKNOWN'\nexport const UNSUPPORTED = 'UNSUPPORTED'\n\nlet blobMap: Record<string, File> = {}\n\n// get a specific blob\nexport function getBlob(id: string) {\n return blobMap[id]\n}\n\n// used to export entire context to webworker\nexport function getBlobMap() {\n return blobMap\n}\n\n// used in new contexts like webworkers\nexport function setBlobMap(map: Record<string, File>) {\n blobMap = map\n}\n\nlet counter = 0\n\n// blob files are stored in a global map. the blobId is based on a combination\n// of timestamp plus counter to be unique across sessions and fast repeated\n// calls\nexport function storeBlobLocation(location: PreFileLocation) {\n if ('blob' in location) {\n const blobId = `b${+Date.now()}-${counter++}`\n blobMap[blobId] = location.blob\n return { name: location.blob.name, blobId, locationType: 'BlobLocation' }\n }\n return location\n}\n\n/**\n * creates a new location from the provided location including the appropriate suffix and location type\n * @param location - the FileLocation\n * @param suffix - the file suffix (e.g. .bam)\n * @returns the constructed location object from the provided parameters\n */\nexport function makeIndex(location: FileLocation, suffix: string) {\n if ('uri' in location) {\n return { uri: location.uri + suffix, locationType: 'UriLocation' }\n }\n\n if ('localPath' in location) {\n return {\n localPath: location.localPath + suffix,\n locationType: 'LocalPathLocation',\n }\n }\n\n return location\n}\n\n/**\n * constructs a potential index file (with suffix) from the provided file name\n * @param name - the name of the index file\n * @param typeA - one option of a potential two file suffix (e.g. CSI, BAI)\n * @param typeB - the second option of a potential two file suffix (e.g. CSI, BAI)\n * @returns a likely name of the index file for a given filename\n */\nexport function makeIndexType(\n name: string | undefined,\n typeA: string,\n typeB: string,\n) {\n return name?.toUpperCase().endsWith(typeA) ? typeA : typeB\n}\n\nexport interface AdapterConfig {\n type: string\n [key: string]: unknown\n}\n\nexport type AdapterGuesser = (\n file: FileLocation,\n index?: FileLocation,\n adapterHint?: string,\n) => AdapterConfig | undefined\n\nexport type TrackTypeGuesser = (adapterName: string) => string | undefined\n\nexport function getFileName(track: FileLocation) {\n const uri = 'uri' in track ? track.uri : undefined\n const localPath = 'localPath' in track ? track.localPath : undefined\n const blob = 'blobId' in track ? track : undefined\n return (\n blob?.name ||\n uri?.slice(uri.lastIndexOf('/') + 1) ||\n localPath?.slice(localPath.replace(/\\\\/g, '/').lastIndexOf('/') + 1) ||\n ''\n )\n}\n\nexport function guessAdapter(\n file: FileLocation,\n index: FileLocation | undefined,\n adapterHint?: string,\n model?: IAnyStateTreeNode,\n) {\n if (model) {\n const { pluginManager } = getEnv(model)\n const adapterGuesser = pluginManager.evaluateExtensionPoint(\n 'Core-guessAdapterForLocation',\n (\n _file: FileLocation,\n _index?: FileLocation,\n _adapterHint?: string,\n ): AdapterConfig | undefined => {\n return undefined\n },\n ) as AdapterGuesser\n\n const adapter = adapterGuesser(file, index, adapterHint)\n\n if (adapter) {\n return adapter\n }\n }\n\n return {\n type: UNKNOWN,\n }\n}\n\nexport function guessTrackType(\n adapterType: string,\n model?: IAnyStateTreeNode,\n): string {\n if (model) {\n const session = getSession(model)\n\n const trackTypeGuesser = getEnv(\n session,\n ).pluginManager.evaluateExtensionPoint(\n 'Core-guessTrackTypeForLocation',\n (_adapterName: string): AdapterConfig | undefined => {\n return undefined\n },\n ) as TrackTypeGuesser\n\n const trackType = trackTypeGuesser(adapterType)\n\n if (trackType) {\n return trackType\n }\n }\n return 'FeatureTrack'\n}\n\nexport function generateUnsupportedTrackConf(\n trackName: string,\n trackUrl: string,\n categories: string[] | undefined,\n) {\n const conf = {\n type: 'FeatureTrack',\n name: `${trackName} (Unsupported)`,\n description: `Support not yet implemented for \"${trackUrl}\"`,\n category: categories,\n trackId: '',\n }\n conf.trackId = objectHash(conf)\n return conf\n}\n\nexport function generateUnknownTrackConf(\n trackName: string,\n trackUrl: string,\n categories: string[] | undefined,\n) {\n const conf = {\n type: 'FeatureTrack',\n name: `${trackName} (Unknown)`,\n description: `Could not determine track type for \"${trackUrl}\"`,\n category: categories,\n trackId: '',\n }\n conf.trackId = objectHash(conf)\n return conf\n}\n\nexport function getTrackName(\n conf: AnyConfigurationModel,\n session: { assemblies: AnyConfigurationModel[] },\n) {\n const trackName = readConfObject(conf, 'name') as string\n if (!trackName && readConfObject(conf, 'type') === 'ReferenceSequenceTrack') {\n const asm = session.assemblies.find(a => a.sequence === conf)\n return asm\n ? `Reference sequence (${\n readConfObject(asm, 'displayName') || readConfObject(asm, 'name')\n })`\n : 'Reference sequence'\n }\n return trackName\n}\n","import { types } from 'mobx-state-tree'\nimport { nanoid } from '../nanoid'\n\nexport const ElementId = types.optional(types.identifier, () => nanoid())\n\nexport const NoAssemblyRegion = types\n .model('NoAssemblyRegion', {\n refName: types.string,\n start: types.number,\n end: types.number,\n reversed: types.optional(types.boolean, false),\n })\n .actions(self => ({\n setRefName(newRefName: string): void {\n self.refName = newRefName\n },\n }))\n\nexport const Region = types.compose(\n 'Region',\n NoAssemblyRegion,\n types.model({\n assemblyName: types.string,\n }),\n)\n\nexport const LocalPathLocation = types.model('LocalPathLocation', {\n locationType: types.literal('LocalPathLocation'),\n localPath: types.string,\n})\n\n// like how blobId is used to get a blob map\nexport const BlobLocation = types.model('BlobLocation', {\n locationType: types.literal('BlobLocation'),\n name: types.string,\n blobId: types.string,\n})\n\nexport const UriLocationRaw = types.model('UriLocation', {\n locationType: types.literal('UriLocation'),\n uri: types.string,\n baseUri: types.maybe(types.string),\n\n internetAccountId: types.maybe(types.string),\n\n // auths information (such as tokens) needed for using this resource.\n // if provided, these must be completely sufficient for using it\n internetAccountPreAuthorization: types.maybe(\n types.model('InternetAccountPreAuthorization', {\n internetAccountType: types.string,\n authInfo: types.frozen(),\n }),\n ),\n})\n\nexport const UriLocation = types.snapshotProcessor(UriLocationRaw, {\n postProcessor: snap => {\n // xref https://github.com/mobxjs/mobx-state-tree/issues/1524 for Omit\n const { baseUri, ...rest } = snap as Omit<typeof snap, symbol>\n if (!baseUri) {\n return rest\n }\n return snap\n },\n})\n\nexport const FileLocation = types.snapshotProcessor(\n types.union(LocalPathLocation, UriLocation, BlobLocation),\n {\n // @ts-expect-error\n preProcessor(snap) {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!snap) {\n return undefined\n }\n\n // @ts-expect-error\n // xref https://github.com/mobxjs/mobx-state-tree/issues/1524 for Omit\n const { locationType, ...rest } = snap as Omit<typeof snap, symbol>\n if (!locationType) {\n // @ts-expect-error\n const { uri, localPath, blob } = rest\n let locationType = ''\n if (uri !== undefined) {\n locationType = 'UriLocation'\n } else if (localPath !== undefined) {\n locationType = 'LocalPathLocation'\n } else if (blob !== undefined) {\n locationType = 'BlobLocation'\n }\n\n return { ...rest, locationType }\n }\n return snap\n },\n },\n)\n","import { lazy } from 'react'\nimport Plugin from '@jbrowse/core/Plugin'\nimport PluginManager from '@jbrowse/core/PluginManager'\nimport UCSCTrackHubConnectionF from './ucsc-trackhub'\nimport AddTrackWidgetF from './AddTrackWidget'\n\nimport AddConnectionWidgetF from './AddConnectionWidget'\nimport PluginStoreWidgetF from './PluginStoreWidget'\nimport HierarchicalTrackSelectorWidgetF from './HierarchicalTrackSelectorWidget'\n\nconst AssemblyManager = lazy(() => import('./AssemblyManager'))\n\nexport default class DataManagementPlugin extends Plugin {\n name = 'DataManagementPlugin'\n\n exports = {\n AssemblyManager,\n }\n\n install(pluginManager: PluginManager) {\n UCSCTrackHubConnectionF(pluginManager)\n AddTrackWidgetF(pluginManager)\n HierarchicalTrackSelectorWidgetF(pluginManager)\n AddConnectionWidgetF(pluginManager)\n PluginStoreWidgetF(pluginManager)\n }\n\n configure(_pluginManager: PluginManager) {}\n}\n\nexport { AssemblyManager }\n\nexport { type AddTrackModel } from './AddTrackWidget/model'\nexport { type HierarchicalTrackSelectorModel } from './HierarchicalTrackSelectorWidget'\n","import domLoadScript from 'load-script'\n\n// locals\nimport Plugin, { PluginConstructor } from './Plugin'\nimport ReExports from './ReExports'\nimport { isElectron } from './util'\n\nexport interface UMDLocPluginDefinition {\n umdLoc: {\n uri: string\n baseUri?: string\n }\n name: string\n}\n\nexport interface UMDUrlPluginDefinition {\n umdUrl: string\n name: string\n}\n\nexport interface LegacyUMDPluginDefinition {\n url: string\n name: string\n}\n\ntype UMDPluginDefinition = UMDLocPluginDefinition | UMDUrlPluginDefinition\n\nexport function isUMDPluginDefinition(\n def: PluginDefinition,\n): def is UMDPluginDefinition | LegacyUMDPluginDefinition {\n return (\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n ((def as UMDUrlPluginDefinition).umdUrl !== undefined ||\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n (def as LegacyUMDPluginDefinition).url !== undefined ||\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n (def as UMDLocPluginDefinition).umdLoc !== undefined) &&\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n (def as LegacyUMDPluginDefinition | UMDPluginDefinition).name !== undefined\n )\n}\n\nexport interface ESMLocPluginDefinition {\n esmLoc: {\n uri: string\n baseUri?: string\n }\n}\nexport interface ESMUrlPluginDefinition {\n esmUrl: string\n}\n\nexport type ESMPluginDefinition =\n | ESMLocPluginDefinition\n | ESMUrlPluginDefinition\n\nexport function isESMPluginDefinition(\n def: PluginDefinition,\n): def is ESMPluginDefinition {\n return (\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n (def as ESMUrlPluginDefinition).esmUrl !== undefined ||\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n (def as ESMLocPluginDefinition).esmLoc !== undefined\n )\n}\n\nexport interface CJSPluginDefinition {\n cjsUrl: string\n}\n\nfunction promisifiedLoadScript(src: string) {\n return new Promise((resolve, reject) => {\n domLoadScript(src, (err, script) => {\n if (err) {\n reject(err)\n } else {\n resolve(script.src)\n }\n })\n })\n}\n\nasync function loadScript(scriptUrl: string) {\n if (!isInWebWorker()) {\n return promisifiedLoadScript(scriptUrl)\n }\n\n // @ts-expect-error\n if (globalThis.importScripts) {\n // @ts-expect-error\n await globalThis.importScripts(scriptUrl)\n return\n }\n throw new Error(\n 'cannot figure out how to load external JS scripts in this environment',\n )\n}\n\nexport function isCJSPluginDefinition(\n def: PluginDefinition,\n): def is CJSPluginDefinition {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n return (def as CJSPluginDefinition).cjsUrl !== undefined\n}\n\nexport type PluginDefinition =\n | UMDUrlPluginDefinition\n | UMDLocPluginDefinition\n | LegacyUMDPluginDefinition\n | ESMLocPluginDefinition\n | ESMUrlPluginDefinition\n | CJSPluginDefinition\n\nexport interface PluginRecord {\n plugin: PluginConstructor\n definition: PluginDefinition\n}\n\nexport interface LoadedPlugin {\n default: PluginConstructor\n}\n\nexport function pluginDescriptionString(pluginDefinition: PluginDefinition) {\n if (isUMDPluginDefinition(pluginDefinition)) {\n return `UMD plugin ${pluginDefinition.name}`\n }\n if (isESMPluginDefinition(pluginDefinition)) {\n return `ESM plugin ${\n (pluginDefinition as ESMUrlPluginDefinition).esmUrl ||\n (pluginDefinition as ESMLocPluginDefinition).esmLoc.uri\n }`\n }\n if (isCJSPluginDefinition(pluginDefinition)) {\n return `CJS plugin ${pluginDefinition.cjsUrl}`\n }\n return 'unknown plugin'\n}\n\nfunction isInWebWorker() {\n return Boolean('WorkerGlobalScope' in globalThis)\n}\n\nexport default class PluginLoader {\n definitions: PluginDefinition[] = []\n\n fetchESM?: (url: string) => Promise<LoadedPlugin>\n fetchCJS?: (url: string) => Promise<LoadedPlugin>\n\n constructor(\n defs: PluginDefinition[] = [],\n args?: {\n fetchESM?: (url: string) => Promise<LoadedPlugin>\n fetchCJS?: (url: string) => Promise<LoadedPlugin>\n },\n ) {\n this.fetchESM = args?.fetchESM\n this.fetchCJS = args?.fetchCJS\n this.definitions = JSON.parse(JSON.stringify(defs))\n }\n\n async loadCJSPlugin(def: CJSPluginDefinition, baseUri?: string) {\n const parsedUrl = new URL(def.cjsUrl, baseUri)\n if (parsedUrl.protocol !== 'http:' && parsedUrl.protocol !== 'https:') {\n throw new Error(\n `Cannot load plugins using protocol \"${parsedUrl.protocol}\"`,\n )\n }\n if (!this.fetchCJS) {\n throw new Error('No fetchCJS callback provided')\n }\n\n return this.fetchCJS(parsedUrl.href)\n }\n\n async loadESMPlugin(def: ESMPluginDefinition, baseUri?: string) {\n const parsedUrl =\n 'esmUrl' in def\n ? new URL(def.esmUrl, baseUri)\n : new URL(def.esmLoc.uri, def.esmLoc.baseUri)\n\n if (parsedUrl.protocol !== 'http:' && parsedUrl.protocol !== 'https:') {\n throw new Error(\n `cannot load plugins using protocol \"${parsedUrl.protocol}\"`,\n )\n }\n\n if (!this.fetchESM) {\n throw new Error('No ESM fetcher installed')\n }\n const plugin = await this.fetchESM(parsedUrl.href)\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!plugin) {\n throw new Error(`Could not load ESM plugin: ${parsedUrl}`)\n }\n return plugin\n }\n\n async loadUMDPlugin(\n def: UMDPluginDefinition | LegacyUMDPluginDefinition,\n baseUri?: string,\n ) {\n const parsedUrl =\n 'url' in def\n ? new URL(def.url, baseUri)\n : 'umdUrl' in def\n ? new URL(def.umdUrl, baseUri)\n : new URL(def.umdLoc.uri, def.umdLoc.baseUri)\n\n if (parsedUrl.protocol !== 'http:' && parsedUrl.protocol !== 'https:') {\n throw new Error(\n `cannot load plugins using protocol \"${parsedUrl.protocol}\"`,\n )\n }\n const moduleName = def.name\n const umdName = `JBrowsePlugin${moduleName}`\n if (typeof jest === 'undefined') {\n await loadScript(parsedUrl.href)\n } else {\n // @ts-expect-error\n globalThis[umdName] = { default: Plugin }\n }\n\n // @ts-expect-error\n const plugin = globalThis[umdName] as\n | { default: PluginConstructor }\n | undefined\n if (!plugin) {\n throw new Error(\n `Failed to load UMD bundle for ${moduleName}, ${umdName} is undefined`,\n )\n }\n return plugin\n }\n\n async loadPlugin(def: PluginDefinition, baseUri?: string) {\n let plugin: LoadedPlugin\n if (isElectron && isCJSPluginDefinition(def)) {\n plugin = await this.loadCJSPlugin(def, baseUri)\n } else if (isESMPluginDefinition(def)) {\n plugin = await this.loadESMPlugin(def, baseUri)\n } else if (isUMDPluginDefinition(def)) {\n plugin = await this.loadUMDPlugin(def, baseUri)\n } else if (!isElectron && isCJSPluginDefinition(def)) {\n throw new Error(\n `CommonJS plugin found, but not in a NodeJS environment: ${JSON.stringify(\n def,\n )}`,\n )\n } else {\n throw new Error(`Could not determine plugin type: ${JSON.stringify(def)}`)\n }\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!plugin.default) {\n throw new Error(\n `${pluginDescriptionString(\n def,\n )} does not have a default export, cannot load`,\n )\n }\n return plugin.default\n }\n\n installGlobalReExports(target: WindowOrWorkerGlobalScope) {\n // @ts-expect-error\n target.JBrowseExports = Object.fromEntries(\n Object.entries(ReExports).map(([moduleName, module]) => {\n return [moduleName, module]\n }),\n )\n return this\n }\n\n async load(baseUri?: string) {\n return Promise.all(\n this.definitions.map(async definition => ({\n plugin: await this.loadPlugin(definition, baseUri),\n definition,\n })),\n )\n }\n}\n","import './workerPolyfill'\nimport { initializeWorker } from '@jbrowse/product-core'\nimport { enableStaticRendering } from 'mobx-react'\n\n// locals\nimport corePlugins from './corePlugins'\n\n// static rendering is used for \"SSR\" style rendering which is done on the\n// worker\nenableStaticRendering(true)\n\n// eslint-disable-next-line @typescript-eslint/no-floating-promises\ninitializeWorker(corePlugins, {\n fetchESM: url => import(/* webpackIgnore:true */ url),\n})\n\nexport default function doNothing() {\n /* do nothing */\n}\n","import RpcServer from 'librpc-web-mod'\nimport PluginManager from '@jbrowse/core/PluginManager'\nimport { remoteAbortRpcHandler } from '@jbrowse/core/rpc/remoteAbortSignals'\nimport PluginLoader, {\n LoadedPlugin,\n PluginDefinition,\n} from '@jbrowse/core/PluginLoader'\nimport { PluginConstructor } from '@jbrowse/core/Plugin'\nimport { serializeError } from 'serialize-error'\n\ninterface WorkerConfiguration {\n plugins: PluginDefinition[]\n windowHref: string\n}\n\n// waits for a message from the main thread containing our configuration, which\n// must be sent on boot\nfunction receiveConfiguration() {\n const configurationP = new Promise<WorkerConfiguration>(resolve => {\n function listener(e: MessageEvent) {\n if (e.data.message === 'config') {\n resolve(e.data.config as WorkerConfiguration)\n removeEventListener('message', listener)\n }\n }\n self.addEventListener('message', listener)\n })\n postMessage({ message: 'readyForConfig' })\n return configurationP\n}\n\nasync function getPluginManager(\n corePlugins: PluginConstructor[],\n opts: { fetchESM?: (url: string) => Promise<LoadedPlugin> },\n) {\n // Load runtime plugins\n const config = await receiveConfiguration()\n const pluginLoader = new PluginLoader(\n config.plugins,\n opts,\n ).installGlobalReExports(self)\n return new PluginManager(\n [\n ...corePlugins.map(p => ({ plugin: p })),\n ...(await pluginLoader.load(config.windowHref)),\n ].map(P => new P.plugin()),\n )\n .createPluggableElements()\n .configure()\n}\n\ninterface WrappedFuncArgs {\n rpcDriverClassName: string\n channel: string\n [key: string]: unknown\n}\n\ntype RpcFunc = (args: unknown, rpcDriverClassName: string) => unknown\n\nfunction wrapForRpc(func: RpcFunc) {\n return (args: WrappedFuncArgs) => {\n const { channel, rpcDriverClassName } = args\n return func(\n {\n ...args,\n statusCallback: (message: string) => {\n // @ts-expect-error\n self.rpcServer.emit(channel, message)\n },\n },\n rpcDriverClassName,\n )\n }\n}\n\nexport async function initializeWorker(\n corePlugins: PluginConstructor[],\n opts: {\n fetchESM?: (url: string) => Promise<LoadedPlugin>\n fetchCJS?: (url: string) => Promise<LoadedPlugin>\n },\n) {\n try {\n const pluginManager = await getPluginManager(corePlugins, opts)\n const rpcConfig = Object.fromEntries(\n pluginManager\n .getRpcElements()\n .map(e => [e.name, wrapForRpc(e.execute.bind(e))]),\n )\n\n // @ts-expect-error\n self.rpcServer = new RpcServer.Server({\n ...rpcConfig,\n ...remoteAbortRpcHandler(),\n ping: async () => {\n // the ping method is required by the worker driver for checking the\n // health of the worker\n },\n })\n postMessage({ message: 'ready' })\n } catch (e) {\n postMessage({ message: 'error', error: serializeError(e) })\n }\n /* do nothing */\n}\n","// this is a little polyfill for running in workers that\n// contains just enough stubbing to make webpack style-loader\n// think that it is actually inserting styles into the DOM\n\nself.window = {\n addEventListener() {},\n fetch: self.fetch.bind(self),\n location: self.location,\n Date: self.Date,\n requestIdleCallback: cb => {\n cb()\n },\n cancelIdleCallback: () => {},\n requestAnimationFrame: cb => {\n cb()\n },\n cancelAnimationFrame: () => {},\n navigator: {},\n}\nself.document = {\n createTextNode() {},\n querySelector() {\n return { appendChild() {} }\n },\n documentElement: {},\n querySelectorAll: () => [],\n createElement() {\n return {\n style: {},\n setAttribute() {},\n removeAttribute() {},\n appendChild() {},\n }\n },\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n__webpack_require__.x = () => {\n\t// Load entry module and return exports\n\t// This entry module depends on other loaded chunks and execution need to be delayed\n\tvar __webpack_exports__ = __webpack_require__.O(undefined, [5255,3301,6837], () => (__webpack_require__(2657)))\n\t__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n\treturn __webpack_exports__;\n};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"static/js/\" + chunkId + \".\" + {\"12\":\"c0c7bdf9\",\"14\":\"b9913d1d\",\"26\":\"604133d9\",\"120\":\"a447052d\",\"246\":\"9848bd41\",\"266\":\"94eb2bf9\",\"311\":\"2c004784\",\"366\":\"b00bf6ca\",\"399\":\"e36b7683\",\"419\":\"021427b6\",\"439\":\"bdc14632\",\"457\":\"6d7b716d\",\"489\":\"43cb4a5f\",\"491\":\"0011d1ad\",\"518\":\"7222a328\",\"561\":\"8b38948f\",\"596\":\"84c38eb7\",\"722\":\"4329bc98\",\"741\":\"a9772d36\",\"759\":\"9c32be0d\",\"772\":\"83c2d2db\",\"937\":\"4f610bdf\",\"946\":\"245d7df9\",\"972\":\"c0d17685\",\"1012\":\"a7d14de3\",\"1029\":\"8c806427\",\"1051\":\"8e1641e2\",\"1110\":\"702cba94\",\"1157\":\"c0d4652e\",\"1189\":\"f18c6e1f\",\"1260\":\"ee4ecbf4\",\"1266\":\"cd6d9354\",\"1281\":\"1d836fc4\",\"1304\":\"a512b560\",\"1310\":\"8a044016\",\"1326\":\"19289940\",\"1345\":\"aaaaf175\",\"1354\":\"ded982ce\",\"1503\":\"cc48d25a\",\"1516\":\"ca4ab8f0\",\"1537\":\"4fdb4e95\",\"1598\":\"3b48685f\",\"1637\":\"21a8cf01\",\"1696\":\"8a290cef\",\"1725\":\"795fc4d3\",\"1752\":\"a727a500\",\"1757\":\"a6d05bc3\",\"1811\":\"7cfd8419\",\"1822\":\"2cbe112a\",\"1824\":\"c2ed4bca\",\"1978\":\"1faf7d31\",\"1996\":\"a37d9ec7\",\"1999\":\"2554e815\",\"2018\":\"9ce7fb06\",\"2062\":\"a28f26f8\",\"2141\":\"d36fb4a8\",\"2197\":\"a5134ce4\",\"2212\":\"116fbbf4\",\"2241\":\"3d359b22\",\"2246\":\"e5e65a4f\",\"2249\":\"b91f0bb3\",\"2306\":\"f8d640f4\",\"2321\":\"ef211da9\",\"2398\":\"731eb1c6\",\"2412\":\"10574f7d\",\"2418\":\"0b1f308b\",\"2424\":\"7cd6703f\",\"2493\":\"20e8e76c\",\"2583\":\"db78b17f\",\"2627\":\"300bea43\",\"2645\":\"4b79a04c\",\"2697\":\"4ab94d07\",\"2729\":\"9660c29b\",\"2775\":\"e25b4dd4\",\"2777\":\"56f29f41\",\"2820\":\"3c0e09be\",\"2847\":\"009c96ee\",\"2861\":\"aa6cd5b7\",\"2872\":\"5129bbd8\",\"2885\":\"8a30e856\",\"2977\":\"aa562b03\",\"2989\":\"031b43a0\",\"3003\":\"0f0cbacd\",\"3011\":\"9da53e7c\",\"3012\":\"9940fd01\",\"3029\":\"cd8dcca2\",\"3103\":\"4dfe3f78\",\"3106\":\"e1981605\",\"3109\":\"3173f682\",\"3162\":\"eb9bf76d\",\"3167\":\"312d0953\",\"3175\":\"af2c93a5\",\"3199\":\"a36b17a7\",\"3266\":\"accbd4dc\",\"3274\":\"053c3df5\",\"3301\":\"db457761\",\"3304\":\"65e5d8dd\",\"3311\":\"92fac4a6\",\"3368\":\"6e9b017b\",\"3384\":\"e146a796\",\"3416\":\"f7c72cbe\",\"3425\":\"be85a6ad\",\"3474\":\"8c1888be\",\"3497\":\"9db6611b\",\"3525\":\"e74d3ff0\",\"3550\":\"089089a8\",\"3578\":\"058bdae5\",\"3614\":\"af493134\",\"3682\":\"840e721c\",\"3728\":\"99a63442\",\"3778\":\"e18101e6\",\"3795\":\"0386c297\",\"3862\":\"9fd8e870\",\"3902\":\"69c7ff0c\",\"3940\":\"c8b3da50\",\"4033\":\"df8ecd0d\",\"4060\":\"8757dbe8\",\"4133\":\"451f5e47\",\"4138\":\"57ad92a3\",\"4234\":\"63e1ba57\",\"4284\":\"61dbc58f\",\"4345\":\"0a9072cc\",\"4395\":\"8fda7b8b\",\"4414\":\"7f4caeab\",\"4435\":\"a57cabe2\",\"4456\":\"93a06b74\",\"4499\":\"3f0b2e70\",\"4615\":\"dc35870f\",\"4629\":\"1f1a55a3\",\"4630\":\"f0bdb9f0\",\"4659\":\"b65d8547\",\"4704\":\"9b3995ff\",\"4753\":\"834007ba\",\"4755\":\"8d938db2\",\"4770\":\"3d757d6b\",\"4773\":\"6cd74b80\",\"4806\":\"7e497d7a\",\"4861\":\"6244e4c0\",\"4863\":\"9dfed19c\",\"4864\":\"28cfc358\",\"4902\":\"452e575b\",\"4947\":\"2e80fd2d\",\"4974\":\"cf97ef5b\",\"5008\":\"f8d32f92\",\"5031\":\"6eccfd35\",\"5090\":\"bc77ac67\",\"5099\":\"14f82444\",\"5101\":\"993a6b6e\",\"5132\":\"00a31df0\",\"5156\":\"75195722\",\"5189\":\"3e22269d\",\"5243\":\"9de20396\",\"5255\":\"af554ced\",\"5260\":\"e7b7aeb6\",\"5327\":\"8f1dcfc1\",\"5331\":\"28d667f0\",\"5369\":\"993afa3f\",\"5461\":\"5c8cf5d1\",\"5484\":\"3ceeebff\",\"5511\":\"154ce441\",\"5515\":\"671905b2\",\"5595\":\"b4517d69\",\"5608\":\"1b8d39e1\",\"5640\":\"33b8306c\",\"5668\":\"73016b9c\",\"5676\":\"818528e8\",\"5677\":\"28a25579\",\"5682\":\"ea285a50\",\"5727\":\"f7a524b6\",\"5736\":\"48705208\",\"5746\":\"39e4296b\",\"5763\":\"48010c9a\",\"5896\":\"622b5e88\",\"5903\":\"9145cef7\",\"5904\":\"240caa72\",\"5930\":\"0ffd2546\",\"5951\":\"251be759\",\"5998\":\"22bd8296\",\"6021\":\"21769087\",\"6043\":\"e402bf73\",\"6054\":\"e0881c55\",\"6149\":\"c6c4af73\",\"6157\":\"96f40683\",\"6205\":\"903f897d\",\"6214\":\"0ed0ac32\",\"6235\":\"93768761\",\"6310\":\"ae82dc58\",\"6323\":\"1c706a2d\",\"6342\":\"62a02e7b\",\"6391\":\"aabba4a1\",\"6395\":\"f6027b24\",\"6397\":\"8fc250af\",\"6423\":\"1e8da08b\",\"6435\":\"b4633aa1\",\"6514\":\"d36ecbb8\",\"6526\":\"b2c8fd93\",\"6621\":\"cf64e54c\",\"6658\":\"fe512b5a\",\"6683\":\"2a35f0fe\",\"6703\":\"faa93a20\",\"6746\":\"8d3f75be\",\"6785\":\"07d4b66b\",\"6799\":\"754a77ae\",\"6823\":\"6e35b0cf\",\"6833\":\"c77c5928\",\"6834\":\"bc9e9f2b\",\"6837\":\"a706c464\",\"6861\":\"66a2e4c0\",\"6932\":\"a37ea756\",\"6946\":\"dd09a891\",\"6999\":\"3486cca0\",\"7013\":\"5240d550\",\"7067\":\"e9508417\",\"7087\":\"79101e8e\",\"7117\":\"b3239756\",\"7126\":\"b4b7d70b\",\"7181\":\"938de865\",\"7203\":\"03e2b86a\",\"7309\":\"f9d18abb\",\"7348\":\"40afbdc0\",\"7374\":\"932d083d\",\"7389\":\"fa6a1eb0\",\"7407\":\"4421929d\",\"7409\":\"8e71acc1\",\"7418\":\"2ac24978\",\"7428\":\"1e6f676f\",\"7489\":\"b8a76d29\",\"7579\":\"1b98701c\",\"7584\":\"a162e3d6\",\"7627\":\"31dfd44e\",\"7706\":\"430ce07e\",\"7753\":\"87963fd9\",\"7761\":\"0cf7cf29\",\"7773\":\"7e072552\",\"7790\":\"3790bece\",\"7809\":\"eb2c5f08\",\"7812\":\"6bb31bfb\",\"7831\":\"cfcb0221\",\"7842\":\"cbff451c\",\"7864\":\"59d0de32\",\"7865\":\"e02aee95\",\"7902\":\"f48e3002\",\"7909\":\"8f1d759d\",\"7911\":\"764ec401\",\"7974\":\"3f19c570\",\"7991\":\"5d96c772\",\"8009\":\"a65f1b78\",\"8052\":\"7d772984\",\"8105\":\"4fd35586\",\"8109\":\"344e1845\",\"8114\":\"eb856986\",\"8120\":\"85042513\",\"8150\":\"09c54606\",\"8165\":\"d07843b4\",\"8187\":\"383aefbf\",\"8216\":\"16f39607\",\"8301\":\"877076ce\",\"8341\":\"fa84fa67\",\"8343\":\"dd515382\",\"8408\":\"2e2896bf\",\"8424\":\"a1a3e663\",\"8435\":\"484d30f8\",\"8483\":\"7fadf4ea\",\"8526\":\"5dd9c712\",\"8528\":\"f68ff14f\",\"8535\":\"189d090a\",\"8546\":\"0a89cbee\",\"8556\":\"0053a402\",\"8565\":\"c4ea9980\",\"8582\":\"9b93fffc\",\"8615\":\"0950a86f\",\"8624\":\"190dd7af\",\"8678\":\"8424d5dc\",\"8704\":\"ae4808df\",\"8762\":\"3d2b9142\",\"8797\":\"3168365d\",\"8856\":\"4593419f\",\"8859\":\"efb2561f\",\"8869\":\"74066774\",\"8876\":\"24bf6aed\",\"8880\":\"6ae9d985\",\"8929\":\"70ce258f\",\"8965\":\"51db703f\",\"8984\":\"1a816123\",\"9028\":\"12f6efe2\",\"9032\":\"b54e1975\",\"9037\":\"03715b7f\",\"9067\":\"1cc02121\",\"9070\":\"d49de235\",\"9086\":\"035adaa3\",\"9088\":\"9fbbeb5c\",\"9106\":\"b274c701\",\"9114\":\"d412d44e\",\"9168\":\"6afdec67\",\"9206\":\"bbf34514\",\"9245\":\"d882c265\",\"9280\":\"6e897b98\",\"9292\":\"96b77fb0\",\"9305\":\"4d748fb5\",\"9314\":\"3e43d34c\",\"9329\":\"c269472b\",\"9372\":\"67d6f914\",\"9374\":\"8ac7e6d7\",\"9384\":\"a4e7a69a\",\"9409\":\"c7569196\",\"9449\":\"2e1d2652\",\"9458\":\"07f0ae54\",\"9589\":\"9087e0ea\",\"9657\":\"0cccd5bf\",\"9658\":\"33669a59\",\"9690\":\"0cd8a2c8\",\"9756\":\"4ac80c37\",\"9824\":\"b9ece376\",\"9831\":\"de8b3aa9\",\"9870\":\"f395e633\",\"9943\":\"d3ab0f18\"}[chunkId] + \".chunk.js\";\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.j = 2047;","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl + \"../../\";","// no baseURI\n\n// object to store loaded chunks\n// \"1\" means \"already loaded\"\nvar installedChunks = {\n\t2047: 1\n};\n\n// importScripts chunk loading\nvar installChunk = (data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\tfor(var moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\twhile(chunkIds.length)\n\t\tinstalledChunks[chunkIds.pop()] = 1;\n\tparentChunkLoadingFunction(data);\n};\n__webpack_require__.f.i = (chunkId, promises) => {\n\t// \"1\" is the signal for \"already loaded\"\n\tif(!installedChunks[chunkId]) {\n\t\tif(true) { // all chunks have JS\n\t\t\timportScripts(__webpack_require__.p + __webpack_require__.u(chunkId));\n\t\t}\n\t}\n};\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunk_jbrowse_web\"] = globalThis[\"webpackChunk_jbrowse_web\"] || [];\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\nchunkLoadingGlobal.push = installChunk;\n\n// no HMR\n\n// no HMR manifest","__webpack_require__.nc = undefined;","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n"],"names":["deferred","leafPrototypes","getProto","next","adapterCache","async","getAdapter","pluginManager","sessionId","adapterConfigSnapshot","cacheKey","conf","idMaker","adapterConfigCacheKey","adapterType","type","Error","JSON","stringify","dataAdapterType","getAdapterType","adapterConfig","configSchema","create","getSubAdapter","bind","dataAdapter","getAdapterClass","sessionIds","Set","cacheEntry","add","freeAdapterResources","specification","deleteCount","specKeys","Object","keys","length","entries","forEach","delete","size","values","regions","region","undefined","refName","freeResources","isRemoteAbortSignal","thing","abortSignalId","WeakMap","surrogateAbortControllers","Map","deserializeAbortSignal","surrogateAbortController","get","AbortController","set","signal","remoteAbort","props","signalId","abort","remoteAbortRpcHandler","signalAbort","CascadingContext","React","parentPopupState","rootPopupState","CascadingMenuItem","onClick","closeAfterItemClick","useContext","MenuItem","_extends","event","close","CascadingSubmenu","title","Icon","inset","popupId","popupState","usePopupState","variant","bindHover","bindFocus","ListItemIcon","ListItemText","primary","ChevronRight","CascadingSubmenuHover","anchorOrigin","vertical","horizontal","transformOrigin","onMenuItemClick","menuItems","classes","context","useMemo","Provider","value","HoverMenu","bindMenu","CascadingMenu","Menu","EndDecoration","item","MenuItemEndDecoration","checked","disabled","CascadingMenuList","hasIcon","some","m","icon","sort","a","b","priority","map","idx","key","label","subMenu","Divider","component","ListSubheader","callback","Boolean","secondary","subLabel","style","flexGrow","minWidth","rest","useStyles","makeStyles","theme","closeButton","position","right","spacing","top","color","palette","grey","DialogError","error","width","margin","ErrorMessage","observer","header","children","onClose","useTheme","MUIDialog","ScopedCssBaseline","DialogTitle","SanitizedHTML","html","IconButton","className","CloseIcon","ErrorBoundary","FallbackComponent","ThemeProvider","createTheme","components","MuiInputBase","styleOverrides","input","boxSizing","inputBase","typography","left","whiteSpace","visibility","inputRoot","padding","inputFocused","borderStyle","borderWidth","ref","setValue","other","ref2","useMeasure","editedValue","setEditedValue","useState","inputNode","setInputNode","blur","setBlur","useEffect","val","Typography","InputBase","inputRef","node","inputProps","root","focused","onChange","target","onKeyDown","onBlur","ErrorMessageStackTraceDialog","lazy","bg","background","divider","border","iconFloat","float","marginLeft","ErrorButtons","onReset","showStack","setShowStack","Tooltip","ReportIcon","RefreshIcon","Suspense","fallback","str","str2","indexOf","str3","slice","snapshotError","trim","findStr","match","exec","match2","parseError","RedErrorMessageBox","parse","FactoryResetDialog","open","onFactoryReset","handleDialogClose","action","Dialog","DialogContent","DialogContentText","DialogActions","Button","ContentCopy","SvgIcon","d","Indexing","TrackSelector","getColors","midnight","forrest","grape","mandarin","gray","Logomark","viewBox","LogoFull","Text","colors","fill","transform","paper","overflowY","overflowX","minHeight","maxWidth","maxHeight","outline","menuItemEndDecoration","height","ArrowRightIcon","CheckBoxIcon","CheckBoxOutlineBlankIcon","RadioButtonCheckedIcon","RadioButtonUncheckedIcon","checkIfValid","MenuPage","subMenuAnchorEl","setSubMenuAnchorEl","openSubMenuIdx","setOpenSubMenuIdx","isSubMenuOpen","setIsSubMenuOpen","selectedMenuItemIdx","setSelectedMenuItemIdx","setPosition","paperRef","useRef","anchorEl","shouldSubMenuBeOpen","timer","setTimeout","clearTimeout","rect","getBoundingClientRect","menuItem","menuItemStyle","ListContents","MenuList","autoFocusItem","dense","endDecoration","MUIMenuItem","id","String","selected","onMouseMove","e","currentTarget","document","activeElement","focus","currentIdx","findLastIndex","findPreviousValidIdx","findIndex","findNextValidIdx","Grow","in","Paper","elevation","Popover","horizontalHandle","cursor","verticalHandle","flexbox_verticalHandle","alignSelf","flexbox_horizontalHandle","onDrag","flexbox","originalClassName","onMouseDown","mouseDragging","setMouseDragging","initialPosition","prevPos","cx","mouseMove","preventDefault","pos","clientX","clientY","totalDistance","current","lastFrameDistance","mouseUp","window","addEventListener","removeEventListener","model","handleClose","clearView","autoFocus","added","full","RegExp","tag","join","pre","linkify","test","escapeHTML","dompurify","tagName","setAttribute","dangerouslySetInnerHTML","__html","refTheme","forest","augmentColor","main","bases","A","green","C","blue","G","orange","T","red","framesCDS","frames","stopCodon","startCodon","stockTheme","mode","tertiary","quaternary","highlight","MuiLink","defaultThemes","default","name","lightStock","lightMinimal","darkMinimal","darkStock","MuiAppBar","defaultProps","enableColorOnDark","overwriteArrayMerge","_","sourceArray","createJBrowseBaseTheme","themeP","fontSize","MuiButton","text","MuiAccordion","disableGutters","slotProps","transition","timeout","unmountOnExit","MuiFilledInput","MuiFormControl","MuiFormHelperText","MuiIconButton","MuiAutocomplete","MuiInputLabel","MuiToolbar","MuiListItem","MuiOutlinedInput","MuiFab","backgroundColor","MuiTable","MuiPopover","transitionDuration","MuiMenu","MuiMenuItem","MuiTextField","MuiCheckbox","MuiRadio","MuiFormLabel","MuiAccordionSummary","content","contrastText","MuiToggleButtonGroup","deepmerge","arrayMerge","createJBrowseTheme","configTheme","themes","themeName","augmentTheme","augmentThemePlus","importFormEntry","session","InputProps","TextFieldProps","localStorageKey","helperText","assemblyNames","assemblyManager","config","URLSearchParams","location","search","lastSelected","setLastSelected","jest","useLocalStorage","host","pathname","selection","includes","TextField","select","assembly","displayName","getConf","ToggleButtonWithTooltip","ToggleButton","shorten","len","Math","max","description","rootModel","setLocation","fileOrUrl","isUriLocation","toggleButtonValue","setToggleButtonValue","internetAccountId","accounts","isAppRootModel","internetAccounts","filter","f","recentlyUsedInternetAccounts","setRecentlyUsedInternetAccounts","fromEntries","arr","s","shownAccounts","hiddenAccounts","setAnchorEl","selectedAccount","setLocationWithAccount","useCallback","locationInput","UrlChooser","selectorLabel","LocalFileChooser","SelectorComponent","Box","display","InputLabel","shrink","flexDirection","ToggleButtonGroup","exclusive","_event","newState","notEmpty","toggleContents","ArrowDropDownIcon","FormHelperText","highResolutionScaling","imageData","blockKey","showSoftClip","done","setDone","featureCanvas","canvas","getContext","drawImageOntoCanvasContext","QuickLRU","constructor","options","super","maxSize","TypeError","maxAge","this","Number","POSITIVE_INFINITY","onEviction","cache","oldCache","_size","_emitEvictions","_deleteIfExpired","expiry","Date","now","_getOrDeleteIfExpired","_getItemValue","_peek","_set","_moveToRecent","_entriesAscending","has","peek","deleted","clear","resize","newSize","items","removeCount","Symbol","iterator","entriesDescending","i","entriesAscending","oldCacheSize","min","callbackFunction","thisArgument","call","toStringTag","useDebounce","delay","debouncedValue","setDebouncedValue","handle","useWidthSetter","view","isAlive","requestAnimationFrame","setWidth","parseInt","useDebouncedCallback","wait","argsRef","args","findParentThat","predicate","hasParent","currentNode","getParent","springAnimate","fromValue","toValue","onFinish","precision","tension","friction","clamp","animationFrameId","update","animation","time","lastPosition","lastTime","velocity","lastVelocity","numSteps","floor","isVelocity","abs","isDisplacement","cancelAnimationFrame","findParentThatIs","getSession","isSessionModel","getContainingView","isViewModel","getContainingTrack","isTrackModel","getContainingDisplay","isDisplayModel","assembleLocString","assembleLocStringFast","toLocale","cb","n","assemblyName","start","end","reversed","assemblyNameString","startString","endString","rev","parseLocStringOneBased","locString","isValidRefName","endsWith","replace","assemblyMatch","assemblyName2","location2","startsWith","lastColonIdx","lastIndexOf","prefix","suffix","rangeMatch","singleMatch","replaceAll","separator","parseLocString","parsed","compareLocs","locA","locB","assemblyComp","localeCompare","refComp","startComp","endComp","compareLocStrings","num","bpToPx","bp","bpPerPx","round","oneEightyOverPi","PI","piOverOneEighty","radToDeg","radians","degToRad","degrees","polarToCartesian","rho","theta","cos","sin","cartesianToPolar","x","y","sqrt","atan","featureSpanPx","feature","bpSpanPx","leftBp","rightBp","iterMap","iter","func","sizeHint","results","Array","from","counter","array","l","findLast","makeAbortableReaction","self","dataFunction","asyncReactionFunction","reactionOptions","startedFunction","successFunction","errorFunction","inProgress","handleError","isAbortException","console","addDisposer","reaction","data","mobxReactionHandle","aborted","thisInProgress","result","checkAbortSignal","renameRegionIfNeeded","refNameMap","isStateTreeNode","newRef","getSnapshot","originalRefName","renameRegionsIfNeeded","assemblyMaps","Promise","all","getRefNameMapForAdapter","minmax","short","coord","oob","useAssemblyName","isElectron","navigator","userAgent","revcom","seqString","reverse","complement","split","complementRegex","complementTable","S","w","r","N","K","Y","V","M","h","k","g","t","W","X","v","B","H","c","D","R","rIC","requestIdleCallback","widths","measureText","total","code","charCodeAt","getFrame","strand","phase","defaultStarts","defaultStops","defaultCodonTable","TCA","TCC","TCG","TCT","TTC","TTT","TTA","TTG","TAC","TAT","TAA","TAG","TGC","TGT","TGA","TGG","CTA","CTC","CTG","CTT","CCA","CCC","CCG","CCT","CAC","CAT","CAA","CAG","CGA","CGC","CGG","CGT","ATA","ATC","ATT","ATG","ACA","ACC","ACG","ACT","AAC","AAT","AAA","AAG","AGC","AGT","AGA","AGG","GTA","GTC","GTG","GTT","GCA","GCC","GCG","GCT","GAC","GAT","GAA","GAG","GGA","GGC","GGG","GGT","generateCodonTable","table","tempCodonTable","codon","aa","nucs","nuc","charAt","toUpperCase","toLowerCase","n0","j","n1","n2","updateStatus","msg","fn","res","hashCode","hash","objectHash","obj","bytesForRegions","index","blocksForRange","flat","block","minv","blockPosition","maxv","reduce","isSupportedIndexingAdapter","getBpDisplayStr","totalBp","parseFloat","toPrecision","toLocaleString","getTickDisplayStr","toFixed","getViewParams","exportSVG","dynamicBlocks","staticBlocks","offsetPx","contentBlocks","staticblock","staticblock1","offsetPx1","getLayoutId","layoutId","initialValue","storedValue","setStoredValue","localStorage","getItem","valueToStore","Function","setItem","getUriLink","uri","baseUri","href","URL","getStr","isObject","coarseStripHTML","measureGridWidth","elements","stripHTML","element","getEnv","getEnvMST","localStorageGetItem","localStorageSetItem","init","NEGATIVE_INFINITY","entry","sum","avg","groupBy","push","mergeIntervals","intervals","stack","at","pop","gatherOverlaps","memo","flatMap","group","stripAlpha","colord","alpha","toHex","getStrokeProps","strokeOpacity","stroke","getFillProps","fillOpacity","renderToStaticMarkup","createRootFn","div","createElement","flushSync","render","innerHTML","isGzip","buf","getTrackAssemblyNames","track","getConfAssemblyNames","configuration","trackAssemblyNames","readConfObject","parent","getRpcSessionId","thisNode","highestRpcSessionId","isRoot","rpcSessionId","getParentRenderProps","renderProps","UNKNOWN","UNSUPPORTED","blobMap","getBlob","getBlobMap","setBlobMap","storeBlobLocation","blobId","blob","locationType","makeIndex","localPath","makeIndexType","typeA","typeB","getFileName","guessAdapter","file","adapterHint","adapter","evaluateExtensionPoint","_file","_index","_adapterHint","adapterGuesser","guessTrackType","trackType","_adapterName","trackTypeGuesser","generateUnsupportedTrackConf","trackName","trackUrl","categories","category","trackId","generateUnknownTrackConf","getTrackName","asm","assemblies","find","sequence","ElementId","types","optional","identifier","nanoid","NoAssemblyRegion","string","number","boolean","actions","setRefName","newRefName","Region","compose","LocalPathLocation","literal","BlobLocation","UriLocationRaw","maybe","internetAccountPreAuthorization","internetAccountType","authInfo","frozen","UriLocation","snapshotProcessor","postProcessor","snap","FileLocation","union","preProcessor","AssemblyManager","DataManagementPlugin","Plugin","exports","install","UCSCTrackHubConnectionF","AddTrackWidgetF","HierarchicalTrackSelectorWidgetF","AddConnectionWidgetF","PluginStoreWidgetF","configure","_pluginManager","isUMDPluginDefinition","def","umdUrl","url","umdLoc","isESMPluginDefinition","esmUrl","esmLoc","isCJSPluginDefinition","cjsUrl","PluginLoader","definitions","defs","fetchESM","fetchCJS","loadCJSPlugin","parsedUrl","protocol","loadESMPlugin","plugin","loadUMDPlugin","moduleName","umdName","scriptUrl","globalThis","src","resolve","reject","domLoadScript","err","script","importScripts","loadScript","loadPlugin","pluginDefinition","installGlobalReExports","JBrowseExports","ReExports","module","load","definition","enableStaticRendering","corePlugins","opts","configurationP","listener","message","postMessage","receiveConfiguration","pluginLoader","plugins","PluginManager","p","windowHref","P","createPluggableElements","getPluginManager","rpcConfig","getRpcElements","execute","channel","rpcDriverClassName","statusCallback","rpcServer","emit","RpcServer","Server","ping","serializeError","initializeWorker","import","fetch","cancelIdleCallback","createTextNode","querySelector","appendChild","documentElement","querySelectorAll","removeAttribute","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","__webpack_exports__","O","chunkIds","notFulfilled","Infinity","fulfilled","every","splice","getter","__esModule","getPrototypeOf","then","ns","getOwnPropertyNames","o","defineProperty","enumerable","chunkId","promises","u","miniCssF","prop","prototype","hasOwnProperty","currentScript","scripts","getElementsByTagName","installedChunks","chunkLoadingGlobal","parentChunkLoadingFunction","moreModules","runtime","nc"],"sourceRoot":""}