diff x/static/js/7663.e79b053a.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 diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/x/static/js/7663.e79b053a.chunk.js.map	Sat Oct 05 23:58:05 2024 +0000
@@ -0,0 +1,1 @@
+{"version":3,"file":"static/js/7663.e79b053a.chunk.js","mappings":"0VAIA,SAAe,EAAAA,EAAA,IAA4B,SAAK,OAAQ,CACtDC,EAAG,6HACD,e,0BCoBJ,MAAMC,GAAiBC,EAAAA,EAAAA,OAAK,IAAM,kCAIlC,SAASC,GAAU,IAAEC,IACnB,OACEC,EAAAA,cAACC,EAAAA,EAAS,CACRC,MAAM,MACNC,MAAOJ,EACPK,WAAY,CAAEC,UAAU,GACxBC,QAAQ,SACRC,WAAS,EACTC,QAASC,IACQA,EAAMC,OACdC,QAAQ,GAIvB,CAEA,MA2IA,GA3IoBC,EAAAA,EAAAA,WAAS,UAAU,YACrCC,EAAW,QACXC,IAKA,MAAOC,EAAcC,IAAmBC,EAAAA,EAAAA,UAAS,KAC1CC,EAAeC,IAAoBF,EAAAA,EAAAA,UAAS,KAC5CG,EAAUC,IAAeJ,EAAAA,EAAAA,UAAS,KAClCK,EAASC,IAAcN,EAAAA,EAAAA,UAAS,KAChCO,EAASC,IAAcR,EAAAA,EAAAA,WAAS,IAChCS,EAAOC,IAAYV,EAAAA,EAAAA,aACnBW,EAAoBC,IAAyBZ,EAAAA,EAAAA,WAAS,IACtD,CAAEa,IAAeC,EAAAA,EAAAA,eAAc,WAAYC,EAAAA,cAC3C,CAAEC,IAAcF,EAAAA,EAAAA,eAAc,UAAWC,EAAAA,aAE1CjC,EAAMe,EAAQoB,SACdC,EACJC,aAAaC,QArCkB,qBAqCqB,QAChDC,GAAOC,EAAAA,EAAA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AAA,EAAY,QAIG,UAAnBpC,EACCT,EACE1B,EAAAA,cAACwE,EAAAA,aAAY,CACX9C,MAAOA,EACP+C,QAASA,KACP9C,OAAS+C,EAAU,IAGrBlD,EACFxB,EAAAA,cAAC2E,EAAAA,EAAU,KAAC,2BAEZ3E,EAAAA,cAACF,EAAS,CAACC,IAAKqB,IAGlBpB,EAAAA,cAACF,EAAS,CAACC,IAAKuB,KAGpBtB,EAAAA,cAAC4E,EAAAA,EAAa,KACZ5E,EAAAA,cAAC6E,EAAAA,EAAM,CACLC,UAAW9E,EAAAA,cAAC+E,EAAe,MAC3BjB,SAAUA,EACVtD,QAASC,IACPA,EAAMuE,iBACNlD,EAAYZ,EAAe,aAC3Be,EAAWlB,EAAc,aACzBkE,MAAM,uCAAuC,GAEhD,2BAIDjF,EAAAA,cAAC6E,EAAAA,EAAM,CACLrE,QAASA,KACP0E,IAAK9D,GAAYE,GACjBR,EAAQqE,OAAO,sBAAuB,UAAU,EAElDL,UAAW9E,EAAAA,cAACoF,EAAAA,GAAe,MAC3BtB,SAAUA,GACX,qBAID9D,EAAAA,cAAC6E,EAAAA,EAAM,CAACrE,QAASK,EAAawE,WAAS,GAAC,WAM5CrF,EAAAA,cAACJ,EAAc,CACbqE,KAAMrC,EACNsC,QAASA,KACPrC,GAAsB,EAAM,EAE9BM,eAAgBA,IAIxB,G","sources":["../../../node_modules/@mui/icons-material/esm/BookmarkAdd.js","components/ShareDialog.tsx"],"sourcesContent":["\"use client\";\n\nimport createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n  d: \"M21 7h-2v2h-2V7h-2V5h2V3h2v2h2zm-2 14-7-3-7 3V5c0-1.1.9-2 2-2h7c-.63.84-1 1.87-1 3 0 2.76 2.24 5 5 5 .34 0 .68-.03 1-.1z\"\n}), 'BookmarkAdd');","import React, { useState, useEffect, lazy } from 'react'\nimport { getSnapshot } from 'mobx-state-tree'\nimport { observer } from 'mobx-react'\nimport { Dialog, ErrorMessage } from '@jbrowse/core/ui'\nimport {\n  Button,\n  DialogActions,\n  DialogContent,\n  DialogContentText,\n  IconButton,\n  TextField,\n  Typography,\n} from '@mui/material'\nimport copy from 'copy-to-clipboard'\nimport { StringParam, useQueryParam } from 'use-query-params'\nimport { AbstractSessionModel } from '@jbrowse/core/util'\n\n// icons\nimport SettingsIcon from '@mui/icons-material/Settings'\nimport { ContentCopy as ContentCopyIcon } from '@jbrowse/core/ui/Icons'\nimport BookmarkAddIcon from '@mui/icons-material/BookmarkAdd'\n\n// locals\nimport { toUrlSafeB64 } from '../util'\nimport { shareSessionToDynamo } from '../sessionSharing'\n\nconst SettingsDialog = lazy(() => import('./ShareSettingsDialog'))\n\nconst SHARE_URL_LOCALSTORAGE_KEY = 'jbrowse-shareURL'\n\nfunction LinkField({ url }: { url: string }) {\n  return (\n    <TextField\n      label=\"URL\"\n      value={url}\n      InputProps={{ readOnly: true }}\n      variant=\"filled\"\n      fullWidth\n      onClick={event => {\n        const target = event.target as HTMLTextAreaElement\n        target.select()\n      }}\n    />\n  )\n}\n\nconst ShareDialog = observer(function ({\n  handleClose,\n  session,\n}: {\n  handleClose: () => void\n  session: AbstractSessionModel & { shareURL: string }\n}) {\n  const [sessionParam, setSessionParam] = useState('')\n  const [passwordParam, setPasswordParam] = useState('')\n  const [shortUrl, setShortUrl] = useState('')\n  const [longUrl, setLongUrl] = useState('')\n  const [loading, setLoading] = useState(true)\n  const [error, setError] = useState<unknown>()\n  const [settingsDialogOpen, setSettingsDialogOpen] = useState(false)\n  const [, setPassword] = useQueryParam('password', StringParam)\n  const [, setSession] = useQueryParam('session', StringParam)\n\n  const url = session.shareURL\n  const currentSetting =\n    localStorage.getItem(SHARE_URL_LOCALSTORAGE_KEY) || 'short'\n  const snap = getSnapshot(session)\n\n  useEffect(() => {\n    // eslint-disable-next-line @typescript-eslint/no-floating-promises\n    ;(async () => {\n      // checking !error allows retry when error state is cleared\n      if (error) {\n        return\n      }\n      try {\n        if (currentSetting === 'short') {\n          setLoading(true)\n          const locationUrl = new URL(window.location.href)\n          const result = await shareSessionToDynamo(snap, url, locationUrl.href)\n          const params = new URLSearchParams(locationUrl.search)\n          params.set('session', `share-${result.json.sessionId}`)\n          params.set('password', result.password)\n          locationUrl.search = params.toString()\n          setShortUrl(locationUrl.href)\n\n          setSessionParam(`share-${result.json.sessionId}`)\n          setPasswordParam(result.password)\n        } else {\n          const sess = await toUrlSafeB64(JSON.stringify(getSnapshot(session)))\n          const longUrl = new URL(window.location.href)\n          const longParams = new URLSearchParams(longUrl.search)\n          longParams.set('session', `encoded-${sess}`)\n          setSessionParam(`encoded-${sess}`)\n          longUrl.search = longParams.toString()\n          setLongUrl(longUrl.toString())\n        }\n      } catch (e) {\n        setError(e)\n      } finally {\n        setLoading(false)\n      }\n    })()\n  }, [currentSetting, error, session, url, snap])\n\n  const disabled = (currentSetting === 'short' && loading) || !!error\n  return (\n    <>\n      <Dialog\n        maxWidth=\"xl\"\n        open\n        onClose={handleClose}\n        title=\"JBrowse Shareable Link\"\n      >\n        <DialogContent>\n          <DialogContentText>\n            Copy the URL below to share your current JBrowse session.\n            <IconButton\n              onClick={() => {\n                setSettingsDialogOpen(true)\n              }}\n            >\n              <SettingsIcon />\n            </IconButton>\n          </DialogContentText>\n\n          {currentSetting === 'short' ? (\n            error ? (\n              <ErrorMessage\n                error={error}\n                onReset={() => {\n                  setError(undefined)\n                }}\n              />\n            ) : loading ? (\n              <Typography>Generating short URL...</Typography>\n            ) : (\n              <LinkField url={shortUrl} />\n            )\n          ) : (\n            <LinkField url={longUrl} />\n          )}\n        </DialogContent>\n        <DialogActions>\n          <Button\n            startIcon={<BookmarkAddIcon />}\n            disabled={disabled}\n            onClick={event => {\n              event.preventDefault()\n              setPassword(passwordParam, 'replaceIn')\n              setSession(sessionParam, 'replaceIn')\n              alert('Now press Ctrl+D (PC) or Cmd+D (Mac)')\n            }}\n          >\n            Create browser Bookmark\n          </Button>\n\n          <Button\n            onClick={() => {\n              copy(shortUrl || longUrl)\n              session.notify('Copied to clipboard', 'success')\n            }}\n            startIcon={<ContentCopyIcon />}\n            disabled={disabled}\n          >\n            Copy to Clipboard\n          </Button>\n\n          <Button onClick={handleClose} autoFocus>\n            Close\n          </Button>\n        </DialogActions>\n      </Dialog>\n\n      <SettingsDialog\n        open={settingsDialogOpen}\n        onClose={() => {\n          setSettingsDialogOpen(false)\n        }}\n        currentSetting={currentSetting}\n      />\n    </>\n  )\n})\n\nexport default ShareDialog\n"],"names":["createSvgIcon","d","SettingsDialog","lazy","LinkField","url","React","TextField","label","value","InputProps","readOnly","variant","fullWidth","onClick","event","target","select","observer","handleClose","session","sessionParam","setSessionParam","useState","passwordParam","setPasswordParam","shortUrl","setShortUrl","longUrl","setLongUrl","loading","setLoading","error","setError","settingsDialogOpen","setSettingsDialogOpen","setPassword","useQueryParam","StringParam","setSession","shareURL","currentSetting","localStorage","getItem","snap","getSnapshot","useEffect","locationUrl","URL","window","location","href","result","shareSessionToDynamo","params","URLSearchParams","search","set","json","sessionId","password","toString","sess","toUrlSafeB64","JSON","stringify","longParams","e","disabled","Dialog","maxWidth","open","onClose","title","DialogContent","DialogContentText","IconButton","SettingsIcon","ErrorMessage","onReset","undefined","Typography","DialogActions","Button","startIcon","BookmarkAddIcon","preventDefault","alert","copy","notify","ContentCopyIcon","autoFocus"],"sourceRoot":""}
\ No newline at end of file