{"version":3,"sources":["bundles/ipfs-provider.js","bundles/task.js","bundles/local-storage.js","lib/files.js","bundles/files/consts.js","icons/GlyphSmallCancel.js","icons/StrokeIpld.js","components/button/Button.js","components/checkbox/Checkbox.js","lib/tours.js","lib/sort.js","components/error/ErrorBoundary.js","components/box/Box.js","helpers/i8n.js","icons/StrokeFolder.js","settings/Title.js","bundles/files/utils.js","i18n.js","icons/StrokeCube.js","components/analytics-toggle/AnalyticsToggle.js","icons/GlyphSmallTick.js","components/details/Details.js","bundles/gateway.js","lib/count-dirs.js","bundles/files/actions.js","loader/ComponentLoader.js","bundles/config.js","bundles/files/selectors.js","bundles/files/index.js","bundles/enum.js","navigation/ipfs-logo-text-vert.svg","navigation/ipfs-logo-text-horiz.svg","icons/StrokeMarketing.js","icons/StrokeWeb.js","icons/StrokeSettings.js","navigation/NavBar.js","components/notify/Toast.js","components/notify/Notify.js","components/connected/Connected.js","components/tour/TourHelper.js","files/explore-form/FilesExploreForm.js","App.js","bundles/app-idle.js","bundles/node-bandwidth-chart.js","bundles/node-bandwidth.js","bundles/peers.js","bundles/peer-locations.js","constants/pinning.js","bundles/pinning.js","status/LoadableStatusPage.js","files/LoadableFilesPage.js","explore/LoadableStartExploringPage.js","explore/LoadableExplorePage.js","peers/LoadablePeersPage.js","settings/LoadableSettingsPage.js","settings/AnalyticsPage.js","welcome/LoadableWelcomePage.js","blank/BlankPage.js","bundles/routes.js","bundles/redirects.js","bundles/config-save.js","bundles/tours.js","bundles/experiments.js","bundles/notify.js","bundles/connected.js","bundles/retry-init.js","bundles/identity.js","lib/bundle-cache.js","bundles/ipfs-desktop.js","bundles/repo-stats.js","bundles/analytics.js","bundles/cli-tutor-mode.js","bundles/index.js","lib/dnd-backend.js","webpack:///./src/index.js?b635"],"names":["ACTIONS","Enum","readAPIAddressSetting","setting","readSetting","asAPIOptions","checkValidAPIAddress","value","asHttpClientOptions","asMultiaddress","asURL","URL","toString","_","multiaddr","parseHTTPClientOptions","readHTTPClientOptions","input","JSON","parse","url","username","password","headers","authorization","btoa","host","apiPath","protocol","port","ipfs","extra","getIpfs","actions","doTryInitIpfs","a","store","doInitIpfs","perform","context","apiAddress","getState","ipfsOptions","connectionTest","last","stats","bw","test","loadHttpClientModule","HttpClient","providers","httpClient","result","Error","doStopIpfs","stop","dispatch","type","doUpdateIpfsApiAddress","address","IPFS_API_ADDRESS_INVALID","writeSetting","IPFS_API_ADDRESS_UPDATED","payload","IPFS_API_ADDRESS_PENDING_FIRST_CONNECTION","pending","IPFS_STOPPED","NOTIFY_DISMISSED","succeeded","IPFS_CONNECT_SUCCEED","IPFS_CONNECT_FAILED","doDismissIpfsInvalidAddress","doGetPathInfo","path","files","stat","doCheckIfPinned","cid","first","pin","ls","paths","bundle","name","reducer","state","message","IPFS_INIT","task","status","ready","ok","provider","service","failed","invalidAddress","IPFS_API_ADDRESS_INVALID_DISMISS","pendingFirstConnection","update","getExtraArgs","selectIpfsReady","selectIpfsProvider","selectIpfsApiAddress","selectIpfsInvalidAddress","selectIpfsInitFailed","selectIpfsPendingFirstConnection","init","spawn","id","Symbol","start","performance","now","process","next","done","duration","error","window","localStorage","getItem","console","setItem","stringify","normalizeFiles","streams","file","push","filepath","webkitRelativePath","content","size","downloadSingle","gatewayUrl","apiUrl","filename","method","makeCIDFromFiles","object","new","template","patch","addLink","downloadMultiple","e","Promise","reject","getDownloadLink","length","getShareableLink","encodeURIComponent","humanSize","opts","filesize","spacer","String","fromCharCode","round","standard","base","bits","IS_MAC","navigator","userAgent","indexOf","FETCH","MOVE","COPY","DELETE","MAKE_DIR","WRITE","DOWNLOAD_LINK","SHARE_LINK","ADD_BY_PATH","PIN_ADD","PIN_REMOVE","PIN_LIST","SIZE_GET","PINS_SIZE_GET","DISMISS_ERRORS","CLEAR_ALL","WRITE_UPDATED","UPDATE_SORT","SORTING","BY_NAME","BY_SIZE","IGNORED_FILES","DEFAULT_STATE","pageContent","mfsSize","pinsSize","numberOfPins","pins","sorting","by","asc","finished","cliCmdKeys","DOWNLOAD_OBJECT_COMMAND","REMOVE_FILE_FROM_IPFS","UPDATE_IPFS_CONFIG","PIN_OBJECT","RENAME_IPFS_OBJECT","ADD_FILE","ADD_DIRECTORY","CREATE_NEW_DIRECTORY","FROM_IPFS","ADD_NEW_PEER","cliCmdPrefixes","cliCommandList","filePath","op","fileName","prefix","replace","trim","GlyphSmallCancel","props","viewBox","d","StrokeIpld","getButtonClassName","fill","bg","color","danger","disabled","Button","className","minWidth","children","style","classNames","defaultProps","Checkbox","label","checked","onChange","event","target","appTour","getSteps","t","placement","disableBeacon","styles","tooltipContent","padding","tooltipFooter","display","options","width","backgroundColor","arrowColor","textColor","zIndex","welcomeTour","Trans","primaryColor","statusTour","i18nKey","locale","filesTour","href","rel","peersTour","settingsTour","sortByName","dir","numeric","sensitivity","b","localeCompare","undefined","sortBySize","sortByProperty","property","ErrorBoundary","hasError","info","this","setState","log","root","Countly","q","Fallback","fallback","React","Component","ErrorIcon","Box","background","getJoyrideLocales","translate","back","close","skip","StrokeFolder","Title","Task","send","action","sortFiles","sortDir","nameSort","sizeSort","sort","cumulativeSize","infoFromPath","uriDecode","realPath","isMfs","isPins","isRoot","check","substr","startsWith","endsWith","substring","decodeURIComponent","Channel","queue","asyncIterator","pop","resolve","unshift","promise","ensureMFS","selectFilesPathInfo","localesList","Object","values","locales","i18n","use","ICU","Backend","LanguageDetector","backend","backends","LocalStorageBackend","HttpBackend","backendOptions","defaultVersion","version","expirationTime","loadPath","ns","defaultNS","fallbackNS","fallbackLng","zh","default","debug","DEBUG","react","wait","useSuspense","bindI18n","bindStore","nsMode","StrokeCube","ExampleRequest","QueryParams","params","searchParams","entries","map","key","AnalyticType","enabled","summary","exampleRequest","sourceLink","queryParams","sourceLinkLabel","useState","isOpen","setOpen","onClick","connect","analyticsActionsToRecord","analyticsConsent","doToggleConsent","doToggleAnalytics","analyticsEnabled","open","Fragment","summaryText","includes","GlyphSmallTick","Details","DEFAULT_GATEWAY","availableGateway","publicGateway","checkValidHttpUrl","checkViaImgSrc","imgUrl","hostname","Date","timeout","timer","clearTimeout","setTimeout","img","Image","onerror","onload","src","doSetAvailableGateway","doUpdatePublicGateway","selectAvailableGateway","gateway","selectPublicGateway","findUniqueDirectories","res","Set","dirname","add","countDirs","f","filter","p","directories","forEach","fileFromStats","pinned","isParent","split","Boolean","cidOrPath","realMfsPath","memStat","memoize","hashOrPath","CID","getRawPins","getPinCIDs","getPins","importFiles","doPinsFetch","all","cids","doFilesFetch","isReady","isConnected","selectIpfsConnected","isFetching","selectFilesIsFetching","doFetch","fetched","resolvedPath","time","read","cat","dirStats","selectFilesSorting","doFilesWrite","source","$","basename","slice","totalSize","reduce","prev","progress","offset","uploaded","added","numberOfFiles","numberOfDirs","expectedResponseCount","assign","code","dst","join","cp","doFilesDelete","removeLocally","removeRemotely","remoteServices","tryAsync","fn","rm","recursive","remote","lastIndexOf","doUpdateHash","doFilesAddPath","srcPath","doFilesDownloadLink","selectApiUrl","selectGatewayUrl","doFilesShareLink","doFilesMove","mv","page","selectFiles","pagePath","doFilesCopy","doFilesMakeDir","mkdir","parents","doFilesPin","doFilesUnpin","doFilesDismissErrors","doFilesNavigateTo","link","doFilesUpdateSorting","doFilesClear","doPinsStatsGet","doFilesSizeGet","doGetFileSizeThroughCid","channel","addAll","wrapWithDirectory","then","dirCount","absPath","parent","parentPath","parentInfo","upper","ComponentLoader","margin","xmlns","strokeDasharray","stroke","strokeWidth","fillOpacity","x1","y1","x2","y2","gradientUnits","stopColor","LOCAL_HOSTNAMES","createAsyncResourceBundle","staleAfter","persist","checkIfOnline","getPromise","config","getAll","rawConf","conf","Buffer","isBuffer","getURLFromAddress","gw","localUrl","checkIfSubdomainGatewayUrlIsAccessible","checkIfGatewayUrlIsAccessible","Array","isArray","Addresses","toUri","assumeHttp","selectConfigObject","createSelector","configStr","selectAvailableGatewayUrl","selectBootstrapPeers","Bootstrap","selectIsConfigBlocked","errorType","reactConfigFetch","shouldUpdate","ipfsReady","actionCreator","fetch","selectors","selectCurrentDirectorySize","curr","selectPins","selectFilesSize","selectPinsSize","selectNumberOfPins","some","selectShowLoadingAnimation","find","selectFilesPending","s","selectFilesFinished","selectFilesHasError","selectFilesErrors","selectHasUpperDirectory","routeInfo","sorts","updateJob","createFilesBundle","pullPending","rest","end","tasks","from","variants","create","StrokeMarketing","StrokeWeb","StrokeSettings","NavLink","to","icon","alternative","Svg","hash","location","active","anchorClass","classnames","svgClass","role","title","whiteSpace","withTranslation","codeUrl","bugsUrl","gitRevision","revisionUrl","webUiVersion","webUiVersionUrl","overflowY","height","ipfsLogoTextVert","alt","ipfsLogoTextHoriz","Toast","onDismiss","left","transform","notify","notifyI18nKey","doNotifyDismiss","show","ipfsConnected","doSetIsNodeInfoOpen","pickTitleKey","pickColor","opacity","aria-hidden","doEnableTours","aria-label","FilesExploreForm","hideExplore","bind","onKeyDown","onBrowse","onInspect","evt","preventDefault","isValid","isIPFS","data-id","inputClass","borderRadius","placeholder","aria-describedby","App","addFiles","filesPromise","filesPathInfo","isFilesPage","pattern","addAtPath","handleJoyrideCb","data","doDisableTooltip","Page","route","doExploreUserProvidedPath","connectDropTarget","canDrop","isOver","showTooltip","getNavHelper","doUpdateUrl","minHeight","WebkitAppRegion","paddingTop","paddingBottom","run","steps","callback","scrollToFirstStep","disableOverlay","AppWithDropTarget","DropTarget","NativeTypes","FILE","drop","monitor","didDrop","dropTarget","defaults","idleTimeout","idleAction","stopWhenTabInactive","ricOptions","createAppIdle","spec","idleDispatcher","stopWhenInactive","debounce","raf","ric","subscribe","createNodeBandwidthChart","windowSize","in","out","chartData","selectNodeBandwidthChartData","nodeBandwidthChart","doUpdateNodeBandwidthChartData","timestamp","startIndex","concat","x","y","parseInt","rateIn","toFixed","rateOut","findIndex","reactUpdateNodeBandwidthChartData","lastSuccess","args","actionBaseType","ms","seconds","retryAfter","selectNodeBandwidthEnabled","nodeBandwidth","selectNodeBandwidthLastSuccess","reactNodeBandwidthFetchWhenIdle","swarmPeersTTL","swarm","peers","verbose","asyncResourceReducer","asyncResult","selectedPeers","selectPeersCount","doConnectSwarm","addr","reactPeersFetchWhenIdle","reactPeersFetchWhenActive","appTime","peersInfo","isLoading","selectSelectedPeers","doSetSelectedPeers","peer","UPDATE_EVERY","geoipVersion","dependencies","isNonHomeIPv4","toLocationString","loc","country","country_name","city","parseConnection","protoNames","parseLatency","latency","exec","getPublicIP","identity","addresses","maddr","Multiaddr","nodeAddress","ip","isV4Format","isV6Format","isPrivate","isPrivateAndNearby","publicIP","isNearby","cidrSubnet","contains","PeerLocationResolver","geoipCache","getConfiguredCache","maxAge","weeks","cache","failedAddrs","HLRU","PQueue","concurrency","autoStart","geoipLookupPromises","Map","pass","optimizedPeerSet","peerId","ipv4Tuple","stringTuples","ipv4Addr","has","get","set","geoip","lookup","delete","sortedPeersByLatency","createPeersLocations","peerLocResolver","selectPeers","findLocations","reactPeerLocationsFetch","selectPeerLocationsForSwarm","locations","locationObj","flagCode","country_code","coordinates","longitude","latitude","connection","direction","protocols","Protocol","selectPeersCoordinates","previous","hasFoundACloseCoordinate","previousCoordinates","currentX","currentY","peerIds","pinningServiceTemplates","apiEndpoint","visitServiceUrl","parseService","remoteServiceTemplates","endpoint","mfsPolicyEnableFlag","autoUpload","parsedService","online","pinCount","serviceName","uniqueCidBatches","arrayOfCids","array","i","chunk","pinningBundle","pinningServices","remotePins","notRemotePins","arePinningServicesSupported","adds","removals","r","rid","oldServices","newServices","withPinStats","oldStats","newStats","doFetchRemotePins","selectPinningServices","allCids","cacheId2Cid","selectRemotePins","selectNotRemotePins","allSettled","skipCids","cidChunk","cidsToCheck","notPins","pinCid","notPinCid","pinning","doSelectRemotePinsForFile","pinningServicesNames","string","pinId","doFetchPinningServices","commands","isPinRemotePresent","Subcommands","c","Name","selectRemoteServiceTemplates","offlineListOfServices","fullListOfServices","fullRemoteServices","selectArePinningServicesSupported","selectPinningServicesDefaults","nickname","doSetPinning","services","wasLocallyPinned","previousRemotePins","pinLocally","shouldPin","doAddPinningService","secretApiKey","replaceAll","doRemovePinningService","doSetAutoUploadForService","configName","previousPolicy","LoadableStatusPage","Loadable","LoadableFilesPage","LoadableStartExploringPage","LoadableExplorePage","LoadablePeersPage","LoadableSettingsPage","Helmet","AnalyticsToggle","LoadableWelcomePage","BlankPage","createRouteBundle","StartExploringPage","ExplorePage","FilesPage","PeersPage","AnalyticsPage","SettingsPage","WelcomePage","StatusPage","routeInfoSelector","redirectsBundle","reactToEmptyHash","reactToIpfsConnectionFail","doSaveConfig","selectConfigIsSaving","doPerformSaveConfig","attempt","obj","doMarkConfigAsOutdated","isSaving","CONFIG_SAVE","errorMessage","lastError","config_save","selectConfigSaveLastSuccess","selectConfigSaveLastError","toursBundle","tooltip","doDisableTours","selectTours","tours","selectToursEnabled","selectShowTooltip","EXPERIMENTS","mergeState","keys","toggleEnabled","unblock","blocked","block","selectExperimentsState","experiments","selectExperiments","doExpToggleAction","EXPERIMENTS_TOGGLE","experimentsBundle","persistActions","EXPERIMENTS_UPDATE_STATE","defaultState","eventId","match","EXP_ACTIONS","EXP_TOGGLE_FAILED","selectNotify","selectNotifyI18nKey","FILES_ACTIONS","reactNotifyOkDismiss","selectConnectedLastError","connected","selectIsNodeInfoOpen","isNodeInfoOpen","retryInit","startedAt","failedAt","selectInitStartedAt","selectInitFailedAt","reactConnectionInitRetry","Infinity","selectIdentityLastSuccess","reactIdentityFetch","idLastSuccess","connLastError","bundleCache","baseSelectors","selectIsIpfsDesktop","ipfsDesktop","selectDesktopCountlyActions","desktopSelectors","selectDesktopVersion","selectDesktopCountlyDeviceId","countlyDeviceId","countlyActions","desktopActions","doDesktopAddConsent","consent","addConsent","doDesktopRemoveConsent","removeConsent","doDesktopUpdateLanguage","language","updateLanguage","repo","selectRepoSize","repoStats","repoSize","selectRepoNumObjects","numObjects","reactRepoStatsFetch","DESKTOP","ASYNC_ACTIONS_TO_RECORD","INIT","CONIFG","FILES","EXP","DESKTOP_SETTING_TOGGLE","consentGroups","safe","selectAnalytics","analytics","selectAnalyticsConsent","selectAnalyticsEnabled","selectAnalyticsAskToEnable","lastEnabledAt","lastDisabledAt","selectAnalyticsActionsToRecord","isDesktop","doEnableAnalytics","doDisableAnalytics","opt_out","opt_in","doRemoveConsent","doAddConsent","item","parseTask","parseTaskResult","parseToggleResult","changeCase","constantCase","createAnalyticsBundle","countlyUrl","countlyAppKey","appVersion","appGitRevision","ANALYTICS_ENABLED","ANALYTICS_DISABLED","ANALYTICS_ADD_CONSENT","ANALYTICS_REMOVE_CONSENT","require_consent","app_key","app_version","subscribeToSelectors","getMiddleware","count","dur","reactIsCliTutorModeEnabled","isCliTutorModeEnabled","isEnabled","selectIsCliTutorModeEnabled","cliTutorMode","selectIsCliTutorModalOpen","showCliTutorModal","selectCliOptions","cliOptions","doToggleCliTutorMode","doSetCliOptions","doOpenCliTutorModal","openModal","composeBundles","createCacheBundle","cacheFn","appIdle","ipfsProvider","identityBundle","routesBundle","filesBundle","exploreBundle","configBundle","configSaveBundle","gatewayBundle","nodeBandwidthBundle","nodeBandwidthChartBundle","peersBundle","peerLocationsBundle","notifyBundle","connectedBundle","retryInitBundle","cliTutorModeBundle","createBackend","manager","HTML5Backend","handler","handleTopDropCapture","call","currentNativeSource","dataTransfer","items","every","kind","getFilesFromDataTransferItems","initialData","getStore","ReactDOM","render","I18nextProvider","DndProvider","DndBackend","document","getElementById"],"mappings":"gUAkEaA,EAAUC,IAAU,CAC/B,YACA,eACA,2BACA,4CACA,2BACA,mCAEA,sBACA,uBACA,qBAsFIC,EAAwB,WAC5B,IAAMC,EAAUC,YAAY,WAC5B,OAAkB,MAAXD,EAAkB,KAAOE,EAAaF,IAOlCG,EAAuB,SAACC,GACnC,OAA8B,MAAvBF,EAAaE,IAOhBF,EAAe,SAACE,GAAD,OAAWC,EAAoBD,IAAUE,EAAeF,IAAUG,EAAMH,IAQvFG,EAAQ,SAACH,GACb,IACE,OAAO,IAAII,IAAIJ,GAAOK,WACtB,MAAOC,GACP,OAAO,OAULJ,EAAiB,SAACF,GAEtB,G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ASvF,GAAY3L,MAEvBmR,GAAQ,CAAEhY,YAAa,MACvBiY,IACAC,GACAC,GACAzJ,GACAgB,GACA0I,eACAC,eACAC,KACAC,GACAC,KACAC,GACAC,KACAC,GACAC,KACAjP,GACAkP,GACAC,GACAC,GACAlI,GACA8B,GACAkB,GACAmF,GACAhD,GAAsB,K,wCCXTiD,GAfO,SAACC,GACrB,IAAMvvB,EAAUwvB,YAAaD,GACvBE,EAAUzvB,EAAQ0vB,qBAWxB,OAVA1vB,EAAQ0vB,qBAAuB,SAAC/1B,GAE9B,GADA81B,EAAQE,KAAK3vB,EAASrG,GAClBqG,EAAQ4vB,qBAAuBj2B,EAAMk2B,aAAaC,MAAO,CAE3D,GAAI,aAAIn2B,EAAMk2B,aAAaC,OAAOC,OAAM,kBAAuB,WAAvB,EAAGC,QAA+B,OAE1E,IAAM9b,EAAe+b,yCAA8Bt2B,EAAMk2B,aAAaC,OACtE9vB,EAAQ4vB,oBAAoB7D,KAAK7X,aAAeA,IAG7ClU,G,8CCvBT,8BAAAhT,EAAA,sEAC4B67B,GAAYhc,SADxC,OACQqjB,EADR,OAKQjjC,EAAQkjC,GAASD,GACvBE,IAASC,OACP,cAAC,IAAD,CAAUpjC,MAAOA,EAAjB,SACE,cAACqjC,GAAA,EAAD,CAAiB3wB,KAAMA,KAAvB,SACE,cAAC4wB,GAAA,EAAD,CAAavwB,QAASwwB,GAAtB,SACE,cAAC,EAAD,UAINC,SAASC,eAAe,SAd5B,4C,sBAFAp+B,QAAQiK,IAAR,yBAHmBzK,SAGnB,iEAFoBA,Y,oCAsBpBu+B,K","file":"static/js/main.ab164c00.chunk.js","sourcesContent":["import multiaddr from 'multiaddr'\nimport HttpClient from 'ipfs-http-client'\n// @ts-ignore\nimport { getIpfs, providers } from 'ipfs-provider'\nimport first from 'it-first'\nimport last from 'it-last'\nimport * as Enum from './enum'\nimport { perform } from './task'\nimport { readSetting, writeSetting } from './local-storage'\n\n/* TODO: restore when  no longer bundle standalone ipld with ipld-explorer\n * context: https://github.com/ipfs/ipld-explorer-components/pull/289\n// @ts-ignore\nimport ipldGit from 'ipld-git'\n// @ts-ignore\nimport ipldEthereum from 'ipld-ethereum'\n*/\n\n/**\n * @typedef {import('ipfs').IPFSService} IPFSService\n * @typedef {import('cids')} CID\n * @typedef {import('ipfs').FileStat} FileStat\n * @typedef {'httpClient'|'jsIpfs'|'windowIpfs'|'webExt'} ProviderName\n * @typedef {Object} Model\n * @property {null|string|HTTPClientOptions} apiAddress\n * @property {null|ProviderName} provider\n * @property {boolean} failed\n * @property {boolean} ready\n * @property {boolean} invalidAddress\n * @property {boolean} pendingFirstConnection\n *\n *\n * @typedef {import('./task').Perform<'IPFS_INIT', Error, InitResult, void>} Init\n * @typedef {Object} Stopped\n * @property {'IPFS_STOPPED'} type\n *\n * @typedef {Object} AddressUpdated\n * @property {'IPFS_API_ADDRESS_UPDATED'} type\n * @property {string|HTTPClientOptions} payload\n *\n * @typedef {Object} AddressInvalid\n * @property {'IPFS_API_ADDRESS_INVALID'} type\n *\n * @typedef {Object} Dismiss\n * @property {'IPFS_API_ADDRESS_INVALID_DISMISS'} type\n *\n * @typedef {Object} ConnectSuccess\n * @property {'IPFS_CONNECT_SUCCEED'} type\n *\n * @typedef {Object} ConnectFail\n * @property {'IPFS_CONNECT_FAILED'} type\n *\n * @typedef {Object} DismissError\n * @property {'NOTIFY_DISMISSED'} type\n *\n * @typedef {Object} PendingFirstConnection\n * @property {'IPFS_API_ADDRESS_PENDING_FIRST_CONNECTION'} type\n * @property {boolean} pending\n *\n * @typedef {Object} InitResult\n * @property {ProviderName} provider\n * @property {IPFSService} ipfs\n * @property {string} [apiAddress]\n * @typedef {Init|Stopped|AddressUpdated|AddressInvalid|Dismiss|PendingFirstConnection|ConnectFail|ConnectSuccess|DismissError} Message\n */\n\nexport const ACTIONS = Enum.from([\n  'IPFS_INIT',\n  'IPFS_STOPPED',\n  'IPFS_API_ADDRESS_UPDATED',\n  'IPFS_API_ADDRESS_PENDING_FIRST_CONNECTION',\n  'IPFS_API_ADDRESS_INVALID',\n  'IPFS_API_ADDRESS_INVALID_DISMISS',\n  // Notifier actions\n  'IPFS_CONNECT_FAILED',\n  'IPFS_CONNECT_SUCCEED',\n  'NOTIFY_DISMISSED'\n])\n\n/**\n * @param {Model} state\n * @param {Message} message\n * @returns {Model}\n */\nconst update = (state, message) => {\n  switch (message.type) {\n    case ACTIONS.IPFS_INIT: {\n      const { task } = message\n      switch (task.status) {\n        case 'Init': {\n          return { ...state, ready: false }\n        }\n        case 'Exit': {\n          const { result } = task\n          if (result.ok) {\n            const { provider, apiAddress, ipfs: service } = result.value\n            ipfs = service\n            return {\n              ...state,\n              ready: true,\n              failed: false,\n              provider,\n              apiAddress: apiAddress || state.apiAddress\n            }\n          } else {\n            return {\n              ...state,\n              ready: false,\n              failed: true\n            }\n          }\n        }\n        default: {\n          return state\n        }\n      }\n    }\n    case ACTIONS.IPFS_STOPPED: {\n      return { ...state, ready: false, failed: false }\n    }\n    case ACTIONS.IPFS_API_ADDRESS_UPDATED: {\n      return { ...state, apiAddress: message.payload, invalidAddress: false }\n    }\n    case ACTIONS.IPFS_API_ADDRESS_INVALID: {\n      return { ...state, invalidAddress: true }\n    }\n    case ACTIONS.IPFS_API_ADDRESS_INVALID_DISMISS: {\n      return { ...state, invalidAddress: true }\n    }\n    case ACTIONS.IPFS_API_ADDRESS_PENDING_FIRST_CONNECTION: {\n      const { pending } = message\n      return { ...state, pendingFirstConnection: pending }\n    }\n    case ACTIONS.IPFS_CONNECT_SUCCEED: {\n      return { ...state, failed: false }\n    }\n    case ACTIONS.IPFS_CONNECT_FAILED: {\n      return { ...state, failed: true }\n    }\n    default: {\n      return state\n    }\n  }\n}\n\n/**\n * @returns {Model}\n */\nconst init = () => {\n  return {\n    apiAddress: readAPIAddressSetting(),\n    provider: null,\n    failed: false,\n    ready: false,\n    invalidAddress: false,\n    pendingFirstConnection: false\n  }\n}\n\n/**\n * @returns {HTTPClientOptions|string|null}\n */\nconst readAPIAddressSetting = () => {\n  const setting = readSetting('ipfsApi')\n  return setting == null ? null : asAPIOptions(setting)\n}\n\n/**\n * @param {string|object} value\n * @returns {boolean}\n */\nexport const checkValidAPIAddress = (value) => {\n  return asAPIOptions(value) != null\n}\n\n/**\n * @param {string|object} value\n * @returns {HTTPClientOptions|string|null}\n */\nconst asAPIOptions = (value) => asHttpClientOptions(value) || asMultiaddress(value) || asURL(value)\n\n/**\n * Attempts to turn cast given value into URL.\n * Return either string instance or `null`.\n * @param {any} value\n * @returns {string|null}\n */\nconst asURL = (value) => {\n  try {\n    return new URL(value).toString()\n  } catch (_) {\n    return null\n  }\n}\n\n/**\n * Attempts to turn cast given value into Multiaddr.\n * Return either string instance or `null`.\n * @param {any} value\n * @returns {string|null}\n */\nconst asMultiaddress = (value) => {\n  // ignore empty string, as it will produce '/'\n  if (value != null && value !== '') {\n    try {\n      return multiaddr(value).toString()\n    } catch (_) {}\n  }\n  return null\n}\n\n/**\n * @typedef {Object} HTTPClientOptions\n * @property {string} [url]\n * @property {string} [host]\n * @property {string} [port] - (e.g. '443', or '80')\n * @property {string} [protocol] - (e.g 'https', 'http')\n * @property {string} [apiPath] - ('/api/v0' by default)\n * @property {Object<string, string>} [headers]\n */\n\n/**\n * @typedef {Object} IPFSProviderHttpClientOptions\n * @property {Object} [ipld]\n * @property {string|undefined} [url]\n */\n\n/**\n * Attempts to turn parse given input as an options object for ipfs-http-client.\n * @param {string|object} value\n * @returns {HTTPClientOptions|null}\n */\nconst asHttpClientOptions = (value) =>\n  typeof value === 'string' ? parseHTTPClientOptions(value) : readHTTPClientOptions(value)\n\n/**\n *\n * @param {string} input\n */\nconst parseHTTPClientOptions = (input) => {\n  // Try parsing and reading as json\n  try {\n    return readHTTPClientOptions(JSON.parse(input))\n  } catch (_) {}\n\n  // turn URL with inlined basic auth into client options object\n  try {\n    const url = new URL(input)\n    const { username, password } = url\n    if (username && password) {\n      url.username = url.password = ''\n      return {\n        url: url.toString(),\n        headers: {\n          authorization: `Basic ${btoa(username + ':' + password)}`\n        }\n      }\n    }\n  } catch (_) { }\n\n  return null\n}\n\n/**\n * @param {Object<string, any>} value\n * @returns {HTTPClientOptions|null}\n */\nconst readHTTPClientOptions = (value) => {\n  // https://github.com/ipfs/js-ipfs/tree/master/packages/ipfs-http-client#importing-the-module-and-usage\n  if (value && (!!value.url || value.host || value.apiPath || value.protocol || value.port || value.headers)) {\n    return value\n  } else {\n    return null\n  }\n}\n\n/** @type {IPFSService|null} */\nlet ipfs = null\n\n/**\n * @typedef {typeof extra} Extra\n */\nconst extra = {\n  getIpfs () {\n    return ipfs\n  }\n}\n\n/**\n * @typedef {import('redux-bundler').Selectors<typeof selectors>} Selectors\n */\n\nconst selectors = {\n  /**\n   * @param {State} state\n   */\n  selectIpfsReady: state => state.ipfs.ready,\n  /**\n   * @param {State} state\n   */\n  selectIpfsProvider: state => state.ipfs.provider,\n  /**\n   * @param {State} state\n   */\n  selectIpfsApiAddress: state => state.ipfs.apiAddress,\n  /**\n   * @param {State} state\n   */\n  selectIpfsInvalidAddress: state => state.ipfs.invalidAddress,\n  /**\n   * @param {State} state\n   */\n  selectIpfsInitFailed: state => state.ipfs.failed,\n  /**\n   * @param {State} state\n   */\n  selectIpfsPendingFirstConnection: state => state.ipfs.pendingFirstConnection\n}\n\n/**\n * @typedef {import('redux-bundler').Actions<typeof actions>} Actions\n * @typedef {Selectors & Actions} Ext\n * @typedef {import('redux-bundler').Context<State, Message, Ext, Extra>} Context\n */\n\nconst actions = {\n  /**\n   * @returns {function(Context):Promise<boolean>}\n   */\n  doTryInitIpfs: () => async ({ store }) => {\n    // There is a code in `bundles/retry-init.js` that reacts to `IPFS_INIT`\n    // action and attempts to retry.\n    try {\n      await store.doInitIpfs()\n      return true\n    } catch (_) {\n      // Catches connection errors like timeouts\n      return false\n    }\n  },\n  /**\n   * @returns {function(Context):Promise<InitResult>}\n   */\n  doInitIpfs: () => perform('IPFS_INIT',\n    /**\n    * @param {Context} context\n    * @returns {Promise<InitResult>}\n    */\n    async (context) => {\n      const { apiAddress } = context.getState().ipfs\n      /** @type {IPFSProviderHttpClientOptions} */\n      let ipfsOptions = {\n        /* TODO: restore when  no longer bundle standalone ipld with ipld-explorer\n        * context: https://github.com/ipfs/ipld-explorer-components/pull/289\n        ipld: {\n          formats: [\n            ...Object.values(ipldEthereum),\n            ipldGit\n          ]\n        }\n        */\n      }\n\n      if (typeof apiAddress === 'string') {\n        ipfsOptions = {\n          ...ipfsOptions,\n          url: apiAddress\n        }\n      } else {\n        ipfsOptions = {\n          ...apiAddress,\n          ...ipfsOptions\n        }\n      }\n\n      const result = await getIpfs({\n        // @ts-ignore - TS can't seem to infer connectionTest option\n        connectionTest: async (ipfs) => {\n          // ipfs connection is working if can we fetch the bw stats.\n          // See: https://github.com/ipfs-shipyard/ipfs-webui/issues/835#issuecomment-466966884\n          try {\n            await last(ipfs.stats.bw())\n          } catch (err) {\n            if (!/bandwidth reporter disabled in config/.test(err)) {\n              throw err\n            }\n          }\n\n          return true\n        },\n        loadHttpClientModule: () => HttpClient,\n        providers: [\n          providers.httpClient(ipfsOptions)\n        ]\n      })\n\n      if (!result) {\n        throw Error(`Could not connect to the IPFS API (${apiAddress})`)\n      } else {\n        return result\n      }\n    }),\n  /**\n   * @returns {function(Context):Promise<void>}\n   */\n  doStopIpfs: () => async (context) => {\n    if (ipfs) {\n      await ipfs.stop()\n      context.dispatch({ type: 'IPFS_STOPPED' })\n    }\n  },\n\n  /**\n   * @param {string} address\n   * @returns {function(Context):Promise<boolean>}\n   */\n  doUpdateIpfsApiAddress: (address) => async (context) => {\n    const apiAddress = asAPIOptions(address)\n    if (apiAddress == null) {\n      context.dispatch({ type: ACTIONS.IPFS_API_ADDRESS_INVALID })\n      return false\n    } else {\n      await writeSetting('ipfsApi', apiAddress)\n      context.dispatch({ type: ACTIONS.IPFS_API_ADDRESS_UPDATED, payload: apiAddress })\n\n      // Sends action to indicate we're going to try to update the IPFS API address.\n      // There is logic to retry doTryInitIpfs in bundles/retry-init.js, so\n      // we're triggering the PENDING_FIRST_CONNECTION action here to avoid blocking\n      // the UI while we automatically retry.\n      context.dispatch({\n        type: ACTIONS.IPFS_API_ADDRESS_PENDING_FIRST_CONNECTION,\n        pending: true\n      })\n      context.dispatch({\n        type: ACTIONS.IPFS_STOPPED\n      })\n      context.dispatch({\n        type: ACTIONS.NOTIFY_DISMISSED\n      })\n      const succeeded = await context.store.doTryInitIpfs()\n      if (succeeded) {\n        context.dispatch({\n          type: ACTIONS.IPFS_CONNECT_SUCCEED\n        })\n      } else {\n        context.dispatch({\n          type: ACTIONS.IPFS_CONNECT_FAILED\n        })\n      }\n      context.dispatch({\n        type: ACTIONS.IPFS_API_ADDRESS_PENDING_FIRST_CONNECTION,\n        pending: false\n      })\n      return succeeded\n    }\n  },\n\n  /**\n   * @returns {function(Context):void}\n   */\n  doDismissIpfsInvalidAddress: () => (context) => {\n    context.dispatch({ type: 'IPFS_API_ADDRESS_INVALID_DISMISS' })\n  },\n\n  /**\n   * @param {string} path\n   * @returns {function(Context):Promise<FileStat>}\n   */\n  doGetPathInfo: (path) => async () => {\n    if (ipfs) {\n      return await ipfs.files.stat(path)\n    } else {\n      throw Error('IPFS is not initialized')\n    }\n  },\n\n  /**\n   * @param {CID} cid\n   * @returns {function(Context):Promise<boolean>}\n   */\n  doCheckIfPinned: (cid) => async () => {\n    if (ipfs == null) {\n      return false\n    }\n\n    try {\n      const value = await first(ipfs.pin.ls({ paths: [cid], type: 'recursive' }))\n      return !!value\n    } catch (_) { return false }\n  }\n}\n\n/**\n * @typedef {Actions & Selectors} IPFSProviderStore\n * @typedef {Object} State\n * @property {Model} ipfs\n */\n\nconst bundle = {\n  name: 'ipfs',\n  /**\n   * @param {Model|void} state\n   * @param {Message} message\n   * @returns {Model}\n   */\n  reducer: (state, message) => update(state == null ? init() : state, message),\n  getExtraArgs () {\n    return extra\n  },\n  ...selectors,\n  ...actions\n}\n\nexport default bundle\n","// @ts-check\n\n/**\n  * @template State, Message, Ext, Extra\n  * @typedef {import('redux-bundler').Context<State, Message, Ext, Extra>} BundlerContext\n  */\n\n/**\n * A Result is the result of a computation that may fail.\n *\n * @template X = Error\n * @template T\n * @typedef {{ok:false, error:X} | {ok:true, value: T}} Result\n */\n\n/**\n * Represents task in it's initialization phase.\n *\n * @template Init\n * @typedef {Object} InitState\n * @property {'Init'} status\n * @property {Symbol} id - Unique identifier of this task.\n * @property {Init} init - Initialization paramater provided on spawn.\n */\n\n/**\n * Reperesents task in it's completion phase.\n *\n * @template Failure = Error - Type of `result.error` if failed.\n * @template Success - Type of `result.value` if succeeded.\n * @typedef {Object} ExitState\n * @property {'Exit'} status\n * @property {Symbol} id - Unique identifier of this task.\n * @property {number} duration - Time spend from initialization to completion.\n * @property {Result<Failure, Success>} result - Result of the task.\n */\n\n/**\n * Type reperesenting a state of the performed task. It is state machine\n * representing task state that will initial be in `InitState` and on completion\n * transition to `ExitState`.\n *\n * @template Failure = Error\n * @template Success\n * @template Init = void\n * @typedef {InitState<Init>|ExitState<Failure, Success>} PerformState\n */\n\n/**\n * Type representing actions dispatched when performing a task.\n *\n * @template {string} Type - String literal used as `action.type`.\n * @template Failure - Type of the `result.error` for a failed task.\n * @template Success - Type of the `result.value` for the successfull task.\n * @template Init - Initialization parameter passed to perform.\n * @typedef {Object} Perform\n * @property {Type} type\n * @property {PerformState<Failure, Success, Init>} task\n */\n\n/**\n * Takes the action `type`, a `task` (in form of async function) and an optional\n * `init` parameters to produce a `doX` style action creator. On exectuion\n * `{ type, task }` actions will be dispatched, where `task` represents a state\n * (machine) of the executed task, which proceeds as follows:\n *\n * - At the start of the execution, task will have an `Init` status, which is\n *  dispatched just once: `{ status: 'Init' id: Symbol, init: Init}`. An `id`\n *  is unique identifier of the task (kind of like PID) and `init` is an\n *  optional parameter that was passed to `perform` (Which can be useful in\n *  certain reducers and middleware that need to keep track of state).\n *\n * - Once task is finishes, action with status `Exit` is dispatced just once:\n *   `{ status: 'Exit', id: Symbol, duration: number, result: Result<Error, Success> }`\n *   with some new new fields:\n *     - `duration` - Is a time it took a task from `Init` to `Exit` in ms.\n *     - `result` - Is a result of the task. On succesful completion it is\n *       `{ok:true, value:Success}` (value is return value of the async\n *       function). On failure it is `{ok:false, error:Error}` (`error` is an\n *       expception thrown, or a rejection reason of the promise).\n *\n * @template {string} Type - Corresponds to `action.type` for all the actions\n * @template Success - Type of the `action.task.result.vaule` when task is\n * complete successfully. It is also a value of the promise returned by\n * running `store.doX` created by this decorator.\n * @template Init - Type of the initialization paramater.\n * @template State - Type of the `context.getState()` for this task.\n * @template {Object} StoreExt - Store extension.\n * @template {Object} ContextExt - Context extension\n * @template {BundlerContext<State, Perform<Type, Error, Success, Init>, StoreExt, ContextExt>} Context\n *\n * @param {Type} type - Type of the actions this will dispatch.\n * @param {(context:Context) => Promise<Success>} task\n * @param {Init[]} rest\n * @returns {(context:Context) => Promise<Success>}\n */\nexport const perform = (type, task, ...[init]) =>\n  // eslint-disable-next-line require-yield\n  spawn(type, async function * (context) {\n    return await task(context)\n  }, init)\n\n/**\n * @template Message\n * @typedef {Object} SendState\n * @property {Symbol} id\n * @property {'Send'} status\n * @property {Message} message\n */\n\n/**\n * Type reperesenting a state of the spawned task. It is state machine that will\n * transition from InitState -> SendState -> ExitState. It is guaranteed that\n * spawned task will be in `InitState` and `ExitState` exactly once. It is also\n * guaranteed that task can be in `SendState` 0 or 1 or more times between\n * `InitState` and `ExitStates`.\n *\n * @template Message\n * @template Fail\n * @template Success\n * @template Input = void\n * @typedef {InitState<Input>|SendState<Message>|ExitState<Fail, Success>} SpawnState\n */\n\n/**\n * Represents actions that will be dispatched by the `spawn`-ed task.\n * This is more advanced superset of `Perform` as spawned tasks can send\n * messages during execution.\n *\n * @template {string} Name\n * @template Message - Type of messages it produces\n * @template Fail - Type of the failure error\n * @template Success - Type of the success value\n * @template Init = void - Initial type\n * @typedef {Object} Spawn\n * @property {Name} type\n * @property {SpawnState<Message, Fail, Success, Init>} task\n */\n\n/**\n * This is more advanced form of `perform`, which can be used to execute tasks\n * that need to send messages (that turn into dispatched actions) during\n * execution.\n *\n * It takes the action `type`, a `task` (in form of async generator) and an\n * optional `init` parameters to produce a `doX` style action creator. On\n * exectuion `{ type, task }` actions will be dispatched, where `task`\n * represents a state (machine) of the executed task, which proceeds as follows:\n *\n * - At the start of the execution, task will have an `Init` status, which is\n *  dispatched just once: `{ status: 'Init' id: Symbol, init: Init}`. An `id`\n *  is unique identifier of the task (kind of like PID) and `init` is an\n *  optional parameter that was passed to `perform` (Which can be useful in\n *  certain reducers and middleware that need to keep track of state).\n *\n * - During execution task may produce messages by yielding them. On each\n *   message dispatche actions task will have a `Send` status:\n *  `{ status: 'Send', id: Symbol, message: Message }`. Task can produce >= 0\n *  such actions. (If your task produces 0 messages you want to use perform\n *   instead).\n *\n Once task is finishes, action with status `Exit` is dispatced just once:\n *   `{ status: 'Exit', id: Symbol, duration: number, result: Result<Error, Success> }`\n *   with some new new fields:\n *     - `duration` - Is a time it took a task from `Init` to `Exit` in ms.\n *     - `result` - Is a result of the task. On succesful completion it is\n *       `{ok:true, value:Success}` (value is return value of the async\n *       generator). On failure it is `{ok:false, error:Error}` (`error` is an\n *       expception thrown, or a rejection reason of the promise).\n *\n * @template {string} Type - Corresponds to `action.type` for all the actions\n * that this task will dispatch.\n * @template Message - Type of messages that task will produce (by yielding).\n * Which correspond to `action.task.message` when `action.status`\n * is `Send`.\n * @template Success - Type of the `action.task.result.vaule` when task is\n * complete successfully. It is also a value of the promise returned by\n * running `store.doX` created by this decorator.\n * @template Init - Type of the initialization paramater.\n * @template State - Type of the `context.getState()` for this task.\n * @template {Object} StoreExt - Store extension.\n * @template {Object} ContextExt - Context extension\n * @template {BundlerContext<State, Spawn<Type, Message, Error, Success, Init>, StoreExt, ContextExt>} Context\n *\n * @param {Type} type - Type of the actions this will dispatch.\n * @param {(context:Context) => AsyncGenerator<Message, Success, void>} task - Task\n * @param {Init[]} rest - Optinal initialization parameter.\n * @returns {(context:Context) => Promise<Success>}\n */export const spawn = (type, task, ...[init]) => async (context) => {\n  // Generate unique id for this task\n  const id = Symbol(type)\n  const start = performance.now()\n\n  try {\n    context.dispatch({ type, task: { id, status: 'Init', init } })\n\n    const process = task(context)\n    while (true) {\n      const next = await process.next()\n      if (next.done) {\n        const { value } = next\n        context.dispatch({\n          type,\n          task: {\n            id,\n            status: 'Exit',\n            duration: performance.now() - start,\n            result: {\n              ok: true, value\n            }\n          }\n        })\n        return value\n      } else {\n        const { value } = next\n        context.dispatch({\n          type,\n          task: {\n            id,\n            status: 'Send',\n            message: value\n          }\n        })\n      }\n    }\n  } catch (error) {\n    context.dispatch({\n      type,\n      task: {\n        id,\n        status: 'Exit',\n        duration: performance.now() - start,\n        result: { ok: false, error }\n      }\n    })\n    // Propagate error to a caller.\n    throw error\n  }\n}\n","/**\n * Reads setting from the `localStorage` with a given `id` as JSON. If JSON\n * parse is failed setting is interpreted as a string value.\n * @param {string} id\n * @returns {string|object|null}\n */\nexport const readSetting = (id) => {\n  /** @type {string|null} */\n  let setting = null\n  if (window.localStorage) {\n    try {\n      setting = window.localStorage.getItem(id)\n    } catch (error) {\n      console.error(`Error reading '${id}' value from localStorage`, error)\n    }\n\n    try {\n      return JSON.parse(setting || '')\n    } catch (_) {\n      // res was probably a string, so pass it on.\n      return setting\n    }\n  }\n\n  return setting\n}\n\n/**\n * @param {string} id\n * @param {string|number|boolean|object} value\n */\nexport const writeSetting = (id, value) => {\n  try {\n    window.localStorage.setItem(id, JSON.stringify(value))\n  } catch (error) {\n    console.error(`Error writing '${id}' value to localStorage`, error)\n  }\n}\n","import filesize from 'filesize'\n/**\n * @typedef {import('ipfs').IPFSService} IPFSService\n * @typedef {import('../bundles/files/actions').FileStat} FileStat\n * @typedef {import('cids')} CID\n */\n\n/**\n * @typedef {Object} FileExt\n * @property {string} [filepath]\n * @property {string} [webkitRelativePath]\n *\n * @typedef {FileExt &  File} ExtendedFile\n *\n * @typedef {Object} FileStream\n * @property {string} path\n * @property {Blob} content\n * @property {number} size\n *\n * @param {ExtendedFile[]} files\n * @returns {FileStream[]}\n */\nexport function normalizeFiles (files) {\n  const streams = []\n\n  for (const file of files) {\n    streams.push({\n      path: file.filepath || file.webkitRelativePath || file.name,\n      content: file,\n      size: file.size\n    })\n  }\n\n  return streams\n}\n\n/**\n * @typedef {Object} FileDownload\n * @property {string} url\n * @property {string} filename\n * @property {string} method\n *\n * @param {FileStat} file\n * @param {string} gatewayUrl\n * @param {string} apiUrl\n * @returns {Promise<FileDownload>}\n */\nasync function downloadSingle (file, gatewayUrl, apiUrl) {\n  let url, filename, method\n\n  if (file.type === 'directory') {\n    const name = file.name || `download_${file.cid}` // Name is not always available.\n    url = `${apiUrl}/api/v0/get?arg=${file.cid}&archive=true&compress=true`\n    filename = `${name}.tar.gz`\n    method = 'POST' // API is POST-only\n  } else {\n    url = `${gatewayUrl}/ipfs/${file.cid}`\n    filename = file.name\n    method = 'GET'\n  }\n\n  return { url, filename, method }\n}\n\n/**\n * @param {FileStat[]} files\n * @param {IPFSService} ipfs\n * @returns {Promise<CID>}\n */\nexport async function makeCIDFromFiles (files, ipfs) {\n  let cid = await ipfs.object.new({ template: 'unixfs-dir' })\n\n  for (const file of files) {\n    cid = await ipfs.object.patch.addLink(cid, {\n      name: file.name,\n      // @ts-ignore - can this be `null` ?\n      size: file.size,\n      cid: file.cid\n    })\n  }\n\n  return cid\n}\n\n/**\n *\n * @param {FileStat[]} files\n * @param {string} apiUrl\n * @param {IPFSService} ipfs\n * @returns {Promise<FileDownload>}\n */\nasync function downloadMultiple (files, apiUrl, ipfs) {\n  if (!apiUrl) {\n    const e = new Error('api url undefined')\n    return Promise.reject(e)\n  }\n\n  const cid = await makeCIDFromFiles(files, ipfs)\n\n  return {\n    url: `${apiUrl}/api/v0/get?arg=${cid}&archive=true&compress=true`,\n    filename: `download_${cid}.tar.gz`,\n    method: 'POST' // API is POST-only\n  }\n}\n\n/**\n *\n * @param {FileStat[]} files\n * @param {string} gatewayUrl\n * @param {string} apiUrl\n * @param {IPFSService} ipfs\n * @returns {Promise<FileDownload>}\n */\nexport async function getDownloadLink (files, gatewayUrl, apiUrl, ipfs) {\n  if (files.length === 1) {\n    return downloadSingle(files[0], gatewayUrl, apiUrl)\n  }\n\n  return downloadMultiple(files, apiUrl, ipfs)\n}\n\n/**\n * @param {FileStat[]} files\n * @param {string} gatewayUrl\n * @param {IPFSService} ipfs\n * @returns {Promise<string>}\n */\nexport async function getShareableLink (files, gatewayUrl, ipfs) {\n  let cid\n  let filename\n\n  if (files.length === 1) {\n    cid = files[0].cid\n    if (files[0].type === 'file') {\n      filename = `?filename=${encodeURIComponent(files[0].name)}`\n    }\n  } else {\n    cid = await makeCIDFromFiles(files, ipfs)\n  }\n\n  return `${gatewayUrl}/ipfs/${cid}${filename || ''}`\n}\n\n/**\n * @param {number} size in bytes\n * @param {object} opts format customization\n * @returns {string} human-readable size\n */\nexport function humanSize (size, opts) {\n  if (typeof size === 'undefined') return 'N/A'\n  return filesize(size || 0, {\n    // base-2 byte units (GiB, MiB, KiB) to remove any ambiguity\n    spacer: String.fromCharCode(160), // non-breakable space (&nbsp)\n    round: size >= 1073741824 ? 1 : 0, // show decimal > 1GiB\n    standard: 'iec',\n    base: 2,\n    bits: false,\n    ...opts\n  })\n}\n","export const IS_MAC = navigator.userAgent.indexOf('Mac') !== -1\n\n/**\n * @typedef {import('./protocol').Message} Message\n * @typedef {import('./protocol').Model} Model\n */\nexport const ACTIONS = {\n  /** @type {'FILES_FETCH'} */\n  FETCH: ('FILES_FETCH'),\n  /** @type {'FILES_MOVE'} */\n  MOVE: ('FILES_MOVE'),\n  /** @type {'FILES_COPY'} */\n  COPY: ('FILES_COPY'),\n  /** @type {'FILES_DELETE'} */\n  DELETE: ('FILES_DELETE'),\n  /** @type {'FILES_MAKEDIR'} */\n  MAKE_DIR: ('FILES_MAKEDIR'),\n  /** @type {'FILES_WRITE'} */\n  WRITE: ('FILES_WRITE'),\n  /** @type {'FILES_DOWNLOADLINK'} */\n  DOWNLOAD_LINK: ('FILES_DOWNLOADLINK'),\n  /** @type {'FILES_SHARE_LINK'} */\n  SHARE_LINK: ('FILES_SHARE_LINK'),\n  /** @type {'FILES_ADDBYPATH'} */\n  ADD_BY_PATH: ('FILES_ADDBYPATH'),\n  /** @type {'FILES_PIN_ADD'} */\n  PIN_ADD: ('FILES_PIN_ADD'),\n  /** @type {'FILES_PIN_REMOVE'} */\n  PIN_REMOVE: ('FILES_PIN_REMOVE'),\n  /** @type {'FILES_PIN_LIST'} */\n  PIN_LIST: ('FILES_PIN_LIST'),\n  /** @type {'FILES_SIZE_GET'} */\n  SIZE_GET: ('FILES_SIZE_GET'),\n  /** @type {'FILES_PINS_SIZE_GET'} */\n  PINS_SIZE_GET: ('FILES_PINS_SIZE_GET'),\n  /** @type {'FILES_DISMISS_ERRORS'} */\n  DISMISS_ERRORS: ('FILES_DISMISS_ERRORS'),\n  /** @type {'FILES_CLEAR_ALL'} */\n  CLEAR_ALL: ('FILES_CLEAR_ALL'),\n  /** @type {'FILES_WRITE_UPDATED'} */\n  WRITE_UPDATED: ('FILES_WRITE_UPDATED'),\n  /** @type {'FILES_UPDATE_SORT'} */\n  UPDATE_SORT: ('FILES_UPDATE_SORT')\n}\n\nexport const SORTING = {\n  /** @type {'name'} */\n  BY_NAME: ('name'),\n  /** @type {'size'} */\n  BY_SIZE: ('size')\n}\n\nexport const IGNORED_FILES = [\n  '.DS_Store',\n  'thumbs.db',\n  'desktop.ini'\n]\n\n/** @type {Model} */\nexport const DEFAULT_STATE = {\n  pageContent: null,\n  mfsSize: -1,\n  pinsSize: 0,\n  numberOfPins: 0,\n  pins: [],\n  sorting: { // TODO: cache this\n    by: SORTING.BY_NAME,\n    asc: true\n  },\n  pending: [],\n  finished: [],\n  failed: []\n}\n\nexport const cliCmdKeys = {\n  DOWNLOAD_OBJECT_COMMAND: 'downloadObjectCommand',\n  REMOVE_FILE_FROM_IPFS: 'removeFileFromIpfs',\n  UPDATE_IPFS_CONFIG: 'updateIpfsConfig',\n  PIN_OBJECT: 'pinObject',\n  RENAME_IPFS_OBJECT: 'renameObject',\n  ADD_FILE: 'addNewFile',\n  ADD_DIRECTORY: 'addNewDirectory',\n  CREATE_NEW_DIRECTORY: 'createNewDirectory',\n  FROM_IPFS: 'fromIpfs',\n  ADD_NEW_PEER: 'addNewPeer'\n}\n\nexport const cliCmdPrefixes = {\n  PIN_OBJECT: 'ipfs pin'\n}\n\nexport const cliCommandList = {\n  [cliCmdKeys.UPDATE_IPFS_CONFIG]: () => 'ipfs config replace <path-to-settings.json>',\n  /**\n   * @param {string} filePath\n   */\n  [cliCmdKeys.REMOVE_FILE_FROM_IPFS]: (filePath) => `ipfs files rm -r \"${filePath}\"`,\n  /**\n   * @param {string} cid\n   */\n  [cliCmdKeys.DOWNLOAD_OBJECT_COMMAND]: (cid) => `ipfs get ${cid}`,\n  /**\n   * @param {string} cid\n   * @param {string} op\n   */\n  [cliCmdKeys.PIN_OBJECT]: (cid, op) => `${cliCmdPrefixes.PIN_OBJECT} ${op} ${cid}`,\n  /**\n   * @param {string} filePath\n   * @param {string} fileName\n   */\n  [cliCmdKeys.RENAME_IPFS_OBJECT]: (filePath, fileName) => {\n    const prefix = filePath.replace(fileName, '').trim()\n    return `ipfs files mv \"${filePath}\" \"${prefix}<new-name>\"`\n  },\n  /**\n   * @param {string} path\n   */\n  [cliCmdKeys.ADD_FILE]: (path) => `ipfs files cp /ipfs/$(ipfs add -Q <local-file>) \"${path}/<dest-name>\"`,\n  /**\n   * @param {string} path\n   */\n  [cliCmdKeys.ADD_DIRECTORY]: (path) => `ipfs files cp /ipfs/$(ipfs add -r -Q <local-folder>) \"${path}/<dest-name>\"`,\n  /**\n   * @param {string} path\n   */\n  [cliCmdKeys.CREATE_NEW_DIRECTORY]: (path) => `ipfs files mkdir \"${path}/<folder-name>\"`,\n  /**\n   * @param {string} path\n   */\n  [cliCmdKeys.FROM_IPFS]: (path) => `ipfs cp /ipfs/<cid> \"${path}/<dest-name>\"`,\n  [cliCmdKeys.ADD_NEW_PEER]: () => 'ipfs swarm connect <peer-multiaddr>'\n}\n","import React from 'react'\n\nconst GlyphSmallCancel = props => (\n  <svg viewBox='0 0 100 100' {...props}>\n    <path d='M63.79 63.2l-3.88 3.88-9.71-9.7-9.7 9.7-3.88-3.88 9.7-9.71-9.7-9.7 3.88-3.88 9.7 9.7 9.71-9.7 3.88 3.88-9.7 9.7 9.7 9.71z' />\n  </svg>\n)\n\nexport default GlyphSmallCancel\n","import React from 'react'\n\nconst StrokeIpld = props => (\n  <svg viewBox='0 0 100 100' {...props}>\n    <path d='M87.589 44.265c0-1.157-.45-2.245-1.27-3.062a4.304 4.304 0 0 0-3.062-1.269 4.304 4.304 0 0 0-3.062 1.269 4.337 4.337 0 0 0 0 6.125c.602.602 1.35 1 2.164 1.172v2.442l-14.686 9.276v-19.79l4.498-2.842v-3.717a4.27 4.27 0 0 0 1.827-1.067 4.337 4.337 0 0 0 0-6.125 4.337 4.337 0 0 0-6.126 0 4.304 4.304 0 0 0-1.27 3.063c0 1.157.45 2.245 1.27 3.062a4.282 4.282 0 0 0 1.963 1.107V36.3L51.11 48.128v-8.901l9.304-5.877v-7.051a4.282 4.282 0 0 0 1.986-1.114 4.336 4.336 0 0 0-.001-6.125 4.337 4.337 0 0 0-6.125 0h-.001a4.337 4.337 0 0 0 0 6.125c.52.519 1.145.859 1.804 1.059v5.818l-6.967 4.401V15.062a4.283 4.283 0 0 0 2.008-1.12 4.337 4.337 0 0 0-.001-6.126 4.337 4.337 0 0 0-6.125 0h-.001a4.337 4.337 0 0 0 0 6.126 4.273 4.273 0 0 0 1.783 1.053v15.881l-7.23-4.566v-3.436a4.292 4.292 0 0 0 2.009-1.12 4.337 4.337 0 0 0 0-6.125 4.337 4.337 0 0 0-6.126 0 4.304 4.304 0 0 0-1.27 3.063c0 1.157.45 2.245 1.27 3.062a4.276 4.276 0 0 0 1.78 1.053v4.79l9.566 6.042v21.108l-7.708-4.226v-7.809a4.275 4.275 0 0 0 2.034-1.128 4.337 4.337 0 0 0 0-6.125 4.337 4.337 0 0 0-6.126 0 4.304 4.304 0 0 0-1.27 3.063c0 1.157.45 2.245 1.27 3.062a4.284 4.284 0 0 0 1.756 1.046v6.61l-11.705-6.417v-6.217a4.28 4.28 0 0 0 1.984-1.117 4.3 4.3 0 0 0 1.27-3.063c0-1.157-.45-2.245-1.27-3.062a4.336 4.336 0 0 0-6.125 0 4.337 4.337 0 0 0 0 6.125c.51.51 1.132.858 1.804 1.062v7.621l3.646 2.004v13.632l-10.582-5.77V51.62a4.29 4.29 0 0 0 2.05-1.133 4.337 4.337 0 0 0 0-6.125 4.304 4.304 0 0 0-3.061-1.269 4.304 4.304 0 0 0-3.063 1.269 4.337 4.337 0 0 0 0 6.125 4.285 4.285 0 0 0 1.738 1.041v3.812l33.359 18.269v11.397a4.277 4.277 0 0 0-1.783 1.053 4.337 4.337 0 0 0 0 6.125 4.32 4.32 0 0 0 3.063 1.266 4.316 4.316 0 0 0 3.063-1.267 4.337 4.337 0 0 0 0-6.125 4.29 4.29 0 0 0-2.008-1.119V73.444l33.585-21.216v-3.892a4.29 4.29 0 0 0 1.625-1.008 4.3 4.3 0 0 0 1.269-3.063zM30.46 60.969V47.345l18.314 10.066v13.542zm34.876-19.065v19.79L51.11 70.68V50.89zm3.067-12.164c0-.676.264-1.312.742-1.79a2.525 2.525 0 0 1 1.79-.74c.647 0 1.296.247 1.789.74a2.536 2.536 0 0 1 0 3.581 2.535 2.535 0 0 1-3.58 0 2.516 2.516 0 0 1-.741-1.791zm-10.857-9.407a2.534 2.534 0 0 1 3.58 0 2.534 2.534 0 0 1 0 3.58 2.534 2.534 0 0 1-3.58 0 2.534 2.534 0 0 1 0-3.58zM48.264 9.09a2.536 2.536 0 0 1 3.58 0c.988.987.988 2.593.002 3.58a2.536 2.536 0 0 1-3.581 0 2.535 2.535 0 0 1-.001-3.58zm-10.305 9.601c0-.676.264-1.312.742-1.79a2.525 2.525 0 0 1 1.79-.74c.647 0 1.296.247 1.789.74a2.536 2.536 0 0 1 0 3.581 2.535 2.535 0 0 1-3.58 0 2.52 2.52 0 0 1-.741-1.791zm-.453 19.832c0-.676.264-1.312.742-1.79a2.525 2.525 0 0 1 1.79-.74c.647 0 1.296.247 1.789.74a2.536 2.536 0 0 1 0 3.581 2.535 2.535 0 0 1-3.58 0 2.525 2.525 0 0 1-.741-1.791zm-13.348-7.887a2.524 2.524 0 0 1 1.789-.74 2.526 2.526 0 0 1 2.532 2.531c0 .677-.264 1.312-.742 1.79-.422.422-.984.647-1.562.696h-.456c-.577-.049-1.14-.274-1.561-.696a2.534 2.534 0 0 1 0-3.581zM14.95 45.635a2.514 2.514 0 0 1 1.79-.742 2.534 2.534 0 0 1 1.789 4.322 2.533 2.533 0 0 1-3.58 0 2.533 2.533 0 0 1 0-3.58zm36.894 45.277a2.534 2.534 0 0 1-3.58 0 2.534 2.534 0 0 1 0-3.58 2.536 2.536 0 0 1 3.58 0 2.534 2.534 0 0 1 0 3.58zm33.202-44.857c-.955.955-2.624.957-3.58 0a2.534 2.534 0 0 1 1.79-4.322c.677 0 1.312.264 1.79.742.479.478.742 1.113.742 1.79s-.263 1.311-.742 1.79z' />\n  </svg>\n)\n\nexport default StrokeIpld\n","import React from 'react'\nimport './Button.css'\nimport classNames from 'classnames'\nimport PropTypes from 'prop-types'\n\nconst getButtonClassName = ({ fill, bg, color, danger, disabled }, type) => {\n  if (danger) return 'bg-red fill-white white'\n  if (disabled) return 'bg-gray-muted fill-snow light-gray'\n  if (type === 'link') return 'link bg-transparent'\n  return `${fill} ${bg} ${color}`\n}\n\nconst Button = ({ className, minWidth, children, style, type, danger, ...props }) =>\n  <button type={type} className={classNames('Button transition-all sans-serif dib v-mid fw5 nowrap lh-copy bn br1 pa2 focus-outline', className, getButtonClassName(props, type))} disabled={props.disabled} style={{ minWidth, ...style }} {...props}>\n    {children}\n  </button>\n\nButton.defaultProps = {\n  bg: 'bg-teal',\n  color: 'white',\n  fill: 'white',\n  className: '',\n  minWidth: 140\n}\n\nButton.propTypes = {\n  danger: PropTypes.bool,\n  disabled: PropTypes.bool\n}\n\nexport default Button\n","import React from 'react'\nimport PropTypes from 'prop-types'\nimport Tick from '../../icons/GlyphSmallTick'\nimport './Checkbox.css'\n\nconst Checkbox = ({ className, label, disabled, checked, onChange, ...props }) => {\n  className = `Checkbox dib sans-serif ${className}`\n  if (!disabled) {\n    className += ' pointer'\n  }\n\n  const change = (event) => {\n    onChange(event.target.checked)\n  }\n\n  return (\n    <label className={className} {...props}>\n      <input className='absolute' type='checkbox' checked={checked} disabled={disabled} onChange={change} />\n      <span className='dib v-mid br1 w1 h1 pointer'>\n        <Tick className='w1 h1 o-0 fill-aqua' viewBox='25 25 50 50' />\n      </span>\n      <span className='v-mid pl2'>\n        {label}\n      </span>\n    </label>\n  )\n}\n\nCheckbox.propTypes = {\n  className: PropTypes.string,\n  label: PropTypes.node,\n  disabled: PropTypes.bool,\n  checked: PropTypes.bool,\n  onChange: PropTypes.func\n}\n\nCheckbox.defaultProps = {\n  className: '',\n  label: '',\n  disabled: false,\n  checked: null,\n  onChange: () => {}\n}\n\nexport default Checkbox\n","import React from 'react'\n\nexport const appTour = {\n  getSteps: ({ t }) => [{\n    content: <div className='montserrat white'>\n      <p className='ma0 pa0 tl f6'>{t('tour.tooltip')}</p>\n    </div>,\n    placement: 'left',\n    target: '.joyride-app-tour',\n    disableBeacon: true\n  }],\n  styles: {\n    tooltipContent: { padding: '0 20px 0 0' },\n    tooltipFooter: { display: 'none' },\n    options: {\n      width: '250px',\n      backgroundColor: 'rgba(105, 196, 205, 0.85)',\n      arrowColor: 'rgba(105, 196, 205, 0.85)',\n      textColor: '#fff',\n      zIndex: 999\n    }\n  }\n}\n\nexport const welcomeTour = {\n  getSteps: ({ t, Trans }) => [\n    {\n      content: <div className='montserrat charcoal'>\n        <h2 className='f3 fw4'>{t('tour.step1.title')}</h2>\n        <p className='tl f6'>{t('tour.step1.paragraph1')}</p>\n        <p className='tl f6'>{t('tour.step1.paragraph2')}</p>\n        <p className='tl f6'>{t('tour.step1.paragraph3')}</p>\n      </div>,\n      placement: 'center',\n      target: 'body'\n    }\n  ],\n  styles: {\n    options: {\n      width: '500px',\n      primaryColor: '#378085',\n      textColor: '#34373f',\n      zIndex: 999\n    }\n  }\n}\n\nexport const statusTour = {\n  getSteps: ({ t, Trans }) => [\n    {\n      content: <div className='montserrat charcoal'>\n        <h2 className='f3 fw4'>{t('tour.step1.title')}</h2>\n        <p className='tl f6'>{t('tour.step1.paragraph1')}</p>\n        <p className='tl f6'>{t('tour.step1.paragraph2')}</p>\n      </div>,\n      placement: 'center',\n      target: 'body'\n    },\n    {\n      content: <div className='montserrat charcoal'>\n        <h2 className='f3 fw4'>{t('tour.step2.title')}</h2>\n        <p className='tl f6'>{t('tour.step2.paragraph1')}</p>\n        <p className='tl f6'>{t('tour.step2.paragraph2')}</p>\n      </div>,\n      placement: 'left',\n      target: '.joyride-app-status'\n    },\n    {\n      content: <div className='montserrat charcoal'>\n        <h2 className='f3 fw4'>{t('tour.step3.title')}</h2>\n        <p className='tl f6'>{t('tour.step3.paragraph1')}</p>\n        <Trans i18nKey='tour.step3.paragraph2' t={t}>\n          <p className='tl f6'>Click on <code>Advanced</code> to see more info such as the gateway URL and addresses.</p>\n        </Trans>\n      </div>,\n      placement: 'bottom',\n      target: '.joyride-status-node'\n    },\n    {\n      content: <div className='montserrat charcoal'>\n        <h2 className='f3 fw4'>{t('tour.step4.title')}</h2>\n        <p className='tl f6'>{t('tour.step4.paragraph1')}</p>\n        <p className='tl f6'>{t('tour.step4.paragraph2')}</p>\n      </div>,\n      placement: 'top',\n      target: '.joyride-status-charts'\n    },\n    {\n      content: <div className='montserrat charcoal'>\n        <h2 className='f3 fw4'>{t('tour.stepExplore.title')}</h2>\n        <p className='tl f6'>{t('tour.stepExplore.paragraph')}</p>\n      </div>,\n      locale: { last: t('tour.finish') },\n      placement: 'right',\n      target: '.joyride-app-explore'\n    }\n  ],\n  styles: {\n    options: {\n      width: '500px',\n      primaryColor: '#378085',\n      textColor: '#34373f',\n      zIndex: 999\n    }\n  }\n}\n\nexport const filesTour = {\n  getSteps: ({ t, Trans }) => [\n    {\n      content: <div className='montserrat charcoal'>\n        <h2 className='f3 fw4'>{t('tour.step1.title')}</h2>\n        <Trans i18nKey='tour.step1.paragraph1' t={t}>\n          <p className='tl f6'>\n            This is where the files on your <a className='teal link' href='https://docs.ipfs.io/concepts/file-systems/' rel='noopener noreferrer' target='_blank'>\n            Mutable File System (MFS)</a> live. You can add files or folders and manage them from this page.\n          </p>\n        </Trans>\n        <p className='tl f6'>{t('tour.step1.paragraph2')}</p>\n      </div>,\n      placement: 'center',\n      target: 'body'\n    },\n    {\n      content: <div className='montserrat charcoal'>\n        <h2 className='f3 fw4'>{t('tour.step2.title')}</h2>\n        <p className='tl f6'>{t('tour.step2.paragraph1')}</p>\n        <ul className='pl4'>\n          <li className='tl f6'>{t('tour.step2.bullet1')}</li>\n          <li className='tl f6'>{t('tour.step2.bullet2')}</li>\n          <li className='tl f6'>{t('tour.step2.bullet3')}</li>\n        </ul>\n      </div>,\n      placement: 'bottom',\n      target: '.joyride-files-breadcrumbs'\n    },\n    {\n      content: <div className='montserrat charcoal'>\n        <h2 className='f3 fw4'>{t('tour.step3.title')}</h2>\n        <p className='tl f6'>{t('tour.step3.paragraph1')}</p>\n        <p className='tl f6'>{t('tour.step3.paragraph2')}</p>\n        <Trans i18nKey='tour.step3.paragraph3' t={t}>\n          <p className='tl f6'>\n            If you want to add something that is already on IPFS, you can import it to your MFS by passing its <a className='teal link' href='https://docs.ipfs.io/concepts/content-addressing/' rel='noopener noreferrer' target='_blank'>Content\n            Identifier (CID)</a>.\n          </p>\n        </Trans>\n      </div>,\n      placement: 'bottom',\n      target: '.joyride-files-add'\n    },\n    {\n      content: <div className='montserrat charcoal'>\n        <h2 className='f3 fw4'>{t('tour.step5.title')}</h2>\n        <p className='tl f6'>{t('tour.step5.paragraph1')}</p>\n        <p className='tl f6'>{t('tour.step5.paragraph2')}</p>\n        <p className='tl f6'>{t('tour.step5.paragraph3')}</p>\n      </div>,\n      locale: { last: t('tour.finish') },\n      placement: 'center',\n      target: 'body'\n    }\n  ],\n  styles: {\n    options: {\n      width: '500px',\n      primaryColor: '#378085',\n      textColor: '#34373f',\n      zIndex: 999\n    }\n  }\n}\n\nexport const peersTour = {\n  getSteps: ({ t }) => [\n    {\n      content: <div className='montserrat charcoal'>\n        <h2 className='f3 fw4'>{t('tour.step1.title')}</h2>\n        <p className='tl f6'>{t('tour.step1.paragraph1')}</p>\n        <p className='tl f6'>{t('tour.step1.paragraph2')}</p>\n      </div>,\n      placement: 'center',\n      target: 'body'\n    },\n    {\n      content: <div className='montserrat charcoal'>\n        <h2 className='f3 fw4'>{t('tour.step2.title')}</h2>\n        <p className='tl f6'>{t('tour.step2.paragraph1')}</p>\n      </div>,\n      placement: 'bottom',\n      target: '.joyride-peers-map'\n    },\n    {\n      content: <div className='montserrat charcoal'>\n        <h2 className='f3 fw4'>{t('tour.step3.title')}</h2>\n        <p className='tl f6'>{t('tour.step3.paragraph1')}</p>\n      </div>,\n      locale: { last: t('tour.finish') },\n      placement: 'top',\n      target: '.joyride-peers-table'\n    }\n  ],\n  styles: {\n    options: {\n      width: '500px',\n      primaryColor: '#378085',\n      textColor: '#34373f',\n      zIndex: 999\n    }\n  }\n}\n\nexport const settingsTour = {\n  getSteps: ({ t, Trans }) => [\n    {\n      content: <div className='montserrat charcoal'>\n        <h2 className='f3 fw4'>{t('tour.step1.title')}</h2>\n        <p className='tl f6'>{t('tour.step1.paragraph1')}</p>\n        <p className='tl f6'>{t('tour.step1.paragraph2')}</p>\n      </div>,\n      placement: 'center',\n      target: 'body'\n    },\n    {\n      content: <div className='montserrat charcoal'>\n        <h2 className='f3 fw4'>{t('tour.step2.title')}</h2>\n        <p className='tl f6'>{t('tour.step2.paragraph1')}</p>\n      </div>,\n      placement: 'auto',\n      target: '.joyride-settings-customapi'\n    },\n    {\n      content: <div className='montserrat charcoal'>\n        <h2 className='f3 fw4'>{t('tour.step3.title')}</h2>\n        <Trans i18nKey='tour.step3.paragraph1' t={t}>\n          <p className='tl f6'>If you have accounts with third-party remote pinning services, add them here so you can pin/unpin items to those services directly from the Files screen. You can learn more about third-party pinning services in the <a className='teal link' href='https://docs.ipfs.io/how-to/work-with-pinning-services' rel='noopener noreferrer' target='_blank'>IPFS Docs</a>.\n          </p>\n        </Trans>\n      </div>,\n      placement: 'auto',\n      target: '.joyride-settings-pinning'\n    },\n    {\n      content: <div className='montserrat charcoal'>\n        <h2 className='f3 fw4'>{t('tour.step4.title')}</h2>\n        <Trans i18nKey='tour.step4.paragraph1' t={t}>\n          <p className='tl f6'>You can change the language of the Web UI.\n          If your preferred language isn't available, head over our project page in <a className='teal link' href='https://www.transifex.com/ipfs/ipfs-webui/translate/' rel='noopener noreferrer' target='_blank'>Transifex</a> to help us translate!\n          </p>\n        </Trans>\n      </div>,\n      placement: 'auto',\n      target: '.joyride-settings-language'\n    },\n    {\n      content: <div className='montserrat charcoal'>\n        <h2 className='f3 fw4'>{t('tour.step5.title')}</h2>\n        <p className='tl f6'>{t('tour.step5.paragraph1')}</p>\n        <p className='tl f6'>{t('tour.step5.paragraph2')}</p>\n      </div>,\n      placement: 'auto',\n      target: '.joyride-settings-analytics'\n    },\n    {\n      content: <div className='montserrat charcoal'>\n        <h2 className='f3 fw4'>{t('tour.step6.title')}</h2>\n        <p className='tl f6'>{t('tour.step6.paragraph1')}</p>\n      </div>,\n      placement: 'auto',\n      target: '.joyride-settings-tutormode'\n    },\n    {\n      content: <div className='montserrat charcoal'>\n        <h2 className='f3 fw4'>{t('tour.step7.title')}</h2>\n        <p className='tl f6'>{t('tour.step7.paragraph1')}</p>\n        <p className='tl f6'>{t('tour.step7.paragraph2')}</p>\n      </div>,\n      locale: { last: t('tour.finish') },\n      placement: 'auto',\n      target: '.joyride-settings-config'\n    }\n  ],\n  styles: {\n    options: {\n      width: '500px',\n      primaryColor: '#378085',\n      textColor: '#34373f',\n      zIndex: 999\n    }\n  }\n}\n","/**\n * Natural sort comparator for strings.\n *\n * @param {Number} dir - sorting direction, 1 for ascending or -1 for descending\n * @param {Intl.CollatorOptions} opts - localeCompare options (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare)\n * @returns {(a:string, b:string) => number}\n */\nexport function sortByName (dir = 1, opts = { numeric: true, sensitivity: 'base' }) {\n  return (a, b) => a.localeCompare(b, undefined, opts) * dir\n}\n\n/**\n * Numerical sort comparator.\n *\n * @param {Number} dir - sorting direction, 1 for ascending or -1 for descending\n * @returns {(a:number, b:number) => number}\n */\nexport function sortBySize (dir = 1) {\n  return (a, b) => (a - b) * dir\n}\n\n/**\n * Object sorting by property\n * @template {Object} T\n * @param {keyof T} property - object property to sort by\n * @param {1|-1} dir - sorting direction, 1 for ascending or -1 for descending\n * @returns {(a:T, b:T) => number}\n */\nexport function sortByProperty (property, dir = 1) {\n  // @ts-ignore - `a` and `b` may not be numbers\n  return ({ [property]: a }, { [property]: b }) => (a == null) - (b == null) || dir * +(a > b) || dir * -(a < b)\n}\n","import React from 'react'\nimport ErrorIcon from '../../icons/GlyphSmallCancel'\nimport root from 'window-or-global'\n\nclass ErrorBoundary extends React.Component {\n  state = {\n    hasError: false\n  }\n\n  static defaultProps = {\n    fallback: ErrorIcon\n  }\n\n  componentDidCatch (error, info) {\n    this.setState({ hasError: true })\n    console.log(error)\n    if (root && root.Countly) {\n      root.Countly.q.push(['log_error'], error)\n    }\n  }\n\n  render () {\n    const { hasError } = this.state\n    const { children, fallback: Fallback } = this.props\n    return hasError ? <Fallback /> : children\n  }\n}\n\nexport default ErrorBoundary\n","import React from 'react'\nimport ErrorBoundary from '../error/ErrorBoundary'\n\nexport const Box = ({\n  className = 'pa4',\n  style,\n  children,\n  ...props\n}) => {\n  return (\n    <section className={className} style={{ background: '#fbfbfb', ...style }}>\n      <ErrorBoundary>\n        {children}\n      </ErrorBoundary>\n    </section>\n  )\n}\n\nexport default Box\n","\nexport const getJoyrideLocales = (translate) => ({\n  back: translate('tour.back'),\n  close: translate('tour.close'),\n  last: translate('tour.last'),\n  next: translate('tour.next'),\n  skip: translate('tour.skip')\n})\n","import React from 'react'\n\nconst StrokeFolder = props => (\n  <svg viewBox='0 0 100 100' {...props}>\n    <path d='M72.53 32.38H55.08a3.76 3.76 0 0 1-3.44-2.25l-2.28-4.83a6 6 0 0 0-5.57-3.8H31.47c-6.37 0-11.56 5.5-11.56 12.18v32.64c0 6.68 5.19 12.18 11.56 12.18h41.06c6.37 0 11.56-5.46 11.56-12.18V44.56c0-6.72-5.19-12.18-11.56-12.18zM31.47 24.1h12.32A3.45 3.45 0 0 1 47 26.35l2.34 4.95a6.33 6.33 0 0 0 5.74 3.7h17.45a9.22 9.22 0 0 1 8.9 8.5H22.51v-9.8c0-5.3 4.02-9.6 8.96-9.6zm41.06 51.8H31.47c-4.94 0-9-4.3-9-9.58V45h59v21.32c.02 5.28-4 9.58-8.94 9.58z' />\n  </svg>\n)\n\nexport default StrokeFolder\n","import React from 'react'\n\nconst Title = ({ props, children }) => (\n  <h2 className='ttu tracked f6 fw4 teal mt0 mb3' {...props}>{ children }</h2>\n)\nexport default Title\n","import { sortByName, sortBySize } from '../../lib/sort'\nimport { IS_MAC, SORTING } from './consts'\nimport * as Task from '../task'\n\n/**\n * @typedef {import('ipfs').IPFSService} IPFSService\n * @typedef {import('./actions').Ext} Ext\n * @typedef {import('./actions').Extra} Extra\n */\n\n/**\n  * @template State, Message, Ext, Extra\n  * @typedef {import('redux-bundler').Context<State, Message, Ext, Extra>} BundlerContext\n  */\n\n/**\n * Utility function that takes a task name and task (in form of async generator) and\n * produces `doX` style action creator that will execute a task and dispatch\n * actions in form of `{type: name, job: Job<State, Error, Return>}` as it makes\n * progress.\n *\n * A `.job` property of dispatched action will correspond to one of the states:\n *\n * 1. `{ status: 'Idle', id: Symbol }` - State just before task is executed.\n * 2. `{ status: 'Pending', id: Symbol, state: State }` - State while task is in\n *    progress. Each yielded value will cause this action and will correspond\n *    to `state` field.\n * 3. `{ status: 'Done', id: Symbol, value: Return }` - State when task is\n *    successfully complete.\n * 4. `{ status: 'Failed', id: Symbol, error: Error }` - State when task is\n *    failed do to error.\n *\n * template {string} Name - Name of the task which, correponds to `.type` of\n * dispatched actions.\n * template State - Type of yielded value by a the generator, which will\n * correspond to `.job.state` of dispatched actions while task is pending.\n * template Return - Return type of the task, which will correspond to\n * `.job.result.value` of dispatched action on succefully completed task.\n * template {BundlerContext<State, Job<Name, State, Error, Return>, StoreExt, GetIPFS>} Ctx\n *\n * param {Name} name - Name of the task\n * param {(service:IPFSService, context:Ctx) => AsyncGenerator<State, Return, void>} task\n * returns {(context:Ctx) => Promise<Return>}\n */\n\n/**\n * @template Name, Message, Failure, Success, Init\n * @typedef {import('../task').Spawn<Name, Message, Failure, Success, Init>} Spawn\n */\n\n/**\n * Specialized version of `Task.spawn` which will only spawn a task if\n * `context.getIpfs()` returns an `IPFSService` passing it into the task as a\n * first argument. Otherwise it fails without dispatching any actions.\n *\n * @template {string} Type - Corresponds to `action.type` for all the actions\n * that this task will dispatch.\n * @template Message - Type of messages that task will produce (by yielding).\n * Which correspond to `action.task.message` when `action.status`\n * is `Send`.\n * @template Success - Type of the `action.task.result.vaule` when task is\n * complete successfully. It is also a value of the promise returned by\n * running `store.doX` created by this decorator.\n * @template Init - Type of the initialization paramater.\n * @template State - Type of the `context.getState()` for this task.\n * @template {BundlerContext<State, Spawn<Type, Message, Error, Success, Init>, Ext, Extra>} Context\n *\n * @param {Type} type - Type of the actions this will dispatch.\n * @param {(service:IPFSService, context:Context) => AsyncGenerator<Message, Success, void>} task - Task\n * @param {Init[]} rest - Optinal initialization parameter.\n * @returns {(context:Context) => Promise<Success>}\n */\nexport const spawn = (type, task, ...[init]) => async (context) => {\n  const ipfs = context.getIpfs()\n  if (ipfs == null) {\n    throw Error('IPFS node was not found')\n  } else {\n    const spawn = Task.spawn(\n      type,\n      /**\n       * @param {Context} context\n       * @returns {AsyncGenerator<Message, Success, void>}}\n       */\n      async function * (context) {\n        const process = task(ipfs, context)\n        while (true) {\n          const next = await process.next()\n          if (next.done) {\n            return next.value\n          } else {\n            yield next.value\n          }\n        }\n      },\n      init\n    )\n\n    return await spawn(context)\n  }\n}\n\n/**\n * @template Name, Failure, Success, Init\n * @typedef {import('../task').Perform<Name, Failure, Success, Init>} Perform\n */\n\n/**\n * Specialized version of `Task.perform` which will only perform a task if\n * `context.getIpfs()` returns an `IPFSService` passing it into the task as a\n * first argument. Otherwise it fails without dispatching any actions.\n *\n * @template {string} Type - Type of the task which, correponds to `.type` of\n * dispatched actions.\n * @template Success - Return type of the task, which will correspond to\n * `.job.result.value` of dispatched action on succefully completed task.\n * @template Init - Initial data\n * @template State - Type of the `context.getState()` for this task.\n * @template {BundlerContext<State, Perform<Type, Error, Success, Init>, Ext, Extra>} Context\n *\n * @param {Type} type - Type of the actions this will dispatch.\n * @param {(service:IPFSService, context:Context) => Promise<Success>} task\n * @param {Init[]} rest\n * @returns {(context:Context) => Promise<Success>}\n */\nexport const perform = (type, task, ...[init]) => async (context) => {\n  const ipfs = context.getIpfs()\n  if (ipfs == null) {\n    throw Error('IPFS node was not found')\n  } else {\n    const perform = Task.perform(\n      type,\n      /**\n       * @param {Context} context\n       */\n      context => task(ipfs, context),\n      init\n    )\n    return await perform(context)\n  }\n}\n\n/**\n * Creates an action creator that just dispatches given action.\n * @template T\n * @param {T} action\n * @returns {(context:BundlerContext<any, T, any, any>) => Promise<void>}\n */\nexport const send = (action) => async ({ store }) => {\n  store.dispatch(action)\n}\n\n/**\n * @typedef {Object} Sorting\n * @property {boolean} [asc]\n * @property {import('./consts').SORTING} [by]\n */\n\n/**\n * @template {{name:string, type:string, cumulativeSize?:number, size:number}} T\n * @param {T[]} files\n * @param {Sorting} sorting\n\n * @returns {T[]}\n */\nexport const sortFiles = (files, sorting) => {\n  const sortDir = sorting.asc ? 1 : -1\n  const nameSort = sortByName(sortDir)\n  const sizeSort = sortBySize(sortDir)\n\n  return files.sort((a, b) => {\n    if (a.type === b.type || IS_MAC) {\n      if (sorting.by === SORTING.BY_NAME) {\n        return nameSort(a.name, b.name)\n      } else {\n        return sizeSort(a.cumulativeSize || a.size, b.cumulativeSize || b.size)\n      }\n    }\n\n    if (a.type === 'directory') {\n      return -1\n    } else {\n      return 1\n    }\n  })\n}\n\n/**\n * @typedef {Object} Info\n * @property {string} path\n * @property {string} realPath\n * @property {boolean} isMfs\n * @property {boolean} isPins\n * @property {boolean} isRoot\n *\n * @param {string} path\n * @param {boolean} uriDecode\n * @returns {Info|void}\n */\nexport const infoFromPath = (path, uriDecode = true) => {\n  const info = {\n    path: path,\n    realPath: '',\n    isMfs: false,\n    isPins: false,\n    isRoot: false\n  }\n\n  /**\n   * @param {string} prefix\n   */\n  const check = (prefix) => {\n    info.realPath = info.path.substr(prefix.length).trim() || '/'\n    info.isRoot = info.realPath === '/'\n  }\n\n  if (info.path.startsWith('/ipns') || info.path.startsWith('/ipfs')) {\n    info.realPath = info.path\n    info.isRoot = info.path === '/ipns' || info.path === '/ipfs'\n  } else if (info.path.startsWith('/files')) {\n    check('/files')\n    info.isMfs = true\n  } else if (info.path.startsWith('/pins')) {\n    check('/pins')\n    info.isPins = true\n\n    if (info.realPath !== '/') {\n      info.realPath = `/ipfs${info.realPath}`\n    }\n  } else {\n    return\n  }\n\n  if (info.path.endsWith('/') && info.realPath !== '/') {\n    info.path = info.path.substring(0, info.path.length - 1)\n    info.realPath = info.realPath.substring(0, info.realPath.length - 1)\n  }\n\n  if (uriDecode) {\n    info.realPath = decodeURIComponent(info.realPath)\n    info.path = decodeURIComponent(info.path)\n  }\n\n  return info\n}\n\n/**\n * @template T\n * @implements {AsyncIterable<T>}\n */\nexport class Channel {\n  constructor () {\n    this.done = false\n    /** @type {T[]} */\n    this.queue = []\n    /** @type {{resolve(value:IteratorResult<T, void>):void, reject(error:any):void}[]} */\n    this.pending = []\n  }\n\n  [Symbol.asyncIterator] () {\n    return this\n  }\n\n  /**\n   * @returns {Promise<IteratorResult<T, void>>}\n   */\n  async next () {\n    const { done, queue, pending } = this\n    if (done) {\n      return { done, value: undefined }\n    } else if (queue.length > 0) {\n      const value = queue[queue.length - 1]\n      queue.pop()\n      return { done, value }\n    } else {\n      return await new Promise((resolve, reject) => {\n        pending.unshift({ resolve, reject })\n      })\n    }\n  }\n\n  /**\n   * @param {T} value\n   */\n  send (value) {\n    const { done, pending, queue } = this\n    if (done) {\n      throw Error('Channel is closed')\n    } else if (pending.length) {\n      const promise = pending[pending.length - 1]\n      pending.pop()\n      promise.resolve({ done, value })\n    } else {\n      queue.unshift(value)\n    }\n  }\n\n  /**\n   * @param {Error|void} error\n   */\n  close (error) {\n    const { done, pending } = this\n    if (done) {\n      throw Error('Channel is already closed')\n    } else {\n      this.done = true\n      for (const promise of pending) {\n        if (error) {\n          promise.reject(error)\n        } else {\n          promise.resolve({ done: true, value: undefined })\n        }\n      }\n      pending.length = 0\n    }\n  }\n}\n\n/**\n * @param {import('./selectors').Selectors} store\n */\nexport const ensureMFS = (store) => {\n  const info = store.selectFilesPathInfo()\n  if (!info || !info.isMfs) {\n    throw new Error('Unable to perform task if not in MFS')\n  }\n}\n","import i18n from 'i18next'\nimport ICU from 'i18next-icu'\nimport Backend from 'i18next-chained-backend'\nimport LocalStorageBackend from 'i18next-localstorage-backend'\nimport HttpBackend from 'i18next-http-backend'\nimport LanguageDetector from 'i18next-browser-languagedetector'\nimport { version } from '../package.json'\n\nimport locales from './lib/languages.json'\nexport const localesList = Object.values(locales)\n\ni18n\n  .use(ICU)\n  .use(Backend)\n  .use(LanguageDetector)\n  .init({\n    backend: {\n      backends: [\n        LocalStorageBackend,\n        HttpBackend\n      ],\n      backendOptions: [\n        { // LocalStorageBackend\n          defaultVersion: version,\n          expirationTime: (!process.env.NODE_ENV || process.env.NODE_ENV === 'development') ? 1 : 7 * 24 * 60 * 60 * 1000\n        },\n        { // HttpBackend\n          // ensure a relative path is used to look up the locales, so it works when loaded from /ipfs/<cid>\n          loadPath: 'locales/{{lng}}/{{ns}}.json'\n        }\n      ]\n    },\n    ns: ['app', 'welcome', 'status', 'files', 'explore', 'peers', 'settings', 'notify'],\n    defaultNS: 'app',\n    fallbackNS: 'app',\n    fallbackLng: {\n      'zh-Hans': ['zh-CN', 'en'],\n      'zh-Hant': ['zh-TW', 'en'],\n      zh: ['zh-CN', 'en'],\n      default: ['en']\n    },\n    debug: process.env.DEBUG,\n    // react i18next special options (optional)\n    react: {\n      wait: true,\n      useSuspense: false,\n      bindI18n: 'languageChanged loaded',\n      bindStore: 'added removed',\n      nsMode: 'default'\n    }\n  })\n\nexport default i18n\n","import React from 'react'\n\nconst StrokeCube = props => (\n  <svg viewBox='0 0 100 100' {...props}>\n    <path d='M84.173 64.865v-29.1a4.48 4.48 0 1 0-4.4-7.63l-25.35-14.61a4.7 4.7 0 0 0 0-1.5 4.485 4.485 0 0 0-8.86 1.4v.17l-25 14.85a4.48 4.48 0 1 0-4.74 7.32v29.08a4.48 4.48 0 0 0 1.5 8.71 4.14 4.14 0 0 0 .7-.06 4.24 4.24 0 0 0 1.51-.5l26 14.72v.27a4.49 4.49 0 0 0 4.49 3.76 4.2 4.2 0 0 0 .7 0 4.5 4.5 0 0 0 3.78-4.19l25-15.32a4.48 4.48 0 0 0 3.2 1.37 4.23 4.23 0 0 0 .7-.06 4.47 4.47 0 0 0 .8-8.63zm-5.15 1.56a4.42 4.42 0 0 0-.82 3l-24.63 15.13a4.5 4.5 0 0 0-2.55-1.66v-28.55a4.48 4.48 0 0 0 3.44-5l25-14.77a4.46 4.46 0 0 0 1.74 1.15v29.12a4.46 4.46 0 0 0-2.18 1.58zm-32.67 18.27l-24.81-14a4.34 4.34 0 0 0 .26-2.3 4.44 4.44 0 0 0-2.93-3.5v-29.13a4.61 4.61 0 0 0 1.44-.85l25.33 14.16a4.4 4.4 0 0 0 0 1.62 4.48 4.48 0 0 0 3.38 3.66v28.55a4.52 4.52 0 0 0-2.67 1.79zm3.67-67.48a4.23 4.23 0 0 0 .7-.06 4.33 4.33 0 0 0 2.2-1l25.35 14.58a4.76 4.76 0 0 0 0 1.51 4 4 0 0 0 .17.66l-24.71 14.59a4.46 4.46 0 0 0-7.25-.24l-25-14a4.31 4.31 0 0 0 .33-2.06l25.34-15a4.48 4.48 0 0 0 2.87 1.02zm.39 35.24a2.49 2.49 0 1 1 2.07-2.85 2.5 2.5 0 0 1-2.07 2.85zm31.87-23.37a2.49 2.49 0 1 1-2.07 2.84 2.49 2.49 0 0 1 2.07-2.84zm-32.65-18.81a2.49 2.49 0 1 1-2.07 2.84 2.49 2.49 0 0 1 2.07-2.84zm-34.71 21.65a2.49 2.49 0 1 1 2.84 2.07 2.48 2.48 0 0 1-2.84-2.07zm2.84 39.6a2.49 2.49 0 0 1-.74-4.91 2.43 2.43 0 0 1 1.85.44 2.48 2.48 0 0 1-1.07 4.47zm32.65 18.19a2.49 2.49 0 1 1 2.07-2.84 2.5 2.5 0 0 1-2.07 2.84zm32.61-18.19a2.49 2.49 0 1 1-.78-4.91 2.47 2.47 0 0 1 2.84 2.06 2.49 2.49 0 0 1-2.06 2.85z' />\n  </svg>\n)\n\nexport default StrokeCube\n","import React, { useState } from 'react'\nimport { Trans } from 'react-i18next'\nimport { connect } from 'redux-bundler-react'\nimport Checkbox from '../checkbox/Checkbox'\nimport Details from '../details/Details'\n\nconst ExampleRequest = ({ url, method = 'GET' }) => {\n  return (\n    <pre className='overflow-x-scroll pa3 mr3 f6 ba b--black-10 br2 bg-snow-muted'>\n      <code className='green'>{method}</code> {url}\n    </pre>\n  )\n}\n\nconst QueryParams = ({ url }) => {\n  if (!url) return null\n  const params = (new URL(url)).searchParams\n  const entries = [...params]\n  return (\n    <dl className='pa3 mr3 f7 overflow-x-scroll monospace nowrap ba b--black-10 br2 bg-snow-muted'>\n      {entries.map(([key, value]) => (\n        <div key={`QueryParams-${key}`}>\n          <dt className='dib green'>{key}:</dt>\n          <dd className='dib ml1'>{value}</dd>\n        </div>\n      ))}\n    </dl>\n  )\n}\n\nconst AnalyticType = ({ children, onChange, enabled, label, summary, exampleRequest, queryParams, sourceLink, sourceLinkLabel = 'view source' }) => {\n  // show hide state. update react.\n  const [isOpen, setOpen] = useState(false)\n  return (\n    <section className='bg-white bb b--black-10'>\n      <div className='flex items-center'>\n        <Checkbox className='pv3 pl3 pr1 bg-white flex-none' onChange={onChange} checked={enabled} label={\n          <span className='fw5 f6'>{label}</span>\n        } />\n        <div className='truncate fw4 f6 flex-auto charcoal-muted'>&ndash; {summary}</div>\n        <button className='focus-outline bg-transparent pa3 bn link blue flex-none' onClick={() => setOpen(!isOpen)} style={{ minWidth: 100 }}>\n          {isOpen ? 'Close' : 'Show me' }\n        </button>\n      </div>\n      {isOpen && (\n        <div className='ph3 nt2 pb3'>\n          {children}\n          {sourceLink && (\n            <p>\n              <a href={sourceLink} className='link blue' target='_blank' rel='noopener noreferrer'>View source</a>\n            </p>\n          )}\n          {exampleRequest && (\n            <div>\n              <h3 className='f5 fw6'>Example request</h3>\n              <ExampleRequest url={exampleRequest} />\n              <h4 className='f6 fw5'>Query parameters</h4>\n              <QueryParams url={exampleRequest} />\n            </div>\n          )}\n        </div>\n      )}\n    </section>\n  )\n}\n\nconst AnalyticsToggle = ({ analyticsActionsToRecord, analyticsConsent, doToggleConsent, doToggleAnalytics, analyticsEnabled, t, open }) => {\n  return (\n    <React.Fragment>\n      <Checkbox className='dib' onChange={doToggleAnalytics} checked={analyticsEnabled} label={\n        <span className='f5'>\n          {t('AnalyticsToggle.label')}\n        </span>\n      } />\n      <div className='f6 charcoal lh-copy'>\n        <p className='mb0'>{t('AnalyticsToggle.paragraph1')}</p>\n        <Details summaryText={t('AnalyticsToggle.summary')} className='pt2' open={open}>\n          <p>\n            <Trans i18nKey='AnalyticsToggle.paragraph2' t={t}>\n              Protocol Labs hosts a <a className='link blue' href='https://count.ly/'>Countly</a> instance to record anonymous usage data for this app.\n            </Trans>\n          </p>\n          <p>{t('AnalyticsToggle.optionalInfo')}</p>\n          <AnalyticType\n            onChange={() => doToggleConsent('sessions')}\n            enabled={analyticsConsent.includes('sessions')}\n            label={t('AnalyticsToggle.sessions.label')}\n            summary={t('AnalyticsToggle.sessions.summary')}\n            sourceLink='https://github.com/Countly/countly-sdk-web/blob/93442edbe8c108618c88cc9e1ad179892c42940b/lib/countly.js#L1885-L1953'\n            exampleRequest='https://countly.ipfs.io/i?begin_session=1&metrics=%7B%22_app_version%22%3A%222.4.0%22%2C%22_ua%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_14_2)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F72.0.3626.121%20Safari%2F537.36%22%2C%22_resolution%22%3A%221920x1080%22%2C%22_density%22%3A2%2C%22_locale%22%3A%22en-GB%22%7D&app_key=700fd825c3b257e021bd9dbc6cbf044d33477531&device_id=804117b1-c21d-4e55-a65f-f9dbbe9a1f91&sdk_name=javascript_native_web&sdk_version=19.02.1&timestamp=1552296210554&hour=9&dow=1&consent=%7B%22sessions%22%3Atrue%2C%22events%22%3Atrue%2C%22views%22%3Atrue%2C%22location%22%3Atrue%2C%22crashes%22%3Atrue%7D'>\n            <Trans i18nKey='AnalyticsToggle.sessions.details' t={t}>\n              <p>The following browser metrics are sent</p>\n              <ul>\n                <li>A random, generated device ID</li>\n                <li>Timestamp when the session starts</li>\n                <li>Periodic timestamps to track duration</li>\n                <li>App version e.g. \"2.4.4\"</li>\n                <li>Locale e.g. \"en-GB\"</li>\n                <li>User Agent e.g. \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) ...\"</li>\n                <li>Screen resolution e.g. \"800x600\"</li>\n                <li>Screen pixel density e.g. \"1\"</li>\n              </ul>\n            </Trans>\n          </AnalyticType>\n\n          <AnalyticType\n            onChange={() => doToggleConsent('events')}\n            enabled={analyticsConsent.includes('events')}\n            label={t('AnalyticsToggle.events.label')}\n            summary={t('AnalyticsToggle.events.summary')}\n            sourceLink='https://github.com/ipfs-shipyard/ipfs-webui/blob/30a077efe5198bf6403681b094ab585a88395c40/src/bundles/analytics.js#L93-L111'\n            exampleRequest='https://countly.ipfs.io/i?events=%5B%7B%22key%22%3A%22FILES_MAKEDIR%22%2C%22count%22%3A1%2C%22dur%22%3A0.015194999985396862%2C%22timestamp%22%3A1552296333639%2C%22hour%22%3A9%2C%22dow%22%3A1%7D%5D&app_key=700fd825c3b257e021bd9dbc6cbf044d33477531&device_id=804117b1-c21d-4e55-a65f-f9dbbe9a1f91&sdk_name=javascript_native_web&sdk_version=19.02.1&timestamp=1552296333640&hour=9&dow=1'>\n            <p>\n              <Trans i18nKey='AnalyticsToggle.events.details' t={t}>\n                App specific actions. We record only that the action happened, how long it took from start to finish, and a count if the event involved multiple items.\n              </Trans>\n            </p>\n            <p>The recorded actions are:</p>\n            <ul>\n              {analyticsActionsToRecord.map(name => (\n                <li key={name} className='mb1'>\n                  <code className='f7 bg-snow-muted pa1 br2'>{name}</code>\n                </li>\n              ))}\n            </ul>\n          </AnalyticType>\n\n          <AnalyticType\n            onChange={() => doToggleConsent('views')}\n            enabled={analyticsConsent.includes('views')}\n            label={t('AnalyticsToggle.views.label')}\n            summary={t('AnalyticsToggle.views.summary')}\n            sourceLink='https://github.com/ipfs-shipyard/ipfs-webui/blob/2fb9df4e7b294f26b35b1dd76084fe85672b6f2b/src/bundles/analytics.js#L81-L86'\n            exampleRequest='https://countly.ipfs.io/i?events=%5B%7B%22key%22%3A%22%5BCLY%5D_view%22%2C%22count%22%3A1%2C%22dur%22%3A2%2C%22segmentation%22%3A%7B%22name%22%3A%22%2F%22%7D%2C%22timestamp%22%3A1552296364914%2C%22hour%22%3A9%2C%22dow%22%3A1%7D%2C%7B%22key%22%3A%22%5BCLY%5D_view%22%2C%22count%22%3A1%2C%22segmentation%22%3A%7B%22name%22%3A%22%2Ffiles*%22%2C%22visit%22%3A1%2C%22domain%22%3A%22localhost%22%2C%22view%22%3A%22%2F%22%7D%2C%22timestamp%22%3A1552296364915%2C%22hour%22%3A9%2C%22dow%22%3A1%7D%5D&app_key=700fd825c3b257e021bd9dbc6cbf044d33477531&device_id=804117b1-c21d-4e55-a65f-f9dbbe9a1f91&sdk_name=javascript_native_web&sdk_version=19.02.1&timestamp=1552296364916&hour=9&dow=1'>\n            <p>{t('AnalyticsToggle.views.details')}</p>\n          </AnalyticType>\n\n          <AnalyticType\n            onChange={() => doToggleConsent('location')}\n            enabled={analyticsConsent.includes('location')}\n            label={t('AnalyticsToggle.location.label')}\n            summary={t('AnalyticsToggle.location.summary')}\n            sourceLink='https://github.com/Countly/countly-sdk-web/blob/93442edbe8c108618c88cc9e1ad179892c42940b/lib/countly.js#L1736-L1751'>\n            <p>{t('AnalyticsToggle.location.details')}</p>\n          </AnalyticType>\n\n          <AnalyticType\n            onChange={() => doToggleConsent('crashes')}\n            enabled={analyticsConsent.includes('crashes')}\n            label={t('AnalyticsToggle.crashes.label')}\n            summary={t('AnalyticsToggle.crashes.summary')}\n            sourceLink='https://github.com/ipfs-shipyard/ipfs-webui/blob/2fb9df4e7b294f26b35b1dd76084fe85672b6f2b/src/bundles/analytics.js#L115-L121'\n            exampleRequest='https://countly.ipfs.io/i?crash=%7B%22_resolution%22%3A%221920x1080%22%2C%22_error%22%3A%22Error%3A%20example%20error%5Cn%20%20%20%20at%20Object._callee%24%20(http%3A%2F%2Flocalhost%3A3000%2Fstatic%2Fjs%2Fbundle.js%3A192105%3A63)%5Cn%20%20%20%20at%20tryCatch%20(http%3A%2F%2Flocalhost%3A3000%2Fstatic%2Fjs%2Fbundle.js%3A173974%3A40)%5Cn%20%20%20%20at%20Generator.invoke%20%5Bas%20_invoke%5D%20(http%3A%2F%2Flocalhost%3A3000%2Fstatic%2Fjs%2Fbundle.js%3A174208%3A22)%5Cn%20%20%20%20at%20Generator.prototype.(anonymous%20function)%20%5Bas%20next%5D%20(http%3A%2F%2Flocalhost%3A3000%2Fstatic%2Fjs%2Fbundle.js%3A174026%3A21)%5Cn%20%20%20%20at%20step%20(http%3A%2F%2Flocalhost%3A3000%2Fstatic%2Fjs%2Fbundle.js%3A192086%3A191)%5Cn%20%20%20%20at%20http%3A%2F%2Flocalhost%3A3000%2Fstatic%2Fjs%2Fbundle.js%3A192086%3A361%22%2C%22_app_version%22%3A%222.4.0%22%2C%22_run%22%3A5%2C%22_not_os_specific%22%3Atrue%2C%22_online%22%3Atrue%2C%22_background%22%3Atrue%2C%22_logs%22%3A%22STATS_FETCH_FAILED%22%2C%22_nonfatal%22%3Atrue%2C%22_view%22%3A%22%2F%23%2Fsettings%22%2C%22_custom%22%3Anull%2C%22_opengl%22%3A%22WebGL%201.0%20(OpenGL%20ES%202.0%20Chromium)%22%7D&app_key=700fd825c3b257e021bd9dbc6cbf044d33477531&device_id=d96d67ff-4797-45da-83b4-9e8f599cd12a&sdk_name=javascript_native_web&sdk_version=19.02.1&timestamp=1552294449012&hour=8&dow=1'>\n            <p>\n              <Trans i18nKey='AnalyticsToggle.crashes.details' t={t}>\n                Records JavaScript error messages and stack traces that occur while using the app, where possible. It is very helpful to know when the app is not working for you, but <b>error messages may include identifiable information</b> like CIDs or file paths, so only enable this if you are comfortable sharing that information with us.\n              </Trans>\n            </p>\n          </AnalyticType>\n\n        </Details>\n      </div>\n    </React.Fragment>\n  )\n}\n\nexport default connect(\n  'selectAnalyticsEnabled',\n  'selectAnalyticsConsent',\n  'selectAnalyticsActionsToRecord',\n  'doToggleAnalytics',\n  'doToggleConsent',\n  AnalyticsToggle\n)\n","import React from 'react'\n\nconst GlyphSmallTick = props => (\n  <svg viewBox='0 0 100 100' {...props}>\n    <path d='M44.39 66.09L32.74 54.44l3.92-3.92 7.73 7.73 19.36-19.36 3.92 3.92z' />\n  </svg>\n)\n\nexport default GlyphSmallTick\n","import React from 'react'\nimport 'details-polyfill'\n\nconst Details = ({\n  summaryText = 'Advanced',\n  children,\n  onClick,\n  ...props\n}) => {\n  return (\n    <details {...props}>\n      <summary className='pointer blue outline-0' onClick={onClick}>{summaryText}</summary>\n      {children}\n    </details>\n  )\n}\n\nexport default Details\n","import { readSetting, writeSetting } from './local-storage'\n\nexport const DEFAULT_GATEWAY = 'https://ipfs.io' // TODO: switch to dweb.link when https://github.com/ipfs/go-ipfs/issues/7318\nconst IMG_HASH = 'bafybeibwzifw52ttrkqlikfzext5akxu7lz4xiwjgwzmqcpdzmp3n5vnbe' // 1x1px image\n\nconst readPublicGatewaySetting = () => {\n  const setting = readSetting('ipfsPublicGateway')\n  return setting || DEFAULT_GATEWAY\n}\n\nconst init = () => ({\n  availableGateway: null,\n  publicGateway: readPublicGatewaySetting()\n})\n\nexport const checkValidHttpUrl = (value) => {\n  let url\n\n  try {\n    url = new URL(value)\n  } catch (_) {\n    return false\n  }\n\n  return url.protocol === 'http:' || url.protocol === 'https:'\n}\n\nexport const checkViaImgSrc = (gatewayUrl) => {\n  const url = new URL(gatewayUrl)\n  const imgUrl = new URL(`${url.protocol}//${url.hostname}/ipfs/${IMG_HASH}?now=${Date.now()}&filename=1x1.png#x-ipfs-companion-no-redirect`)\n\n  // we check if gateway is up by loading 1x1 px image:\n  // this is more robust check than loading js, as it won't be blocked\n  // by privacy protections present in modern browsers or in extensions such as Privacy Badger\n  const imgCheckTimeout = 15000\n  return new Promise((resolve, reject) => {\n    const timeout = () => {\n      if (!timer) return false\n      clearTimeout(timer)\n      timer = null\n      return true\n    }\n\n    let timer = setTimeout(() => { if (timeout()) reject(new Error()) }, imgCheckTimeout)\n    const img = new Image()\n\n    img.onerror = () => {\n      timeout()\n      reject(new Error())\n    }\n\n    img.onload = () => {\n      // subdomain works\n      timeout()\n      resolve()\n    }\n\n    img.src = imgUrl\n  })\n}\n\nconst bundle = {\n  name: 'gateway',\n\n  reducer: (state = init(), action) => {\n    if (action.type === 'SET_AVAILABLE_GATEWAY') {\n      return { ...state, availableGateway: action.payload }\n    }\n\n    if (action.type === 'SET_PUBLIC_GATEWAY') {\n      return { ...state, publicGateway: action.payload }\n    }\n\n    return state\n  },\n\n  doSetAvailableGateway: url => ({ dispatch }) => dispatch({ type: 'SET_AVAILABLE_GATEWAY', payload: url }),\n\n  doUpdatePublicGateway: (address) => async ({ dispatch }) => {\n    await writeSetting('ipfsPublicGateway', address)\n    dispatch({ type: 'SET_PUBLIC_GATEWAY', payload: address })\n  },\n\n  selectAvailableGateway: (state) => state?.gateway?.availableGateway,\n\n  selectPublicGateway: (state) => state?.gateway?.publicGateway\n}\n\nexport default bundle\n","import { dirname } from 'path'\n\n/**\n* countDirs: find all the dirs that will be created from a list of paths.\n*\n* files is an array of file objects as passed to ipfs.added\n* The root dir is counted, and All entries are assumed to be file paths,\n* `/foo` is assumed to be a file `foo` with no extention in the root dir,\n* which would be counted as 1 unigue dir by this function.\n*\n* ```js\n* files = [\n*   { path: '/foo/bar/foo.txt', ... }\n*   { path: '/foo/bar/odd', ... }\n* ]\n* countDirs(files) === 3\n* // ['/', '/foo', '/foo/bar']\n* ```\n*\n* We need to calculat how many directories are in the tree.\n*\n* See: https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/FILES.md#add\n* @param {{path:string}[]} files\n* @returns {number}\n*/\nfunction countDirs (files) {\n  if (!files || !files.length) return 0\n  const paths = files.map(f => f.path)\n    .filter(p => !!p)\n\n  // [ /foo/bar, /foo/other, /foo/zoom, /aaa/other ]\n  const directories = new Set()\n  paths.forEach(path => findUniqueDirectories(path, directories))\n  return directories.size\n}\n\n/**\n *\n * @param {string} path\n * @param {Set<string>} [res]\n * @returns {Set<string>}\n */\nfunction findUniqueDirectories (path, res = new Set()) {\n  if (!path) return res\n  const name = dirname(path)\n  if (name === '.') return res\n  res.add(name)\n  if (name === '/') return res\n  return findUniqueDirectories(name, res)\n}\n\nexport default countDirs\n","/* eslint-disable require-yield */\n\nimport { join, dirname, basename } from 'path'\nimport { getDownloadLink, getShareableLink } from '../../lib/files'\nimport countDirs from '../../lib/count-dirs'\nimport memoize from 'p-memoize'\nimport all from 'it-all'\nimport map from 'it-map'\nimport last from 'it-last'\nimport CID from 'cids'\n\nimport { spawn, perform, send, ensureMFS, Channel, sortFiles, infoFromPath } from './utils'\nimport { IGNORED_FILES, ACTIONS } from './consts'\n\n/**\n * @typedef {import('ipfs').IPFSService} IPFSService\n * @typedef {import('../../lib/files').FileStream} FileStream\n * @typedef {import('./utils').Info} Info\n * @typedef {import('ipfs').Pin} Pin\n */\n\n/**\n * @typedef {Object} FileStat\n * @property {number} size\n * @property {'directory'|'file'|'unknown'} type\n * @property {CID} cid\n * @property {string} name\n * @property {string} path\n * @property {boolean} pinned\n * @property {boolean|void} isParent\n *\n * @param {Object} stat\n * @param {'dir'|'directory'|'file'|'unknown'} stat.type\n * @param {CID} stat.cid\n * @param {string} stat.path\n * @param {number} [stat.cumulativeSize]\n * @param {number} stat.size\n * @param {string|void} [stat.name]\n * @param {boolean|void} [stat.pinned]\n * @param {boolean|void} [stat.isParent]\n * @param {string} [prefix]\n * @returns {FileStat}\n */\nconst fileFromStats = ({ cumulativeSize, type, size, cid, name, path, pinned, isParent }, prefix = '/ipfs') => ({\n  size: cumulativeSize || size || 0,\n  type: type === 'dir' ? 'directory' : type,\n  cid,\n  name: name || path.split('/').pop() || cid.toString(),\n  path: path || `${prefix}/${cid.toString()}`,\n  pinned: Boolean(pinned),\n  isParent: isParent\n})\n\n/**\n * @param {IPFSService} ipfs\n * @param {string|CID} cidOrPath\n * @returns {Promise<number>}\n */\nconst cumulativeSize = async (ipfs, cidOrPath) => {\n  const { cumulativeSize } = await stat(ipfs, cidOrPath)\n  return cumulativeSize || 0\n}\n\n/**\n * @param {string} path\n * @returns {string}\n */\n// TODO: use sth else\nexport const realMfsPath = (path) => {\n  if (path.startsWith('/files')) {\n    return path.substr('/files'.length) || '/'\n  }\n\n  return path\n}\n\nconst memStat = memoize((path, ipfs) => ipfs.files.stat(path))\n\n/**\n * @typedef {Object} Stat\n * @property {string} path\n * @property {'file'|'directory'|'unknown'} type\n * @property {CID} cid\n * @property {number} cumulativeSize\n * @property {number} size\n *\n * @param {IPFSService} ipfs\n * @param {string|CID} cidOrPath\n * @returns {Promise<Stat>}\n */\nconst stat = async (ipfs, cidOrPath) => {\n  const hashOrPath = cidOrPath.toString()\n  const path = hashOrPath.startsWith('/')\n    ? hashOrPath\n    : `/ipfs/${hashOrPath}`\n\n  try {\n    let stats\n    if (path.startsWith('/ipfs/')) {\n      stats = await memStat(path, ipfs)\n    } else {\n      stats = await ipfs.files.stat(path)\n    }\n    return { path, ...stats }\n  } catch (e) {\n    // Discard error and mark DAG as 'unknown' to unblock listing other pins.\n    // Clicking on 'unknown' entry will open it in Inspector.\n    // No information is lost: if there is an error related\n    // to specified hashOrPath user will read it in Inspector.\n    const [, , cid] = path.split('/')\n    return {\n      path: hashOrPath,\n      cid: new CID(cid),\n      type: 'unknown',\n      cumulativeSize: 0,\n      size: 0\n    }\n  }\n}\n\n/**\n *\n * @param {IPFSService} ipfs\n * @returns {AsyncIterable<Pin>}\n */\nconst getRawPins = async function * (ipfs) {\n  yield * ipfs.pin.ls({ type: 'recursive' })\n  yield * ipfs.pin.ls({ type: 'direct' })\n}\n\n/**\n * @param {IPFSService} ipfs\n * @returns {AsyncIterable<CID>}\n */\nconst getPinCIDs = (ipfs) => map(getRawPins(ipfs), (pin) => pin.cid)\n\n/**\n * @param {IPFSService} ipfs\n * @returns {AsyncIterable<FileStat>}\n */\nconst getPins = async function * (ipfs) {\n  for await (const cid of getPinCIDs(ipfs)) {\n    const info = await stat(ipfs, cid)\n    yield fileFromStats({ ...info, pinned: true }, '/pins')\n  }\n}\n\n/**\n * @typedef {import('./protocol').Message} Message\n * @typedef {import('./protocol').Model} Model\n\n * @typedef {import('./selectors').Selectors} Selectors\n * @typedef {import('../ipfs-provider').IPFSProviderStore} IPFSProviderStore\n * @typedef {import('../connected').Selectors} ConnectedSelectors\n *\n * @typedef {Object} ConfigSelectors\n * @property {function():string} selectApiUrl\n * @property {function():string} selectGatewayUrl\n * @property {function():string} selectPublicGateway\n *\n * @typedef {Object} UnkonwActions\n * @property {function(string):Promise<unknown>} doUpdateHash\n * @typedef {Selectors & Actions & IPFSProviderStore & ConnectedSelectors & ConfigSelectors & UnkonwActions} Ext\n * @typedef {import('../ipfs-provider').Extra} Extra\n * @typedef {import('redux-bundler').Store<Model, Message, Ext>} Store\n * @typedef {import('redux-bundler').Context<Model, Message, Ext, Extra>} Context\n * @typedef {import('./protocol').PageContent} PageContent\n *\n * @typedef {import('redux-bundler').Actions<ReturnType<typeof actions>>} Actions\n *\n */\n\nconst actions = () => ({\n  /**\n   * Fetches list of pins and updates `state.pins` on successful completion.\n   * @returns {function(Context):Promise<{pins: CID[]}>}\n   */\n  doPinsFetch: () => perform(ACTIONS.PIN_LIST, async (ipfs) => {\n    const cids = await all(getPinCIDs(ipfs))\n\n    return { pins: cids }\n  }),\n\n  /**\n   * Syncs currently selected path file list.\n   * @returns {function(Context):Promise<void>}\n   */\n  doFilesFetch: () => async ({ store }) => {\n    const isReady = store.selectIpfsReady()\n    const isConnected = store.selectIpfsConnected()\n    const isFetching = store.selectFilesIsFetching()\n    const info = store.selectFilesPathInfo()\n    if (isReady && isConnected && !isFetching && info) {\n      await store.doFetch(info)\n    }\n  },\n\n  /**\n   * Fetches conten for the currently selected path. And updates\n   * `state.pageContent` on succesful completion.\n   * @param {Info} info\n   * @returns {function(Context): *}\n   */\n  doFetch: ({ path, realPath, isMfs, isPins, isRoot }) => perform(ACTIONS.FETCH, async (ipfs, { store }) => {\n    if (isRoot && !isMfs && !isPins) {\n      throw new Error('not supposed to be here')\n    }\n\n    if (isRoot && isPins) {\n      const pins = await all(getPins(ipfs)) // FIX: pins path\n\n      return {\n        path: '/pins',\n        fetched: Date.now(),\n        type: 'directory',\n        content: pins\n      }\n    }\n\n    const resolvedPath = realPath.startsWith('/ipns')\n      ? await last(ipfs.name.resolve(realPath))\n      : realPath\n\n    const stats = await stat(ipfs, resolvedPath)\n    const time = Date.now()\n\n    switch (stats.type) {\n      case 'unknown': {\n        return {\n          fetched: time,\n          ...stats\n        }\n      }\n      case 'file': {\n        return {\n          ...fileFromStats({ ...stats, path }),\n          fetched: time,\n          type: 'file',\n          read: () => ipfs.cat(stats.cid),\n          name: path.split('/').pop(),\n          size: stats.size,\n          cid: stats.cid\n        }\n      }\n      case 'directory': {\n        return await dirStats(ipfs, stats.cid, {\n          path,\n          isRoot,\n          sorting: store.selectFilesSorting()\n        })\n      }\n      default: {\n        throw Error(`Unsupported file type \"${stats.type}\"`)\n      }\n    }\n  }),\n\n  /**\n   * Imports given `source` files to the provided `root` path. On completion\n   * (success or fail) will trigger `doFilesFetch` to update the state.\n   * @param {FileStream[]} source\n   * @param {string} root\n   */\n  doFilesWrite: (source, root) => spawn(ACTIONS.WRITE, async function * (ipfs, { store }) {\n    const files = source\n      // Skip ignored files\n      .filter($ => !IGNORED_FILES.includes(basename($.path)))\n      // Dropped files come as absolute, those added by the file input come\n      // as relative paths, so normalise all to be relative.\n      .map($ => $.path[0] === '/' ? { ...$, path: $.path.slice(1) } : $)\n\n    const totalSize = files.reduce((prev, { size }) => prev + size, 0)\n\n    const entries = files.map(({ path, size }) => ({ path, size }))\n\n    yield { entries, progress: 0 }\n\n    const { result, progress } = importFiles(ipfs, files)\n\n    /** @type {null|{uploaded:number, offset:number, name:string}} */\n    let status = null\n\n    for await (const { name, offset } of progress) {\n      status = status == null\n        ? { uploaded: 0, offset, name }\n        : name === status.name\n          ? { uploaded: status.uploaded, offset, name }\n          : { uploaded: status.uploaded + status.offset, offset, name }\n      const progress = (status.uploaded + status.offset) / totalSize * 100\n\n      yield { entries, progress }\n    }\n\n    try {\n      const added = await result\n\n      const numberOfFiles = files.length\n      const numberOfDirs = countDirs(files)\n      const expectedResponseCount = numberOfFiles + numberOfDirs\n\n      if (added.length !== expectedResponseCount) {\n        // See https://github.com/ipfs/js-ipfs-api/issues/797\n        throw Object.assign(new Error('API returned a partial response.'), {\n          code: 'ERR_API_RESPONSE'\n        })\n      }\n\n      for (const { path, cid } of added) {\n        // Only go for direct children\n        if (path.indexOf('/') === -1 && path !== '') {\n          const src = `/ipfs/${cid}`\n          const dst = join(realMfsPath(root || '/files'), path)\n\n          try {\n            await ipfs.files.cp(src, dst)\n          } catch (err) {\n            // TODO: Not sure why we do this. Perhaps a generic error is used\n            // to avoid leaking private information via Countly?\n            throw Object.assign(new Error('ipfs.files.cp call failed'), {\n              code: 'ERR_FILES_CP_FAILED'\n            })\n          }\n        }\n      }\n\n      yield { entries, progress: 100 }\n      return entries\n    } finally {\n      await store.doFilesFetch()\n    }\n  }),\n\n  /**\n   * Deletes `files` with provided paths. On completion (success sor fail) will\n   * trigger `doFilesFetch` to update the state.\n   * @param {Object} args\n   * @param {FileStat[]} args.files\n   * @param {boolean} args.removeLocally\n   * @param {boolean} args.removeRemotely\n   * @param {string[]} args.remoteServices\n   */\n  doFilesDelete: ({ files, removeLocally, removeRemotely, remoteServices }) => perform(ACTIONS.DELETE, async (ipfs, { store }) => {\n    ensureMFS(store)\n\n    if (files.length === 0) return undefined\n\n    /**\n     * Execute function asynchronously in a best-effort fashion.\n     * We don't want any edge case (like a directory with multiple copies of\n     * same file) to crash webui, nor want to bother user with false-negatives\n     * @param {Function} fn\n     */\n    const tryAsync = async fn => { try { await fn() } catch (_) {} }\n\n    try {\n      // try removing from MFS first\n      await Promise.all(\n        files.map(async file => ipfs.files.rm(realMfsPath(file.path), {\n          recursive: true\n        }))\n      )\n\n      // Pin cleanup only if MFS removal was successful\n      if (removeRemotely) {\n        // remote unpin can be slow, so we do this async in best-effort fashion\n        files.forEach(file => remoteServices.map(async service => tryAsync(() =>\n          ipfs.pin.remote.rm({ cid: [file.cid], service })\n        )))\n      }\n\n      if (removeLocally) {\n        // removal of local pin can fail if same CID is present twice,\n        // this is done in best-effort as well\n        await Promise.all(files.map(async file => file.pinned && tryAsync(() =>\n          ipfs.pin.rm(file.cid)\n        )))\n      }\n\n      const src = files[0].path\n      const path = src.slice(0, src.lastIndexOf('/'))\n      await store.doUpdateHash(path)\n\n      return undefined\n    } finally {\n      await store.doFilesFetch()\n    }\n  }),\n\n  /**\n   * Adds file under the `src` path to the given `root` path. On completion will\n   * trigger `doFilesFetch` to update the state.\n   * @param {string} root\n   * @param {string} src\n   */\n  doFilesAddPath: (root, src) => perform(ACTIONS.ADD_BY_PATH, async (ipfs, { store }) => {\n    ensureMFS(store)\n\n    const path = realMfsPath(src)\n    /** @type {string} */\n    const name = (path.split('/').pop())\n    const dst = realMfsPath(join(root, name))\n    const srcPath = src.startsWith('/') ? src : `/ipfs/${name}`\n\n    try {\n      return await ipfs.files.cp(srcPath, dst)\n    } finally {\n      await store.doFilesFetch()\n    }\n  }),\n\n  /**\n   * Creates a download link for the provided files.\n   * @param {FileStat[]} files\n   */\n  doFilesDownloadLink: (files) => perform(ACTIONS.DOWNLOAD_LINK, async (ipfs, { store }) => {\n    const apiUrl = store.selectApiUrl()\n    const gatewayUrl = store.selectGatewayUrl()\n    return await getDownloadLink(files, gatewayUrl, apiUrl, ipfs)\n  }),\n\n  /**\n   * Generates sharable link for the provided files.\n   * @param {FileStat[]} files\n   */\n  doFilesShareLink: (files) => perform(ACTIONS.SHARE_LINK, async (ipfs, { store }) => {\n    // ensureMFS deliberately omitted here, see https://github.com/ipfs/ipfs-webui/issues/1744 for context.\n    const publicGateway = store.selectPublicGateway()\n    return await getShareableLink(files, publicGateway, ipfs)\n  }),\n\n  /**\n   * Moves file from `src` MFS path to a `dst` MFS path. On completion (success\n   * or fail) triggers `doFilesFetch` to update the state.\n   * @param {string} src\n   * @param {string} dst\n   */\n  doFilesMove: (src, dst) => perform(ACTIONS.MOVE, async (ipfs, { store }) => {\n    ensureMFS(store)\n\n    try {\n      await ipfs.files.mv(realMfsPath(src), realMfsPath(dst))\n\n      const page = store.selectFiles()\n      const pagePath = page && page.path\n      if (src === pagePath) {\n        await store.doUpdateHash(dst)\n      }\n    } finally {\n      await store.doFilesFetch()\n    }\n  }),\n\n  /**\n   * Copies file from `src` MFS path to a `dst` MFS path. On completion (success\n   * or fail) triggers `doFilesFetch` to update the state.\n  * @param {string} src\n  * @param {string} dst\n  */\n  doFilesCopy: (src, dst) => perform(ACTIONS.COPY, async (ipfs, { store }) => {\n    ensureMFS(store)\n\n    try {\n      await ipfs.files.cp(realMfsPath(src), realMfsPath(dst))\n    } finally {\n      await store.doFilesFetch()\n    }\n  }),\n\n  /**\n   * Creates a directory at given MFS `path`. On completion (success or fail)\n   * triggers `doFilesFetch` to update the state.\n   * @param {string} path\n   */\n  doFilesMakeDir: (path) => perform(ACTIONS.MAKE_DIR, async (ipfs, { store }) => {\n    ensureMFS(store)\n\n    try {\n      await ipfs.files.mkdir(realMfsPath(path), {\n        parents: true\n      })\n    } finally {\n      await store.doFilesFetch()\n    }\n  }),\n\n  /**\n   * Pins given `cid`. On completion (success or fail) triggers `doPinsFetch` to\n   * update the state.\n   * @param {CID} cid\n   */\n  doFilesPin: (cid) => perform(ACTIONS.PIN_ADD, async (ipfs, { store }) => {\n    try {\n      return await ipfs.pin.add(cid)\n    } finally {\n      await store.doPinsFetch()\n    }\n  }),\n\n  /**\n   * Unpins given `cid`. On completion (success or fail) triggers `doPinsFetch`\n   * to update the state.\n   * @param {CID} cid\n   */\n  doFilesUnpin: (cid) => perform(ACTIONS.PIN_REMOVE, async (ipfs, { store }) => {\n    try {\n      return await ipfs.pin.rm(cid)\n    } finally {\n      await store.doPinsFetch()\n    }\n  }),\n\n  /**\n   * Clears all failed tasks.\n   */\n  doFilesDismissErrors: () => send({ type: ACTIONS.DISMISS_ERRORS }),\n\n  /**\n   * @param {Object} fileArgs\n   * @param {string} fileArgs.path\n   * @param {string|CID} fileArgs.cid\n  */\n  doFilesNavigateTo: ({ path, cid }) =>\n    /**\n     * @param {Context} context\n     */\n    async ({ store }) => {\n      try {\n        const link = path.split('/').map(p => encodeURIComponent(p)).join('/')\n        const files = store.selectFiles()\n        const url = store.selectFilesPathInfo()\n\n        if (files && files.path === link && url) {\n          await store.doFilesFetch()\n        } else {\n          await store.doUpdateHash(link)\n        }\n      } catch (e) {\n        console.error(e)\n        store.doUpdateHash(`/ipfs/${cid}`)\n      }\n    },\n\n  /**\n   * @param {import('./consts').SORTING} by\n   * @param {boolean} asc\n   */\n  doFilesUpdateSorting: (by, asc) => send({\n    type: ACTIONS.UPDATE_SORT,\n    payload: { by, asc }\n  }),\n\n  /**\n   * Clears all the tasks (pending, complete and failed).\n   */\n  doFilesClear: () => send({ type: ACTIONS.CLEAR_ALL }),\n\n  /**\n   * Gets total size of the local pins. On successful completion `state.mfsSize` will get\n   * updated.\n   */\n  doPinsStatsGet: () => perform(ACTIONS.PINS_SIZE_GET, async (ipfs) => {\n    const pinsSize = -1 // TODO: right now calculating size of all pins is too expensive (requires ipfs.files.stat per CID)\n    let numberOfPins = 0\n\n    for await (const _ of ipfs.pin.ls({ type: 'recursive' })) { // eslint-disable-line  no-unused-vars\n      numberOfPins++\n    }\n\n    return { pinsSize, numberOfPins }\n  }),\n\n  /**\n   * Gets size of the MFS. On successful completion `state.mfsSize` will get\n   * updated.\n   */\n  doFilesSizeGet: () => perform(ACTIONS.SIZE_GET, async (ipfs) => {\n    return { size: await cumulativeSize(ipfs, '/') }\n  }),\n\n  /**\n   * @param {string|CID} cid\n  */\n  doGetFileSizeThroughCid: (cid) =>\n    /**\n     * @param {Object} store\n     * @param {Function} store.getIpfs\n    */\n    async (store) => {\n      const ipfs = store.getIpfs()\n      return cumulativeSize(ipfs, cid)\n    }\n})\n\nexport default actions\n/**\n *\n * @param {IPFSService} ipfs\n * @param {FileStream[]} files\n */\nconst importFiles = (ipfs, files) => {\n  /** @type {Channel<{ offset:number, name: string}>} */\n  const channel = new Channel()\n  const result = all(ipfs.addAll(files, {\n    pin: false,\n    wrapWithDirectory: false,\n    progress: (offset, name) => channel.send({ offset, name })\n  }))\n\n  result.then(() => channel.close(), error => channel.close(error))\n\n  return { result, progress: channel }\n}\n\n/**\n * @param {IPFSService} ipfs\n * @param {CID} cid\n * @param {Object} options\n * @param {string} options.path\n * @param {boolean} [options.isRoot]\n * @param {import('./utils').Sorting} options.sorting\n */\nconst dirStats = async (ipfs, cid, { path, isRoot, sorting }) => {\n  const entries = await all(ipfs.ls(cid)) || []\n  // Workarounds regression in IPFS HTTP Client that causes\n  // ls on empty dir to return list with that dir only.\n  // @see https://github.com/ipfs/js-ipfs/issues/3566\n  const res = (entries.length === 1 && entries[0].cid.toString() === cid.toString())\n    ? []\n    : entries\n  const files = []\n\n  // precaution: there was a historical performance issue when too many dirs were present\n  let dirCount = 0\n\n  for (const f of res) {\n    const absPath = join(path, f.name)\n    let file = null\n\n    if (dirCount < 1000 && (f.type === 'directory' || f.type === 'dir')) {\n      dirCount += 1\n      file = fileFromStats({ ...await stat(ipfs, f.cid), path: absPath })\n    } else {\n      file = fileFromStats({ ...f, path: absPath })\n    }\n\n    files.push(file)\n  }\n\n  let parent = null\n\n  if (!isRoot) {\n    const parentPath = dirname(path)\n    const parentInfo = infoFromPath(parentPath, false)\n\n    if (parentInfo && (parentInfo.isMfs || !parentInfo.isRoot)) {\n      const realPath = parentInfo.realPath\n\n      if (realPath && realPath.startsWith('/ipns')) {\n        parentInfo.realPath = await last(ipfs.name.resolve(parentInfo.realPath))\n      }\n\n      parent = fileFromStats({\n        ...await stat(ipfs, parentInfo.realPath),\n        path: parentInfo.path,\n        name: '..',\n        isParent: true\n      })\n    }\n  }\n\n  return {\n    path: path,\n    fetched: Date.now(),\n    type: 'directory',\n    cid,\n    upper: parent,\n    content: sortFiles(files, sorting)\n  }\n}\n","import React from 'react'\nimport './ComponentLoader.css'\n\nconst ComponentLoader = (props) => (\n  <div {...props} style={{ width: 300, margin: '10vh auto', ...props.style }}>\n    <svg className='ComponentLoader' style={{ width: '100%' }} viewBox=\"0 0 512 512\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n      <path className='shape' strokeDasharray=\"4187\" stroke=\"#40898C\" strokeWidth=\"3\" d=\"M256.7 511.99L35 383.99V128L256.7 0L478.4 127.99V383.99L256.7 511.99ZM73.075 123.636L233.815 30.83H233.832C247.387 40.831 265.877 40.831 279.431 30.83L440.171 123.636C439.85 126.49 439.85 129.37 440.172 132.224L279.422 225.031C265.868 215.031 247.379 215.031 233.825 225.031L73.075 132.226C73.3963 129.372 73.3963 126.49 73.075 123.636ZM294.685 251.7L455.605 157.86L455.614 157.864C457.926 159.569 460.421 161.009 463.054 162.158V347.768C447.615 354.506 438.371 370.519 440.255 387.258L279.505 480.063C277.194 478.358 274.699 476.918 272.066 475.769L271.886 291.189C287.324 284.451 296.569 268.439 294.685 251.7ZM50.357 163.187C52.9892 162.038 55.4841 160.597 57.795 158.892L57.796 158.887L218.536 251.697C216.652 268.437 225.897 284.449 241.336 291.187V476.797C238.703 477.946 236.208 479.387 233.896 481.092L73.156 388.286C75.04 371.547 65.795 355.535 50.357 348.797V163.187Z\"/>\n      <path d=\"M34.298 384L255.998 512L477.698 384V128L255.998 0.0100098L34.298 128.01V384Z\" fill=\"url(#paint1_linear)\"/>\n      <path d=\"M233.113 30.84L72.373 123.646C72.6943 126.5 72.6943 129.382 72.373 132.236L233.123 225.041C246.677 215.041 265.166 215.041 278.72 225.041L439.47 132.234C439.148 129.38 439.148 126.5 439.469 123.646L278.729 30.84C265.175 40.841 246.685 40.841 233.13 30.84H233.113ZM454.903 157.87L293.983 251.71C295.867 268.449 286.622 284.461 271.184 291.199L271.364 475.779C273.997 476.928 276.492 478.368 278.803 480.073L439.553 387.268C437.669 370.529 446.913 354.516 462.352 347.778V162.168C459.719 161.019 457.224 159.579 454.912 157.874L454.903 157.87ZM57.093 158.902C54.7821 160.607 52.2872 162.048 49.655 163.197V348.807C65.093 355.545 74.338 371.557 72.454 388.296L233.194 481.102C235.506 479.397 238.001 477.956 240.634 476.807V291.197C225.195 284.459 215.95 268.447 217.834 251.707L57.094 158.897L57.093 158.902Z\" fill=\"url(#paint2_linear)\"/>\n      <path d=\"M256 512L477.7 384V128L256 256V512Z\" fill=\"black\" fillOpacity=\"0.251\"/>\n      <path d=\"M256 512V256C169.421 206.013 120.879 177.987 34.3 128V384L256 512Z\" fill=\"black\" fillOpacity=\"0.039\"/>\n      <path d=\"M34.298 128L255.998 256L477.698 128L255.998 0L34.298 128Z\" fill=\"black\" fillOpacity=\"0.13\"/>\n      <defs>\n        <linearGradient id=\"paint1_linear\" x1=\"34.298\" y1=\"256\" x2=\"477.703\" y2=\"256\" gradientUnits=\"userSpaceOnUse\">\n          <stop stopColor=\"#4A9EA1\"/>\n        </linearGradient>\n        <linearGradient id=\"paint2_linear\" x1=\"49.658\" y1=\"255.97\" x2=\"462.343\" y2=\"255.97\" gradientUnits=\"userSpaceOnUse\">\n          <stop stopColor=\"#63D3D7\"/>\n        </linearGradient>\n      </defs>\n    </svg>\n  </div>\n)\n\nexport default ComponentLoader\n","import memoize from 'p-memoize'\nimport toUri from 'multiaddr-to-uri'\nimport { createAsyncResourceBundle, createSelector } from 'redux-bundler'\n\nconst LOCAL_HOSTNAMES = ['127.0.0.1', '[::1]', '0.0.0.0', '[::]']\n\nconst bundle = createAsyncResourceBundle({\n  name: 'config',\n  staleAfter: 60000,\n  persist: false,\n  checkIfOnline: false,\n\n  getPromise: async ({ getIpfs, store }) => {\n    const rawConf = await getIpfs().config.getAll()\n    let conf\n\n    if (Buffer.isBuffer(rawConf)) {\n      conf = rawConf.toString()\n    } else {\n      conf = JSON.stringify(rawConf, null, '\\t')\n    }\n\n    const config = JSON.parse(conf)\n\n    const publicGateway = store.selectPublicGateway()\n    const url = getURLFromAddress('Gateway', config) || publicGateway\n\n    // Normalize local hostnames to localhost\n    // to leverage subdomain gateway, if present\n    // https://github.com/ipfs-shipyard/ipfs-webui/issues/1490\n    const gw = new URL(url)\n    if (LOCAL_HOSTNAMES.includes(gw.hostname)) {\n      gw.hostname = 'localhost'\n      const localUrl = gw.toString().replace(/\\/+$/, '') // no trailing slashes\n      if (await checkIfSubdomainGatewayUrlIsAccessible(localUrl)) {\n        store.doSetAvailableGateway(localUrl)\n        return conf\n      }\n    }\n\n    if (!await checkIfGatewayUrlIsAccessible(url)) {\n      store.doSetAvailableGateway(publicGateway)\n    }\n\n    // stringy json for quick compares\n    return conf\n  }\n})\n\n// derive the object from the stringy json\nbundle.selectConfigObject = createSelector(\n  'selectConfig',\n  (configStr) => JSON.parse(configStr)\n)\n\nbundle.selectApiUrl = createSelector(\n  'selectConfigObject',\n  'selectPublicGateway',\n  (config, publicGateway) => getURLFromAddress('API', config) || publicGateway\n)\n\nbundle.selectGatewayUrl = createSelector(\n  'selectConfigObject',\n  'selectPublicGateway',\n  (config, publicGateway) => getURLFromAddress('Gateway', config) || publicGateway\n)\n\nbundle.selectAvailableGatewayUrl = createSelector(\n  'selectAvailableGateway',\n  'selectGatewayUrl',\n  (availableGateway, gatewayUrl) => availableGateway || gatewayUrl\n)\n\nbundle.selectBootstrapPeers = createSelector(\n  'selectConfigObject',\n  (config) => config && config.Bootstrap\n)\n\n// TODO: this is a work-around for IPFS companion blocking the config API\n// see: https://github.com/ipfs-shipyard/ipfs-companion/issues/454\nbundle.selectIsConfigBlocked = createSelector(\n  'selectConfigRaw',\n  ({ errorType }) => errorType === 'Access to config.get API is globally blocked for window.ipfs'\n)\n\n// Fetch the config if we don't have it or it's more than `staleAfter` ms old\nbundle.reactConfigFetch = createSelector(\n  'selectConfigShouldUpdate',\n  'selectIpfsReady',\n  (shouldUpdate, ipfsReady) => {\n    if (shouldUpdate && ipfsReady) {\n      return { actionCreator: 'doFetchConfig' }\n    }\n  }\n)\n\nfunction getURLFromAddress (name, config) {\n  if (!config) return null\n\n  try {\n    const address = Array.isArray(config.Addresses[name])\n      ? config.Addresses[name][0]\n      : config.Addresses[name]\n    const url = toUri(address, { assumeHttp: true })\n    if (new URL(url).port === 0) throw Error('port set to 0, not deterministic')\n    return url\n  } catch (error) {\n    console.log(`Failed to get url from config at Addresses.${name}`, error)\n    return null\n  }\n}\n\nconst checkIfGatewayUrlIsAccessible = memoize(async (url) => {\n  try {\n    const { status } = await fetch(\n    `${url}/ipfs/bafkqae2xmvwgg33nmuqhi3zajfiemuzahiwss`\n    )\n    return status === 200\n  } catch (e) {\n    console.error(`Unable to use the gateway at ${url}. The public gateway will be used as a fallback`, e)\n    return false\n  }\n})\n\n// Separate test is necessary to see if subdomain mode is possible,\n// because some browser+OS combinations won't resolve them:\n// https://github.com/ipfs/go-ipfs/issues/7527\nconst checkIfSubdomainGatewayUrlIsAccessible = memoize(async (url) => {\n  try {\n    url = new URL(url)\n    url.hostname = `bafkqae2xmvwgg33nmuqhi3zajfiemuzahiwss.ipfs.${url.hostname}`\n    const { status } = await fetch(url.toString())\n    return status === 200\n  } catch (e) {\n    console.error(`Unable to use the subdomain gateway at ${url}. Regular gateway will be used as a fallback`, e)\n    return false\n  }\n})\n\nexport default bundle\n","import { createSelector } from 'redux-bundler'\nimport { ACTIONS } from './consts'\nimport { infoFromPath } from './utils'\n\n/**\n * @typedef {import('./protocol').Model} Files\n * @typedef {import('./protocol').PageContent} PageContent\n * @typedef {Object} Model\n * @property {Files} files\n *\n * @typedef {import('redux-bundler').Selectors<ReturnType<typeof selectors>>} Selectors\n */\n\n/**\n * @template M, I\n * @typedef {import('./protocol').PendingJob<M, I>} PendingJob\n */\n\nconst selectors = () => ({\n  /**\n   * @param {Model} state\n   * @returns {null|PageContent}\n   */\n  selectFiles: (state) => state.files.pageContent,\n\n  /**\n   * @param {Model} state\n   */\n  selectCurrentDirectorySize: (state) => {\n    return state.files.pageContent?.type === 'directory' && state.files.pageContent?.content?.reduce((prev, curr) => prev + curr.size, 0)\n  },\n\n  /**\n   * @param {Model} state\n   * @returns {string[]}\n   */\n  selectPins: (state) => state.files.pins,\n\n  /**\n   * @param {Model} state\n   * @returns {number}\n   */\n  selectFilesSize: (state) => state.files.mfsSize,\n\n  /**\n   * @param {Model} state\n   */\n  selectPinsSize: (state) => state.files.pinsSize,\n\n  /**\n   * @param {Model} state\n   */\n  selectNumberOfPins: (state) => state.files.numberOfPins,\n\n  /**\n   * @param {Model} state\n   */\n  selectFilesIsFetching: (state) => state.files.pending.some(a => a.type === ACTIONS.FETCH),\n\n  /**\n   * @param {Model} state\n   * @returns {boolean}\n   */\n  selectShowLoadingAnimation: (state) => {\n    const pending = state.files.pending.find(a => a.type === ACTIONS.FETCH)\n    return pending ? (Date.now() - pending.start) > 1000 : false\n  },\n\n  /**\n   * @param {Model} state\n   */\n  selectFilesSorting: (state) => state.files.sorting,\n\n  /**\n   * @param {Model} state\n   * @returns {PendingJob<void, {progress: number, entries: {size:number, path: string}[]}>[]}\n   */\n  selectFilesPending: (state) =>\n    state.files.pending.filter(s => s.type === ACTIONS.WRITE && s.message != null),\n\n  /**\n   * @param {Model} state\n   */\n  selectFilesFinished: (state) =>\n    state.files.finished.filter(s => s.type === ACTIONS.WRITE),\n\n  /**\n   * @param {Model} state\n   */\n  selectFilesHasError: (state) => state.files.failed.length > 0,\n\n  /**\n   * @param {Model} state\n   */\n  selectFilesErrors: (state) => state.files.failed,\n\n  /**\n   * @param {Model} state\n   */\n  selectHasUpperDirectory: (state) => state.files.pageContent?.type === 'directory' && state.files.pageContent?.upper,\n\n  selectFilesPathInfo: createSelector(\n    'selectRouteInfo',\n    /**\n     * @param {object} routeInfo\n     * @param {string} routeInfo.url\n     */\n    (routeInfo) => {\n      return infoFromPath(routeInfo.url)\n    }\n  )\n})\n\nexport default selectors\n","import { sortFiles } from './utils'\nimport { DEFAULT_STATE, ACTIONS, SORTING } from './consts'\nimport selectors from './selectors'\nimport actions from './actions'\n\nexport { ACTIONS }\n\nexport const sorts = SORTING\n\n/**\n * @typedef {import('./protocol').Model} Model\n * @typedef {import('./protocol').Message} Message\n * @typedef {import('../task').SpawnState<any, Error, any, any>} JobState\n */\nconst createFilesBundle = () => {\n  return {\n    name: 'files',\n\n    /**\n     * @param {Model} state\n     * @param {Message} action\n     * @returns {Model}\n     */\n    reducer: (state = DEFAULT_STATE, action) => {\n      switch (action.type) {\n        case ACTIONS.DELETE:\n        case ACTIONS.ADD_BY_PATH:\n        case ACTIONS.DOWNLOAD_LINK:\n        case ACTIONS.SHARE_LINK:\n        case ACTIONS.MOVE:\n        case ACTIONS.COPY:\n        case ACTIONS.MAKE_DIR:\n        case ACTIONS.PIN_ADD:\n        case ACTIONS.PIN_REMOVE:\n          return updateJob(state, action.task, action.type)\n        case ACTIONS.WRITE: {\n          return updateJob(state, action.task, action.type)\n        }\n        case ACTIONS.PIN_LIST: {\n          const { task, type } = action\n\n          const pins = task.status === 'Exit' && task.result.ok\n            ? task.result.value.pins.map(String)\n            : state.pins\n\n          return {\n            ...updateJob(state, task, type),\n            pins\n          }\n        }\n        case ACTIONS.FETCH: {\n          const { task, type } = action\n          const result = task.status === 'Exit' && task.result.ok\n            ? task.result.value\n            : null\n          const { pageContent, pins } = result\n            ? {\n              pageContent: result,\n              pins: result.type === 'directory' && result.path === '/pins'\n                ? result.content.map($ => $.cid.toString())\n                : state.pins\n            }\n            : state\n\n          return {\n            ...updateJob(state, task, type),\n            pageContent,\n            pins\n          }\n        }\n        case ACTIONS.DISMISS_ERRORS: {\n          return {\n            ...state,\n            failed: []\n          }\n        }\n        case ACTIONS.CLEAR_ALL: {\n          return {\n            ...state,\n            failed: [],\n            finished: [],\n            pending: []\n          }\n        }\n        case ACTIONS.UPDATE_SORT: {\n          const { pageContent } = state\n          if (pageContent && pageContent.type === 'directory') {\n            const content = sortFiles(pageContent.content, action.payload)\n            return {\n              ...state,\n              pageContent: {\n                ...pageContent,\n                content\n              },\n              sorting: action.payload\n            }\n          } else {\n            return state\n          }\n        }\n        case ACTIONS.PINS_SIZE_GET: {\n          const { task, type } = action\n          const pinsSize = task.status === 'Exit' && task.result.ok\n            ? task.result.value.pinsSize\n            : 0\n\n          const numberOfPins = task.status === 'Exit' && task.result.ok\n            ? task.result.value.numberOfPins\n            : 0\n\n          return {\n            ...updateJob(state, task, type),\n            pinsSize,\n            numberOfPins\n          }\n        }\n        case ACTIONS.SIZE_GET: {\n          const { task, type } = action\n          const mfsSize = task.status === 'Exit' && task.result.ok\n            ? task.result.value.size\n            : state.mfsSize\n\n          return {\n            ...updateJob(state, task, type),\n            mfsSize\n          }\n        }\n        default: {\n          return state\n        }\n      }\n    },\n    ...actions(),\n    ...selectors()\n  }\n}\nexport default createFilesBundle\n/**\n * Updates state of the given job.\n * @param {Model} state\n * @param {JobState} task\n * @param {*} type\n * @returns {Model}\n */\nconst updateJob = (state, task, type) => {\n  switch (task.status) {\n    case 'Init': {\n      return {\n        ...state,\n        pending: [\n          ...state.pending,\n          {\n            ...task,\n            type,\n            status: 'Pending',\n            start: Date.now()\n          }\n        ]\n      }\n    }\n    case 'Send': {\n      const { pending, rest } = pullPending(state.pending, task)\n      return {\n        ...state,\n        pending: [\n          ...rest,\n          {\n            ...pending,\n            ...task,\n            status: 'Pending'\n          }\n        ]\n      }\n    }\n    case 'Exit': {\n      const { pending, rest } = pullPending(state.pending, task)\n\n      if (task.result.ok) {\n        return {\n          ...state,\n          pending: rest,\n          finished: [\n            ...state.finished,\n            {\n              ...pending,\n              ...task,\n              end: Date.now(),\n              value: task.result.value,\n              status: 'Done'\n            }\n          ]\n        }\n      } else {\n        return {\n          ...state,\n          pending: rest,\n          failed: [\n            ...state.failed,\n            {\n              ...pending,\n              ...task,\n              end: Date.now(),\n              error: task.result.error,\n              status: 'Failed'\n            }\n          ]\n        }\n      }\n    }\n    default: {\n      console.error('Task has an invalid state', task)\n      return state\n    }\n  }\n}\n\n/**\n * @template T, I\n * @typedef {import('./protocol').PendingJob<T, I>} PendingJob\n */\n\n/**\n * Takes array of pending job states and job that was updated and returns\n * array of pending jobs but the one passed & start time of that job\n * @template T, I\n * @param {PendingJob<T, I>[]} tasks\n * @param {JobState} task\n * @returns {{pending:PendingJob<T, I>, rest:PendingJob<T, I>[]}}\n */\nconst pullPending = (tasks, task) => {\n  const { id } = task\n  const pending = tasks.find($ => $.id === id)\n\n  if (pending == null) {\n    throw Error('Unable to find a pending task')\n  }\n\n  return {\n    pending,\n    rest: tasks.filter($ => $.id !== id)\n  }\n}\n","// @ts-check\n\n/**\n * @template {string} T\n * @param {T[]} variants\n * @returns {{[K in T]: K}}\n */\nexport const from = (variants) => variants.reduce((result, key) => {\n  result[key] = key\n  return result\n}, Object.create(null))\n","export default __webpack_public_path__ + \"static/media/ipfs-logo-text-vert.6fc9edd5.svg\";","export default __webpack_public_path__ + \"static/media/ipfs-logo-text-horiz.2c5486c4.svg\";","import React from 'react'\n\nconst StrokeMarketing = props => (\n  <svg viewBox='0 0 100 100' {...props}>\n    <path d='M76.595 19.785h-52.93a3.93 3.93 0 0 0-3.92 3.92v39.12a5.74 5.74 0 0 0 5.73 5.73h23.79v6.25h-9.67a4 4 0 0 0-4 4 3.59 3.59 0 0 0 .08.81l.12.6h28.49l.13-.6a4.28 4.28 0 0 0 .08-.81 4 4 0 0 0-4-4h-9.73v-6.25h25.83a3.67 3.67 0 0 0 3.66-3.67v-41.44a3.67 3.67 0 0 0-3.66-3.66zm-13.61 58.94h-25.95a2.52 2.52 0 0 1 2.56-2.42h20.88a2.51 2.51 0 0 1 2.51 2.42zm-39.32-55.94h52.93a.66.66 0 0 1 .66.66v5.56h-54.51v-5.3a.92.92 0 0 1 .92-.92zm52.93 42.77h-51.12a2.73 2.73 0 0 1-2.73-2.73v-32.29h54.53v34.35a.67.67 0 0 1-.68.67z' />\n    <path d='M68.315 35.735a3.61 3.61 0 0 0-3.61 3.61 3.58 3.58 0 0 0 .74 2.17l-9.77 10.38a3.5 3.5 0 0 0-4.13.46l-7.4-5a3.61 3.61 0 1 0-6.9-1.48 3.58 3.58 0 0 0 .41 1.63l-.06-.05-4.54 5.55a3.57 3.57 0 0 0-1.35-.27 3.62 3.62 0 1 0 2.6 1.11l4.29-5.21a3.53 3.53 0 0 0 2.3.86 3.62 3.62 0 0 0 2.39-.92l7.41 5a3.52 3.52 0 0 0-.37 1.43 3.635 3.635 0 1 0 7.27 0 3.57 3.57 0 0 0-.74-2.16l9.74-10.35a3.49 3.49 0 0 0 1.73.46 3.61 3.61 0 0 0 0-7.22zm-36.61 22.72a2.11 2.11 0 1 1 2.11-2.11 2.12 2.12 0 0 1-2.11 2.11zm9.15-10.45a2.11 2.11 0 1 1 2.11-2.11 2.12 2.12 0 0 1-2.11 2.11zm13.08 9.15a2.11 2.11 0 1 1 2.11-2.15 2.11 2.11 0 0 1-2.11 2.14zm14.38-15.7a2.11 2.11 0 1 1 2.11-2.11 2.11 2.11 0 0 1-2.11 2.11z' />\n  </svg>\n)\n\nexport default StrokeMarketing\n","import React from 'react'\n\nconst StrokeWeb = props => (\n  <svg viewBox='0 0 100 100' {...props}>\n    <path d='M36 33.4h14.21a1 1 0 0 0 0-2H36a1 1 0 0 0 0 2zm0 8.84h14.21a1 1 0 0 0 0-2H36a1 1 0 0 0 0 2zm30.08 7.57a1.07 1.07 0 0 0-.07-.19.64.64 0 0 1 0-.07l-.08-.08-.14-.15-.15-.1-.18-.08h-.2a.35.35 0 0 0-.11 0H36a1 1 0 0 0-1 1v17.68a.71.71 0 0 0 0 .2.64.64 0 0 0 .06.18.36.36 0 0 1 0 .07.65.65 0 0 0 .13.16 1.26 1.26 0 0 0 .28.19h.08a1 1 0 0 0 .34.07h29.24a1 1 0 0 0 1-1V50a1.62 1.62 0 0 0-.05-.19zm-4.52 1.26L37 66V51.07zm-22 15.68l24.52-14.9v14.9z' />\n    <path d='M75.13 37.17v-.05L56.55 17.8H30a5.51 5.51 0 0 0-5.5 5.5v53.4a5.51 5.51 0 0 0 5.5 5.5h40a5.51 5.51 0 0 0 5.5-5.5V37.51zM56.91 22.51l14 14.61h-7.08c-4 0-6.92-2.53-6.92-6zM70 79.2H30a2.5 2.5 0 0 1-2.5-2.5V23.3a2.5 2.5 0 0 1 2.5-2.5h24.91v10.31c0 4.64 3.75 8 8.92 8h8.63V76.7A2.5 2.5 0 0 1 70 79.2z' />\n  </svg>\n)\n\nexport default StrokeWeb\n","import React from 'react'\n\nconst StrokeSettings = props => (\n  <svg viewBox='0 0 100 100' {...props}>\n    <path d='M50.077 42.884h-.09a7.14 7.14 0 0 0-5 2.06 7.07 7.07 0 0 0-2.11 5 7.16 7.16 0 0 0 7.11 7.21 7.14 7.14 0 0 0 .09-14.27zm-.09 11.67a4.57 4.57 0 0 1-4.54-4.54 4.46 4.46 0 0 1 1.34-3.19 4.54 4.54 0 0 1 3.2-1.34 4.53 4.53 0 0 1 4.48 4.67 4.54 4.54 0 0 1-4.48 4.4z' />\n    <path d='M83.697 56.764c-3.29-1.27-4.93-3.4-5-6.51-.07-3.29 1.56-5.53 5-6.86a1.3 1.3 0 0 0 .82-1.38c-.25-2.51-3-9-4.45-10.72a1.3 1.3 0 0 0-1.53-.28c-3.25 1.52-6 1.15-8.27-1.14-2.27-2.29-2.71-5-1.17-8.39a1.29 1.29 0 0 0-.5-1.65 34.72 34.72 0 0 0-10.42-4.29 1.29 1.29 0 0 0-1.52.84c-1.11 3.22-3.1 4.9-6.1 5.12-3.57.27-6-1.41-7.36-5.11a1.31 1.31 0 0 0-1.53-.82 35.49 35.49 0 0 0-10.38 4.37 1.3 1.3 0 0 0-.48 1.66c1.56 3.28 1.21 6-1.07 8.32-2.28 2.32-5.05 2.74-8.38 1.21a1.31 1.31 0 0 0-1.66.5 35.31 35.31 0 0 0-4.23 10.38 1.31 1.31 0 0 0 .82 1.51c3.34 1.23 5 3.35 5.07 6.51.07 3.16-1.55 5.53-5 6.86a1.3 1.3 0 0 0-.79 1.52 34.69 34.69 0 0 0 4.42 10.34 1.29 1.29 0 0 0 1.63.5c3.23-1.44 5.9-1.06 8.16 1.14s2.75 5 1.32 8.23a1.3 1.3 0 0 0 .52 1.63 35.46 35.46 0 0 0 10.37 4.23 1.15 1.15 0 0 0 .26 0 1.44 1.44 0 0 0 1.23-.79 2.43 2.43 0 0 0 .14-.28 6.89 6.89 0 0 1 13-.17 1.7 1.7 0 0 0 2.16 1.06 35.78 35.78 0 0 0 9.44-3.9l.36-.24.11-.08a1.29 1.29 0 0 0 .47-1.61c-1.32-3-1.06-5.51.8-7.68 2.29-2.66 5.12-3.22 8.67-1.71a1.29 1.29 0 0 0 1.61-.51 34.87 34.87 0 0 0 4.3-10.33 1.29 1.29 0 0 0-.84-1.48zm-5.16 9.55a9.16 9.16 0 0 0-10.55 2.82 9.05 9.05 0 0 0-1.62 9.36 33 33 0 0 1-7.63 3.16 9.36 9.36 0 0 0-8.75-5.5h-.14a9.5 9.5 0 0 0-8.38 5.54 32.24 32.24 0 0 1-7.63-3.12 9.06 9.06 0 0 0-2.32-10 9.11 9.11 0 0 0-10-2.08 32.48 32.48 0 0 1-3.2-7.57 9.1 9.1 0 0 0 5.67-8.91 9.08 9.08 0 0 0-5.69-8.44 32.5 32.5 0 0 1 3.09-7.62 9.08 9.08 0 0 0 10.23-2.2 9 9 0 0 0 2-10.17 32.73 32.73 0 0 1 7.6-3.18 9.12 9.12 0 0 0 9.53 5.71 9 9 0 0 0 7.93-5.75 32.76 32.76 0 0 1 7.61 3.14 9.09 9.09 0 0 0 2.15 10.24 9.08 9.08 0 0 0 10.19 2.07 37.24 37.24 0 0 1 3.13 7.6 9.49 9.49 0 0 0-.06 17.33 32.18 32.18 0 0 1-3.16 7.57z' />\n    <path d='M49.987 32.934a17.09 17.09 0 1 0 17.08 17.08 17.1 17.1 0 0 0-17.08-17.08zm0 32.67a15.59 15.59 0 1 1 15.58-15.59 15.61 15.61 0 0 1-15.58 15.59z' />\n  </svg>\n)\n\nexport default StrokeSettings\n","import React from 'react'\nimport { connect } from 'redux-bundler-react'\nimport { withTranslation } from 'react-i18next'\nimport classnames from 'classnames'\nimport ipfsLogoTextVert from './ipfs-logo-text-vert.svg'\nimport ipfsLogoTextHoriz from './ipfs-logo-text-horiz.svg'\nimport StrokeMarketing from '../icons/StrokeMarketing'\nimport StrokeWeb from '../icons/StrokeWeb'\nimport StrokeCube from '../icons/StrokeCube'\nimport StrokeSettings from '../icons/StrokeSettings'\nimport StrokeIpld from '../icons/StrokeIpld'\n\n// Styles\nimport './NavBar.css'\n\nconst NavLink = ({\n  to,\n  icon,\n  alternative,\n  disabled,\n  children\n}) => {\n  const Svg = icon\n  const { hash } = window.location\n  const href = `#${to}`\n  const active = alternative\n    ? hash === href || hash.startsWith(`${href}${alternative}`)\n    : hash && hash.startsWith(href)\n  const anchorClass = classnames({\n    'bg-white-10 navbar-item-active': active,\n    'o-50 no-pointer-events': disabled\n  }, ['navbar-item dib db-l pt2 pb3 pv1-l white no-underline f5 hover-bg-white-10 tc bb bw2 bw0-l b--navy'])\n  const svgClass = classnames({\n    'o-100': active,\n    'o-50': !active\n  }, ['fill-current-color'])\n\n  return (\n    // eslint-disable-next-line jsx-a11y/anchor-is-valid\n    <a href={disabled ? null : href} className={anchorClass} role='menuitem' title={children}>\n      <div className='db ph2 pv1'>\n        <div className='db'>\n          <Svg width='46' role='presentation' className={svgClass} />\n        </div>\n        <div className={`${active ? 'o-100' : 'o-50'} db f6 tc montserrat ttu fw1 `} style={{ whiteSpace: 'pre-wrap' }}>\n          {children}\n        </div>\n      </div>\n    </a>\n  )\n}\n\nexport const NavBar = ({ t }) => {\n  const codeUrl = 'https://github.com/ipfs-shipyard/ipfs-webui'\n  const bugsUrl = `${codeUrl}/issues`\n  const gitRevision = process.env.REACT_APP_GIT_REV\n  const revisionUrl = `${codeUrl}/commit/${gitRevision}`\n  const webUiVersion = process.env.REACT_APP_VERSION\n  const webUiVersionUrl = `${codeUrl}/releases/tag/v${webUiVersion}`\n  return (\n    <div className='h-100 fixed-l flex flex-column justify-between' style={{ overflowY: 'auto', width: 'inherit' }}>\n      <div className='flex flex-column'>\n        <a href=\"#/welcome\" role='menuitem' title={t('welcome:description')}>\n          <div className='pt3 pb1 pb2-l'>\n            <img className='navbar-logo-vert center db-l dn pt3 pb1' style={{ height: 94 }} src={ipfsLogoTextVert} alt='' />\n            <img className='navbar-logo-horiz center db dn-l' style={{ height: 70 }} src={ipfsLogoTextHoriz} alt='' />\n          </div>\n        </a>\n        <div className='db overflow-x-scroll overflow-x-hidden-l nowrap tc' role='menubar'>\n          <NavLink to='/' alternative=\"status\" icon={StrokeMarketing}>{t('status:title')}</NavLink>\n          <NavLink to='/files' icon={StrokeWeb}>{t('files:title')}</NavLink>\n          <NavLink to='/explore' icon={StrokeIpld}>{t('explore:tabName')}</NavLink>\n          <NavLink to='/peers' icon={StrokeCube}>{t('peers:title')}</NavLink>\n          <NavLink to='/settings' icon={StrokeSettings}>{t('settings:title')}</NavLink>\n        </div>\n      </div>\n      <div className='dn db-l navbar-footer mb2 tc center f7 o-80 glow'>\n        { webUiVersion && <div className='mb1'>\n          <a className='link white' href={webUiVersionUrl} target='_blank' rel='noopener noreferrer'>{t('app:terms.ui')} v{webUiVersion}</a>\n        </div> }\n        { gitRevision && <div className='mb1'>\n          <a className='link white' href={revisionUrl} target='_blank' rel='noopener noreferrer'>{t('app:nav.revision')} {gitRevision}</a>\n        </div> }\n        <div className='mb1'>\n          <a className='link white' href={codeUrl} target='_blank' rel='noopener noreferrer'>{t('app:nav.codeLink')}</a>\n        </div>\n        <div>\n          <a className='link white' href={bugsUrl} target='_blank' rel='noopener noreferrer'>{t('app:nav.bugsLink')}</a>\n        </div>\n      </div>\n    </div>\n  )\n}\n\nexport default connect(\n  withTranslation()(NavBar)\n)\n","import React from 'react'\nimport CancelIcon from '../../icons/GlyphSmallCancel'\n\nconst Toast = ({ error, children, onDismiss }) => {\n  const bg = error ? 'bg-yellow' : 'bg-green'\n  return (\n    <div className='fixed bottom-0 tc pb2 z-max' style={{ left: '50% ', transform: 'translateX(-50%)' }}>\n      <div className={`flex items-center f5 lh-copy avenir pl2 pl4-ns pv2 white br2 ${bg}`}>\n        {children}\n        <CancelIcon\n          className='fill-current-color ph3 glow o-80 pointer'\n          style={{ height: '28px', transform: 'scale(1.5)' }}\n          onClick={onDismiss} />\n      </div>\n    </div>\n  )\n}\n\nexport default Toast\n","import React from 'react'\nimport { connect } from 'redux-bundler-react'\nimport { withTranslation } from 'react-i18next'\nimport Toast from './Toast'\n\nconst Notify = ({ t, notify, notifyI18nKey, doNotifyDismiss }) => {\n  const { show, error } = notify\n  if (!show) return null\n\n  return (\n    <Toast error={error} onDismiss={doNotifyDismiss}>\n      {t(notifyI18nKey)}\n    </Toast>\n  )\n}\n\nexport default connect(\n  'selectNotify',\n  'selectNotifyI18nKey',\n  'doNotifyDismiss',\n  withTranslation('notify')(Notify)\n)\n","import React from 'react'\nimport { connect } from 'redux-bundler-react'\nimport { withTranslation } from 'react-i18next'\n\nconst pickColor = (ipfsReady, ipfsConnected) => {\n  if (ipfsReady && ipfsConnected) return 'teal'\n  if (ipfsReady) return 'red'\n  return 'gray'\n}\n\nconst pickTitleKey = (ipfsReady, ipfsConnected) => {\n  if (ipfsReady && ipfsConnected) return 'app:status.connectedToIpfs'\n  if (ipfsReady) return 'ipfsApiRequestFailed'\n  return 'app:status.connectingToIpfs'\n}\n\nexport const Connected = ({ t, className, size = 28, ipfsReady, ipfsConnected, doSetIsNodeInfoOpen }) => {\n  const title = t(pickTitleKey(ipfsReady, ipfsConnected))\n  const fill = pickColor(ipfsReady, ipfsConnected)\n  const opacity = ipfsConnected ? 'o-60' : 'o-100'\n\n  return (\n    <a title={title} className={`dib ${className}`} href='#/status' onClick={() => doSetIsNodeInfoOpen(true)}>\n      <svg className={`${fill} ${opacity} fill-current-color transition-all glow`} viewBox='0 0 24 24' width={size} height={size} aria-hidden=\"true\">\n        <path d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM6.5 9L10 5.5 13.5 9H11v4H9V9H6.5zm11 6L14 18.5 10.5 15H13v-4h2v4h2.5z ' />\n      </svg>\n    </a>\n  )\n}\n\nexport default connect(\n  'selectIpfsReady',\n  'selectIpfsConnected',\n  'doSetIsNodeInfoOpen',\n  withTranslation('notify')(Connected)\n)\n","import React from 'react'\nimport { connect } from 'redux-bundler-react'\nimport { withTranslation } from 'react-i18next'\n\nexport const TourHelper = ({ doEnableTours, className = '', size = 23, t }) => {\n  const handleClick = () => {\n    doEnableTours()\n  }\n\n  return (\n    <button className={`dib mr1 ml4-m pointer ${className}`} onClick={handleClick} aria-label={ t('startTourHelper')}>\n      <svg className='fill-teal o-60 glow' viewBox='0 0 44 44' width={size} height={size} aria-hidden=\"true\">\n        <path d='m22,0c-12.2,0-22,9.8-22,22s9.8,22 22,22 22-9.8 22-22-9.8-22-22-22zm2,34c0,0.6-0.4,1-1,1h-2c-0.6,0-1-0.4-1-1v-2c0-0.6 0.4-1 1-1h2c0.6,0 1,0.4 1,1v2zm2.7-8.9c-1.4,1.2-2.4,2-2.7,3.1-0.1,0.5-0.5,0.8-1,0.8h-2c-0.6,0-1.1-0.5-1-1.1 0.4-2.9 2.5-4.5 4.2-5.9 1.8-1.4 2.8-2.3 2.8-4 0-2.8-2.2-5-5-5s-5,2.2-5,5c0,0.2 0,0.4 0,0.6 0.1,0.5-0.2,1-0.7,1.1l-1.9,.6c-0.6,0.2-1.2-0.2-1.3-0.8-0.1-0.5-0.1-1-0.1-1.5 0-5 4-9 9-9s9,4 9,9c0,3.7-2.4,5.6-4.3,7.1z' />\n      </svg>\n    </button>\n  )\n}\n\nexport default connect(\n  'doEnableTours',\n  withTranslation('app')(TourHelper)\n)\n","import React from 'react'\nimport isIPFS from 'is-ipfs'\nimport PropTypes from 'prop-types'\nimport { withTranslation } from 'react-i18next'\nimport StrokeFolder from '../../icons/StrokeFolder'\nimport StrokeIpld from '../../icons/StrokeIpld'\nimport Button from '../../components/button/Button'\nimport './FilesExploreForm.css'\n\nclass FilesExploreForm extends React.Component {\n  constructor (props) {\n    super(props)\n    this.state = {\n      path: '',\n      hideExplore: false\n    }\n    this.onChange = this.onChange.bind(this)\n    this.onKeyDown = this.onKeyDown.bind(this)\n    this.onBrowse = this.onBrowse.bind(this)\n    this.onInspect = this.onInspect.bind(this)\n  }\n\n  onKeyDown (evt) {\n    if (evt.key === 'Enter') {\n      this.onBrowse(evt)\n    }\n  }\n\n  onBrowse (evt) {\n    evt.preventDefault()\n\n    if (this.isValid) {\n      let path = this.path\n\n      if (isIPFS.cid(path)) {\n        path = `/ipfs/${path}`\n      }\n\n      this.props.onBrowse({ path })\n      this.setState({ path: '' })\n    }\n  }\n\n  onInspect (evt) {\n    evt.preventDefault()\n\n    if (this.isValid) {\n      this.props.onInspect(this.path)\n      this.setState({ path: '' })\n    }\n  }\n\n  onChange (evt) {\n    const path = evt.target.value\n    this.setState({ path })\n  }\n\n  get path () {\n    return this.state.path.trim()\n  }\n\n  get isValid () {\n    return this.path !== '' && (isIPFS.cid(this.path) || isIPFS.path(this.path))\n  }\n\n  get inputClass () {\n    if (this.path === '') {\n      return 'focus-outline'\n    }\n\n    if (this.isValid) {\n      return 'b--green-muted focus-outline-green'\n    } else {\n      return 'b--red-muted focus-outline-red'\n    }\n  }\n\n  render () {\n    const { t } = this.props\n    return (\n      <div data-id='FilesExploreForm' className='sans-serif black-80 flex'>\n        <div className='flex-auto'>\n          <div className='relative'>\n            <input id='ipfs-path' className={`input-reset bn pa2 mb2 db w-100 f6 br-0 placeholder-light ${this.inputClass}`} style={{ borderRadius: '3px 0 0 3px' }} type='text' placeholder='QmHash/bafyHash' aria-describedby='ipfs-path-desc' onChange={this.onChange} onKeyDown={this.onKeyDown} value={this.state.path} />\n            <small id='ipfs-path-desc' className='o-0 absolute f6 black-60 db mb2'>Paste in a CID or IPFS path</small>\n          </div>\n        </div>\n        <div className='flex flex-row-reverse mb2'>\n          <Button\n            minWidth={0}\n            disabled={!this.isValid}\n            title={t('app:actions.inspect')}\n            style={{ borderRadius: '0 3px 3px 0' }}\n            onClick={this.onInspect}\n            bg='bg-teal'\n            className='ExploreFormButton button-reset pv1 ph2 ba f7 fw4 white overflow-hidden tc' >\n            <StrokeIpld style={{ height: 24 }} className='dib fill-current-color v-mid' />\n            <span className='ml2'>{t('app:actions.inspect')}</span>\n          </Button>\n          <Button\n            minWidth={0}\n            disabled={!this.isValid}\n            style={{ borderRadius: '0' }}\n            title={t('app:actions.browse')}\n            onClick={this.onBrowse}\n            className='ExploreFormButton button-reset pv1 ph2 ba f7 fw4 white bg-gray overflow-hidden tc' >\n            <StrokeFolder style={{ height: 24 }} className='dib fill-current-color v-mid' />\n            <span className='ml2'>{t('app:actions.browse')}</span>\n          </Button>\n        </div>\n      </div>\n    )\n  }\n}\n\nFilesExploreForm.propTypes = {\n  t: PropTypes.func.isRequired,\n  onInspect: PropTypes.func.isRequired,\n  onBrowse: PropTypes.func.isRequired\n}\n\nexport default withTranslation('files')(FilesExploreForm)\n","import React, { Component } from 'react'\nimport PropTypes from 'prop-types'\nimport { connect } from 'redux-bundler-react'\nimport { getNavHelper } from 'internal-nav-helper'\nimport ReactJoyride from 'react-joyride'\nimport { withTranslation } from 'react-i18next'\nimport { normalizeFiles } from './lib/files'\n// React DnD\nimport { DropTarget } from 'react-dnd'\nimport { NativeTypes } from 'react-dnd-html5-backend'\n// Lib\nimport { appTour } from './lib/tours'\nimport { getJoyrideLocales } from './helpers/i8n'\n// Components\nimport NavBar from './navigation/NavBar'\nimport ComponentLoader from './loader/ComponentLoader'\nimport Notify from './components/notify/Notify'\nimport Connected from './components/connected/Connected'\nimport TourHelper from './components/tour/TourHelper'\nimport FilesExploreForm from './files/explore-form/FilesExploreForm'\n\nexport class App extends Component {\n  static propTypes = {\n    doTryInitIpfs: PropTypes.func.isRequired,\n    doUpdateUrl: PropTypes.func.isRequired,\n    doUpdateHash: PropTypes.func.isRequired,\n    doFilesWrite: PropTypes.func.isRequired,\n    routeInfo: PropTypes.object.isRequired,\n    filesPathInfo: PropTypes.object,\n    // Injected by DropTarget\n    isOver: PropTypes.bool.isRequired\n  }\n\n  componentDidMount () {\n    this.props.doTryInitIpfs()\n  }\n\n  addFiles = async (filesPromise) => {\n    const { doFilesWrite, doUpdateHash, routeInfo, filesPathInfo } = this.props\n    const isFilesPage = routeInfo.pattern === '/files*'\n    const addAtPath = isFilesPage ? (filesPathInfo?.realPath || routeInfo.params.path) : '/'\n    const files = await filesPromise\n\n    doFilesWrite(normalizeFiles(files), addAtPath)\n    // Change to the files pages if the user is not there\n    if (!isFilesPage) {\n      doUpdateHash('/files')\n    }\n  }\n\n  handleJoyrideCb = (data) => {\n    if (data.action === 'close') {\n      this.props.doDisableTooltip()\n    }\n  }\n\n  render () {\n    const { t, route: Page, ipfsReady, doFilesNavigateTo, doExploreUserProvidedPath, routeInfo: { url }, connectDropTarget, canDrop, isOver, showTooltip } = this.props\n    return connectDropTarget(\n      // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions\n      <div className='sans-serif h-100 relative' onClick={getNavHelper(this.props.doUpdateUrl)}>\n        {/* Tinted overlay that appears when dragging and dropping an item */}\n        { canDrop && isOver && <div className='h-100 top-0 right-0 fixed appOverlay' style={{ background: 'rgba(99, 202, 210, 0.2)' }} /> }\n        <div className='flex flex-row-reverse-l flex-column-reverse justify-end justify-start-l' style={{ minHeight: '100vh' }}>\n          <div className='flex-auto-l'>\n            <div className='flex items-center ph3 ph4-l' style={{ WebkitAppRegion: 'drag', height: 75, background: '#F0F6FA', paddingTop: '20px', paddingBottom: '15px' }}>\n              <div className='joyride-app-explore' style={{ width: 560 }}>\n                <FilesExploreForm onBrowse={doFilesNavigateTo} onInspect={doExploreUserProvidedPath} />\n              </div>\n              <div className='dn flex-ns flex-auto items-center justify-end'>\n                <TourHelper />\n                <Connected className='joyride-app-status' />\n              </div>\n            </div>\n            <main className='bg-white pv3 pa3 pa4-l'>\n              { (ipfsReady || url === '/welcome' || url.startsWith('/settings'))\n                ? <Page />\n                : <ComponentLoader />\n              }\n            </main>\n          </div>\n          <div className='navbar-container flex-none-l bg-navy'>\n            <NavBar />\n          </div>\n        </div>\n\n        <ReactJoyride\n          run={showTooltip}\n          steps={appTour.getSteps({ t })}\n          styles={appTour.styles}\n          callback={this.handleJoyrideCb}\n          scrollToFirstStep\n          disableOverlay\n          locale={getJoyrideLocales(t)}\n        />\n\n        <Notify />\n      </div>\n    )\n  }\n}\n\nconst dropTarget = {\n  drop: (props, monitor, App) => {\n    if (monitor.didDrop()) {\n      return\n    }\n\n    const { filesPromise } = monitor.getItem()\n    App.addFiles(filesPromise)\n  },\n  canDrop: (props) => props.filesPathInfo ? props.filesPathInfo.isMfs : true\n}\n\nconst dropCollect = (connect, monitor) => ({\n  connectDropTarget: connect.dropTarget(),\n  isOver: monitor.isOver(),\n  canDrop: monitor.canDrop()\n})\n\nexport const AppWithDropTarget = DropTarget(NativeTypes.FILE, dropTarget, dropCollect)(App)\n\nexport default connect(\n  'selectRoute',\n  'selectRouteInfo',\n  'selectIpfsReady',\n  'selectShowTooltip',\n  'doFilesNavigateTo',\n  'doExploreUserProvidedPath',\n  'doUpdateUrl',\n  'doUpdateHash',\n  'doTryInitIpfs',\n  'doFilesWrite',\n  'doDisableTooltip',\n  'selectFilesPathInfo',\n  withTranslation('app')(AppWithDropTarget)\n)\n","// Extracted from https://github.com/HenrikJoreteg/redux-bundler/blob/c1b8ce7629ee6c389f4155b3254e530bd09c868e/src/bundles/create-reactor-bundle.js\nimport { debounce, ric, raf } from 'redux-bundler'\n\nconst defaults = {\n  idleTimeout: 2000,\n  idleAction: 'APP_IDLE',\n  stopWhenTabInactive: false\n}\n\nconst ricOptions = { timeout: 500 }\n\nexport const getIdleDispatcher = (stopWhenInactive, timeout, fn) =>\n  debounce(() => {\n    // the requestAnimationFrame ensures it doesn't run when tab isn't active\n    stopWhenInactive ? raf(() => ric(fn, ricOptions)) : ric(fn, ricOptions)\n  }, timeout)\n\nconst createAppIdle = spec => ({\n  name: 'appIdle',\n\n  init: store => {\n    const opts = Object.assign({}, defaults, spec)\n    const { idleAction, idleTimeout } = opts\n    let idleDispatcher\n    if (idleTimeout) {\n      idleDispatcher = getIdleDispatcher(\n        opts.stopWhenTabInactive,\n        idleTimeout,\n        () => store.dispatch({ type: idleAction })\n      )\n    }\n\n    const callback = () => {\n      if (idleDispatcher) {\n        idleDispatcher()\n      }\n    }\n\n    store.subscribe(callback)\n    callback()\n  }\n})\nexport default createAppIdle\n","import { createSelector } from 'redux-bundler'\n\n// Depends on nodeBandwidthBundle\nfunction createNodeBandwidthChart (opts) {\n  opts = opts || {}\n  // Only store up to 1 day of data\n  opts.windowSize = opts.windowSize || 1000 * 60 * 60 * 24\n\n  return {\n    name: 'nodeBandwidthChart',\n\n    reducer (state = { data: { in: [], out: [] } }, action) {\n      if (action.type === 'NODE_BANDWIDTH_CHART_DATA_UPDATED') {\n        return { ...state, data: action.payload.chartData }\n      }\n\n      return state\n    },\n\n    selectNodeBandwidthChartData: state => state.nodeBandwidthChart.data,\n\n    doUpdateNodeBandwidthChartData: (bw, timestamp, chartData) => ({ dispatch }) => {\n      chartData = {\n        in: chartData.in.concat({ x: timestamp, y: parseInt(bw.rateIn.toFixed(0), 10) }),\n        out: chartData.out.concat({ x: timestamp, y: parseInt(bw.rateOut.toFixed(0) * -1, 10) })\n      }\n\n      const startIndex = chartData.in.findIndex(d => d.x >= timestamp - opts.windowSize)\n      if (startIndex > 0) {\n        chartData.in = chartData.in.slice(startIndex)\n        chartData.out = chartData.out.slice(startIndex)\n      }\n\n      dispatch({ type: 'NODE_BANDWIDTH_CHART_DATA_UPDATED', payload: { chartData } })\n    },\n\n    reactUpdateNodeBandwidthChartData: createSelector(\n      'selectNodeBandwidth',\n      'selectNodeBandwidthLastSuccess',\n      'selectNodeBandwidthEnabled',\n      'selectNodeBandwidthChartData',\n      (bw, lastSuccess, enabled, chartData) => {\n        if (!bw || !enabled) return\n\n        // Only tests for .in because it has the same timestamps as .out\n        if (!chartData.in.length || lastSuccess > chartData.in[chartData.in.length - 1].x) {\n          return {\n            actionCreator: 'doUpdateNodeBandwidthChartData',\n            args: [bw, lastSuccess, chartData]\n          }\n        }\n      }\n    )\n  }\n}\nexport default createNodeBandwidthChart\n","import { createAsyncResourceBundle, createSelector } from 'redux-bundler'\nimport ms from 'milliseconds'\nimport last from 'it-last'\n\nconst bundle = createAsyncResourceBundle({\n  name: 'nodeBandwidth',\n  actionBaseType: 'NODE_BANDWIDTH',\n  getPromise: async ({ getIpfs }) => {\n    try {\n      const stats = await last(getIpfs().stats.bw())\n      return stats\n    } catch (err) {\n      if (/bandwidth reporter disabled in config/.test(err)) {\n        return { disabled: true }\n      }\n\n      throw err\n    }\n  },\n  staleAfter: ms.seconds(3),\n  retryAfter: ms.seconds(3),\n  persist: false,\n  checkIfOnline: false\n})\n\nbundle.selectNodeBandwidthEnabled = state => state.nodeBandwidth.data ? !state.nodeBandwidth.data.disabled : false\n\nbundle.selectNodeBandwidthLastSuccess = state => state.nodeBandwidth.lastSuccess\n\n// Update the node bandwidth if it is stale (appTime - lastSuccess > staleAfter)\nbundle.reactNodeBandwidthFetchWhenIdle = createSelector(\n  'selectNodeBandwidthShouldUpdate',\n  'selectIpfsReady',\n  (shouldUpdate, ipfsReady) => {\n    if (shouldUpdate && ipfsReady) {\n      return { actionCreator: 'doFetchNodeBandwidth' }\n    }\n  }\n)\n\nexport default bundle\n","import { createAsyncResourceBundle, createSelector } from 'redux-bundler'\nimport ms from 'milliseconds'\n\nconst swarmPeersTTL = ms.seconds(10)\nconst bundle = createAsyncResourceBundle({\n  name: 'peers',\n  actionBaseType: 'PEERS',\n  getPromise: ({ getIpfs }) => getIpfs().swarm.peers({ verbose: true, timeout: swarmPeersTTL }),\n  staleAfter: swarmPeersTTL,\n  persist: false,\n  checkIfOnline: false\n})\n\nconst asyncResourceReducer = bundle.reducer\n\nbundle.reducer = (state, action) => {\n  const asyncResult = asyncResourceReducer(state, action)\n\n  if (action.type === 'SET_SELECTED_PEER') {\n    return { ...asyncResult, selectedPeers: action.payload }\n  }\n\n  return asyncResult\n}\n\nbundle.selectPeersCount = createSelector(\n  'selectPeers',\n  (peers) => {\n    if (!Array.isArray(peers)) return 0\n    return peers.length\n  }\n)\n\nbundle.doConnectSwarm = addr => async ({ dispatch, getIpfs }) => {\n  dispatch({ type: 'SWARM_CONNECT_STARTED', payload: { addr } })\n  const ipfs = getIpfs()\n\n  try {\n    await ipfs.swarm.connect(addr)\n  } catch (err) {\n    return dispatch({\n      type: 'SWARM_CONNECT_FAILED',\n      payload: { addr, error: err }\n    })\n  }\n\n  return dispatch({ type: 'SWARM_CONNECT_FINISHED', payload: { addr } })\n}\n\n// Update the peers if they are stale (appTime - lastSuccess > staleAfter)\nbundle.reactPeersFetchWhenIdle = createSelector(\n  'selectPeersShouldUpdate',\n  'selectIpfsConnected',\n  (shouldUpdate, ipfsConnected) => {\n    if (shouldUpdate && ipfsConnected) {\n      return { actionCreator: 'doFetchPeers' }\n    }\n  }\n)\n\n// Get the peers frequently when we're on the peers page\nbundle.reactPeersFetchWhenActive = createSelector(\n  'selectAppTime',\n  'selectRouteInfo',\n  'selectPeersRaw',\n  'selectIpfsConnected',\n  (appTime, routeInfo, peersInfo, selectIpfsReady, ipfsConnected) => {\n    const lastSuccess = peersInfo.lastSuccess || 0\n    if (routeInfo.url === '/peers' && ipfsConnected && !peersInfo.isLoading && appTime - lastSuccess > ms.seconds(5)) {\n      return { actionCreator: 'doFetchPeers' }\n    }\n  }\n)\n\nbundle.selectSelectedPeers = (state) => state.peers.selectedPeers\n\nbundle.doSetSelectedPeers = (peer) => ({ dispatch }) => {\n  dispatch({ type: 'SET_SELECTED_PEER', payload: peer })\n}\n\nexport default bundle\n","import { createAsyncResourceBundle, createSelector } from 'redux-bundler'\nimport { getConfiguredCache } from 'money-clip'\nimport geoip from 'ipfs-geoip'\nimport PQueue from 'p-queue'\nimport HLRU from 'hashlru'\nimport Multiaddr from 'multiaddr'\nimport ms from 'milliseconds'\nimport ip from 'ip'\nimport memoize from 'p-memoize'\nimport { dependencies } from '../../package.json'\n\n// After this time interval, we re-check the locations for each peer\n// once again through PeerLocationResolver.\nconst UPDATE_EVERY = ms.seconds(1)\n\n// We reuse cached geoip lookups as long geoipVersion is the same.\nconst geoipVersion = dependencies['ipfs-geoip']\n\n// Depends on ipfsBundle, peersBundle\nfunction createPeersLocations (opts) {\n  opts = opts || {}\n  // Max number of locations to retrieve concurrently.\n  // HTTP API are throttled to max 4-6 at a time by the browser itself.\n  opts.concurrency = opts.concurrency || 4\n  // Cache options\n  opts.cache = opts.cache || {}\n\n  const peerLocResolver = new PeerLocationResolver(opts)\n\n  const bundle = createAsyncResourceBundle({\n    name: 'peerLocations',\n    actionBaseType: 'PEER_LOCATIONS',\n    getPromise: async ({ store, getIpfs }) => {\n      const peers = store.selectPeers()\n      return peerLocResolver.findLocations(peers, getIpfs)\n    },\n    staleAfter: UPDATE_EVERY,\n    retryAfter: UPDATE_EVERY,\n    persist: false,\n    checkIfOnline: false\n  })\n\n  bundle.reactPeerLocationsFetch = createSelector(\n    'selectRouteInfo',\n    'selectPeerLocationsShouldUpdate',\n    'selectIpfsConnected',\n    (routeInfo, shouldUpdate, ipfsConnected) => {\n      if (routeInfo.url === '/peers' && shouldUpdate && ipfsConnected) {\n        return { actionCreator: 'doFetchPeerLocations' }\n      }\n    }\n  )\n\n  bundle.selectPeerLocationsForSwarm = createSelector(\n    'selectPeers',\n    'selectPeerLocations',\n    'selectBootstrapPeers',\n    'selectIdentity', // ipfs.id info for local node, used for detecting local peers\n    (peers, locations = {}, bootstrapPeers, identity) => peers && peers.map(peer => {\n      const peerId = peer.peer\n      const locationObj = locations ? locations[peerId] : null\n      const location = toLocationString(locationObj)\n      const flagCode = locationObj && locationObj.country_code\n      const coordinates = locationObj && [\n        locationObj.longitude,\n        locationObj.latitude\n      ]\n      const connection = parseConnection(peer.addr)\n      const address = peer.addr.toString()\n      const latency = parseLatency(peer.latency)\n      const direction = peer.direction\n      const { isPrivate, isNearby } = isPrivateAndNearby(peer.addr, identity)\n\n      const protocols = (Array.isArray(peer.streams)\n        ? Array.from(new Set(peer.streams\n          .map(s => s.Protocol)\n          .map(p => (!p?.trim() ? '[unnamed]' : p)) // mark weird 'empty' protocols\n        )).sort()\n        : []).join(', ')\n\n      return {\n        peerId,\n        location,\n        flagCode,\n        coordinates,\n        connection,\n        address,\n        protocols,\n        direction,\n        latency,\n        isPrivate,\n        isNearby\n      }\n    })\n  )\n\n  const COORDINATES_RADIUS = 4\n\n  bundle.selectPeersCoordinates = createSelector(\n    'selectPeerLocationsForSwarm',\n    peers => {\n      if (!peers) return []\n\n      return peers.reduce((previous, { peerId, coordinates }) => {\n        if (!coordinates) return previous\n\n        let hasFoundACloseCoordinate = false\n\n        const previousCoordinates = previous.map(prev => {\n          if (!prev || hasFoundACloseCoordinate) return prev\n\n          const [x, y] = prev.coordinates\n          const [currentX, currentY] = coordinates\n\n          const isCloseInXAxis = x - COORDINATES_RADIUS <= currentX && x + COORDINATES_RADIUS >= currentX\n          const isCloseInYAxis = y - COORDINATES_RADIUS <= currentY && y + COORDINATES_RADIUS >= currentY\n\n          if (isCloseInXAxis && isCloseInYAxis) {\n            prev.peerIds.push(peerId)\n            hasFoundACloseCoordinate = true\n          }\n\n          return prev\n        })\n\n        if (hasFoundACloseCoordinate) {\n          return previousCoordinates\n        }\n\n        return [...previousCoordinates, { peerIds: [peerId], coordinates }]\n      }, [])\n    }\n  )\n\n  return bundle\n}\n\nconst isNonHomeIPv4 = t => t[0] === 4 && t[1] !== '127.0.0.1'\n\nconst toLocationString = loc => {\n  if (!loc) return null\n  const { country_name: country, city } = loc\n  return city && country ? `${country}, ${city}` : country\n}\n\nconst parseConnection = (multiaddr) => {\n  return multiaddr.protoNames().join(' • ')\n}\n\nconst parseLatency = (latency) => {\n  if (latency === 'n/a') return\n\n  let value = parseInt(latency)\n  const unit = /(s|ms)/.exec(latency)[0]\n\n  value = unit === 's' ? value * 1000 : value\n\n  return value\n}\n\nconst getPublicIP = memoize((identity) => {\n  if (!identity) return\n\n  for (const maddr of identity.addresses) {\n    try {\n      const addr = Multiaddr(maddr).nodeAddress()\n\n      if ((ip.isV4Format(addr.address) || ip.isV6Format(addr.address)) && !ip.isPrivate(addr.address)) {\n        return addr.address\n      }\n    } catch (_) {}\n  }\n})\n\nconst isPrivateAndNearby = (maddr, identity) => {\n  const publicIP = getPublicIP(identity)\n  let isPrivate = false\n  let isNearby = false\n  let addr\n\n  try {\n    addr = maddr.nodeAddress()\n  } catch (_) {\n    // Might explode if maddr does not have an IP or cannot be converted\n    // to a node address. This might happen if it's a relay. We do not print\n    // or handle the error, otherwise we would get perhaps thousands of logs.\n    return { isPrivate, isNearby }\n  }\n\n  // At this point, addr.address and publicIP must be valid IP addresses. Hence,\n  // none of the calls bellow for ip library should fail.\n  isPrivate = ip.isPrivate(addr.address)\n\n  if (publicIP) {\n    if (ip.isV4Format(addr.address)) {\n      isNearby = ip.cidrSubnet(`${publicIP}/24`).contains(addr.address)\n    } else if (ip.isV6Format(addr.address)) {\n      isNearby = ip.cidrSubnet(`${publicIP}/48`).contains(addr.address) &&\n        !ip.cidrSubnet('fc00::/8').contains(addr.address)\n      // peerIP6 ∉ fc00::/8 to fix case of cjdns where IPs are not spatial allocated.\n    }\n  }\n\n  return { isPrivate, isNearby }\n}\n\nclass PeerLocationResolver {\n  constructor (opts) {\n    this.geoipCache = getConfiguredCache({\n      name: 'geoipCache',\n      version: geoipVersion,\n      maxAge: ms.weeks(1),\n      ...opts.cache\n    })\n\n    this.failedAddrs = HLRU(500)\n\n    this.queue = new PQueue({\n      concurrency: opts.concurrency,\n      autoStart: true\n    })\n\n    this.geoipLookupPromises = new Map()\n\n    this.pass = 0\n  }\n\n  async findLocations (peers, getIpfs) {\n    const res = {}\n\n    for (const p of this.optimizedPeerSet(peers)) {\n      const peerId = p.peer\n\n      const ipv4Tuple = p.addr.stringTuples().find(isNonHomeIPv4)\n      if (!ipv4Tuple) {\n        continue\n      }\n\n      const ipv4Addr = ipv4Tuple[1]\n      if (this.failedAddrs.has(ipv4Addr)) {\n        continue\n      }\n\n      // maybe we have it cached by ipv4 address already, check that.\n      const location = await this.geoipCache.get(ipv4Addr)\n      if (location) {\n        res[peerId] = location\n        continue\n      }\n\n      // no ip address cached. are we looking it up already?\n      if (this.geoipLookupPromises.has(ipv4Addr)) {\n        continue\n      }\n\n      this.geoipLookupPromises.set(ipv4Addr, this.queue.add(async () => {\n        try {\n          const data = await geoip.lookup(getIpfs(), ipv4Addr)\n          await this.geoipCache.set(ipv4Addr, data)\n        } catch (e) {\n          // mark this one as failed so we don't retry again\n          this.failedAddrs.set(ipv4Addr, true)\n        } finally {\n          this.geoipLookupPromises.delete(ipv4Addr)\n        }\n      }))\n    }\n\n    return res\n  }\n\n  optimizedPeerSet (peers) {\n    if (this.pass < 3) {\n      // use a copy of peers sorted by latency so we can resolve closest ones first\n      // (https://github.com/ipfs-shipyard/ipfs-webui/issues/1273)\n      const ms = x => (parseLatency(x.latency) || 9999)\n      const sortedPeersByLatency = peers.concat().sort((a, b) => ms(a) - ms(b))\n      // take the closest subset, increase sample size each time\n      // this ensures initial map updates are fast even with thousands of peers\n      this.pass = this.pass + 1\n\n      switch (this.pass - 1) {\n        case 0:\n          return sortedPeersByLatency.slice(0, 10)\n        case 1:\n          return sortedPeersByLatency.slice(0, 100)\n        default:\n          return sortedPeersByLatency.slice(0, 200)\n      }\n    }\n    return peers\n  }\n}\nexport default createPeersLocations\n","// This is a list of predefined templates for popular services from the IPFS\n// community.  We are open to reviewing PRs that add more entries here,\n// but only well-established and mission-aligned services will be accepted.\nconst pinningServiceTemplates = [\n  {\n    name: 'Pinata',\n    icon: 'https://dweb.link/ipfs/QmVYXV4urQNDzZpddW4zZ9PGvcAbF38BnKWSgch3aNeViW?filename=pinata.svg',\n    apiEndpoint: 'https://api.pinata.cloud/psa',\n    visitServiceUrl: 'https://pinata.cloud/documentation#PinningServicesAPI'\n  }\n]\n\nexport {\n  pinningServiceTemplates\n}\n","// @ts-check\nimport { pinningServiceTemplates } from '../constants/pinning'\nimport memoize from 'p-memoize'\n\nconst parseService = async (service, remoteServiceTemplates, ipfs) => {\n  const template = remoteServiceTemplates.find(t => service.endpoint.toString() === t.apiEndpoint.toString())\n  const icon = template?.icon\n  const visitServiceUrl = template?.visitServiceUrl\n  const autoUpload = await mfsPolicyEnableFlag(service.service, ipfs)\n  const parsedService = { ...service, name: service.service, icon, visitServiceUrl, autoUpload }\n\n  if (service?.stat?.status === 'invalid') {\n    return { ...parsedService, numberOfPins: -1, online: false }\n  }\n\n  const numberOfPins = service.stat?.pinCount?.pinned\n  const online = typeof numberOfPins === 'number'\n\n  return { ...parsedService, numberOfPins, online }\n}\n\nconst mfsPolicyEnableFlag = memoize(async (serviceName, ipfs) => {\n  try {\n    return await ipfs.config.get(`Pinning.RemoteServices.${serviceName}.Policies.MFS.Enable`)\n  } catch (e) {\n    if (e.message?.includes('key has no attribute')) {\n      try { // retry with notation from https://github.com/ipfs/go-ipfs/pull/8096\n        return await ipfs.config.get(`Pinning.RemoteServices[\"${serviceName}\"].Policies.MFS.Enable`)\n      } catch (_) {}\n    }\n    console.error(`unexpected config.get error for \"${serviceName}\": ${e.message}`)\n  }\n  return false\n}, { maxAge: 3000 })\n\nconst uniqueCidBatches = (arrayOfCids, size) => {\n  const array = [...new Set(arrayOfCids)] // deduplicate CIDs\n  const result = []\n  for (let i = 0; i < array.length; i += size) {\n    const chunk = array.slice(i, i + size)\n    result.push(chunk)\n  }\n  return result\n}\n\n/**\n * TODO: This might change, current version from: https://github.com/ipfs/go-ipfs/blob/petar/pincli/core/commands/remotepin.go#L53\n * @typedef {Object} RemotePin\n * @property {string} id\n * @property {string} name\n * @property {('queued'|'pinning'|'pinned'|'failed')} status\n * @property {string} cid\n * @property {Array<string>} [delegates] (multiaddrs endind with /p2p/peerid)\n*/\nconst pinningBundle = {\n  name: 'pinning',\n  reducer: (state = {\n    pinningServices: [],\n    remotePins: [],\n    notRemotePins: [],\n    arePinningServicesSupported: false\n  }, action) => {\n    if (action.type === 'CACHE_REMOTE_PINS') {\n      const { adds, removals } = action.payload\n      const remotePins = [...state.remotePins, ...adds].filter(p => !removals.some(r => r === p.id))\n      const notRemotePins = [...state.notRemotePins, ...removals].filter(rid => !adds.some(a => a.id === rid))\n      return { ...state, remotePins, notRemotePins }\n    }\n    if (action.type === 'SET_REMOTE_PINNING_SERVICES') {\n      const oldServices = state.pinningServices\n      const newServices = action.payload\n      // Skip update when list length did not change and new one has no stats\n      // so there is no janky update in 'Set pinning modal' when 3+ services\n      // are defined and some of them are offline.\n      if (oldServices.length === newServices.length) {\n        const withPinStats = s => (s && typeof s.numberOfPins !== 'undefined')\n        const oldStats = oldServices.some(withPinStats)\n        const newStats = newServices.some(withPinStats)\n        if (oldStats && !newStats) return state\n      }\n      return { ...state, pinningServices: newServices }\n    }\n    if (action.type === 'SET_REMOTE_PINNING_SERVICES_AVAILABLE') {\n      return { ...state, arePinningServicesSupported: action.payload }\n    }\n    return state\n  },\n\n  doFetchRemotePins: (files) => async ({ dispatch, store, getIpfs }) => {\n    // Only check services that are confirmed to be online\n    const pinningServices = store.selectPinningServices().filter(s => s.online)\n\n    if (!pinningServices?.length) return\n\n    const ipfs = getIpfs()\n\n    if (!ipfs || store?.ipfs?.ipfs?.ready || !ipfs.pin.remote) return\n\n    const allCids = files ? files.map(f => f.cid) : []\n\n    // Reuse known state for some CIDs to avoid unnecessary requests\n    const cacheId2Cid = (id) => id.split(':').slice(-1)[0]\n    const remotePins = store.selectRemotePins().map(pin => pin.id)\n    const notRemotePins = store.selectNotRemotePins()\n\n    // Check remaining CID status in chunks of 10 (remote API limitation)\n    const cids = uniqueCidBatches(allCids, 10)\n\n    const adds = []\n    const removals = []\n\n    await Promise.allSettled(pinningServices.map(async service => {\n      try {\n        // skip CIDs that we know the state of at this service\n        const skipCids = new Set(\n          [...remotePins, ...notRemotePins]\n            .filter(id => id.startsWith(service.name))\n            .map(cacheId2Cid)\n        )\n        return Promise.allSettled(cids.map(async cidChunk => {\n          const cidsToCheck = cidChunk.filter(cid => !skipCids.has(cid.toString()))\n          if (!cidsToCheck.length) return // skip if no new cids to check\n          const notPins = new Set(cidsToCheck.map(cid => cid.toString()))\n          const pins = ipfs.pin.remote.ls({ service: service.name, cid: cidsToCheck })\n          for await (const pin of pins) {\n            const pinCid = pin.cid.toString()\n            notPins.delete(pinCid)\n            adds.push({ id: `${service.name}:${pinCid}`, ...pin })\n          }\n          // store 'not pinned remotely on this service' to avoid future checks\n          for (const notPinCid of notPins) {\n            removals.push(`${service.name}:${notPinCid}`)\n          }\n        }))\n      } catch (e) {\n        // ignore service and network errors for now\n        // and continue checking remaining ones\n        console.error('unexpected error during doFetchRemotePins', e)\n      }\n    }))\n    dispatch({ type: 'CACHE_REMOTE_PINS', payload: { adds, removals } })\n  },\n\n  selectRemotePins: (state) => state.pinning.remotePins || [],\n  selectNotRemotePins: (state) => state.pinning.notRemotePins || [],\n\n  doSelectRemotePinsForFile: (file) => ({ store }) => {\n    const pinningServicesNames = store.selectPinningServices().map(remote => remote.name)\n\n    const remotePinForFile = store.selectRemotePins().filter(pin => pin.cid.string === file.cid.string)\n    const servicesBeingUsed = remotePinForFile.map(pin => pin.id.split(':')[0]).filter(pinId => pinningServicesNames.includes(pinId))\n\n    return servicesBeingUsed\n  },\n\n  doFetchPinningServices: () => async ({ getIpfs, store, dispatch }) => {\n    const ipfs = getIpfs()\n    if (!ipfs || store?.ipfs?.ipfs?.ready || !ipfs.pin.remote) return null\n\n    const isPinRemotePresent = (await ipfs.commands()).Subcommands.find(c => c.Name === 'pin').Subcommands.some(c => c.Name === 'remote')\n    dispatch({ type: 'SET_REMOTE_PINNING_SERVICES_AVAILABLE', payload: isPinRemotePresent })\n    if (!isPinRemotePresent) return null\n\n    const remoteServiceTemplates = store.selectRemoteServiceTemplates()\n    // list of services without online check (should be instant)\n    const offlineListOfServices = await ipfs.pin.remote.service.ls()\n    const remoteServices = await Promise.all(offlineListOfServices.map(service => parseService(service, remoteServiceTemplates, ipfs)))\n    dispatch({ type: 'SET_REMOTE_PINNING_SERVICES', payload: remoteServices })\n    // slower list of services + their pin stats (usually slower)\n    const fullListOfServices = await ipfs.pin.remote.service.ls({ stat: true })\n    const fullRemoteServices = await Promise.all(fullListOfServices.map(service => parseService(service, remoteServiceTemplates, ipfs)))\n    dispatch({ type: 'SET_REMOTE_PINNING_SERVICES', payload: fullRemoteServices })\n  },\n\n  selectPinningServices: (state) => state.pinning.pinningServices || [],\n\n  selectRemoteServiceTemplates: () => pinningServiceTemplates,\n\n  selectArePinningServicesSupported: (state) => state.pinning.arePinningServicesSupported,\n\n  selectPinningServicesDefaults: () => pinningServiceTemplates.reduce((prev, curr) => ({\n    ...prev,\n    [curr.name]: {\n      ...curr,\n      nickname: curr.name\n    }\n  }), {}),\n\n  doSetPinning: (pin, services = [], wasLocallyPinned, previousRemotePins = []) => async ({ getIpfs, store, dispatch }) => {\n    const ipfs = getIpfs()\n    const { cid, name } = pin\n\n    const pinLocally = services.includes('local')\n    if (wasLocallyPinned !== pinLocally) {\n      try {\n        pinLocally ? await ipfs.pin.add(cid) : await ipfs.pin.rm(cid)\n      } catch (e) {\n        console.error(`unexpected local pin error for ${cid} (${name})`, e)\n        dispatch({ type: 'IPFS_PIN_FAILED' })\n      }\n    }\n\n    const adds = []\n    const removals = []\n\n    store.selectPinningServices().filter(s => s.online).forEach(async service => {\n      const shouldPin = services.includes(service.name)\n      const wasPinned = previousRemotePins.includes(service.name)\n      if (wasPinned === shouldPin) return\n\n      try {\n        const id = `${service.name}:${pin.cid}`\n        if (shouldPin) {\n          adds.push({ id, ...pin })\n          // TODO: remove background:true and add pin job to queue.\n          // wait for pinning to finish + add indicator for ongoing pinning\n          await ipfs.pin.remote.add(cid, { service: service.name, name, background: true })\n        } else {\n          removals.push(id)\n          await ipfs.pin.remote.rm({ cid: [cid], service: service.name })\n        }\n      } catch (e) {\n        // log error and continue with other services\n        console.error(`unexpected pin.remote error for ${cid}@${service.name}`, e)\n        dispatch({ type: 'IPFS_PIN_FAILED' })\n      }\n    })\n\n    dispatch({ type: 'CACHE_REMOTE_PINS', payload: { adds, removals } })\n\n    await store.doPinsFetch()\n  },\n  doAddPinningService: ({ apiEndpoint, nickname, secretApiKey }) => async ({ getIpfs }) => {\n    const ipfs = getIpfs()\n\n    // temporary mitigation for https://github.com/ipfs/ipfs-webui/issues/1770\n    nickname = nickname.replaceAll('.', '_')\n\n    await ipfs.pin.remote.service.add(nickname, {\n      endpoint: apiEndpoint,\n      key: secretApiKey\n    })\n  },\n\n  doRemovePinningService: (name) => async ({ getIpfs, store }) => {\n    const ipfs = getIpfs()\n\n    await ipfs.pin.remote.service.rm(name)\n\n    store.doFetchPinningServices()\n  },\n\n  doSetAutoUploadForService: (name) => async ({ getIpfs, store }) => {\n    const ipfs = getIpfs()\n\n    const configName = `Pinning.RemoteServices.${name}.Policies.MFS.Enable`\n\n    const previousPolicy = await ipfs.config.get(configName)\n\n    await ipfs.config.set(configName, !previousPolicy)\n\n    store.doFetchPinningServices()\n  }\n}\nexport default pinningBundle\n","import React from 'react'\nimport Loadable from '@loadable/component'\nimport ComponentLoader from '../loader/ComponentLoader.js'\n\nconst LoadableStatusPage = Loadable(() => import('./StatusPage'),\n  { fallback: <ComponentLoader/> }\n)\n\nexport default LoadableStatusPage\n","import React from 'react'\nimport Loadable from '@loadable/component'\nimport ComponentLoader from '../loader/ComponentLoader.js'\n\nconst LoadableFilesPage = Loadable(() => import('./FilesPage'),\n  { fallback: <ComponentLoader/> }\n)\n\nexport default LoadableFilesPage\n","import React from 'react'\nimport Loadable from '@loadable/component'\nimport ComponentLoader from '../loader/ComponentLoader.js'\n\nconst LoadableStartExploringPage = Loadable(() => import('./StartExploringContainer'),\n  { fallback: <ComponentLoader/> }\n)\n\nexport default LoadableStartExploringPage\n","import React from 'react'\nimport Loadable from '@loadable/component'\nimport ComponentLoader from '../loader/ComponentLoader.js'\n\nconst LoadableExplorePage = Loadable(() => import('./ExploreContainer'),\n  { fallback: <ComponentLoader/> }\n)\n\nexport default LoadableExplorePage\n","import React from 'react'\nimport Loadable from '@loadable/component'\nimport ComponentLoader from '../loader/ComponentLoader.js'\n\nconst LoadablePeersPage = Loadable(() => import('./PeersPage'),\n  { fallback: <ComponentLoader/> }\n)\n\nexport default LoadablePeersPage\n","import React from 'react'\nimport Loadable from '@loadable/component'\nimport ComponentLoader from '../loader/ComponentLoader.js'\n\nconst LoadableSettingsPage = Loadable(() => import('./SettingsPage'),\n  { fallback: <ComponentLoader/> }\n)\n\nexport default LoadableSettingsPage\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport Title from './Title'\nimport Box from '../components/box/Box'\nimport AnalyticsToggle from '../components/analytics-toggle/AnalyticsToggle'\n\nexport const AnalyticsPage = ({ t }) => (\n  <div data-id='AnalyticsPage' className='mw9 center'>\n    <Helmet>\n      <title>{t('title')} | IPFS</title>\n    </Helmet>\n\n    <Box>\n      <Title>{t('analytics')