2018-07-23 15:12:18 +02:00
( function webpackUniversalModuleDefinition ( root , factory ) {
if ( typeof exports === 'object' && typeof module === 'object' )
2019-03-13 06:06:43 +01:00
module . exports = factory ( require ( "lbry-redux" ) ) ;
2018-07-23 15:12:18 +02:00
else if ( typeof define === 'function' && define . amd )
2019-03-13 06:06:43 +01:00
define ( [ "lbry-redux" ] , factory ) ;
2018-07-23 15:12:18 +02:00
else {
2019-03-13 06:06:43 +01:00
var a = typeof exports === 'object' ? factory ( require ( "lbry-redux" ) ) : factory ( root [ "lbry-redux" ] ) ;
2018-07-23 15:12:18 +02:00
for ( var i in a ) ( typeof exports === 'object' ? exports : root ) [ i ] = a [ i ] ;
}
2020-01-10 04:28:46 +01:00
} ) ( window , function ( _ _WEBPACK _EXTERNAL _MODULE _ _5 _ _ ) {
2018-07-23 15:12:18 +02:00
return /******/ ( function ( modules ) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = { } ;
/******/
/******/ // The require function
/******/ function _ _webpack _require _ _ ( moduleId ) {
/******/
/******/ // Check if module is in cache
/******/ if ( installedModules [ moduleId ] ) {
/******/ return installedModules [ moduleId ] . exports ;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules [ moduleId ] = {
/******/ i : moduleId ,
/******/ l : false ,
/******/ exports : { }
/******/ } ;
/******/
/******/ // Execute the module function
/******/ modules [ moduleId ] . call ( module . exports , module , module . exports , _ _webpack _require _ _ ) ;
/******/
/******/ // Flag the module as loaded
/******/ module . l = true ;
/******/
/******/ // Return the exports of the module
/******/ return module . exports ;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ _ _webpack _require _ _ . m = modules ;
/******/
/******/ // expose the module cache
/******/ _ _webpack _require _ _ . c = installedModules ;
/******/
/******/ // define getter function for harmony exports
/******/ _ _webpack _require _ _ . d = function ( exports , name , getter ) {
/******/ if ( ! _ _webpack _require _ _ . o ( exports , name ) ) {
/******/ Object . defineProperty ( exports , name , { enumerable : true , get : getter } ) ;
/******/ }
/******/ } ;
/******/
/******/ // define __esModule on exports
/******/ _ _webpack _require _ _ . r = function ( exports ) {
/******/ if ( typeof Symbol !== 'undefined' && Symbol . toStringTag ) {
/******/ Object . defineProperty ( exports , Symbol . toStringTag , { value : 'Module' } ) ;
/******/ }
/******/ Object . defineProperty ( exports , '__esModule' , { value : true } ) ;
/******/ } ;
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ _ _webpack _require _ _ . t = function ( value , mode ) {
/******/ if ( mode & 1 ) value = _ _webpack _require _ _ ( value ) ;
/******/ if ( mode & 8 ) return value ;
/******/ if ( ( mode & 4 ) && typeof value === 'object' && value && value . _ _esModule ) return value ;
/******/ var ns = Object . create ( null ) ;
/******/ _ _webpack _require _ _ . r ( ns ) ;
/******/ Object . defineProperty ( ns , 'default' , { enumerable : true , value : value } ) ;
/******/ if ( mode & 2 && typeof value != 'string' ) for ( var key in value ) _ _webpack _require _ _ . d ( ns , key , function ( key ) { return value [ key ] ; } . bind ( null , key ) ) ;
/******/ return ns ;
/******/ } ;
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ _ _webpack _require _ _ . n = function ( module ) {
/******/ var getter = module && module . _ _esModule ?
/******/ function getDefault ( ) { return module [ 'default' ] ; } :
/******/ function getModuleExports ( ) { return module ; } ;
/******/ _ _webpack _require _ _ . d ( getter , 'a' , getter ) ;
/******/ return getter ;
/******/ } ;
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ _ _webpack _require _ _ . o = function ( object , property ) { return Object . prototype . hasOwnProperty . call ( object , property ) ; } ;
/******/
/******/ // __webpack_public_path__
/******/ _ _webpack _require _ _ . p = "" ;
/******/
/******/
/******/ // Load entry module and return exports
/******/ return _ _webpack _require _ _ ( _ _webpack _require _ _ . s = 0 ) ;
/******/ } )
/************************************************************************/
/******/ ( [
/* 0 */
2019-04-03 23:34:07 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2018-07-23 15:12:18 +02:00
"use strict" ;
2019-04-03 23:34:07 +02:00
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony import */ var constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 1 ) ;
/* harmony reexport (module object) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "LBRYINC_ACTIONS" , function ( ) { return constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ ; } ) ;
2019-10-02 06:15:24 +02:00
/* harmony import */ var constants _youtube _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( 2 ) ;
/* harmony reexport (module object) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "YOUTUBE_STATUSES" , function ( ) { return constants _youtube _ _WEBPACK _IMPORTED _MODULE _1 _ _ ; } ) ;
2020-01-10 04:28:46 +01:00
/* harmony import */ var constants _errors _ _WEBPACK _IMPORTED _MODULE _2 _ _ = _ _webpack _require _ _ ( 3 ) ;
/* harmony reexport (module object) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "ERRORS" , function ( ) { return constants _errors _ _WEBPACK _IMPORTED _MODULE _2 _ _ ; } ) ;
/* harmony import */ var lbryio _ _WEBPACK _IMPORTED _MODULE _3 _ _ = _ _webpack _require _ _ ( 4 ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "Lbryio" , function ( ) { return lbryio _ _WEBPACK _IMPORTED _MODULE _3 _ _ [ "default" ] ; } ) ;
2018-07-23 15:12:18 +02:00
2020-06-15 22:29:48 +02:00
/* harmony import */ var util _transifex _upload _ _WEBPACK _IMPORTED _MODULE _4 _ _ = _ _webpack _require _ _ ( 9 ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doTransifexUpload" , function ( ) { return util _transifex _upload _ _WEBPACK _IMPORTED _MODULE _4 _ _ [ "doTransifexUpload" ] ; } ) ;
2018-07-23 15:12:18 +02:00
2020-06-15 22:29:48 +02:00
/* harmony import */ var redux _actions _auth _ _WEBPACK _IMPORTED _MODULE _5 _ _ = _ _webpack _require _ _ ( 15 ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doGenerateAuthToken" , function ( ) { return redux _actions _auth _ _WEBPACK _IMPORTED _MODULE _5 _ _ [ "doGenerateAuthToken" ] ; } ) ;
2018-07-23 15:12:18 +02:00
2020-06-15 22:29:48 +02:00
/* harmony import */ var redux _actions _cost _info _ _WEBPACK _IMPORTED _MODULE _6 _ _ = _ _webpack _require _ _ ( 16 ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doFetchCostInfoForUri" , function ( ) { return redux _actions _cost _info _ _WEBPACK _IMPORTED _MODULE _6 _ _ [ "doFetchCostInfoForUri" ] ; } ) ;
2018-07-23 15:12:18 +02:00
2020-06-15 22:29:48 +02:00
/* harmony import */ var redux _actions _blacklist _ _WEBPACK _IMPORTED _MODULE _7 _ _ = _ _webpack _require _ _ ( 17 ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doBlackListedOutpointsSubscribe" , function ( ) { return redux _actions _blacklist _ _WEBPACK _IMPORTED _MODULE _7 _ _ [ "doBlackListedOutpointsSubscribe" ] ; } ) ;
2018-07-23 15:12:18 +02:00
2020-06-15 22:29:48 +02:00
/* harmony import */ var redux _actions _filtered _ _WEBPACK _IMPORTED _MODULE _8 _ _ = _ _webpack _require _ _ ( 18 ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doFilteredOutpointsSubscribe" , function ( ) { return redux _actions _filtered _ _WEBPACK _IMPORTED _MODULE _8 _ _ [ "doFilteredOutpointsSubscribe" ] ; } ) ;
2018-07-23 15:12:18 +02:00
2020-06-15 22:29:48 +02:00
/* harmony import */ var redux _actions _homepage _ _WEBPACK _IMPORTED _MODULE _9 _ _ = _ _webpack _require _ _ ( 19 ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doFetchFeaturedUris" , function ( ) { return redux _actions _homepage _ _WEBPACK _IMPORTED _MODULE _9 _ _ [ "doFetchFeaturedUris" ] ; } ) ;
2018-07-23 15:12:18 +02:00
2020-06-15 22:29:48 +02:00
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doFetchTrendingUris" , function ( ) { return redux _actions _homepage _ _WEBPACK _IMPORTED _MODULE _9 _ _ [ "doFetchTrendingUris" ] ; } ) ;
2019-02-15 10:02:34 +01:00
2020-06-15 22:29:48 +02:00
/* harmony import */ var redux _actions _stats _ _WEBPACK _IMPORTED _MODULE _10 _ _ = _ _webpack _require _ _ ( 20 ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doFetchViewCount" , function ( ) { return redux _actions _stats _ _WEBPACK _IMPORTED _MODULE _10 _ _ [ "doFetchViewCount" ] ; } ) ;
2019-02-15 10:02:34 +01:00
2020-06-15 22:29:48 +02:00
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doFetchSubCount" , function ( ) { return redux _actions _stats _ _WEBPACK _IMPORTED _MODULE _10 _ _ [ "doFetchSubCount" ] ; } ) ;
2018-07-23 15:12:18 +02:00
2020-10-24 02:49:02 +02:00
/* harmony import */ var redux _actions _sync _ _WEBPACK _IMPORTED _MODULE _11 _ _ = _ _webpack _require _ _ ( 21 ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doCheckSync" , function ( ) { return redux _actions _sync _ _WEBPACK _IMPORTED _MODULE _11 _ _ [ "doCheckSync" ] ; } ) ;
2018-07-23 15:12:18 +02:00
2020-10-24 02:49:02 +02:00
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doGetSync" , function ( ) { return redux _actions _sync _ _WEBPACK _IMPORTED _MODULE _11 _ _ [ "doGetSync" ] ; } ) ;
2019-03-11 03:02:17 +01:00
2020-10-24 02:49:02 +02:00
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doSetSync" , function ( ) { return redux _actions _sync _ _WEBPACK _IMPORTED _MODULE _11 _ _ [ "doSetSync" ] ; } ) ;
2019-03-11 03:02:17 +01:00
2020-10-24 02:49:02 +02:00
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doSetDefaultAccount" , function ( ) { return redux _actions _sync _ _WEBPACK _IMPORTED _MODULE _11 _ _ [ "doSetDefaultAccount" ] ; } ) ;
2019-03-11 03:02:17 +01:00
2020-10-24 02:49:02 +02:00
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doSyncApply" , function ( ) { return redux _actions _sync _ _WEBPACK _IMPORTED _MODULE _11 _ _ [ "doSyncApply" ] ; } ) ;
2019-03-11 03:02:17 +01:00
2020-10-24 02:49:02 +02:00
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doResetSync" , function ( ) { return redux _actions _sync _ _WEBPACK _IMPORTED _MODULE _11 _ _ [ "doResetSync" ] ; } ) ;
2019-03-11 03:02:17 +01:00
2020-10-24 02:49:02 +02:00
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doSyncEncryptAndDecrypt" , function ( ) { return redux _actions _sync _ _WEBPACK _IMPORTED _MODULE _11 _ _ [ "doSyncEncryptAndDecrypt" ] ; } ) ;
2019-03-11 03:02:17 +01:00
2020-10-24 02:49:02 +02:00
/* harmony import */ var redux _actions _web _ _WEBPACK _IMPORTED _MODULE _12 _ _ = _ _webpack _require _ _ ( 22 ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doUpdateUploadProgress" , function ( ) { return redux _actions _web _ _WEBPACK _IMPORTED _MODULE _12 _ _ [ "doUpdateUploadProgress" ] ; } ) ;
2019-03-14 19:39:39 +01:00
2020-10-24 02:49:02 +02:00
/* harmony import */ var redux _reducers _auth _ _WEBPACK _IMPORTED _MODULE _13 _ _ = _ _webpack _require _ _ ( 23 ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "authReducer" , function ( ) { return redux _reducers _auth _ _WEBPACK _IMPORTED _MODULE _13 _ _ [ "authReducer" ] ; } ) ;
2019-03-14 19:39:39 +01:00
2020-10-24 02:49:02 +02:00
/* harmony import */ var redux _reducers _cost _info _ _WEBPACK _IMPORTED _MODULE _14 _ _ = _ _webpack _require _ _ ( 24 ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "costInfoReducer" , function ( ) { return redux _reducers _cost _info _ _WEBPACK _IMPORTED _MODULE _14 _ _ [ "costInfoReducer" ] ; } ) ;
2018-07-23 15:12:18 +02:00
2020-10-24 02:49:02 +02:00
/* harmony import */ var redux _reducers _blacklist _ _WEBPACK _IMPORTED _MODULE _15 _ _ = _ _webpack _require _ _ ( 26 ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "blacklistReducer" , function ( ) { return redux _reducers _blacklist _ _WEBPACK _IMPORTED _MODULE _15 _ _ [ "blacklistReducer" ] ; } ) ;
2018-07-23 15:12:18 +02:00
2020-10-24 02:49:02 +02:00
/* harmony import */ var redux _reducers _filtered _ _WEBPACK _IMPORTED _MODULE _16 _ _ = _ _webpack _require _ _ ( 27 ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "filteredReducer" , function ( ) { return redux _reducers _filtered _ _WEBPACK _IMPORTED _MODULE _16 _ _ [ "filteredReducer" ] ; } ) ;
2018-07-23 15:12:18 +02:00
2020-10-24 02:49:02 +02:00
/* harmony import */ var redux _reducers _homepage _ _WEBPACK _IMPORTED _MODULE _17 _ _ = _ _webpack _require _ _ ( 28 ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "homepageReducer" , function ( ) { return redux _reducers _homepage _ _WEBPACK _IMPORTED _MODULE _17 _ _ [ "homepageReducer" ] ; } ) ;
2018-07-23 15:12:18 +02:00
2020-10-24 02:49:02 +02:00
/* harmony import */ var redux _reducers _stats _ _WEBPACK _IMPORTED _MODULE _18 _ _ = _ _webpack _require _ _ ( 29 ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "statsReducer" , function ( ) { return redux _reducers _stats _ _WEBPACK _IMPORTED _MODULE _18 _ _ [ "statsReducer" ] ; } ) ;
2018-07-23 15:12:18 +02:00
2020-10-24 02:49:02 +02:00
/* harmony import */ var redux _reducers _sync _ _WEBPACK _IMPORTED _MODULE _19 _ _ = _ _webpack _require _ _ ( 30 ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "syncReducer" , function ( ) { return redux _reducers _sync _ _WEBPACK _IMPORTED _MODULE _19 _ _ [ "syncReducer" ] ; } ) ;
2018-07-23 15:12:18 +02:00
2020-10-24 02:49:02 +02:00
/* harmony import */ var redux _reducers _web _ _WEBPACK _IMPORTED _MODULE _20 _ _ = _ _webpack _require _ _ ( 31 ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "webReducer" , function ( ) { return redux _reducers _web _ _WEBPACK _IMPORTED _MODULE _20 _ _ [ "webReducer" ] ; } ) ;
2019-03-11 03:02:17 +01:00
2020-10-24 02:49:02 +02:00
/* harmony import */ var redux _selectors _auth _ _WEBPACK _IMPORTED _MODULE _21 _ _ = _ _webpack _require _ _ ( 32 ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectAuthToken" , function ( ) { return redux _selectors _auth _ _WEBPACK _IMPORTED _MODULE _21 _ _ [ "selectAuthToken" ] ; } ) ;
2019-03-11 03:02:17 +01:00
2020-10-24 02:49:02 +02:00
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectIsAuthenticating" , function ( ) { return redux _selectors _auth _ _WEBPACK _IMPORTED _MODULE _21 _ _ [ "selectIsAuthenticating" ] ; } ) ;
2019-03-11 03:02:17 +01:00
2020-10-24 02:49:02 +02:00
/* harmony import */ var redux _selectors _cost _info _ _WEBPACK _IMPORTED _MODULE _22 _ _ = _ _webpack _require _ _ ( 34 ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "makeSelectFetchingCostInfoForUri" , function ( ) { return redux _selectors _cost _info _ _WEBPACK _IMPORTED _MODULE _22 _ _ [ "makeSelectFetchingCostInfoForUri" ] ; } ) ;
2019-03-11 03:02:17 +01:00
2020-10-24 02:49:02 +02:00
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "makeSelectCostInfoForUri" , function ( ) { return redux _selectors _cost _info _ _WEBPACK _IMPORTED _MODULE _22 _ _ [ "makeSelectCostInfoForUri" ] ; } ) ;
2020-03-19 08:55:45 +01:00
2020-10-24 02:49:02 +02:00
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectAllCostInfoByUri" , function ( ) { return redux _selectors _cost _info _ _WEBPACK _IMPORTED _MODULE _22 _ _ [ "selectAllCostInfoByUri" ] ; } ) ;
2019-03-11 03:02:17 +01:00
2020-10-24 02:49:02 +02:00
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectFetchingCostInfo" , function ( ) { return redux _selectors _cost _info _ _WEBPACK _IMPORTED _MODULE _22 _ _ [ "selectFetchingCostInfo" ] ; } ) ;
2019-03-11 03:02:17 +01:00
2020-10-24 02:49:02 +02:00
/* harmony import */ var redux _selectors _blacklist _ _WEBPACK _IMPORTED _MODULE _23 _ _ = _ _webpack _require _ _ ( 35 ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectBlackListedOutpoints" , function ( ) { return redux _selectors _blacklist _ _WEBPACK _IMPORTED _MODULE _23 _ _ [ "selectBlackListedOutpoints" ] ; } ) ;
2020-04-13 15:40:25 +02:00
2020-10-24 02:49:02 +02:00
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectBlacklistedOutpointMap" , function ( ) { return redux _selectors _blacklist _ _WEBPACK _IMPORTED _MODULE _23 _ _ [ "selectBlacklistedOutpointMap" ] ; } ) ;
2020-08-13 19:53:49 +02:00
2020-10-24 02:49:02 +02:00
/* harmony import */ var redux _selectors _filtered _ _WEBPACK _IMPORTED _MODULE _24 _ _ = _ _webpack _require _ _ ( 36 ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectFilteredOutpoints" , function ( ) { return redux _selectors _filtered _ _WEBPACK _IMPORTED _MODULE _24 _ _ [ "selectFilteredOutpoints" ] ; } ) ;
2020-04-13 15:40:25 +02:00
2020-10-24 02:49:02 +02:00
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectFilteredOutpointMap" , function ( ) { return redux _selectors _filtered _ _WEBPACK _IMPORTED _MODULE _24 _ _ [ "selectFilteredOutpointMap" ] ; } ) ;
/* harmony import */ var redux _selectors _homepage _ _WEBPACK _IMPORTED _MODULE _25 _ _ = _ _webpack _require _ _ ( 37 ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectFeaturedUris" , function ( ) { return redux _selectors _homepage _ _WEBPACK _IMPORTED _MODULE _25 _ _ [ "selectFeaturedUris" ] ; } ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectFetchingFeaturedUris" , function ( ) { return redux _selectors _homepage _ _WEBPACK _IMPORTED _MODULE _25 _ _ [ "selectFetchingFeaturedUris" ] ; } ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectTrendingUris" , function ( ) { return redux _selectors _homepage _ _WEBPACK _IMPORTED _MODULE _25 _ _ [ "selectTrendingUris" ] ; } ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectFetchingTrendingUris" , function ( ) { return redux _selectors _homepage _ _WEBPACK _IMPORTED _MODULE _25 _ _ [ "selectFetchingTrendingUris" ] ; } ) ;
/* harmony import */ var redux _selectors _stats _ _WEBPACK _IMPORTED _MODULE _26 _ _ = _ _webpack _require _ _ ( 38 ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "makeSelectViewCountForUri" , function ( ) { return redux _selectors _stats _ _WEBPACK _IMPORTED _MODULE _26 _ _ [ "makeSelectViewCountForUri" ] ; } ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "makeSelectSubCountForUri" , function ( ) { return redux _selectors _stats _ _WEBPACK _IMPORTED _MODULE _26 _ _ [ "makeSelectSubCountForUri" ] ; } ) ;
/* harmony import */ var redux _selectors _sync _ _WEBPACK _IMPORTED _MODULE _27 _ _ = _ _webpack _require _ _ ( 39 ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectHasSyncedWallet" , function ( ) { return redux _selectors _sync _ _WEBPACK _IMPORTED _MODULE _27 _ _ [ "selectHasSyncedWallet" ] ; } ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectSyncData" , function ( ) { return redux _selectors _sync _ _WEBPACK _IMPORTED _MODULE _27 _ _ [ "selectSyncData" ] ; } ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectSyncHash" , function ( ) { return redux _selectors _sync _ _WEBPACK _IMPORTED _MODULE _27 _ _ [ "selectSyncHash" ] ; } ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectSetSyncErrorMessage" , function ( ) { return redux _selectors _sync _ _WEBPACK _IMPORTED _MODULE _27 _ _ [ "selectSetSyncErrorMessage" ] ; } ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectGetSyncErrorMessage" , function ( ) { return redux _selectors _sync _ _WEBPACK _IMPORTED _MODULE _27 _ _ [ "selectGetSyncErrorMessage" ] ; } ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectGetSyncIsPending" , function ( ) { return redux _selectors _sync _ _WEBPACK _IMPORTED _MODULE _27 _ _ [ "selectGetSyncIsPending" ] ; } ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectSetSyncIsPending" , function ( ) { return redux _selectors _sync _ _WEBPACK _IMPORTED _MODULE _27 _ _ [ "selectSetSyncIsPending" ] ; } ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectSyncApplyIsPending" , function ( ) { return redux _selectors _sync _ _WEBPACK _IMPORTED _MODULE _27 _ _ [ "selectSyncApplyIsPending" ] ; } ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectHashChanged" , function ( ) { return redux _selectors _sync _ _WEBPACK _IMPORTED _MODULE _27 _ _ [ "selectHashChanged" ] ; } ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectSyncApplyErrorMessage" , function ( ) { return redux _selectors _sync _ _WEBPACK _IMPORTED _MODULE _27 _ _ [ "selectSyncApplyErrorMessage" ] ; } ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectSyncApplyPasswordError" , function ( ) { return redux _selectors _sync _ _WEBPACK _IMPORTED _MODULE _27 _ _ [ "selectSyncApplyPasswordError" ] ; } ) ;
/* harmony import */ var redux _selectors _web _ _WEBPACK _IMPORTED _MODULE _28 _ _ = _ _webpack _require _ _ ( 40 ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectCurrentUploads" , function ( ) { return redux _selectors _web _ _WEBPACK _IMPORTED _MODULE _28 _ _ [ "selectCurrentUploads" ] ; } ) ;
/* harmony reexport (safe) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectUploadCount" , function ( ) { return redux _selectors _web _ _WEBPACK _IMPORTED _MODULE _28 _ _ [ "selectUploadCount" ] ; } ) ;
2020-04-13 15:40:25 +02:00
2019-09-16 22:12:43 +02:00
2019-04-03 23:34:07 +02:00
// constants
2019-12-05 13:13:10 +01:00
// utils
2019-04-03 23:34:07 +02:00
// actions
2020-10-24 02:49:02 +02:00
2019-04-03 23:34:07 +02:00
// reducers
2020-10-24 02:49:02 +02:00
2019-04-03 23:34:07 +02:00
// selectors
2020-10-24 02:49:02 +02:00
2019-04-03 23:34:07 +02:00
/***/ } ) ,
/* 1 */
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_FEATURED_CONTENT_STARTED" , function ( ) { return FETCH _FEATURED _CONTENT _STARTED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_FEATURED_CONTENT_COMPLETED" , function ( ) { return FETCH _FEATURED _CONTENT _COMPLETED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_TRENDING_CONTENT_STARTED" , function ( ) { return FETCH _TRENDING _CONTENT _STARTED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_TRENDING_CONTENT_COMPLETED" , function ( ) { return FETCH _TRENDING _CONTENT _COMPLETED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "RESOLVE_URIS_STARTED" , function ( ) { return RESOLVE _URIS _STARTED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "RESOLVE_URIS_COMPLETED" , function ( ) { return RESOLVE _URIS _COMPLETED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_CHANNEL_CLAIMS_STARTED" , function ( ) { return FETCH _CHANNEL _CLAIMS _STARTED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_CHANNEL_CLAIMS_COMPLETED" , function ( ) { return FETCH _CHANNEL _CLAIMS _COMPLETED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_CHANNEL_CLAIM_COUNT_STARTED" , function ( ) { return FETCH _CHANNEL _CLAIM _COUNT _STARTED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_CHANNEL_CLAIM_COUNT_COMPLETED" , function ( ) { return FETCH _CHANNEL _CLAIM _COUNT _COMPLETED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_CLAIM_LIST_MINE_STARTED" , function ( ) { return FETCH _CLAIM _LIST _MINE _STARTED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_CLAIM_LIST_MINE_COMPLETED" , function ( ) { return FETCH _CLAIM _LIST _MINE _COMPLETED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "ABANDON_CLAIM_STARTED" , function ( ) { return ABANDON _CLAIM _STARTED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "ABANDON_CLAIM_SUCCEEDED" , function ( ) { return ABANDON _CLAIM _SUCCEEDED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_CHANNEL_LIST_STARTED" , function ( ) { return FETCH _CHANNEL _LIST _STARTED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_CHANNEL_LIST_COMPLETED" , function ( ) { return FETCH _CHANNEL _LIST _COMPLETED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "CREATE_CHANNEL_STARTED" , function ( ) { return CREATE _CHANNEL _STARTED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "CREATE_CHANNEL_COMPLETED" , function ( ) { return CREATE _CHANNEL _COMPLETED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "PUBLISH_STARTED" , function ( ) { return PUBLISH _STARTED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "PUBLISH_COMPLETED" , function ( ) { return PUBLISH _COMPLETED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "PUBLISH_FAILED" , function ( ) { return PUBLISH _FAILED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "SET_PLAYING_URI" , function ( ) { return SET _PLAYING _URI ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "SET_CONTENT_POSITION" , function ( ) { return SET _CONTENT _POSITION ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "SET_CONTENT_LAST_VIEWED" , function ( ) { return SET _CONTENT _LAST _VIEWED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "CLEAR_CONTENT_HISTORY_URI" , function ( ) { return CLEAR _CONTENT _HISTORY _URI ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "CLEAR_CONTENT_HISTORY_ALL" , function ( ) { return CLEAR _CONTENT _HISTORY _ALL ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "CHANNEL_SUBSCRIBE" , function ( ) { return CHANNEL _SUBSCRIBE ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "CHANNEL_UNSUBSCRIBE" , function ( ) { return CHANNEL _UNSUBSCRIBE ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "CHANNEL_SUBSCRIPTION_ENABLE_NOTIFICATIONS" , function ( ) { return CHANNEL _SUBSCRIPTION _ENABLE _NOTIFICATIONS ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "CHANNEL_SUBSCRIPTION_DISABLE_NOTIFICATIONS" , function ( ) { return CHANNEL _SUBSCRIPTION _DISABLE _NOTIFICATIONS ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "HAS_FETCHED_SUBSCRIPTIONS" , function ( ) { return HAS _FETCHED _SUBSCRIPTIONS ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "SET_SUBSCRIPTION_LATEST" , function ( ) { return SET _SUBSCRIPTION _LATEST ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "UPDATE_SUBSCRIPTION_UNREADS" , function ( ) { return UPDATE _SUBSCRIPTION _UNREADS ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "REMOVE_SUBSCRIPTION_UNREADS" , function ( ) { return REMOVE _SUBSCRIPTION _UNREADS ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "CHECK_SUBSCRIPTION_STARTED" , function ( ) { return CHECK _SUBSCRIPTION _STARTED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "CHECK_SUBSCRIPTION_COMPLETED" , function ( ) { return CHECK _SUBSCRIPTION _COMPLETED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "CHECK_SUBSCRIPTIONS_SUBSCRIBE" , function ( ) { return CHECK _SUBSCRIPTIONS _SUBSCRIBE ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_SUBSCRIPTIONS_START" , function ( ) { return FETCH _SUBSCRIPTIONS _START ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_SUBSCRIPTIONS_FAIL" , function ( ) { return FETCH _SUBSCRIPTIONS _FAIL ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_SUBSCRIPTIONS_SUCCESS" , function ( ) { return FETCH _SUBSCRIPTIONS _SUCCESS ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "SET_VIEW_MODE" , function ( ) { return SET _VIEW _MODE ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "GET_SUGGESTED_SUBSCRIPTIONS_START" , function ( ) { return GET _SUGGESTED _SUBSCRIPTIONS _START ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "GET_SUGGESTED_SUBSCRIPTIONS_SUCCESS" , function ( ) { return GET _SUGGESTED _SUBSCRIPTIONS _SUCCESS ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "GET_SUGGESTED_SUBSCRIPTIONS_FAIL" , function ( ) { return GET _SUGGESTED _SUBSCRIPTIONS _FAIL ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "SUBSCRIPTION_FIRST_RUN_COMPLETED" , function ( ) { return SUBSCRIPTION _FIRST _RUN _COMPLETED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "VIEW_SUGGESTED_SUBSCRIPTIONS" , function ( ) { return VIEW _SUGGESTED _SUBSCRIPTIONS ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_BLACK_LISTED_CONTENT_STARTED" , function ( ) { return FETCH _BLACK _LISTED _CONTENT _STARTED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_BLACK_LISTED_CONTENT_COMPLETED" , function ( ) { return FETCH _BLACK _LISTED _CONTENT _COMPLETED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_BLACK_LISTED_CONTENT_FAILED" , function ( ) { return FETCH _BLACK _LISTED _CONTENT _FAILED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "BLACK_LISTED_CONTENT_SUBSCRIBE" , function ( ) { return BLACK _LISTED _CONTENT _SUBSCRIBE ; } ) ;
2019-07-09 16:20:01 +02:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_FILTERED_CONTENT_STARTED" , function ( ) { return FETCH _FILTERED _CONTENT _STARTED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_FILTERED_CONTENT_COMPLETED" , function ( ) { return FETCH _FILTERED _CONTENT _COMPLETED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_FILTERED_CONTENT_FAILED" , function ( ) { return FETCH _FILTERED _CONTENT _FAILED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FILTERED_CONTENT_SUBSCRIBE" , function ( ) { return FILTERED _CONTENT _SUBSCRIBE ; } ) ;
2019-04-03 23:34:07 +02:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_COST_INFO_STARTED" , function ( ) { return FETCH _COST _INFO _STARTED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_COST_INFO_COMPLETED" , function ( ) { return FETCH _COST _INFO _COMPLETED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_VIEW_COUNT_STARTED" , function ( ) { return FETCH _VIEW _COUNT _STARTED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_VIEW_COUNT_FAILED" , function ( ) { return FETCH _VIEW _COUNT _FAILED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_VIEW_COUNT_COMPLETED" , function ( ) { return FETCH _VIEW _COUNT _COMPLETED ; } ) ;
2019-09-25 04:30:53 +02:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_SUB_COUNT_STARTED" , function ( ) { return FETCH _SUB _COUNT _STARTED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_SUB_COUNT_FAILED" , function ( ) { return FETCH _SUB _COUNT _FAILED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "FETCH_SUB_COUNT_COMPLETED" , function ( ) { return FETCH _SUB _COUNT _COMPLETED ; } ) ;
2020-10-24 02:49:02 +02:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "GET_SYNC_STARTED" , function ( ) { return GET _SYNC _STARTED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "GET_SYNC_COMPLETED" , function ( ) { return GET _SYNC _COMPLETED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "GET_SYNC_FAILED" , function ( ) { return GET _SYNC _FAILED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "SET_SYNC_STARTED" , function ( ) { return SET _SYNC _STARTED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "SET_SYNC_FAILED" , function ( ) { return SET _SYNC _FAILED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "SET_SYNC_COMPLETED" , function ( ) { return SET _SYNC _COMPLETED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "SET_DEFAULT_ACCOUNT" , function ( ) { return SET _DEFAULT _ACCOUNT ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "SYNC_APPLY_STARTED" , function ( ) { return SYNC _APPLY _STARTED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "SYNC_APPLY_COMPLETED" , function ( ) { return SYNC _APPLY _COMPLETED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "SYNC_APPLY_FAILED" , function ( ) { return SYNC _APPLY _FAILED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "SYNC_APPLY_BAD_PASSWORD" , function ( ) { return SYNC _APPLY _BAD _PASSWORD ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "SYNC_RESET" , function ( ) { return SYNC _RESET ; } ) ;
2019-10-22 21:21:42 +02:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "UPDATE_UPLOAD_PROGRESS" , function ( ) { return UPDATE _UPLOAD _PROGRESS ; } ) ;
2020-06-15 22:29:48 +02:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "GENERATE_AUTH_TOKEN_FAILURE" , function ( ) { return GENERATE _AUTH _TOKEN _FAILURE ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "GENERATE_AUTH_TOKEN_STARTED" , function ( ) { return GENERATE _AUTH _TOKEN _STARTED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "GENERATE_AUTH_TOKEN_SUCCESS" , function ( ) { return GENERATE _AUTH _TOKEN _SUCCESS ; } ) ;
// Claims
2019-04-03 23:34:07 +02:00
var FETCH _FEATURED _CONTENT _STARTED = 'FETCH_FEATURED_CONTENT_STARTED' ;
var FETCH _FEATURED _CONTENT _COMPLETED = 'FETCH_FEATURED_CONTENT_COMPLETED' ;
var FETCH _TRENDING _CONTENT _STARTED = 'FETCH_TRENDING_CONTENT_STARTED' ;
var FETCH _TRENDING _CONTENT _COMPLETED = 'FETCH_TRENDING_CONTENT_COMPLETED' ;
var RESOLVE _URIS _STARTED = 'RESOLVE_URIS_STARTED' ;
var RESOLVE _URIS _COMPLETED = 'RESOLVE_URIS_COMPLETED' ;
var FETCH _CHANNEL _CLAIMS _STARTED = 'FETCH_CHANNEL_CLAIMS_STARTED' ;
var FETCH _CHANNEL _CLAIMS _COMPLETED = 'FETCH_CHANNEL_CLAIMS_COMPLETED' ;
var FETCH _CHANNEL _CLAIM _COUNT _STARTED = 'FETCH_CHANNEL_CLAIM_COUNT_STARTED' ;
var FETCH _CHANNEL _CLAIM _COUNT _COMPLETED = 'FETCH_CHANNEL_CLAIM_COUNT_COMPLETED' ;
var FETCH _CLAIM _LIST _MINE _STARTED = 'FETCH_CLAIM_LIST_MINE_STARTED' ;
var FETCH _CLAIM _LIST _MINE _COMPLETED = 'FETCH_CLAIM_LIST_MINE_COMPLETED' ;
var ABANDON _CLAIM _STARTED = 'ABANDON_CLAIM_STARTED' ;
var ABANDON _CLAIM _SUCCEEDED = 'ABANDON_CLAIM_SUCCEEDED' ;
var FETCH _CHANNEL _LIST _STARTED = 'FETCH_CHANNEL_LIST_STARTED' ;
var FETCH _CHANNEL _LIST _COMPLETED = 'FETCH_CHANNEL_LIST_COMPLETED' ;
var CREATE _CHANNEL _STARTED = 'CREATE_CHANNEL_STARTED' ;
var CREATE _CHANNEL _COMPLETED = 'CREATE_CHANNEL_COMPLETED' ;
var PUBLISH _STARTED = 'PUBLISH_STARTED' ;
var PUBLISH _COMPLETED = 'PUBLISH_COMPLETED' ;
var PUBLISH _FAILED = 'PUBLISH_FAILED' ;
var SET _PLAYING _URI = 'SET_PLAYING_URI' ;
var SET _CONTENT _POSITION = 'SET_CONTENT_POSITION' ;
var SET _CONTENT _LAST _VIEWED = 'SET_CONTENT_LAST_VIEWED' ;
var CLEAR _CONTENT _HISTORY _URI = 'CLEAR_CONTENT_HISTORY_URI' ;
var CLEAR _CONTENT _HISTORY _ALL = 'CLEAR_CONTENT_HISTORY_ALL' ; // Subscriptions
var CHANNEL _SUBSCRIBE = 'CHANNEL_SUBSCRIBE' ;
var CHANNEL _UNSUBSCRIBE = 'CHANNEL_UNSUBSCRIBE' ;
var CHANNEL _SUBSCRIPTION _ENABLE _NOTIFICATIONS = 'CHANNEL_SUBSCRIPTION_ENABLE_NOTIFICATIONS' ;
var CHANNEL _SUBSCRIPTION _DISABLE _NOTIFICATIONS = 'CHANNEL_SUBSCRIPTION_DISABLE_NOTIFICATIONS' ;
var HAS _FETCHED _SUBSCRIPTIONS = 'HAS_FETCHED_SUBSCRIPTIONS' ;
var SET _SUBSCRIPTION _LATEST = 'SET_SUBSCRIPTION_LATEST' ;
var UPDATE _SUBSCRIPTION _UNREADS = 'UPDATE_SUBSCRIPTION_UNREADS' ;
var REMOVE _SUBSCRIPTION _UNREADS = 'REMOVE_SUBSCRIPTION_UNREADS' ;
var CHECK _SUBSCRIPTION _STARTED = 'CHECK_SUBSCRIPTION_STARTED' ;
var CHECK _SUBSCRIPTION _COMPLETED = 'CHECK_SUBSCRIPTION_COMPLETED' ;
var CHECK _SUBSCRIPTIONS _SUBSCRIBE = 'CHECK_SUBSCRIPTIONS_SUBSCRIBE' ;
var FETCH _SUBSCRIPTIONS _START = 'FETCH_SUBSCRIPTIONS_START' ;
var FETCH _SUBSCRIPTIONS _FAIL = 'FETCH_SUBSCRIPTIONS_FAIL' ;
var FETCH _SUBSCRIPTIONS _SUCCESS = 'FETCH_SUBSCRIPTIONS_SUCCESS' ;
var SET _VIEW _MODE = 'SET_VIEW_MODE' ;
var GET _SUGGESTED _SUBSCRIPTIONS _START = 'GET_SUGGESTED_SUBSCRIPTIONS_START' ;
var GET _SUGGESTED _SUBSCRIPTIONS _SUCCESS = 'GET_SUGGESTED_SUBSCRIPTIONS_SUCCESS' ;
var GET _SUGGESTED _SUBSCRIPTIONS _FAIL = 'GET_SUGGESTED_SUBSCRIPTIONS_FAIL' ;
var SUBSCRIPTION _FIRST _RUN _COMPLETED = 'SUBSCRIPTION_FIRST_RUN_COMPLETED' ;
var VIEW _SUGGESTED _SUBSCRIPTIONS = 'VIEW_SUGGESTED_SUBSCRIPTIONS' ; // Blacklist
var FETCH _BLACK _LISTED _CONTENT _STARTED = 'FETCH_BLACK_LISTED_CONTENT_STARTED' ;
var FETCH _BLACK _LISTED _CONTENT _COMPLETED = 'FETCH_BLACK_LISTED_CONTENT_COMPLETED' ;
var FETCH _BLACK _LISTED _CONTENT _FAILED = 'FETCH_BLACK_LISTED_CONTENT_FAILED' ;
2019-07-09 16:20:01 +02:00
var BLACK _LISTED _CONTENT _SUBSCRIBE = 'BLACK_LISTED_CONTENT_SUBSCRIBE' ; // Filtered list
var FETCH _FILTERED _CONTENT _STARTED = 'FETCH_FILTERED_CONTENT_STARTED' ;
var FETCH _FILTERED _CONTENT _COMPLETED = 'FETCH_FILTERED_CONTENT_COMPLETED' ;
var FETCH _FILTERED _CONTENT _FAILED = 'FETCH_FILTERED_CONTENT_FAILED' ;
var FILTERED _CONTENT _SUBSCRIBE = 'FILTERED_CONTENT_SUBSCRIBE' ; // Cost Info
2019-04-03 23:34:07 +02:00
var FETCH _COST _INFO _STARTED = 'FETCH_COST_INFO_STARTED' ;
2019-09-25 04:30:53 +02:00
var FETCH _COST _INFO _COMPLETED = 'FETCH_COST_INFO_COMPLETED' ; // Stats
2019-04-03 23:34:07 +02:00
var FETCH _VIEW _COUNT _STARTED = 'FETCH_VIEW_COUNT_STARTED' ;
var FETCH _VIEW _COUNT _FAILED = 'FETCH_VIEW_COUNT_FAILED' ;
2019-09-25 04:30:53 +02:00
var FETCH _VIEW _COUNT _COMPLETED = 'FETCH_VIEW_COUNT_COMPLETED' ;
var FETCH _SUB _COUNT _STARTED = 'FETCH_SUB_COUNT_STARTED' ;
var FETCH _SUB _COUNT _FAILED = 'FETCH_SUB_COUNT_FAILED' ;
2020-10-24 02:49:02 +02:00
var FETCH _SUB _COUNT _COMPLETED = 'FETCH_SUB_COUNT_COMPLETED' ; // Cross-device Sync
var GET _SYNC _STARTED = 'GET_SYNC_STARTED' ;
var GET _SYNC _COMPLETED = 'GET_SYNC_COMPLETED' ;
var GET _SYNC _FAILED = 'GET_SYNC_FAILED' ;
var SET _SYNC _STARTED = 'SET_SYNC_STARTED' ;
var SET _SYNC _FAILED = 'SET_SYNC_FAILED' ;
var SET _SYNC _COMPLETED = 'SET_SYNC_COMPLETED' ;
var SET _DEFAULT _ACCOUNT = 'SET_DEFAULT_ACCOUNT' ;
var SYNC _APPLY _STARTED = 'SYNC_APPLY_STARTED' ;
var SYNC _APPLY _COMPLETED = 'SYNC_APPLY_COMPLETED' ;
var SYNC _APPLY _FAILED = 'SYNC_APPLY_FAILED' ;
var SYNC _APPLY _BAD _PASSWORD = 'SYNC_APPLY_BAD_PASSWORD' ;
var SYNC _RESET = 'SYNC_RESET' ; // Lbry.tv
2019-10-22 21:21:42 +02:00
2020-06-15 22:29:48 +02:00
var UPDATE _UPLOAD _PROGRESS = 'UPDATE_UPLOAD_PROGRESS' ; // User
var GENERATE _AUTH _TOKEN _FAILURE = 'GENERATE_AUTH_TOKEN_FAILURE' ;
var GENERATE _AUTH _TOKEN _STARTED = 'GENERATE_AUTH_TOKEN_STARTED' ;
var GENERATE _AUTH _TOKEN _SUCCESS = 'GENERATE_AUTH_TOKEN_SUCCESS' ;
2019-04-03 23:34:07 +02:00
/***/ } ) ,
/* 2 */
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2019-10-02 06:15:24 +02:00
"use strict" ;
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
2020-09-01 19:26:10 +02:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "YOUTUBE_SYNC_NOT_TRANSFERRED" , function ( ) { return YOUTUBE _SYNC _NOT _TRANSFERRED ; } ) ;
2021-03-09 22:46:23 +01:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "YOUTUBE_SYNC_PENDING" , function ( ) { return YOUTUBE _SYNC _PENDING ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "YOUTUBE_SYNC_PENDING_EMAIL" , function ( ) { return YOUTUBE _SYNC _PENDING _EMAIL ; } ) ;
2020-09-01 19:26:10 +02:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "YOUTUBE_SYNC_PENDING_TRANSFER" , function ( ) { return YOUTUBE _SYNC _PENDING _TRANSFER ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "YOUTUBE_SYNC_COMPLETED_TRANSFER" , function ( ) { return YOUTUBE _SYNC _COMPLETED _TRANSFER ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "YOUTUBE_SYNC_QUEUED" , function ( ) { return YOUTUBE _SYNC _QUEUED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "YOUTUBE_SYNC_SYNCING" , function ( ) { return YOUTUBE _SYNC _SYNCING ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "YOUTUBE_SYNC_SYNCED" , function ( ) { return YOUTUBE _SYNC _SYNCED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "YOUTUBE_SYNC_FAILED" , function ( ) { return YOUTUBE _SYNC _FAILED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "YOUTUBE_SYNC_PENDINGUPGRADE" , function ( ) { return YOUTUBE _SYNC _PENDINGUPGRADE ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "YOUTUBE_SYNC_ABANDONDED" , function ( ) { return YOUTUBE _SYNC _ABANDONDED ; } ) ;
var YOUTUBE _SYNC _NOT _TRANSFERRED = 'not_transferred' ;
2021-03-09 22:46:23 +01:00
var YOUTUBE _SYNC _PENDING = 'pending' ;
var YOUTUBE _SYNC _PENDING _EMAIL = 'pendingemail' ;
2020-09-01 19:26:10 +02:00
var YOUTUBE _SYNC _PENDING _TRANSFER = 'pending_transfer' ;
var YOUTUBE _SYNC _COMPLETED _TRANSFER = 'completed_transfer' ;
var YOUTUBE _SYNC _QUEUED = 'queued' ;
var YOUTUBE _SYNC _SYNCING = 'syncing' ;
var YOUTUBE _SYNC _SYNCED = 'synced' ;
var YOUTUBE _SYNC _FAILED = 'failed' ;
var YOUTUBE _SYNC _PENDINGUPGRADE = 'pendingupgrade' ;
2020-09-03 20:10:11 +02:00
var YOUTUBE _SYNC _ABANDONDED = 'abandoned' ;
2019-10-02 06:15:24 +02:00
/***/ } ) ,
/* 3 */
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2020-01-10 04:28:46 +01:00
"use strict" ;
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "ALREADY_CLAIMED" , function ( ) { return ALREADY _CLAIMED ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "REFERRER_NOT_FOUND" , function ( ) { return REFERRER _NOT _FOUND ; } ) ;
var ALREADY _CLAIMED = 'once the invite reward has been claimed the referrer cannot be changed' ;
var REFERRER _NOT _FOUND = 'A lbry.tv account could not be found for the referrer you provided.' ;
/***/ } ) ,
/* 4 */
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2019-04-03 23:34:07 +02:00
"use strict" ;
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony import */ var constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 1 ) ;
2020-01-10 04:28:46 +01:00
/* harmony import */ var lbry _redux _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( 5 ) ;
2019-04-03 23:34:07 +02:00
/* harmony import */ var lbry _redux _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( lbry _redux _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
2020-01-10 04:28:46 +01:00
/* harmony import */ var querystring _ _WEBPACK _IMPORTED _MODULE _2 _ _ = _ _webpack _require _ _ ( 6 ) ;
2019-04-03 23:34:07 +02:00
/* harmony import */ var querystring _ _WEBPACK _IMPORTED _MODULE _2 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( querystring _ _WEBPACK _IMPORTED _MODULE _2 _ _ ) ;
2019-09-16 22:12:43 +02:00
function _typeof ( obj ) { if ( typeof Symbol === "function" && typeof Symbol . iterator === "symbol" ) { _typeof = function _typeof ( obj ) { return typeof obj ; } ; } else { _typeof = function _typeof ( obj ) { return obj && typeof Symbol === "function" && obj . constructor === Symbol && obj !== Symbol . prototype ? "symbol" : typeof obj ; } ; } return _typeof ( obj ) ; }
2019-04-03 23:34:07 +02:00
function _objectSpread ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] != null ? arguments [ i ] : { } ; var ownKeys = Object . keys ( source ) ; if ( typeof Object . getOwnPropertySymbols === 'function' ) { ownKeys = ownKeys . concat ( Object . getOwnPropertySymbols ( source ) . filter ( function ( sym ) { return Object . getOwnPropertyDescriptor ( source , sym ) . enumerable ; } ) ) ; } ownKeys . forEach ( function ( key ) { _defineProperty ( target , key , source [ key ] ) ; } ) ; } return target ; }
function _defineProperty ( obj , key , value ) { if ( key in obj ) { Object . defineProperty ( obj , key , { value : value , enumerable : true , configurable : true , writable : true } ) ; } else { obj [ key ] = value ; } return obj ; }
2018-07-23 15:12:18 +02:00
2019-02-17 09:13:34 +01:00
2018-07-23 15:12:18 +02:00
var Lbryio = {
enabled : true ,
2019-02-20 17:14:42 +01:00
authenticationPromise : null ,
2019-03-11 03:02:17 +01:00
exchangePromise : null ,
exchangeLastFetched : null ,
2019-03-21 18:22:27 +01:00
CONNECTION _STRING : 'https://api.lbry.com/'
2018-07-23 15:12:18 +02:00
} ;
2020-10-24 02:50:10 +02:00
var EXCHANGE _RATE _TIMEOUT = 20 * 60 * 1000 ;
var INTERNAL _APIS _DOWN = 'internal_apis_down' ; // We can't use env's because they aren't passed into node_modules
2018-07-23 15:12:18 +02:00
2018-12-04 17:08:20 +01:00
Lbryio . setLocalApi = function ( endpoint ) {
2019-02-20 17:14:42 +01:00
Lbryio . CONNECTION _STRING = endpoint . replace ( /\/*$/ , '/' ) ; // exactly one slash at the end;
2018-12-04 17:08:20 +01:00
} ;
2018-07-23 15:12:18 +02:00
Lbryio . call = function ( resource , action ) {
var params = arguments . length > 2 && arguments [ 2 ] !== undefined ? arguments [ 2 ] : { } ;
var method = arguments . length > 3 && arguments [ 3 ] !== undefined ? arguments [ 3 ] : 'get' ;
if ( ! Lbryio . enabled ) {
return Promise . reject ( new Error ( _ _ ( 'LBRY internal API is disabled' ) ) ) ;
}
if ( ! ( method === 'get' || method === 'post' ) ) {
return Promise . reject ( new Error ( _ _ ( 'Invalid method' ) ) ) ;
}
function checkAndParse ( response ) {
if ( response . status >= 200 && response . status < 300 ) {
return response . json ( ) ;
}
2019-04-03 23:34:07 +02:00
2020-10-24 02:50:10 +02:00
if ( response . status === 500 ) {
return Promise . reject ( INTERNAL _APIS _DOWN ) ;
}
if ( response ) return response . json ( ) . then ( function ( json ) {
2019-04-03 23:34:07 +02:00
var error ;
2018-07-23 15:12:18 +02:00
if ( json . error ) {
error = new Error ( json . error ) ;
} else {
error = new Error ( 'Unknown API error signature' ) ;
}
2019-04-03 23:34:07 +02:00
2018-07-23 15:12:18 +02:00
error . response = response ; // This is primarily a hack used in actions/user.js
2019-04-03 23:34:07 +02:00
2018-07-23 15:12:18 +02:00
return Promise . reject ( error ) ;
} ) ;
}
function makeRequest ( url , options ) {
return fetch ( url , options ) . then ( checkAndParse ) ;
}
return Lbryio . getAuthToken ( ) . then ( function ( token ) {
2019-04-03 23:34:07 +02:00
var fullParams = _objectSpread ( {
auth _token : token
} , params ) ;
2018-07-23 15:12:18 +02:00
2019-09-16 22:12:43 +02:00
Object . keys ( fullParams ) . forEach ( function ( key ) {
var value = fullParams [ key ] ;
if ( _typeof ( value ) === 'object' ) {
fullParams [ key ] = JSON . stringify ( value ) ;
}
} ) ;
2019-04-03 23:34:07 +02:00
var qs = querystring _ _WEBPACK _IMPORTED _MODULE _2 _ _ _default . a . stringify ( fullParams ) ;
var url = "" . concat ( Lbryio . CONNECTION _STRING ) . concat ( resource , "/" ) . concat ( action , "?" ) . concat ( qs ) ;
2018-07-23 15:12:18 +02:00
var options = {
method : 'GET'
} ;
if ( method === 'post' ) {
options = {
method : 'POST' ,
headers : {
'Content-Type' : 'application/x-www-form-urlencoded'
} ,
body : qs
} ;
2019-04-03 23:34:07 +02:00
url = "" . concat ( Lbryio . CONNECTION _STRING ) . concat ( resource , "/" ) . concat ( action ) ;
2018-07-23 15:12:18 +02:00
}
return makeRequest ( url , options ) . then ( function ( response ) {
return response . data ;
} ) ;
} ) ;
} ;
Lbryio . authToken = null ;
Lbryio . getAuthToken = function ( ) {
return new Promise ( function ( resolve ) {
if ( Lbryio . authToken ) {
resolve ( Lbryio . authToken ) ;
2018-09-18 23:56:12 +02:00
} else if ( Lbryio . overrides . getAuthToken ) {
Lbryio . overrides . getAuthToken ( ) . then ( function ( token ) {
resolve ( token ) ;
} ) ;
2020-04-08 18:17:40 +02:00
} else if ( typeof window !== 'undefined' ) {
2018-07-23 16:12:22 +02:00
var _window = window ,
store = _window . store ;
2018-07-23 15:12:18 +02:00
if ( store ) {
var state = store . getState ( ) ;
var token = state . auth ? state . auth . authToken : null ;
Lbryio . authToken = token ;
resolve ( token ) ;
}
2020-04-08 18:17:40 +02:00
resolve ( null ) ;
} else {
2018-07-23 15:12:18 +02:00
resolve ( null ) ;
}
} ) ;
} ;
Lbryio . getCurrentUser = function ( ) {
return Lbryio . call ( 'user' , 'me' ) ;
} ;
2020-11-11 21:03:37 +01:00
Lbryio . authenticate = function ( domain , language ) {
2018-07-23 15:12:18 +02:00
if ( ! Lbryio . enabled ) {
2020-11-11 21:03:37 +01:00
var params = {
id : 1 ,
primary _email : 'disabled@lbry.io' ,
has _verified _email : true ,
is _identity _verified : true ,
is _reward _approved : false ,
language : language || 'en'
} ;
2018-07-23 15:12:18 +02:00
return new Promise ( function ( resolve ) {
2020-11-11 21:03:37 +01:00
resolve ( params ) ;
2018-07-23 15:12:18 +02:00
} ) ;
}
if ( Lbryio . authenticationPromise === null ) {
Lbryio . authenticationPromise = new Promise ( function ( resolve , reject ) {
Lbryio . getAuthToken ( ) . then ( function ( token ) {
if ( ! token || token . length > 60 ) {
2019-02-05 07:11:17 +01:00
return false ;
2019-04-03 23:34:07 +02:00
} // check that token works
2018-07-23 15:12:18 +02:00
2019-02-04 04:48:42 +01:00
return Lbryio . getCurrentUser ( ) . then ( function ( user ) {
return user ;
2020-10-24 02:50:10 +02:00
} ) [ "catch" ] ( function ( error ) {
if ( error === INTERNAL _APIS _DOWN ) {
throw new Error ( 'Internal APIS down' ) ;
}
2018-07-23 15:12:18 +02:00
return false ;
} ) ;
2019-02-04 04:48:42 +01:00
} ) . then ( function ( user ) {
if ( user ) {
return user ;
2018-07-23 15:12:18 +02:00
}
2019-04-03 23:34:07 +02:00
return lbry _redux _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "Lbry" ] . status ( ) . then ( function ( status ) {
2019-02-20 15:03:14 +01:00
return new Promise ( function ( res , rej ) {
2020-11-09 20:53:09 +01:00
var appId = domain && domain !== 'lbry.tv' ? ( domain . replace ( /[.]/gi , '' ) + status . installation _id ) . slice ( 0 , 66 ) : status . installation _id ;
2019-02-17 09:13:34 +01:00
Lbryio . call ( 'user' , 'new' , {
auth _token : '' ,
2020-11-11 21:03:37 +01:00
language : language || 'en' ,
2020-11-09 20:53:09 +01:00
app _id : appId
2019-02-17 09:13:34 +01:00
} , 'post' ) . then ( function ( response ) {
if ( ! response . auth _token ) {
throw new Error ( 'auth_token was not set in the response' ) ;
}
var _window2 = window ,
store = _window2 . store ;
2020-09-02 15:57:46 +02:00
if ( Lbryio . overrides . setAuthToken ) {
Lbryio . overrides . setAuthToken ( response . auth _token ) ;
}
2019-02-17 09:13:34 +01:00
if ( store ) {
store . dispatch ( {
2019-04-03 23:34:07 +02:00
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "GENERATE_AUTH_TOKEN_SUCCESS" ] ,
data : {
authToken : response . auth _token
}
2019-02-17 09:13:34 +01:00
} ) ;
}
Lbryio . authToken = response . auth _token ;
2020-09-02 15:57:46 +02:00
return res ( response ) ;
2019-04-18 10:02:11 +02:00
} ) [ "catch" ] ( function ( error ) {
return rej ( error ) ;
2019-02-17 09:13:34 +01:00
} ) ;
} ) ;
2020-09-02 15:57:46 +02:00
} ) . then ( function ( newUser ) {
if ( ! newUser ) {
return Lbryio . getCurrentUser ( ) ;
}
2019-04-03 23:34:07 +02:00
2020-09-02 15:57:46 +02:00
return newUser ;
} ) ;
2019-02-04 04:48:42 +01:00
} ) . then ( resolve , reject ) ;
2018-07-23 15:12:18 +02:00
} ) ;
}
return Lbryio . authenticationPromise ;
} ;
Lbryio . getStripeToken = function ( ) {
2019-02-20 17:14:42 +01:00
return Lbryio . CONNECTION _STRING . startsWith ( 'http://localhost:' ) ? 'pk_test_NoL1JWL7i1ipfhVId5KfDZgo' : 'pk_live_e8M4dRNnCCbmpZzduEUZBgJO' ;
2018-07-23 15:12:18 +02:00
} ;
2019-03-11 03:02:17 +01:00
Lbryio . getExchangeRates = function ( ) {
if ( ! Lbryio . exchangeLastFetched || Date . now ( ) - Lbryio . exchangeLastFetched > EXCHANGE _RATE _TIMEOUT ) {
Lbryio . exchangePromise = new Promise ( function ( resolve , reject ) {
Lbryio . call ( 'lbc' , 'exchange_rate' , { } , 'get' , true ) . then ( function ( _ref ) {
var LBC _USD = _ref . lbc _usd ,
LBC _BTC = _ref . lbc _btc ,
BTC _USD = _ref . btc _usd ;
2019-04-03 23:34:07 +02:00
var rates = {
LBC _USD : LBC _USD ,
LBC _BTC : LBC _BTC ,
BTC _USD : BTC _USD
} ;
2019-03-11 03:02:17 +01:00
resolve ( rates ) ;
2019-04-03 23:34:07 +02:00
} ) [ "catch" ] ( reject ) ;
2019-03-11 03:02:17 +01:00
} ) ;
Lbryio . exchangeLastFetched = Date . now ( ) ;
}
2019-04-03 23:34:07 +02:00
return Lbryio . exchangePromise ;
} ; // Allow overriding lbryio methods
2018-09-18 23:56:12 +02:00
// The desktop app will need to use it for getAuthToken because we use electron's ipcRenderer
2019-04-03 23:34:07 +02:00
2018-09-18 23:56:12 +02:00
Lbryio . overrides = { } ;
2019-04-03 23:34:07 +02:00
2018-09-18 23:56:12 +02:00
Lbryio . setOverride = function ( methodName , newMethod ) {
Lbryio . overrides [ methodName ] = newMethod ;
} ;
2019-04-03 23:34:07 +02:00
/* harmony default export */ _ _webpack _exports _ _ [ "default" ] = ( Lbryio ) ;
2018-07-23 15:12:18 +02:00
/***/ } ) ,
2020-01-10 04:28:46 +01:00
/* 5 */
2019-03-13 06:06:43 +01:00
/***/ ( function ( module , exports ) {
2018-07-23 15:12:18 +02:00
2020-01-10 04:28:46 +01:00
module . exports = _ _WEBPACK _EXTERNAL _MODULE _ _5 _ _ ;
2018-07-23 15:12:18 +02:00
/***/ } ) ,
2020-01-10 04:28:46 +01:00
/* 6 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
2020-01-10 04:28:46 +01:00
exports . decode = exports . parse = _ _webpack _require _ _ ( 7 ) ;
exports . encode = exports . stringify = _ _webpack _require _ _ ( 8 ) ;
2018-07-23 15:12:18 +02:00
/***/ } ) ,
2020-01-10 04:28:46 +01:00
/* 7 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// If obj.hasOwnProperty has been overridden, then calling
// obj.hasOwnProperty(prop) will break.
// See: https://github.com/joyent/node/issues/1707
function hasOwnProperty ( obj , prop ) {
return Object . prototype . hasOwnProperty . call ( obj , prop ) ;
}
module . exports = function ( qs , sep , eq , options ) {
sep = sep || '&' ;
eq = eq || '=' ;
var obj = { } ;
if ( typeof qs !== 'string' || qs . length === 0 ) {
return obj ;
}
var regexp = /\+/g ;
qs = qs . split ( sep ) ;
var maxKeys = 1000 ;
if ( options && typeof options . maxKeys === 'number' ) {
maxKeys = options . maxKeys ;
}
var len = qs . length ;
// maxKeys <= 0 means that we should not limit keys count
if ( maxKeys > 0 && len > maxKeys ) {
len = maxKeys ;
}
for ( var i = 0 ; i < len ; ++ i ) {
var x = qs [ i ] . replace ( regexp , '%20' ) ,
idx = x . indexOf ( eq ) ,
kstr , vstr , k , v ;
if ( idx >= 0 ) {
kstr = x . substr ( 0 , idx ) ;
vstr = x . substr ( idx + 1 ) ;
} else {
kstr = x ;
vstr = '' ;
}
k = decodeURIComponent ( kstr ) ;
v = decodeURIComponent ( vstr ) ;
if ( ! hasOwnProperty ( obj , k ) ) {
obj [ k ] = v ;
} else if ( isArray ( obj [ k ] ) ) {
obj [ k ] . push ( v ) ;
} else {
obj [ k ] = [ obj [ k ] , v ] ;
}
}
return obj ;
} ;
var isArray = Array . isArray || function ( xs ) {
return Object . prototype . toString . call ( xs ) === '[object Array]' ;
} ;
/***/ } ) ,
2020-01-10 04:28:46 +01:00
/* 8 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
var stringifyPrimitive = function ( v ) {
switch ( typeof v ) {
case 'string' :
return v ;
case 'boolean' :
return v ? 'true' : 'false' ;
case 'number' :
return isFinite ( v ) ? v : '' ;
default :
return '' ;
}
} ;
module . exports = function ( obj , sep , eq , name ) {
sep = sep || '&' ;
eq = eq || '=' ;
if ( obj === null ) {
obj = undefined ;
}
if ( typeof obj === 'object' ) {
return map ( objectKeys ( obj ) , function ( k ) {
var ks = encodeURIComponent ( stringifyPrimitive ( k ) ) + eq ;
if ( isArray ( obj [ k ] ) ) {
return map ( obj [ k ] , function ( v ) {
return ks + encodeURIComponent ( stringifyPrimitive ( v ) ) ;
} ) . join ( sep ) ;
} else {
return ks + encodeURIComponent ( stringifyPrimitive ( obj [ k ] ) ) ;
}
} ) . join ( sep ) ;
}
if ( ! name ) return '' ;
return encodeURIComponent ( stringifyPrimitive ( name ) ) + eq +
encodeURIComponent ( stringifyPrimitive ( obj ) ) ;
} ;
var isArray = Array . isArray || function ( xs ) {
return Object . prototype . toString . call ( xs ) === '[object Array]' ;
} ;
function map ( xs , f ) {
if ( xs . map ) return xs . map ( f ) ;
var res = [ ] ;
for ( var i = 0 ; i < xs . length ; i ++ ) {
res . push ( f ( xs [ i ] , i ) ) ;
}
return res ;
}
var objectKeys = Object . keys || function ( obj ) {
var res = [ ] ;
for ( var key in obj ) {
if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) res . push ( key ) ;
}
return res ;
} ;
/***/ } ) ,
2020-01-10 04:28:46 +01:00
/* 9 */
2019-04-03 23:34:07 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2018-07-23 15:12:18 +02:00
"use strict" ;
2019-04-03 23:34:07 +02:00
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
2020-06-15 22:29:48 +02:00
/* WEBPACK VAR INJECTION */ ( function ( Buffer ) { /* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doTransifexUpload" , function ( ) { return doTransifexUpload ; } ) ;
var apiBaseUrl = 'https://www.transifex.com/api/2/project' ;
var resource = 'app-strings' ;
function doTransifexUpload ( contents , project , token , success , fail ) {
var url = "" . concat ( apiBaseUrl , "/" ) . concat ( project , "/resources/" ) ;
var updateUrl = "" . concat ( apiBaseUrl , "/" ) . concat ( project , "/resource/" ) . concat ( resource , "/content/" ) ;
var headers = {
Authorization : "Basic " . concat ( Buffer . from ( "api:" . concat ( token ) ) . toString ( 'base64' ) ) ,
'Content-Type' : 'application/json'
} ;
var req = {
accept _translations : true ,
i18n _type : 'KEYVALUEJSON' ,
name : resource ,
slug : resource ,
content : contents
} ;
2018-07-23 15:12:18 +02:00
2020-06-15 22:29:48 +02:00
function handleResponse ( text ) {
var json ;
2018-07-23 15:12:18 +02:00
2020-06-15 22:29:48 +02:00
try {
// transifex api returns Python dicts for some reason.
// Any way to get the api to return valid JSON?
json = JSON . parse ( text ) ;
} catch ( e ) { // ignore
}
2018-07-23 15:12:18 +02:00
2020-06-15 22:29:48 +02:00
if ( success ) {
success ( json || text ) ;
2019-04-03 23:34:07 +02:00
}
2020-06-15 22:29:48 +02:00
}
2018-07-23 15:12:18 +02:00
2020-06-15 22:29:48 +02:00
function handleError ( err ) {
if ( fail ) {
fail ( err . message ? err . message : 'Could not upload strings resource to Transifex' ) ;
}
} // check if the resource exists
2018-07-23 15:12:18 +02:00
2020-06-15 22:29:48 +02:00
fetch ( updateUrl , {
headers : headers
} ) . then ( function ( response ) {
return response . json ( ) ;
} ) . then ( function ( ) {
// perform an update
fetch ( updateUrl , {
method : 'PUT' ,
headers : headers ,
body : JSON . stringify ( {
content : contents
} )
} ) . then ( function ( response ) {
if ( response . status !== 200 && response . status !== 201 ) {
throw new Error ( 'failed to update transifex' ) ;
2019-04-03 23:34:07 +02:00
}
2019-02-01 18:19:45 +01:00
2020-06-15 22:29:48 +02:00
return response . text ( ) ;
} ) . then ( handleResponse ) [ "catch" ] ( handleError ) ;
} ) [ "catch" ] ( function ( ) {
// resource doesn't exist, create a fresh resource
fetch ( url , {
method : 'POST' ,
headers : headers ,
body : JSON . stringify ( req )
} ) . then ( function ( response ) {
if ( response . status !== 200 && response . status !== 201 ) {
throw new Error ( 'failed to upload to transifex' ) ;
}
2018-07-23 15:12:18 +02:00
2020-06-15 22:29:48 +02:00
return response . text ( ) ;
} ) . then ( handleResponse ) [ "catch" ] ( handleError ) ;
} ) ;
}
/* WEBPACK VAR INJECTION */ } . call ( this , _ _webpack _require _ _ ( 10 ) . Buffer ) )
2018-07-23 15:12:18 +02:00
2020-06-15 22:29:48 +02:00
/***/ } ) ,
/* 10 */
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
2018-07-23 15:12:18 +02:00
2020-06-15 22:29:48 +02:00
"use strict" ;
/* WEBPACK VAR INJECTION */ ( function ( global ) { / * !
* The buffer module from node . js , for the browser .
*
* @ author Feross Aboukhadijeh < feross @ feross . org > < http : //feross.org>
* @ license MIT
* /
/* eslint-disable no-proto */
2018-10-02 02:38:16 +02:00
2018-07-23 15:12:18 +02:00
2020-06-15 22:29:48 +02:00
var base64 = _ _webpack _require _ _ ( 12 )
var ieee754 = _ _webpack _require _ _ ( 13 )
var isArray = _ _webpack _require _ _ ( 14 )
2018-07-23 15:12:18 +02:00
2020-06-15 22:29:48 +02:00
exports . Buffer = Buffer
exports . SlowBuffer = SlowBuffer
exports . INSPECT _MAX _BYTES = 50
2019-04-03 23:34:07 +02:00
2020-06-15 22:29:48 +02:00
/ * *
* If ` Buffer.TYPED_ARRAY_SUPPORT ` :
* === true Use Uint8Array implementation ( fastest )
* === false Use Object implementation ( most compatible , even IE6 )
*
* Browsers that support typed arrays are IE 10 + , Firefox 4 + , Chrome 7 + , Safari 5.1 + ,
* Opera 11.6 + , iOS 4.2 + .
*
* Due to various browser bugs , sometimes the Object implementation will be used even
* when the browser supports typed arrays .
*
* Note :
*
* - Firefox 4 - 29 lacks support for adding new properties to ` Uint8Array ` instances ,
* See : https : //bugzilla.mozilla.org/show_bug.cgi?id=695438.
*
* - Chrome 9 - 10 is missing the ` TypedArray.prototype.subarray ` function .
*
* - IE10 has a broken ` TypedArray.prototype.subarray ` function which returns arrays of
* incorrect length in some situations .
2019-04-03 23:34:07 +02:00
2020-06-15 22:29:48 +02:00
* We detect these buggy browsers and set ` Buffer.TYPED_ARRAY_SUPPORT ` to ` false ` so they
* get the Object implementation , which is slower but behaves correctly .
* /
Buffer . TYPED _ARRAY _SUPPORT = global . TYPED _ARRAY _SUPPORT !== undefined
? global . TYPED _ARRAY _SUPPORT
: typedArraySupport ( )
2019-04-03 23:34:07 +02:00
2020-06-15 22:29:48 +02:00
/ *
* Export kMaxLength after typed array support is determined .
* /
exports . kMaxLength = kMaxLength ( )
2019-04-03 23:34:07 +02:00
2020-06-15 22:29:48 +02:00
function typedArraySupport ( ) {
try {
var arr = new Uint8Array ( 1 )
arr . _ _proto _ _ = { _ _proto _ _ : Uint8Array . prototype , foo : function ( ) { return 42 } }
return arr . foo ( ) === 42 && // typed array instances can be augmented
typeof arr . subarray === 'function' && // chrome 9-10 lack `subarray`
arr . subarray ( 1 , 1 ) . byteLength === 0 // ie10 has broken `subarray`
} catch ( e ) {
return false
}
}
2019-09-23 10:35:27 +02:00
2020-06-15 22:29:48 +02:00
function kMaxLength ( ) {
return Buffer . TYPED _ARRAY _SUPPORT
? 0x7fffffff
: 0x3fffffff
}
2020-01-10 04:28:46 +01:00
2020-06-15 22:29:48 +02:00
function createBuffer ( that , length ) {
if ( kMaxLength ( ) < length ) {
throw new RangeError ( 'Invalid typed array length' )
}
if ( Buffer . TYPED _ARRAY _SUPPORT ) {
// Return an augmented `Uint8Array` instance, for best performance
that = new Uint8Array ( length )
that . _ _proto _ _ = Buffer . prototype
} else {
// Fallback: Return an object instance of the Buffer class
if ( that === null ) {
that = new Buffer ( length )
}
that . length = length
2020-01-10 04:28:46 +01:00
}
2020-06-15 22:29:48 +02:00
return that
}
2019-04-03 23:34:07 +02:00
2020-06-15 22:29:48 +02:00
/ * *
* The Buffer constructor returns instances of ` Uint8Array ` that have their
* prototype changed to ` Buffer.prototype ` . Furthermore , ` Buffer ` is a subclass of
* ` Uint8Array ` , so the returned instances will have all the node ` Buffer ` methods
* and the ` Uint8Array ` methods . Square bracket notation works as expected -- it
* returns a single octet .
*
* The ` Uint8Array ` prototype remains unmodified .
* /
2019-04-03 23:34:07 +02:00
2020-06-15 22:29:48 +02:00
function Buffer ( arg , encodingOrOffset , length ) {
if ( ! Buffer . TYPED _ARRAY _SUPPORT && ! ( this instanceof Buffer ) ) {
return new Buffer ( arg , encodingOrOffset , length )
2019-04-03 23:34:07 +02:00
}
2020-06-15 22:29:48 +02:00
// Common case.
if ( typeof arg === 'number' ) {
if ( typeof encodingOrOffset === 'string' ) {
throw new Error (
'If encoding is specified then the first argument must be a string'
)
}
return allocUnsafe ( this , arg )
}
return from ( this , arg , encodingOrOffset , length )
}
2019-04-03 23:34:07 +02:00
2020-06-15 22:29:48 +02:00
Buffer . poolSize = 8192 // not used by this implementation
2019-04-03 23:34:07 +02:00
2020-06-15 22:29:48 +02:00
// TODO: Legacy, not needed anymore. Remove in next major version.
Buffer . _augment = function ( arr ) {
arr . _ _proto _ _ = Buffer . prototype
return arr
}
2019-04-03 23:34:07 +02:00
2020-06-15 22:29:48 +02:00
function from ( that , value , encodingOrOffset , length ) {
if ( typeof value === 'number' ) {
throw new TypeError ( '"value" argument must not be a number' )
2019-04-03 23:34:07 +02:00
}
2020-06-15 22:29:48 +02:00
if ( typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer ) {
return fromArrayBuffer ( that , value , encodingOrOffset , length )
}
2019-04-03 23:34:07 +02:00
2020-06-15 22:29:48 +02:00
if ( typeof value === 'string' ) {
return fromString ( that , value , encodingOrOffset )
2019-04-03 23:34:07 +02:00
}
2020-06-15 22:29:48 +02:00
return fromObject ( that , value )
}
/ * *
* Functionally equivalent to Buffer ( arg , encoding ) but throws a TypeError
* if value is a number .
* Buffer . from ( str [ , encoding ] )
* Buffer . from ( array )
* Buffer . from ( buffer )
* Buffer . from ( arrayBuffer [ , byteOffset [ , length ] ] )
* * /
Buffer . from = function ( value , encodingOrOffset , length ) {
return from ( null , value , encodingOrOffset , length )
}
2019-04-03 23:34:07 +02:00
2020-06-15 22:29:48 +02:00
if ( Buffer . TYPED _ARRAY _SUPPORT ) {
Buffer . prototype . _ _proto _ _ = Uint8Array . prototype
Buffer . _ _proto _ _ = Uint8Array
if ( typeof Symbol !== 'undefined' && Symbol . species &&
Buffer [ Symbol . species ] === Buffer ) {
// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
Object . defineProperty ( Buffer , Symbol . species , {
value : null ,
configurable : true
} )
2019-04-03 23:34:07 +02:00
}
2020-06-15 22:29:48 +02:00
}
2019-04-03 23:34:07 +02:00
2020-06-15 22:29:48 +02:00
function assertSize ( size ) {
if ( typeof size !== 'number' ) {
throw new TypeError ( '"size" argument must be a number' )
} else if ( size < 0 ) {
throw new RangeError ( '"size" argument must not be negative' )
}
}
2019-09-23 10:35:27 +02:00
2020-06-15 22:29:48 +02:00
function alloc ( that , size , fill , encoding ) {
assertSize ( size )
if ( size <= 0 ) {
return createBuffer ( that , size )
}
if ( fill !== undefined ) {
// Only pay attention to encoding if it's a string. This
// prevents accidentally sending in a number that would
// be interpretted as a start offset.
return typeof encoding === 'string'
? createBuffer ( that , size ) . fill ( fill , encoding )
: createBuffer ( that , size ) . fill ( fill )
}
return createBuffer ( that , size )
}
2019-09-23 10:35:27 +02:00
2020-06-15 22:29:48 +02:00
/ * *
* Creates a new filled Buffer instance .
* alloc ( size [ , fill [ , encoding ] ] )
* * /
Buffer . alloc = function ( size , fill , encoding ) {
return alloc ( null , size , fill , encoding )
}
2019-09-23 10:35:27 +02:00
2020-06-15 22:29:48 +02:00
function allocUnsafe ( that , size ) {
assertSize ( size )
that = createBuffer ( that , size < 0 ? 0 : checked ( size ) | 0 )
if ( ! Buffer . TYPED _ARRAY _SUPPORT ) {
for ( var i = 0 ; i < size ; ++ i ) {
that [ i ] = 0
2019-09-23 10:35:27 +02:00
}
}
2020-06-15 22:29:48 +02:00
return that
}
2019-09-23 10:35:27 +02:00
2020-06-15 22:29:48 +02:00
/ * *
* Equivalent to Buffer ( num ) , by default creates a non - zero - filled Buffer instance .
* * /
Buffer . allocUnsafe = function ( size ) {
return allocUnsafe ( null , size )
}
/ * *
* Equivalent to SlowBuffer ( num ) , by default creates a non - zero - filled Buffer instance .
* /
Buffer . allocUnsafeSlow = function ( size ) {
return allocUnsafe ( null , size )
}
2019-04-03 23:34:07 +02:00
2020-06-15 22:29:48 +02:00
function fromString ( that , string , encoding ) {
if ( typeof encoding !== 'string' || encoding === '' ) {
encoding = 'utf8'
}
2019-04-03 23:34:07 +02:00
2020-06-15 22:29:48 +02:00
if ( ! Buffer . isEncoding ( encoding ) ) {
throw new TypeError ( '"encoding" must be a valid string encoding' )
}
2019-04-03 23:34:07 +02:00
2020-06-15 22:29:48 +02:00
var length = byteLength ( string , encoding ) | 0
that = createBuffer ( that , length )
2019-04-03 23:34:07 +02:00
2020-06-15 22:29:48 +02:00
var actual = that . write ( string , encoding )
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
if ( actual !== length ) {
// Writing a hex string, for example, that contains invalid characters will
// cause everything after the first invalid character to be ignored. (e.g.
// 'abxxcd' will be treated as 'ab')
that = that . slice ( 0 , actual )
}
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
return that
2019-04-03 23:34:07 +02:00
}
2020-06-15 22:29:48 +02:00
function fromArrayLike ( that , array ) {
var length = array . length < 0 ? 0 : checked ( array . length ) | 0
that = createBuffer ( that , length )
for ( var i = 0 ; i < length ; i += 1 ) {
that [ i ] = array [ i ] & 255
}
return that
}
2019-04-03 23:34:07 +02:00
2020-06-15 22:29:48 +02:00
function fromArrayBuffer ( that , array , byteOffset , length ) {
array . byteLength // this throws if `array` is not a valid ArrayBuffer
2019-04-03 23:34:07 +02:00
2020-06-15 22:29:48 +02:00
if ( byteOffset < 0 || array . byteLength < byteOffset ) {
throw new RangeError ( '\'offset\' is out of bounds' )
}
2019-04-03 23:34:07 +02:00
2020-06-15 22:29:48 +02:00
if ( array . byteLength < byteOffset + ( length || 0 ) ) {
throw new RangeError ( '\'length\' is out of bounds' )
}
2019-04-03 23:34:07 +02:00
2020-06-15 22:29:48 +02:00
if ( byteOffset === undefined && length === undefined ) {
array = new Uint8Array ( array )
} else if ( length === undefined ) {
array = new Uint8Array ( array , byteOffset )
} else {
array = new Uint8Array ( array , byteOffset , length )
}
2019-04-03 23:34:07 +02:00
2020-06-15 22:29:48 +02:00
if ( Buffer . TYPED _ARRAY _SUPPORT ) {
// Return an augmented `Uint8Array` instance, for best performance
that = array
that . _ _proto _ _ = Buffer . prototype
} else {
// Fallback: Return an object instance of the Buffer class
that = fromArrayLike ( that , array )
}
return that
}
2019-04-03 23:34:07 +02:00
2020-06-15 22:29:48 +02:00
function fromObject ( that , obj ) {
if ( Buffer . isBuffer ( obj ) ) {
var len = checked ( obj . length ) | 0
that = createBuffer ( that , len )
2019-04-03 23:34:07 +02:00
2020-06-15 22:29:48 +02:00
if ( that . length === 0 ) {
return that
2019-09-16 22:12:43 +02:00
}
2018-07-23 15:12:18 +02:00
2020-06-15 22:29:48 +02:00
obj . copy ( that , 0 , 0 , len )
return that
}
2018-07-23 15:12:18 +02:00
2020-06-15 22:29:48 +02:00
if ( obj ) {
if ( ( typeof ArrayBuffer !== 'undefined' &&
obj . buffer instanceof ArrayBuffer ) || 'length' in obj ) {
if ( typeof obj . length !== 'number' || isnan ( obj . length ) ) {
return createBuffer ( that , 0 )
}
return fromArrayLike ( that , obj )
2018-07-23 15:12:18 +02:00
}
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
if ( obj . type === 'Buffer' && isArray ( obj . data ) ) {
return fromArrayLike ( that , obj . data )
}
2019-09-16 22:12:43 +02:00
}
2020-06-15 22:29:48 +02:00
throw new TypeError ( 'First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.' )
}
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
function checked ( length ) {
// Note: cannot use `length < kMaxLength()` here because that fails when
// length is NaN (which is otherwise coerced to zero.)
if ( length >= kMaxLength ( ) ) {
throw new RangeError ( 'Attempt to allocate Buffer larger than maximum ' +
'size: 0x' + kMaxLength ( ) . toString ( 16 ) + ' bytes' )
2019-09-16 22:12:43 +02:00
}
2020-06-15 22:29:48 +02:00
return length | 0
}
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
function SlowBuffer ( length ) {
if ( + length != length ) { // eslint-disable-line eqeqeq
length = 0
2019-09-16 22:12:43 +02:00
}
2020-06-15 22:29:48 +02:00
return Buffer . alloc ( + length )
}
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
Buffer . isBuffer = function isBuffer ( b ) {
return ! ! ( b != null && b . _isBuffer )
}
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
Buffer . compare = function compare ( a , b ) {
if ( ! Buffer . isBuffer ( a ) || ! Buffer . isBuffer ( b ) ) {
throw new TypeError ( 'Arguments must be Buffers' )
2019-09-16 22:12:43 +02:00
}
2020-06-15 22:29:48 +02:00
if ( a === b ) return 0
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
var x = a . length
var y = b . length
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
for ( var i = 0 , len = Math . min ( x , y ) ; i < len ; ++ i ) {
if ( a [ i ] !== b [ i ] ) {
x = a [ i ]
y = b [ i ]
break
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
if ( x < y ) return - 1
if ( y < x ) return 1
return 0
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . isEncoding = function isEncoding ( encoding ) {
switch ( String ( encoding ) . toLowerCase ( ) ) {
case 'hex' :
case 'utf8' :
case 'utf-8' :
case 'ascii' :
case 'latin1' :
case 'binary' :
case 'base64' :
case 'ucs2' :
case 'ucs-2' :
case 'utf16le' :
case 'utf-16le' :
return true
default :
return false
}
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . concat = function concat ( list , length ) {
if ( ! isArray ( list ) ) {
throw new TypeError ( '"list" argument must be an Array of Buffers' )
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
if ( list . length === 0 ) {
return Buffer . alloc ( 0 )
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
var i
if ( length === undefined ) {
length = 0
for ( i = 0 ; i < list . length ; ++ i ) {
length += list [ i ] . length
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
var buffer = Buffer . allocUnsafe ( length )
var pos = 0
for ( i = 0 ; i < list . length ; ++ i ) {
var buf = list [ i ]
if ( ! Buffer . isBuffer ( buf ) ) {
throw new TypeError ( '"list" argument must be an Array of Buffers' )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
buf . copy ( buffer , pos )
pos += buf . length
}
return buffer
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
function byteLength ( string , encoding ) {
if ( Buffer . isBuffer ( string ) ) {
return string . length
}
if ( typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer . isView === 'function' &&
( ArrayBuffer . isView ( string ) || string instanceof ArrayBuffer ) ) {
return string . byteLength
}
if ( typeof string !== 'string' ) {
string = '' + string
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
var len = string . length
if ( len === 0 ) return 0
// Use a for loop to avoid recursion
var loweredCase = false
for ( ; ; ) {
switch ( encoding ) {
case 'ascii' :
case 'latin1' :
case 'binary' :
return len
case 'utf8' :
case 'utf-8' :
case undefined :
return utf8ToBytes ( string ) . length
case 'ucs2' :
case 'ucs-2' :
case 'utf16le' :
case 'utf-16le' :
return len * 2
case 'hex' :
return len >>> 1
case 'base64' :
return base64ToBytes ( string ) . length
default :
if ( loweredCase ) return utf8ToBytes ( string ) . length // assume utf8
encoding = ( '' + encoding ) . toLowerCase ( )
loweredCase = true
2019-12-05 13:13:10 +01:00
}
}
}
2020-06-15 22:29:48 +02:00
Buffer . byteLength = byteLength
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
function slowToString ( encoding , start , end ) {
var loweredCase = false
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
// No need to verify that "this.length <= MAX_UINT32" since it's a read-only
// property of a typed array.
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
// This behaves neither like String nor Uint8Array in that we set start/end
// to their upper/lower bounds if the value passed is out of range.
// undefined is handled specially as per ECMA-262 6th Edition,
// Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
if ( start === undefined || start < 0 ) {
start = 0
}
// Return early if start > this.length. Done here to prevent potential uint32
// coercion fail below.
if ( start > this . length ) {
return ''
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
if ( end === undefined || end > this . length ) {
end = this . length
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
if ( end <= 0 ) {
return ''
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
// Force coersion to uint32. This will also coerce falsey/NaN values to 0.
end >>>= 0
start >>>= 0
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
if ( end <= start ) {
return ''
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
if ( ! encoding ) encoding = 'utf8'
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
while ( true ) {
switch ( encoding ) {
case 'hex' :
return hexSlice ( this , start , end )
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
case 'utf8' :
case 'utf-8' :
return utf8Slice ( this , start , end )
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
case 'ascii' :
return asciiSlice ( this , start , end )
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
case 'latin1' :
case 'binary' :
return latin1Slice ( this , start , end )
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
case 'base64' :
return base64Slice ( this , start , end )
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
case 'ucs2' :
case 'ucs-2' :
case 'utf16le' :
case 'utf-16le' :
return utf16leSlice ( this , start , end )
default :
if ( loweredCase ) throw new TypeError ( 'Unknown encoding: ' + encoding )
encoding = ( encoding + '' ) . toLowerCase ( )
loweredCase = true
}
}
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
// Buffer instances.
Buffer . prototype . _isBuffer = true
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
function swap ( b , n , m ) {
var i = b [ n ]
b [ n ] = b [ m ]
b [ m ] = i
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . swap16 = function swap16 ( ) {
var len = this . length
if ( len % 2 !== 0 ) {
throw new RangeError ( 'Buffer size must be a multiple of 16-bits' )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
for ( var i = 0 ; i < len ; i += 2 ) {
swap ( this , i , i + 1 )
}
return this
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . swap32 = function swap32 ( ) {
var len = this . length
if ( len % 4 !== 0 ) {
throw new RangeError ( 'Buffer size must be a multiple of 32-bits' )
}
for ( var i = 0 ; i < len ; i += 4 ) {
swap ( this , i , i + 3 )
swap ( this , i + 1 , i + 2 )
}
return this
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
Buffer . prototype . swap64 = function swap64 ( ) {
var len = this . length
if ( len % 8 !== 0 ) {
throw new RangeError ( 'Buffer size must be a multiple of 64-bits' )
}
for ( var i = 0 ; i < len ; i += 8 ) {
swap ( this , i , i + 7 )
swap ( this , i + 1 , i + 6 )
swap ( this , i + 2 , i + 5 )
swap ( this , i + 3 , i + 4 )
}
return this
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . toString = function toString ( ) {
var length = this . length | 0
if ( length === 0 ) return ''
if ( arguments . length === 0 ) return utf8Slice ( this , 0 , length )
return slowToString . apply ( this , arguments )
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . equals = function equals ( b ) {
if ( ! Buffer . isBuffer ( b ) ) throw new TypeError ( 'Argument must be a Buffer' )
if ( this === b ) return true
return Buffer . compare ( this , b ) === 0
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . inspect = function inspect ( ) {
var str = ''
var max = exports . INSPECT _MAX _BYTES
if ( this . length > 0 ) {
str = this . toString ( 'hex' , 0 , max ) . match ( /.{2}/g ) . join ( ' ' )
if ( this . length > max ) str += ' ... '
}
return '<Buffer ' + str + '>'
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
Buffer . prototype . compare = function compare ( target , start , end , thisStart , thisEnd ) {
if ( ! Buffer . isBuffer ( target ) ) {
throw new TypeError ( 'Argument must be a Buffer' )
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
if ( start === undefined ) {
start = 0
}
if ( end === undefined ) {
end = target ? target . length : 0
}
if ( thisStart === undefined ) {
thisStart = 0
}
if ( thisEnd === undefined ) {
thisEnd = this . length
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
if ( start < 0 || end > target . length || thisStart < 0 || thisEnd > this . length ) {
throw new RangeError ( 'out of range index' )
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
if ( thisStart >= thisEnd && start >= end ) {
return 0
}
if ( thisStart >= thisEnd ) {
return - 1
}
if ( start >= end ) {
return 1
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
start >>>= 0
end >>>= 0
thisStart >>>= 0
thisEnd >>>= 0
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
if ( this === target ) return 0
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
var x = thisEnd - thisStart
var y = end - start
var len = Math . min ( x , y )
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
var thisCopy = this . slice ( thisStart , thisEnd )
var targetCopy = target . slice ( start , end )
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
for ( var i = 0 ; i < len ; ++ i ) {
if ( thisCopy [ i ] !== targetCopy [ i ] ) {
x = thisCopy [ i ]
y = targetCopy [ i ]
break
}
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
if ( x < y ) return - 1
if ( y < x ) return 1
return 0
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
//
// Arguments:
// - buffer - a Buffer to search
// - val - a string, Buffer, or number
// - byteOffset - an index into `buffer`; will be clamped to an int32
// - encoding - an optional encoding, relevant is val is a string
// - dir - true for indexOf, false for lastIndexOf
function bidirectionalIndexOf ( buffer , val , byteOffset , encoding , dir ) {
// Empty buffer means no match
if ( buffer . length === 0 ) return - 1
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
// Normalize byteOffset
if ( typeof byteOffset === 'string' ) {
encoding = byteOffset
byteOffset = 0
} else if ( byteOffset > 0x7fffffff ) {
byteOffset = 0x7fffffff
} else if ( byteOffset < - 0x80000000 ) {
byteOffset = - 0x80000000
}
byteOffset = + byteOffset // Coerce to Number.
if ( isNaN ( byteOffset ) ) {
// byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
byteOffset = dir ? 0 : ( buffer . length - 1 )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
// Normalize byteOffset: negative offsets start from the end of the buffer
if ( byteOffset < 0 ) byteOffset = buffer . length + byteOffset
if ( byteOffset >= buffer . length ) {
if ( dir ) return - 1
else byteOffset = buffer . length - 1
} else if ( byteOffset < 0 ) {
if ( dir ) byteOffset = 0
else return - 1
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
// Normalize val
if ( typeof val === 'string' ) {
val = Buffer . from ( val , encoding )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
// Finally, search either indexOf (if dir is true) or lastIndexOf
if ( Buffer . isBuffer ( val ) ) {
// Special case: looking for empty string/buffer always fails
if ( val . length === 0 ) {
return - 1
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
return arrayIndexOf ( buffer , val , byteOffset , encoding , dir )
} else if ( typeof val === 'number' ) {
val = val & 0xFF // Search for a byte value [0-255]
if ( Buffer . TYPED _ARRAY _SUPPORT &&
typeof Uint8Array . prototype . indexOf === 'function' ) {
if ( dir ) {
return Uint8Array . prototype . indexOf . call ( buffer , val , byteOffset )
} else {
return Uint8Array . prototype . lastIndexOf . call ( buffer , val , byteOffset )
}
}
return arrayIndexOf ( buffer , [ val ] , byteOffset , encoding , dir )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
throw new TypeError ( 'val must be string, number or Buffer' )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
function arrayIndexOf ( arr , val , byteOffset , encoding , dir ) {
var indexSize = 1
var arrLength = arr . length
var valLength = val . length
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
if ( encoding !== undefined ) {
encoding = String ( encoding ) . toLowerCase ( )
if ( encoding === 'ucs2' || encoding === 'ucs-2' ||
encoding === 'utf16le' || encoding === 'utf-16le' ) {
if ( arr . length < 2 || val . length < 2 ) {
return - 1
}
indexSize = 2
arrLength /= 2
valLength /= 2
byteOffset /= 2
2019-12-05 13:13:10 +01:00
}
}
2020-06-15 22:29:48 +02:00
function read ( buf , i ) {
if ( indexSize === 1 ) {
return buf [ i ]
} else {
return buf . readUInt16BE ( i * indexSize )
}
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
var i
if ( dir ) {
var foundIndex = - 1
for ( i = byteOffset ; i < arrLength ; i ++ ) {
if ( read ( arr , i ) === read ( val , foundIndex === - 1 ? 0 : i - foundIndex ) ) {
if ( foundIndex === - 1 ) foundIndex = i
if ( i - foundIndex + 1 === valLength ) return foundIndex * indexSize
} else {
if ( foundIndex !== - 1 ) i -= i - foundIndex
foundIndex = - 1
}
}
} else {
if ( byteOffset + valLength > arrLength ) byteOffset = arrLength - valLength
for ( i = byteOffset ; i >= 0 ; i -- ) {
var found = true
for ( var j = 0 ; j < valLength ; j ++ ) {
if ( read ( arr , i + j ) !== read ( val , j ) ) {
found = false
break
}
}
if ( found ) return i
}
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
return - 1
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . includes = function includes ( val , byteOffset , encoding ) {
return this . indexOf ( val , byteOffset , encoding ) !== - 1
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
Buffer . prototype . indexOf = function indexOf ( val , byteOffset , encoding ) {
return bidirectionalIndexOf ( this , val , byteOffset , encoding , true )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
Buffer . prototype . lastIndexOf = function lastIndexOf ( val , byteOffset , encoding ) {
return bidirectionalIndexOf ( this , val , byteOffset , encoding , false )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
function hexWrite ( buf , string , offset , length ) {
offset = Number ( offset ) || 0
var remaining = buf . length - offset
if ( ! length ) {
length = remaining
} else {
length = Number ( length )
if ( length > remaining ) {
length = remaining
}
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
// must be an even number of digits
var strLen = string . length
if ( strLen % 2 !== 0 ) throw new TypeError ( 'Invalid hex string' )
if ( length > strLen / 2 ) {
length = strLen / 2
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
for ( var i = 0 ; i < length ; ++ i ) {
var parsed = parseInt ( string . substr ( i * 2 , 2 ) , 16 )
if ( isNaN ( parsed ) ) return i
buf [ offset + i ] = parsed
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
return i
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
function utf8Write ( buf , string , offset , length ) {
return blitBuffer ( utf8ToBytes ( string , buf . length - offset ) , buf , offset , length )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
function asciiWrite ( buf , string , offset , length ) {
return blitBuffer ( asciiToBytes ( string ) , buf , offset , length )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
function latin1Write ( buf , string , offset , length ) {
return asciiWrite ( buf , string , offset , length )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
function base64Write ( buf , string , offset , length ) {
return blitBuffer ( base64ToBytes ( string ) , buf , offset , length )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
function ucs2Write ( buf , string , offset , length ) {
return blitBuffer ( utf16leToBytes ( string , buf . length - offset ) , buf , offset , length )
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . write = function write ( string , offset , length , encoding ) {
// Buffer#write(string)
if ( offset === undefined ) {
encoding = 'utf8'
length = this . length
offset = 0
// Buffer#write(string, encoding)
} else if ( length === undefined && typeof offset === 'string' ) {
encoding = offset
length = this . length
offset = 0
// Buffer#write(string, offset[, length][, encoding])
} else if ( isFinite ( offset ) ) {
offset = offset | 0
if ( isFinite ( length ) ) {
length = length | 0
if ( encoding === undefined ) encoding = 'utf8'
} else {
encoding = length
length = undefined
}
// legacy write(string, encoding, offset, length) - remove in v0.13
} else {
throw new Error (
'Buffer.write(string, encoding, offset[, length]) is no longer supported'
)
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
var remaining = this . length - offset
if ( length === undefined || length > remaining ) length = remaining
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
if ( ( string . length > 0 && ( length < 0 || offset < 0 ) ) || offset > this . length ) {
throw new RangeError ( 'Attempt to write outside buffer bounds' )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
if ( ! encoding ) encoding = 'utf8'
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
var loweredCase = false
for ( ; ; ) {
switch ( encoding ) {
case 'hex' :
return hexWrite ( this , string , offset , length )
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
case 'utf8' :
case 'utf-8' :
return utf8Write ( this , string , offset , length )
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
case 'ascii' :
return asciiWrite ( this , string , offset , length )
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
case 'latin1' :
case 'binary' :
return latin1Write ( this , string , offset , length )
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
case 'base64' :
// Warning: maxLength not taken into account in base64Write
return base64Write ( this , string , offset , length )
case 'ucs2' :
case 'ucs-2' :
case 'utf16le' :
case 'utf-16le' :
return ucs2Write ( this , string , offset , length )
default :
if ( loweredCase ) throw new TypeError ( 'Unknown encoding: ' + encoding )
encoding = ( '' + encoding ) . toLowerCase ( )
loweredCase = true
}
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . toJSON = function toJSON ( ) {
return {
type : 'Buffer' ,
data : Array . prototype . slice . call ( this . _arr || this , 0 )
}
}
function base64Slice ( buf , start , end ) {
if ( start === 0 && end === buf . length ) {
return base64 . fromByteArray ( buf )
2019-12-05 13:13:10 +01:00
} else {
2020-06-15 22:29:48 +02:00
return base64 . fromByteArray ( buf . slice ( start , end ) )
2019-12-05 13:13:10 +01:00
}
}
2020-06-15 22:29:48 +02:00
function utf8Slice ( buf , start , end ) {
end = Math . min ( buf . length , end )
var res = [ ]
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
var i = start
while ( i < end ) {
var firstByte = buf [ i ]
var codePoint = null
var bytesPerSequence = ( firstByte > 0xEF ) ? 4
: ( firstByte > 0xDF ) ? 3
: ( firstByte > 0xBF ) ? 2
: 1
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
if ( i + bytesPerSequence <= end ) {
var secondByte , thirdByte , fourthByte , tempCodePoint
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
switch ( bytesPerSequence ) {
case 1 :
if ( firstByte < 0x80 ) {
codePoint = firstByte
}
break
case 2 :
secondByte = buf [ i + 1 ]
if ( ( secondByte & 0xC0 ) === 0x80 ) {
tempCodePoint = ( firstByte & 0x1F ) << 0x6 | ( secondByte & 0x3F )
if ( tempCodePoint > 0x7F ) {
codePoint = tempCodePoint
}
}
break
case 3 :
secondByte = buf [ i + 1 ]
thirdByte = buf [ i + 2 ]
if ( ( secondByte & 0xC0 ) === 0x80 && ( thirdByte & 0xC0 ) === 0x80 ) {
tempCodePoint = ( firstByte & 0xF ) << 0xC | ( secondByte & 0x3F ) << 0x6 | ( thirdByte & 0x3F )
if ( tempCodePoint > 0x7FF && ( tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF ) ) {
codePoint = tempCodePoint
}
}
break
case 4 :
secondByte = buf [ i + 1 ]
thirdByte = buf [ i + 2 ]
fourthByte = buf [ i + 3 ]
if ( ( secondByte & 0xC0 ) === 0x80 && ( thirdByte & 0xC0 ) === 0x80 && ( fourthByte & 0xC0 ) === 0x80 ) {
tempCodePoint = ( firstByte & 0xF ) << 0x12 | ( secondByte & 0x3F ) << 0xC | ( thirdByte & 0x3F ) << 0x6 | ( fourthByte & 0x3F )
if ( tempCodePoint > 0xFFFF && tempCodePoint < 0x110000 ) {
codePoint = tempCodePoint
}
}
2019-12-05 13:13:10 +01:00
}
}
2020-06-15 22:29:48 +02:00
if ( codePoint === null ) {
// we did not generate a valid codePoint so insert a
// replacement char (U+FFFD) and advance only 1 byte
codePoint = 0xFFFD
bytesPerSequence = 1
} else if ( codePoint > 0xFFFF ) {
// encode to utf16 (surrogate pair dance)
codePoint -= 0x10000
res . push ( codePoint >>> 10 & 0x3FF | 0xD800 )
codePoint = 0xDC00 | codePoint & 0x3FF
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
res . push ( codePoint )
i += bytesPerSequence
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
return decodeCodePointsArray ( res )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
// Based on http://stackoverflow.com/a/22747272/680742, the browser with
// the lowest limit is Chrome, with 0x10000 args.
// We go 1 magnitude less, for safety
var MAX _ARGUMENTS _LENGTH = 0x1000
function decodeCodePointsArray ( codePoints ) {
var len = codePoints . length
if ( len <= MAX _ARGUMENTS _LENGTH ) {
return String . fromCharCode . apply ( String , codePoints ) // avoid extra slice()
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
// Decode in chunks to avoid "call stack size exceeded".
var res = ''
var i = 0
while ( i < len ) {
res += String . fromCharCode . apply (
String ,
codePoints . slice ( i , i += MAX _ARGUMENTS _LENGTH )
)
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
return res
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
function asciiSlice ( buf , start , end ) {
var ret = ''
end = Math . min ( buf . length , end )
for ( var i = start ; i < end ; ++ i ) {
ret += String . fromCharCode ( buf [ i ] & 0x7F )
}
return ret
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
function latin1Slice ( buf , start , end ) {
var ret = ''
end = Math . min ( buf . length , end )
for ( var i = start ; i < end ; ++ i ) {
ret += String . fromCharCode ( buf [ i ] )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
return ret
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
function hexSlice ( buf , start , end ) {
var len = buf . length
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
if ( ! start || start < 0 ) start = 0
if ( ! end || end < 0 || end > len ) end = len
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
var out = ''
for ( var i = start ; i < end ; ++ i ) {
out += toHex ( buf [ i ] )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
return out
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
function utf16leSlice ( buf , start , end ) {
var bytes = buf . slice ( start , end )
var res = ''
for ( var i = 0 ; i < bytes . length ; i += 2 ) {
res += String . fromCharCode ( bytes [ i ] + bytes [ i + 1 ] * 256 )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
return res
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
Buffer . prototype . slice = function slice ( start , end ) {
var len = this . length
start = ~ ~ start
end = end === undefined ? len : ~ ~ end
if ( start < 0 ) {
start += len
if ( start < 0 ) start = 0
} else if ( start > len ) {
start = len
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
if ( end < 0 ) {
end += len
if ( end < 0 ) end = 0
} else if ( end > len ) {
end = len
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
if ( end < start ) end = start
var newBuf
if ( Buffer . TYPED _ARRAY _SUPPORT ) {
newBuf = this . subarray ( start , end )
newBuf . _ _proto _ _ = Buffer . prototype
} else {
var sliceLen = end - start
newBuf = new Buffer ( sliceLen , undefined )
for ( var i = 0 ; i < sliceLen ; ++ i ) {
newBuf [ i ] = this [ i + start ]
2019-12-05 13:13:10 +01:00
}
}
2020-06-15 22:29:48 +02:00
return newBuf
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
/ *
* Need to make sure that buffer isn ' t trying to write out of bounds .
* /
function checkOffset ( offset , ext , length ) {
if ( ( offset % 1 ) !== 0 || offset < 0 ) throw new RangeError ( 'offset is not uint' )
if ( offset + ext > length ) throw new RangeError ( 'Trying to access beyond buffer length' )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
Buffer . prototype . readUIntLE = function readUIntLE ( offset , byteLength , noAssert ) {
offset = offset | 0
byteLength = byteLength | 0
if ( ! noAssert ) checkOffset ( offset , byteLength , this . length )
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
var val = this [ offset ]
var mul = 1
var i = 0
while ( ++ i < byteLength && ( mul *= 0x100 ) ) {
val += this [ offset + i ] * mul
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
return val
}
Buffer . prototype . readUIntBE = function readUIntBE ( offset , byteLength , noAssert ) {
offset = offset | 0
byteLength = byteLength | 0
if ( ! noAssert ) {
checkOffset ( offset , byteLength , this . length )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
var val = this [ offset + -- byteLength ]
var mul = 1
while ( byteLength > 0 && ( mul *= 0x100 ) ) {
val += this [ offset + -- byteLength ] * mul
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
return val
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . readUInt8 = function readUInt8 ( offset , noAssert ) {
if ( ! noAssert ) checkOffset ( offset , 1 , this . length )
return this [ offset ]
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . readUInt16LE = function readUInt16LE ( offset , noAssert ) {
if ( ! noAssert ) checkOffset ( offset , 2 , this . length )
return this [ offset ] | ( this [ offset + 1 ] << 8 )
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . readUInt16BE = function readUInt16BE ( offset , noAssert ) {
if ( ! noAssert ) checkOffset ( offset , 2 , this . length )
return ( this [ offset ] << 8 ) | this [ offset + 1 ]
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . readUInt32LE = function readUInt32LE ( offset , noAssert ) {
if ( ! noAssert ) checkOffset ( offset , 4 , this . length )
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
return ( ( this [ offset ] ) |
( this [ offset + 1 ] << 8 ) |
( this [ offset + 2 ] << 16 ) ) +
( this [ offset + 3 ] * 0x1000000 )
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . readUInt32BE = function readUInt32BE ( offset , noAssert ) {
if ( ! noAssert ) checkOffset ( offset , 4 , this . length )
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
return ( this [ offset ] * 0x1000000 ) +
( ( this [ offset + 1 ] << 16 ) |
( this [ offset + 2 ] << 8 ) |
this [ offset + 3 ] )
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . readIntLE = function readIntLE ( offset , byteLength , noAssert ) {
offset = offset | 0
byteLength = byteLength | 0
if ( ! noAssert ) checkOffset ( offset , byteLength , this . length )
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
var val = this [ offset ]
var mul = 1
var i = 0
while ( ++ i < byteLength && ( mul *= 0x100 ) ) {
val += this [ offset + i ] * mul
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
mul *= 0x80
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
if ( val >= mul ) val -= Math . pow ( 2 , 8 * byteLength )
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
return val
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
Buffer . prototype . readIntBE = function readIntBE ( offset , byteLength , noAssert ) {
offset = offset | 0
byteLength = byteLength | 0
if ( ! noAssert ) checkOffset ( offset , byteLength , this . length )
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
var i = byteLength
var mul = 1
var val = this [ offset + -- i ]
while ( i > 0 && ( mul *= 0x100 ) ) {
val += this [ offset + -- i ] * mul
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
mul *= 0x80
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
if ( val >= mul ) val -= Math . pow ( 2 , 8 * byteLength )
return val
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
Buffer . prototype . readInt8 = function readInt8 ( offset , noAssert ) {
if ( ! noAssert ) checkOffset ( offset , 1 , this . length )
if ( ! ( this [ offset ] & 0x80 ) ) return ( this [ offset ] )
return ( ( 0xff - this [ offset ] + 1 ) * - 1 )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
Buffer . prototype . readInt16LE = function readInt16LE ( offset , noAssert ) {
if ( ! noAssert ) checkOffset ( offset , 2 , this . length )
var val = this [ offset ] | ( this [ offset + 1 ] << 8 )
return ( val & 0x8000 ) ? val | 0xFFFF0000 : val
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
Buffer . prototype . readInt16BE = function readInt16BE ( offset , noAssert ) {
if ( ! noAssert ) checkOffset ( offset , 2 , this . length )
var val = this [ offset + 1 ] | ( this [ offset ] << 8 )
return ( val & 0x8000 ) ? val | 0xFFFF0000 : val
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
Buffer . prototype . readInt32LE = function readInt32LE ( offset , noAssert ) {
if ( ! noAssert ) checkOffset ( offset , 4 , this . length )
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
return ( this [ offset ] ) |
( this [ offset + 1 ] << 8 ) |
( this [ offset + 2 ] << 16 ) |
( this [ offset + 3 ] << 24 )
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . readInt32BE = function readInt32BE ( offset , noAssert ) {
if ( ! noAssert ) checkOffset ( offset , 4 , this . length )
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
return ( this [ offset ] << 24 ) |
( this [ offset + 1 ] << 16 ) |
( this [ offset + 2 ] << 8 ) |
( this [ offset + 3 ] )
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . readFloatLE = function readFloatLE ( offset , noAssert ) {
if ( ! noAssert ) checkOffset ( offset , 4 , this . length )
return ieee754 . read ( this , offset , true , 23 , 4 )
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . readFloatBE = function readFloatBE ( offset , noAssert ) {
if ( ! noAssert ) checkOffset ( offset , 4 , this . length )
return ieee754 . read ( this , offset , false , 23 , 4 )
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . readDoubleLE = function readDoubleLE ( offset , noAssert ) {
if ( ! noAssert ) checkOffset ( offset , 8 , this . length )
return ieee754 . read ( this , offset , true , 52 , 8 )
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . readDoubleBE = function readDoubleBE ( offset , noAssert ) {
if ( ! noAssert ) checkOffset ( offset , 8 , this . length )
return ieee754 . read ( this , offset , false , 52 , 8 )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
function checkInt ( buf , value , offset , ext , max , min ) {
if ( ! Buffer . isBuffer ( buf ) ) throw new TypeError ( '"buffer" argument must be a Buffer instance' )
if ( value > max || value < min ) throw new RangeError ( '"value" argument is out of bounds' )
if ( offset + ext > buf . length ) throw new RangeError ( 'Index out of range' )
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . writeUIntLE = function writeUIntLE ( value , offset , byteLength , noAssert ) {
value = + value
offset = offset | 0
byteLength = byteLength | 0
if ( ! noAssert ) {
var maxBytes = Math . pow ( 2 , 8 * byteLength ) - 1
checkInt ( this , value , offset , byteLength , maxBytes , 0 )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
var mul = 1
var i = 0
this [ offset ] = value & 0xFF
while ( ++ i < byteLength && ( mul *= 0x100 ) ) {
this [ offset + i ] = ( value / mul ) & 0xFF
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
return offset + byteLength
}
Buffer . prototype . writeUIntBE = function writeUIntBE ( value , offset , byteLength , noAssert ) {
value = + value
offset = offset | 0
byteLength = byteLength | 0
if ( ! noAssert ) {
var maxBytes = Math . pow ( 2 , 8 * byteLength ) - 1
checkInt ( this , value , offset , byteLength , maxBytes , 0 )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
var i = byteLength - 1
var mul = 1
this [ offset + i ] = value & 0xFF
while ( -- i >= 0 && ( mul *= 0x100 ) ) {
this [ offset + i ] = ( value / mul ) & 0xFF
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
return offset + byteLength
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
Buffer . prototype . writeUInt8 = function writeUInt8 ( value , offset , noAssert ) {
value = + value
offset = offset | 0
if ( ! noAssert ) checkInt ( this , value , offset , 1 , 0xff , 0 )
if ( ! Buffer . TYPED _ARRAY _SUPPORT ) value = Math . floor ( value )
this [ offset ] = ( value & 0xff )
return offset + 1
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
function objectWriteUInt16 ( buf , value , offset , littleEndian ) {
if ( value < 0 ) value = 0xffff + value + 1
for ( var i = 0 , j = Math . min ( buf . length - offset , 2 ) ; i < j ; ++ i ) {
buf [ offset + i ] = ( value & ( 0xff << ( 8 * ( littleEndian ? i : 1 - i ) ) ) ) >>>
( littleEndian ? i : 1 - i ) * 8
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . writeUInt16LE = function writeUInt16LE ( value , offset , noAssert ) {
value = + value
offset = offset | 0
if ( ! noAssert ) checkInt ( this , value , offset , 2 , 0xffff , 0 )
if ( Buffer . TYPED _ARRAY _SUPPORT ) {
this [ offset ] = ( value & 0xff )
this [ offset + 1 ] = ( value >>> 8 )
2019-12-05 13:13:10 +01:00
} else {
2020-06-15 22:29:48 +02:00
objectWriteUInt16 ( this , value , offset , true )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
return offset + 2
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
Buffer . prototype . writeUInt16BE = function writeUInt16BE ( value , offset , noAssert ) {
value = + value
offset = offset | 0
if ( ! noAssert ) checkInt ( this , value , offset , 2 , 0xffff , 0 )
if ( Buffer . TYPED _ARRAY _SUPPORT ) {
this [ offset ] = ( value >>> 8 )
this [ offset + 1 ] = ( value & 0xff )
} else {
objectWriteUInt16 ( this , value , offset , false )
}
return offset + 2
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
function objectWriteUInt32 ( buf , value , offset , littleEndian ) {
if ( value < 0 ) value = 0xffffffff + value + 1
for ( var i = 0 , j = Math . min ( buf . length - offset , 4 ) ; i < j ; ++ i ) {
buf [ offset + i ] = ( value >>> ( littleEndian ? i : 3 - i ) * 8 ) & 0xff
}
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
Buffer . prototype . writeUInt32LE = function writeUInt32LE ( value , offset , noAssert ) {
value = + value
offset = offset | 0
if ( ! noAssert ) checkInt ( this , value , offset , 4 , 0xffffffff , 0 )
if ( Buffer . TYPED _ARRAY _SUPPORT ) {
this [ offset + 3 ] = ( value >>> 24 )
this [ offset + 2 ] = ( value >>> 16 )
this [ offset + 1 ] = ( value >>> 8 )
this [ offset ] = ( value & 0xff )
2019-12-05 13:13:10 +01:00
} else {
2020-06-15 22:29:48 +02:00
objectWriteUInt32 ( this , value , offset , true )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
return offset + 4
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . writeUInt32BE = function writeUInt32BE ( value , offset , noAssert ) {
value = + value
offset = offset | 0
if ( ! noAssert ) checkInt ( this , value , offset , 4 , 0xffffffff , 0 )
if ( Buffer . TYPED _ARRAY _SUPPORT ) {
this [ offset ] = ( value >>> 24 )
this [ offset + 1 ] = ( value >>> 16 )
this [ offset + 2 ] = ( value >>> 8 )
this [ offset + 3 ] = ( value & 0xff )
} else {
objectWriteUInt32 ( this , value , offset , false )
}
return offset + 4
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . writeIntLE = function writeIntLE ( value , offset , byteLength , noAssert ) {
value = + value
offset = offset | 0
if ( ! noAssert ) {
var limit = Math . pow ( 2 , 8 * byteLength - 1 )
checkInt ( this , value , offset , byteLength , limit - 1 , - limit )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
var i = 0
var mul = 1
var sub = 0
this [ offset ] = value & 0xFF
while ( ++ i < byteLength && ( mul *= 0x100 ) ) {
if ( value < 0 && sub === 0 && this [ offset + i - 1 ] !== 0 ) {
sub = 1
}
this [ offset + i ] = ( ( value / mul ) >> 0 ) - sub & 0xFF
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
return offset + byteLength
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
Buffer . prototype . writeIntBE = function writeIntBE ( value , offset , byteLength , noAssert ) {
value = + value
offset = offset | 0
if ( ! noAssert ) {
var limit = Math . pow ( 2 , 8 * byteLength - 1 )
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
checkInt ( this , value , offset , byteLength , limit - 1 , - limit )
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
var i = byteLength - 1
var mul = 1
var sub = 0
this [ offset + i ] = value & 0xFF
while ( -- i >= 0 && ( mul *= 0x100 ) ) {
if ( value < 0 && sub === 0 && this [ offset + i + 1 ] !== 0 ) {
sub = 1
}
this [ offset + i ] = ( ( value / mul ) >> 0 ) - sub & 0xFF
}
return offset + byteLength
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
Buffer . prototype . writeInt8 = function writeInt8 ( value , offset , noAssert ) {
value = + value
offset = offset | 0
if ( ! noAssert ) checkInt ( this , value , offset , 1 , 0x7f , - 0x80 )
if ( ! Buffer . TYPED _ARRAY _SUPPORT ) value = Math . floor ( value )
if ( value < 0 ) value = 0xff + value + 1
this [ offset ] = ( value & 0xff )
return offset + 1
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
Buffer . prototype . writeInt16LE = function writeInt16LE ( value , offset , noAssert ) {
value = + value
offset = offset | 0
if ( ! noAssert ) checkInt ( this , value , offset , 2 , 0x7fff , - 0x8000 )
if ( Buffer . TYPED _ARRAY _SUPPORT ) {
this [ offset ] = ( value & 0xff )
this [ offset + 1 ] = ( value >>> 8 )
2019-12-05 13:13:10 +01:00
} else {
2020-06-15 22:29:48 +02:00
objectWriteUInt16 ( this , value , offset , true )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
return offset + 2
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . writeInt16BE = function writeInt16BE ( value , offset , noAssert ) {
value = + value
offset = offset | 0
if ( ! noAssert ) checkInt ( this , value , offset , 2 , 0x7fff , - 0x8000 )
if ( Buffer . TYPED _ARRAY _SUPPORT ) {
this [ offset ] = ( value >>> 8 )
this [ offset + 1 ] = ( value & 0xff )
} else {
objectWriteUInt16 ( this , value , offset , false )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
return offset + 2
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . writeInt32LE = function writeInt32LE ( value , offset , noAssert ) {
value = + value
offset = offset | 0
if ( ! noAssert ) checkInt ( this , value , offset , 4 , 0x7fffffff , - 0x80000000 )
if ( Buffer . TYPED _ARRAY _SUPPORT ) {
this [ offset ] = ( value & 0xff )
this [ offset + 1 ] = ( value >>> 8 )
this [ offset + 2 ] = ( value >>> 16 )
this [ offset + 3 ] = ( value >>> 24 )
} else {
objectWriteUInt32 ( this , value , offset , true )
}
return offset + 4
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . writeInt32BE = function writeInt32BE ( value , offset , noAssert ) {
value = + value
offset = offset | 0
if ( ! noAssert ) checkInt ( this , value , offset , 4 , 0x7fffffff , - 0x80000000 )
if ( value < 0 ) value = 0xffffffff + value + 1
if ( Buffer . TYPED _ARRAY _SUPPORT ) {
this [ offset ] = ( value >>> 24 )
this [ offset + 1 ] = ( value >>> 16 )
this [ offset + 2 ] = ( value >>> 8 )
this [ offset + 3 ] = ( value & 0xff )
} else {
objectWriteUInt32 ( this , value , offset , false )
}
return offset + 4
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
function checkIEEE754 ( buf , value , offset , ext , max , min ) {
if ( offset + ext > buf . length ) throw new RangeError ( 'Index out of range' )
if ( offset < 0 ) throw new RangeError ( 'Index out of range' )
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
function writeFloat ( buf , value , offset , littleEndian , noAssert ) {
if ( ! noAssert ) {
checkIEEE754 ( buf , value , offset , 4 , 3.4028234663852886 e + 38 , - 3.4028234663852886 e + 38 )
}
ieee754 . write ( buf , value , offset , littleEndian , 23 , 4 )
return offset + 4
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . writeFloatLE = function writeFloatLE ( value , offset , noAssert ) {
return writeFloat ( this , value , offset , true , noAssert )
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
Buffer . prototype . writeFloatBE = function writeFloatBE ( value , offset , noAssert ) {
return writeFloat ( this , value , offset , false , noAssert )
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
function writeDouble ( buf , value , offset , littleEndian , noAssert ) {
if ( ! noAssert ) {
checkIEEE754 ( buf , value , offset , 8 , 1.7976931348623157 E + 308 , - 1.7976931348623157 E + 308 )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
ieee754 . write ( buf , value , offset , littleEndian , 52 , 8 )
return offset + 8
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
Buffer . prototype . writeDoubleLE = function writeDoubleLE ( value , offset , noAssert ) {
return writeDouble ( this , value , offset , true , noAssert )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
Buffer . prototype . writeDoubleBE = function writeDoubleBE ( value , offset , noAssert ) {
return writeDouble ( this , value , offset , false , noAssert )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
Buffer . prototype . copy = function copy ( target , targetStart , start , end ) {
if ( ! start ) start = 0
if ( ! end && end !== 0 ) end = this . length
if ( targetStart >= target . length ) targetStart = target . length
if ( ! targetStart ) targetStart = 0
if ( end > 0 && end < start ) end = start
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
// Copy 0 bytes; we're done
if ( end === start ) return 0
if ( target . length === 0 || this . length === 0 ) return 0
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
// Fatal error conditions
if ( targetStart < 0 ) {
throw new RangeError ( 'targetStart out of bounds' )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
if ( start < 0 || start >= this . length ) throw new RangeError ( 'sourceStart out of bounds' )
if ( end < 0 ) throw new RangeError ( 'sourceEnd out of bounds' )
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
// Are we oob?
if ( end > this . length ) end = this . length
if ( target . length - targetStart < end - start ) {
end = target . length - targetStart + start
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
var len = end - start
var i
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
if ( this === target && start < targetStart && targetStart < end ) {
// descending copy from end
for ( i = len - 1 ; i >= 0 ; -- i ) {
target [ i + targetStart ] = this [ i + start ]
}
} else if ( len < 1000 || ! Buffer . TYPED _ARRAY _SUPPORT ) {
// ascending copy from start
for ( i = 0 ; i < len ; ++ i ) {
target [ i + targetStart ] = this [ i + start ]
}
} else {
Uint8Array . prototype . set . call (
target ,
this . subarray ( start , start + len ) ,
targetStart
)
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
return len
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
// Usage:
// buffer.fill(number[, offset[, end]])
// buffer.fill(buffer[, offset[, end]])
// buffer.fill(string[, offset[, end]][, encoding])
Buffer . prototype . fill = function fill ( val , start , end , encoding ) {
// Handle string cases:
if ( typeof val === 'string' ) {
if ( typeof start === 'string' ) {
encoding = start
start = 0
end = this . length
} else if ( typeof end === 'string' ) {
encoding = end
end = this . length
}
if ( val . length === 1 ) {
var code = val . charCodeAt ( 0 )
if ( code < 256 ) {
val = code
}
}
if ( encoding !== undefined && typeof encoding !== 'string' ) {
throw new TypeError ( 'encoding must be a string' )
}
if ( typeof encoding === 'string' && ! Buffer . isEncoding ( encoding ) ) {
throw new TypeError ( 'Unknown encoding: ' + encoding )
}
} else if ( typeof val === 'number' ) {
val = val & 255
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
// Invalid ranges are not set to a default, so can range check early.
if ( start < 0 || this . length < start || this . length < end ) {
throw new RangeError ( 'Out of range index' )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
if ( end <= start ) {
return this
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
start = start >>> 0
end = end === undefined ? this . length : end >>> 0
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
if ( ! val ) val = 0
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
var i
if ( typeof val === 'number' ) {
for ( i = start ; i < end ; ++ i ) {
this [ i ] = val
}
2019-12-05 13:13:10 +01:00
} else {
2020-06-15 22:29:48 +02:00
var bytes = Buffer . isBuffer ( val )
? val
: utf8ToBytes ( new Buffer ( val , encoding ) . toString ( ) )
var len = bytes . length
for ( i = 0 ; i < end - start ; ++ i ) {
this [ i + start ] = bytes [ i % len ]
2019-12-05 13:13:10 +01:00
}
}
2020-06-15 22:29:48 +02:00
return this
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
// HELPER FUNCTIONS
// ================
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
var INVALID _BASE64 _RE = /[^+\/0-9A-Za-z-_]/g
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
function base64clean ( str ) {
// Node strips out invalid characters like \n and \t from the string, base64-js does not
str = stringtrim ( str ) . replace ( INVALID _BASE64 _RE , '' )
// Node converts strings with length < 2 to ''
if ( str . length < 2 ) return ''
// Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
while ( str . length % 4 !== 0 ) {
str = str + '='
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
return str
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
function stringtrim ( str ) {
if ( str . trim ) return str . trim ( )
return str . replace ( /^\s+|\s+$/g , '' )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
function toHex ( n ) {
if ( n < 16 ) return '0' + n . toString ( 16 )
return n . toString ( 16 )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
function utf8ToBytes ( string , units ) {
units = units || Infinity
var codePoint
var length = string . length
var leadSurrogate = null
var bytes = [ ]
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
for ( var i = 0 ; i < length ; ++ i ) {
codePoint = string . charCodeAt ( i )
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
// is surrogate component
if ( codePoint > 0xD7FF && codePoint < 0xE000 ) {
// last char was a lead
if ( ! leadSurrogate ) {
// no lead yet
if ( codePoint > 0xDBFF ) {
// unexpected trail
if ( ( units -= 3 ) > - 1 ) bytes . push ( 0xEF , 0xBF , 0xBD )
continue
} else if ( i + 1 === length ) {
// unpaired lead
if ( ( units -= 3 ) > - 1 ) bytes . push ( 0xEF , 0xBF , 0xBD )
continue
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
// valid lead
leadSurrogate = codePoint
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
continue
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
// 2 leads in a row
if ( codePoint < 0xDC00 ) {
if ( ( units -= 3 ) > - 1 ) bytes . push ( 0xEF , 0xBF , 0xBD )
leadSurrogate = codePoint
continue
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
// valid surrogate pair
codePoint = ( leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00 ) + 0x10000
} else if ( leadSurrogate ) {
// valid bmp char, but last char was a lead
if ( ( units -= 3 ) > - 1 ) bytes . push ( 0xEF , 0xBF , 0xBD )
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
leadSurrogate = null
// encode utf8
if ( codePoint < 0x80 ) {
if ( ( units -= 1 ) < 0 ) break
bytes . push ( codePoint )
} else if ( codePoint < 0x800 ) {
if ( ( units -= 2 ) < 0 ) break
bytes . push (
codePoint >> 0x6 | 0xC0 ,
codePoint & 0x3F | 0x80
)
} else if ( codePoint < 0x10000 ) {
if ( ( units -= 3 ) < 0 ) break
bytes . push (
codePoint >> 0xC | 0xE0 ,
codePoint >> 0x6 & 0x3F | 0x80 ,
codePoint & 0x3F | 0x80
)
} else if ( codePoint < 0x110000 ) {
if ( ( units -= 4 ) < 0 ) break
bytes . push (
codePoint >> 0x12 | 0xF0 ,
codePoint >> 0xC & 0x3F | 0x80 ,
codePoint >> 0x6 & 0x3F | 0x80 ,
codePoint & 0x3F | 0x80
)
} else {
throw new Error ( 'Invalid code point' )
}
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
return bytes
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
function asciiToBytes ( str ) {
var byteArray = [ ]
for ( var i = 0 ; i < str . length ; ++ i ) {
// Node's code seems to be doing this and not & 0x7F..
byteArray . push ( str . charCodeAt ( i ) & 0xFF )
}
return byteArray
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
function utf16leToBytes ( str , units ) {
var c , hi , lo
var byteArray = [ ]
for ( var i = 0 ; i < str . length ; ++ i ) {
if ( ( units -= 2 ) < 0 ) break
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
c = str . charCodeAt ( i )
hi = c >> 8
lo = c % 256
byteArray . push ( lo )
byteArray . push ( hi )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
return byteArray
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
function base64ToBytes ( str ) {
return base64 . toByteArray ( base64clean ( str ) )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
function blitBuffer ( src , dst , offset , length ) {
for ( var i = 0 ; i < length ; ++ i ) {
if ( ( i + offset >= dst . length ) || ( i >= src . length ) ) break
dst [ i + offset ] = src [ i ]
}
return i
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
function isnan ( val ) {
return val !== val // eslint-disable-line no-self-compare
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
/* WEBPACK VAR INJECTION */ } . call ( this , _ _webpack _require _ _ ( 11 ) ) )
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
/***/ } ) ,
/* 11 */
/***/ ( function ( module , exports ) {
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
var g ;
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
// This works in non-strict mode
g = ( function ( ) {
return this ;
} ) ( ) ;
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
try {
// This works if eval is allowed (see CSP)
g = g || new Function ( "return this" ) ( ) ;
} catch ( e ) {
// This works if the window reference is available
if ( typeof window === "object" ) g = window ;
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
module . exports = g ;
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
/***/ } ) ,
/* 12 */
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
"use strict" ;
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
exports . byteLength = byteLength
exports . toByteArray = toByteArray
exports . fromByteArray = fromByteArray
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
var lookup = [ ]
var revLookup = [ ]
var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
for ( var i = 0 , len = code . length ; i < len ; ++ i ) {
lookup [ i ] = code [ i ]
revLookup [ code . charCodeAt ( i ) ] = i
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
// Support decoding URL-safe base64 strings, as Node.js does.
// See: https://en.wikipedia.org/wiki/Base64#URL_applications
revLookup [ '-' . charCodeAt ( 0 ) ] = 62
revLookup [ '_' . charCodeAt ( 0 ) ] = 63
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
function getLens ( b64 ) {
var len = b64 . length
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
if ( len % 4 > 0 ) {
throw new Error ( 'Invalid string. Length must be a multiple of 4' )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
// Trim off extra bytes after placeholder bytes are found
// See: https://github.com/beatgammit/base64-js/issues/42
var validLen = b64 . indexOf ( '=' )
if ( validLen === - 1 ) validLen = len
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
var placeHoldersLen = validLen === len
? 0
: 4 - ( validLen % 4 )
return [ validLen , placeHoldersLen ]
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
// base64 is 4/3 + up to two characters of the original data
function byteLength ( b64 ) {
var lens = getLens ( b64 )
var validLen = lens [ 0 ]
var placeHoldersLen = lens [ 1 ]
return ( ( validLen + placeHoldersLen ) * 3 / 4 ) - placeHoldersLen
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
function _byteLength ( b64 , validLen , placeHoldersLen ) {
return ( ( validLen + placeHoldersLen ) * 3 / 4 ) - placeHoldersLen
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
function toByteArray ( b64 ) {
var tmp
var lens = getLens ( b64 )
var validLen = lens [ 0 ]
var placeHoldersLen = lens [ 1 ]
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
var arr = new Arr ( _byteLength ( b64 , validLen , placeHoldersLen ) )
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
var curByte = 0
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
// if there are placeholders, only get up to the last complete 4 chars
var len = placeHoldersLen > 0
? validLen - 4
: validLen
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
for ( var i = 0 ; i < len ; i += 4 ) {
tmp =
( revLookup [ b64 . charCodeAt ( i ) ] << 18 ) |
( revLookup [ b64 . charCodeAt ( i + 1 ) ] << 12 ) |
( revLookup [ b64 . charCodeAt ( i + 2 ) ] << 6 ) |
revLookup [ b64 . charCodeAt ( i + 3 ) ]
arr [ curByte ++ ] = ( tmp >> 16 ) & 0xFF
arr [ curByte ++ ] = ( tmp >> 8 ) & 0xFF
arr [ curByte ++ ] = tmp & 0xFF
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
if ( placeHoldersLen === 2 ) {
tmp =
( revLookup [ b64 . charCodeAt ( i ) ] << 2 ) |
( revLookup [ b64 . charCodeAt ( i + 1 ) ] >> 4 )
arr [ curByte ++ ] = tmp & 0xFF
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
if ( placeHoldersLen === 1 ) {
tmp =
( revLookup [ b64 . charCodeAt ( i ) ] << 10 ) |
( revLookup [ b64 . charCodeAt ( i + 1 ) ] << 4 ) |
( revLookup [ b64 . charCodeAt ( i + 2 ) ] >> 2 )
arr [ curByte ++ ] = ( tmp >> 8 ) & 0xFF
arr [ curByte ++ ] = tmp & 0xFF
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
return arr
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
function tripletToBase64 ( num ) {
return lookup [ num >> 18 & 0x3F ] +
lookup [ num >> 12 & 0x3F ] +
lookup [ num >> 6 & 0x3F ] +
lookup [ num & 0x3F ]
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
function encodeChunk ( uint8 , start , end ) {
var tmp
var output = [ ]
for ( var i = start ; i < end ; i += 3 ) {
tmp =
( ( uint8 [ i ] << 16 ) & 0xFF0000 ) +
( ( uint8 [ i + 1 ] << 8 ) & 0xFF00 ) +
( uint8 [ i + 2 ] & 0xFF )
output . push ( tripletToBase64 ( tmp ) )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
return output . join ( '' )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
function fromByteArray ( uint8 ) {
var tmp
var len = uint8 . length
var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
var parts = [ ]
var maxChunkLength = 16383 // must be multiple of 3
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
// go through the array every three bytes, we'll deal with trailing stuff later
for ( var i = 0 , len2 = len - extraBytes ; i < len2 ; i += maxChunkLength ) {
parts . push ( encodeChunk (
uint8 , i , ( i + maxChunkLength ) > len2 ? len2 : ( i + maxChunkLength )
) )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
// pad the end with zeros, but make sure to not forget the extra bytes
if ( extraBytes === 1 ) {
tmp = uint8 [ len - 1 ]
parts . push (
lookup [ tmp >> 2 ] +
lookup [ ( tmp << 4 ) & 0x3F ] +
'=='
)
} else if ( extraBytes === 2 ) {
tmp = ( uint8 [ len - 2 ] << 8 ) + uint8 [ len - 1 ]
parts . push (
lookup [ tmp >> 10 ] +
lookup [ ( tmp >> 4 ) & 0x3F ] +
lookup [ ( tmp << 2 ) & 0x3F ] +
'='
)
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
return parts . join ( '' )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
/***/ } ) ,
/* 13 */
/***/ ( function ( module , exports ) {
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
exports . read = function ( buffer , offset , isLE , mLen , nBytes ) {
var e , m
var eLen = ( nBytes * 8 ) - mLen - 1
var eMax = ( 1 << eLen ) - 1
var eBias = eMax >> 1
var nBits = - 7
var i = isLE ? ( nBytes - 1 ) : 0
var d = isLE ? - 1 : 1
var s = buffer [ offset + i ]
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
i += d
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
e = s & ( ( 1 << ( - nBits ) ) - 1 )
s >>= ( - nBits )
nBits += eLen
for ( ; nBits > 0 ; e = ( e * 256 ) + buffer [ offset + i ] , i += d , nBits -= 8 ) { }
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
m = e & ( ( 1 << ( - nBits ) ) - 1 )
e >>= ( - nBits )
nBits += mLen
for ( ; nBits > 0 ; m = ( m * 256 ) + buffer [ offset + i ] , i += d , nBits -= 8 ) { }
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
if ( e === 0 ) {
e = 1 - eBias
} else if ( e === eMax ) {
return m ? NaN : ( ( s ? - 1 : 1 ) * Infinity )
} else {
m = m + Math . pow ( 2 , mLen )
e = e - eBias
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
return ( s ? - 1 : 1 ) * m * Math . pow ( 2 , e - mLen )
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
exports . write = function ( buffer , value , offset , isLE , mLen , nBytes ) {
var e , m , c
var eLen = ( nBytes * 8 ) - mLen - 1
var eMax = ( 1 << eLen ) - 1
var eBias = eMax >> 1
var rt = ( mLen === 23 ? Math . pow ( 2 , - 24 ) - Math . pow ( 2 , - 77 ) : 0 )
var i = isLE ? 0 : ( nBytes - 1 )
var d = isLE ? 1 : - 1
var s = value < 0 || ( value === 0 && 1 / value < 0 ) ? 1 : 0
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
value = Math . abs ( value )
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
if ( isNaN ( value ) || value === Infinity ) {
m = isNaN ( value ) ? 1 : 0
e = eMax
2019-12-05 13:13:10 +01:00
} else {
2020-06-15 22:29:48 +02:00
e = Math . floor ( Math . log ( value ) / Math . LN2 )
if ( value * ( c = Math . pow ( 2 , - e ) ) < 1 ) {
e --
c *= 2
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
if ( e + eBias >= 1 ) {
value += rt / c
} else {
value += rt * Math . pow ( 2 , 1 - eBias )
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
if ( value * c >= 2 ) {
e ++
c /= 2
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
if ( e + eBias >= eMax ) {
m = 0
e = eMax
} else if ( e + eBias >= 1 ) {
m = ( ( value * c ) - 1 ) * Math . pow ( 2 , mLen )
e = e + eBias
} else {
m = value * Math . pow ( 2 , eBias - 1 ) * Math . pow ( 2 , mLen )
e = 0
2019-12-05 13:13:10 +01:00
}
}
2020-06-15 22:29:48 +02:00
for ( ; mLen >= 8 ; buffer [ offset + i ] = m & 0xff , i += d , m /= 256 , mLen -= 8 ) { }
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
e = ( e << mLen ) | m
eLen += mLen
for ( ; eLen > 0 ; buffer [ offset + i ] = e & 0xff , i += d , e /= 256 , eLen -= 8 ) { }
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
buffer [ offset + i - d ] |= s * 128
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
/***/ } ) ,
/* 14 */
/***/ ( function ( module , exports ) {
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
var toString = { } . toString ;
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
module . exports = Array . isArray || function ( arr ) {
return toString . call ( arr ) == '[object Array]' ;
} ;
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
/***/ } ) ,
/* 15 */
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
"use strict" ;
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doGenerateAuthToken" , function ( ) { return doGenerateAuthToken ; } ) ;
/* harmony import */ var constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 1 ) ;
/* harmony import */ var lbryio _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( 4 ) ;
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
function doGenerateAuthToken ( installationId ) {
return function ( dispatch ) {
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "GENERATE_AUTH_TOKEN_STARTED" ]
} ) ;
lbryio _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "default" ] . call ( 'user' , 'new' , {
auth _token : '' ,
language : 'en' ,
app _id : installationId
} , 'post' ) . then ( function ( response ) {
if ( ! response . auth _token ) {
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "GENERATE_AUTH_TOKEN_FAILURE" ]
} ) ;
} else {
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "GENERATE_AUTH_TOKEN_SUCCESS" ] ,
data : {
authToken : response . auth _token
}
} ) ;
}
} ) [ "catch" ] ( function ( ) {
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "GENERATE_AUTH_TOKEN_FAILURE" ]
} ) ;
} ) ;
} ;
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
/***/ } ) ,
/* 16 */
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
"use strict" ;
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doFetchCostInfoForUri" , function ( ) { return doFetchCostInfoForUri ; } ) ;
/* harmony import */ var constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 1 ) ;
/* harmony import */ var lbryio _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( 4 ) ;
/* harmony import */ var lbry _redux _ _WEBPACK _IMPORTED _MODULE _2 _ _ = _ _webpack _require _ _ ( 5 ) ;
/* harmony import */ var lbry _redux _ _WEBPACK _IMPORTED _MODULE _2 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( lbry _redux _ _WEBPACK _IMPORTED _MODULE _2 _ _ ) ;
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
// eslint-disable-next-line import/prefer-default-export
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
function doFetchCostInfoForUri ( uri ) {
return function ( dispatch , getState ) {
var state = getState ( ) ;
var claim = Object ( lbry _redux _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "selectClaimsByUri" ] ) ( state ) [ uri ] ;
if ( ! claim ) return ;
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
function resolve ( costInfo ) {
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "FETCH_COST_INFO_COMPLETED" ] ,
data : {
uri : uri ,
costInfo : costInfo
}
} ) ;
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
var fee = claim . value ? claim . value . fee : undefined ;
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
if ( fee === undefined ) {
resolve ( {
cost : 0 ,
includesData : true
} ) ;
} else if ( fee . currency === 'LBC' ) {
resolve ( {
cost : fee . amount ,
includesData : true
} ) ;
2019-12-05 13:13:10 +01:00
} else {
2020-06-15 22:29:48 +02:00
lbryio _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "default" ] . getExchangeRates ( ) . then ( function ( _ref ) {
var LBC _USD = _ref . LBC _USD ;
resolve ( {
cost : fee . amount / LBC _USD ,
includesData : true
} ) ;
} ) ;
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
} ;
2019-12-05 13:13:10 +01:00
}
2019-09-16 22:12:43 +02:00
2019-12-05 13:13:10 +01:00
/***/ } ) ,
2020-06-15 22:29:48 +02:00
/* 17 */
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
"use strict" ;
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doFetchBlackListedOutpoints" , function ( ) { return doFetchBlackListedOutpoints ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doBlackListedOutpointsSubscribe" , function ( ) { return doBlackListedOutpointsSubscribe ; } ) ;
/* harmony import */ var lbryio _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 4 ) ;
/* harmony import */ var constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( 1 ) ;
function _slicedToArray ( arr , i ) { return _arrayWithHoles ( arr ) || _iterableToArrayLimit ( arr , i ) || _nonIterableRest ( ) ; }
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
function _nonIterableRest ( ) { throw new TypeError ( "Invalid attempt to destructure non-iterable instance" ) ; }
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
function _iterableToArrayLimit ( arr , i ) { var _arr = [ ] ; var _n = true ; var _d = false ; var _e = undefined ; try { for ( var _i = arr [ Symbol . iterator ] ( ) , _s ; ! ( _n = ( _s = _i . next ( ) ) . done ) ; _n = true ) { _arr . push ( _s . value ) ; if ( i && _arr . length === i ) break ; } } catch ( err ) { _d = true ; _e = err ; } finally { try { if ( ! _n && _i [ "return" ] != null ) _i [ "return" ] ( ) ; } finally { if ( _d ) throw _e ; } } return _arr ; }
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
function _arrayWithHoles ( arr ) { if ( Array . isArray ( arr ) ) return arr ; }
2019-12-05 13:13:10 +01:00
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
var CHECK _BLACK _LISTED _CONTENT _INTERVAL = 60 * 60 * 1000 ;
function doFetchBlackListedOutpoints ( ) {
return function ( dispatch ) {
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "FETCH_BLACK_LISTED_CONTENT_STARTED" ]
} ) ;
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
var success = function success ( _ref ) {
var outpoints = _ref . outpoints ;
var splitOutpoints = [ ] ;
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
if ( outpoints ) {
outpoints . forEach ( function ( outpoint , index ) {
var _outpoint$split = outpoint . split ( ':' ) ,
_outpoint$split2 = _slicedToArray ( _outpoint$split , 2 ) ,
txid = _outpoint$split2 [ 0 ] ,
nout = _outpoint$split2 [ 1 ] ;
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
splitOutpoints [ index ] = {
txid : txid ,
nout : Number . parseInt ( nout , 10 )
} ;
} ) ;
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "FETCH_BLACK_LISTED_CONTENT_COMPLETED" ] ,
data : {
outpoints : splitOutpoints ,
success : true
}
} ) ;
} ;
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
var failure = function failure ( _ref2 ) {
var error = _ref2 . error ;
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "FETCH_BLACK_LISTED_CONTENT_FAILED" ] ,
data : {
error : error ,
success : false
}
} ) ;
} ;
2019-09-16 22:12:43 +02:00
2020-11-11 21:12:47 +01:00
lbryio _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "default" ] . call ( 'file' , 'list_blocked' , {
auth _token : ''
} ) . then ( success , failure ) ;
2020-06-15 22:29:48 +02:00
} ;
}
function doBlackListedOutpointsSubscribe ( ) {
return function ( dispatch ) {
dispatch ( doFetchBlackListedOutpoints ( ) ) ;
setInterval ( function ( ) {
return dispatch ( doFetchBlackListedOutpoints ( ) ) ;
} , CHECK _BLACK _LISTED _CONTENT _INTERVAL ) ;
} ;
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
/***/ } ) ,
/* 18 */
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
"use strict" ;
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doFetchFilteredOutpoints" , function ( ) { return doFetchFilteredOutpoints ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doFilteredOutpointsSubscribe" , function ( ) { return doFilteredOutpointsSubscribe ; } ) ;
/* harmony import */ var lbryio _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 4 ) ;
/* harmony import */ var constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( 1 ) ;
function _slicedToArray ( arr , i ) { return _arrayWithHoles ( arr ) || _iterableToArrayLimit ( arr , i ) || _nonIterableRest ( ) ; }
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
function _nonIterableRest ( ) { throw new TypeError ( "Invalid attempt to destructure non-iterable instance" ) ; }
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
function _iterableToArrayLimit ( arr , i ) { var _arr = [ ] ; var _n = true ; var _d = false ; var _e = undefined ; try { for ( var _i = arr [ Symbol . iterator ] ( ) , _s ; ! ( _n = ( _s = _i . next ( ) ) . done ) ; _n = true ) { _arr . push ( _s . value ) ; if ( i && _arr . length === i ) break ; } } catch ( err ) { _d = true ; _e = err ; } finally { try { if ( ! _n && _i [ "return" ] != null ) _i [ "return" ] ( ) ; } finally { if ( _d ) throw _e ; } } return _arr ; }
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
function _arrayWithHoles ( arr ) { if ( Array . isArray ( arr ) ) return arr ; }
2019-09-16 22:12:43 +02:00
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
var CHECK _FILTERED _CONTENT _INTERVAL = 60 * 60 * 1000 ;
function doFetchFilteredOutpoints ( ) {
return function ( dispatch ) {
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "FETCH_FILTERED_CONTENT_STARTED" ]
} ) ;
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
var success = function success ( _ref ) {
var outpoints = _ref . outpoints ;
var formattedOutpoints = [ ] ;
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
if ( outpoints ) {
formattedOutpoints = outpoints . map ( function ( outpoint ) {
var _outpoint$split = outpoint . split ( ':' ) ,
_outpoint$split2 = _slicedToArray ( _outpoint$split , 2 ) ,
txid = _outpoint$split2 [ 0 ] ,
nout = _outpoint$split2 [ 1 ] ;
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
return {
txid : txid ,
nout : Number . parseInt ( nout , 10 )
} ;
} ) ;
}
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "FETCH_FILTERED_CONTENT_COMPLETED" ] ,
data : {
outpoints : formattedOutpoints
}
} ) ;
} ;
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
var failure = function failure ( _ref2 ) {
var error = _ref2 . error ;
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "FETCH_FILTERED_CONTENT_FAILED" ] ,
data : {
error : error
}
} ) ;
} ;
2019-09-16 22:12:43 +02:00
2020-11-11 21:12:47 +01:00
lbryio _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "default" ] . call ( 'file' , 'list_filtered' , {
auth _token : ''
} ) . then ( success , failure ) ;
2020-06-15 22:29:48 +02:00
} ;
2019-12-05 13:13:10 +01:00
}
2020-06-15 22:29:48 +02:00
function doFilteredOutpointsSubscribe ( ) {
return function ( dispatch ) {
dispatch ( doFetchFilteredOutpoints ( ) ) ;
setInterval ( function ( ) {
return dispatch ( doFetchFilteredOutpoints ( ) ) ;
} , CHECK _FILTERED _CONTENT _INTERVAL ) ;
} ;
2019-12-05 13:13:10 +01:00
}
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
/***/ } ) ,
/* 19 */
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
"use strict" ;
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doFetchFeaturedUris" , function ( ) { return doFetchFeaturedUris ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doFetchTrendingUris" , function ( ) { return doFetchTrendingUris ; } ) ;
/* harmony import */ var lbryio _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 4 ) ;
/* harmony import */ var lbry _redux _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( 5 ) ;
/* harmony import */ var lbry _redux _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( lbry _redux _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/* harmony import */ var constants _action _types _ _WEBPACK _IMPORTED _MODULE _2 _ _ = _ _webpack _require _ _ ( 1 ) ;
function _toConsumableArray ( arr ) { return _arrayWithoutHoles ( arr ) || _iterableToArray ( arr ) || _nonIterableSpread ( ) ; }
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
function _nonIterableSpread ( ) { throw new TypeError ( "Invalid attempt to spread non-iterable instance" ) ; }
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
function _iterableToArray ( iter ) { if ( Symbol . iterator in Object ( iter ) || Object . prototype . toString . call ( iter ) === "[object Arguments]" ) return Array . from ( iter ) ; }
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
function _arrayWithoutHoles ( arr ) { if ( Array . isArray ( arr ) ) { for ( var i = 0 , arr2 = new Array ( arr . length ) ; i < arr . length ; i ++ ) { arr2 [ i ] = arr [ i ] ; } return arr2 ; } }
2019-09-16 22:12:43 +02:00
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
function doFetchFeaturedUris ( ) {
var offloadResolve = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : false ;
return function ( dispatch ) {
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "FETCH_FEATURED_CONTENT_STARTED" ]
} ) ;
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
var success = function success ( _ref ) {
var Uris = _ref . Uris ;
var urisToResolve = [ ] ;
Object . keys ( Uris ) . forEach ( function ( category ) {
urisToResolve = [ ] . concat ( _toConsumableArray ( urisToResolve ) , _toConsumableArray ( Uris [ category ] ) ) ;
} ) ;
var actions = [ {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "FETCH_FEATURED_CONTENT_COMPLETED" ] ,
data : {
uris : Uris ,
success : true
}
} ] ;
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
if ( urisToResolve . length && ! offloadResolve ) {
actions . push ( Object ( lbry _redux _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "doResolveUris" ] ) ( urisToResolve ) ) ;
}
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
dispatch ( lbry _redux _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "batchActions" ] . apply ( void 0 , actions ) ) ;
} ;
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
var failure = function failure ( ) {
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "FETCH_FEATURED_CONTENT_COMPLETED" ] ,
data : {
uris : { }
}
} ) ;
} ;
2019-12-05 13:13:10 +01:00
2020-06-15 22:29:48 +02:00
lbryio _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "default" ] . call ( 'file' , 'list_homepage' ) . then ( success , failure ) ;
} ;
2019-09-16 22:12:43 +02:00
}
2020-06-15 22:29:48 +02:00
function doFetchTrendingUris ( ) {
2019-09-16 22:12:43 +02:00
return function ( dispatch ) {
dispatch ( {
2020-06-15 22:29:48 +02:00
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "FETCH_TRENDING_CONTENT_STARTED" ]
2019-09-16 22:12:43 +02:00
} ) ;
2020-06-15 22:29:48 +02:00
var success = function success ( data ) {
var urisToResolve = data . map ( function ( uri ) {
return uri . url ;
} ) ;
var actions = [ Object ( lbry _redux _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "doResolveUris" ] ) ( urisToResolve ) , {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "FETCH_TRENDING_CONTENT_COMPLETED" ] ,
data : {
uris : data ,
success : true
}
} ] ;
dispatch ( lbry _redux _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "batchActions" ] . apply ( void 0 , actions ) ) ;
} ;
var failure = function failure ( ) {
2019-09-16 22:12:43 +02:00
dispatch ( {
2020-06-15 22:29:48 +02:00
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "FETCH_TRENDING_CONTENT_COMPLETED" ] ,
data : {
uris : [ ]
}
2019-09-16 22:12:43 +02:00
} ) ;
2020-06-15 22:29:48 +02:00
} ;
lbryio _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "default" ] . call ( 'file' , 'list_trending' ) . then ( success , failure ) ;
2019-09-16 22:12:43 +02:00
} ;
}
/***/ } ) ,
2020-06-15 22:29:48 +02:00
/* 20 */
2019-09-16 22:12:43 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
2020-06-15 22:29:48 +02:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doFetchViewCount" , function ( ) { return doFetchViewCount ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doFetchSubCount" , function ( ) { return doFetchSubCount ; } ) ;
2020-01-10 04:28:46 +01:00
/* harmony import */ var lbryio _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 4 ) ;
2020-06-15 22:29:48 +02:00
/* harmony import */ var constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( 1 ) ;
2019-09-16 22:12:43 +02:00
2020-06-15 22:29:48 +02:00
var doFetchViewCount = function doFetchViewCount ( claimId ) {
2019-09-16 22:12:43 +02:00
return function ( dispatch ) {
dispatch ( {
2020-06-15 22:29:48 +02:00
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "FETCH_VIEW_COUNT_STARTED" ]
2019-09-16 22:12:43 +02:00
} ) ;
2020-06-15 22:29:48 +02:00
return lbryio _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "default" ] . call ( 'file' , 'view_count' , {
claim _id : claimId
} ) . then ( function ( result ) {
var viewCount = result [ 0 ] ;
2019-09-16 22:12:43 +02:00
dispatch ( {
2020-06-15 22:29:48 +02:00
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "FETCH_VIEW_COUNT_COMPLETED" ] ,
2019-09-16 22:12:43 +02:00
data : {
2020-06-15 22:29:48 +02:00
claimId : claimId ,
viewCount : viewCount
2019-09-16 22:12:43 +02:00
}
} ) ;
2020-06-15 22:29:48 +02:00
} ) [ "catch" ] ( function ( error ) {
2019-09-16 22:12:43 +02:00
dispatch ( {
2020-06-15 22:29:48 +02:00
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "FETCH_VIEW_COUNT_FAILED" ] ,
data : error
2019-09-16 22:12:43 +02:00
} ) ;
} ) ;
} ;
2020-06-15 22:29:48 +02:00
} ;
var doFetchSubCount = function doFetchSubCount ( claimId ) {
2018-07-23 15:12:18 +02:00
return function ( dispatch ) {
dispatch ( {
2020-06-15 22:29:48 +02:00
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "FETCH_SUB_COUNT_STARTED" ]
2018-07-23 15:12:18 +02:00
} ) ;
2020-06-15 22:29:48 +02:00
return lbryio _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "default" ] . call ( 'subscription' , 'sub_count' , {
claim _id : claimId
} ) . then ( function ( result ) {
var subCount = result [ 0 ] ;
2018-09-04 06:15:53 +02:00
dispatch ( {
2020-06-15 22:29:48 +02:00
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "FETCH_SUB_COUNT_COMPLETED" ] ,
2018-09-04 06:15:53 +02:00
data : {
2020-06-15 22:29:48 +02:00
claimId : claimId ,
subCount : subCount
2018-09-04 06:15:53 +02:00
}
} ) ;
2020-06-15 22:29:48 +02:00
} ) [ "catch" ] ( function ( error ) {
2018-09-04 06:15:53 +02:00
dispatch ( {
2020-06-15 22:29:48 +02:00
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "FETCH_SUB_COUNT_FAILED" ] ,
data : error
2018-09-04 06:15:53 +02:00
} ) ;
2020-06-15 22:29:48 +02:00
} ) ;
2018-09-04 06:15:53 +02:00
} ;
2020-06-15 22:29:48 +02:00
} ;
2018-09-04 06:15:53 +02:00
2018-07-23 15:12:18 +02:00
/***/ } ) ,
2020-06-15 22:29:48 +02:00
/* 21 */
2019-04-03 23:34:07 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2018-07-23 15:12:18 +02:00
2020-10-24 02:49:02 +02:00
"use strict" ;
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doSetDefaultAccount" , function ( ) { return doSetDefaultAccount ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doSetSync" , function ( ) { return doSetSync ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doGetSync" , function ( ) { return doGetSync ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doSyncApply" , function ( ) { return doSyncApply ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doCheckSync" , function ( ) { return doCheckSync ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doResetSync" , function ( ) { return doResetSync ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doSyncEncryptAndDecrypt" , function ( ) { return doSyncEncryptAndDecrypt ; } ) ;
/* harmony import */ var constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 1 ) ;
/* harmony import */ var lbryio _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( 4 ) ;
/* harmony import */ var lbry _redux _ _WEBPACK _IMPORTED _MODULE _2 _ _ = _ _webpack _require _ _ ( 5 ) ;
/* harmony import */ var lbry _redux _ _WEBPACK _IMPORTED _MODULE _2 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( lbry _redux _ _WEBPACK _IMPORTED _MODULE _2 _ _ ) ;
2020-10-24 03:15:58 +02:00
var NO _WALLET _ERROR = 'no wallet found for this user' ;
2020-10-24 02:49:02 +02:00
function doSetDefaultAccount ( success , failure ) {
return function ( dispatch ) {
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "SET_DEFAULT_ACCOUNT" ]
} ) ;
lbry _redux _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "Lbry" ] . account _list ( ) . then ( function ( accountList ) {
var accounts = accountList . lbc _mainnet ;
var defaultId ;
for ( var i = 0 ; i < accounts . length ; ++ i ) {
if ( accounts [ i ] . satoshis > 0 ) {
defaultId = accounts [ i ] . id ;
break ;
}
} // In a case where there's no balance on either account
// assume the second (which is created after sync) as default
if ( ! defaultId && accounts . length > 1 ) {
defaultId = accounts [ 1 ] . id ;
} // Set the default account
if ( defaultId ) {
lbry _redux _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "Lbry" ] . account _set ( {
account _id : defaultId ,
"default" : true
} ) . then ( function ( ) {
if ( success ) {
success ( ) ;
}
} ) [ "catch" ] ( function ( err ) {
if ( failure ) {
failure ( err ) ;
}
} ) ;
} else if ( failure ) {
// no default account to set
failure ( 'Could not set a default account' ) ; // fail
}
} ) [ "catch" ] ( function ( err ) {
if ( failure ) {
failure ( err ) ;
}
} ) ;
} ;
}
function doSetSync ( oldHash , newHash , data ) {
return function ( dispatch ) {
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "SET_SYNC_STARTED" ]
} ) ;
return lbryio _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "default" ] . call ( 'sync' , 'set' , {
old _hash : oldHash ,
new _hash : newHash ,
data : data
} , 'post' ) . then ( function ( response ) {
if ( ! response . hash ) {
throw Error ( 'No hash returned for sync/set.' ) ;
}
return dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "SET_SYNC_COMPLETED" ] ,
data : {
syncHash : response . hash
}
} ) ;
} ) [ "catch" ] ( function ( error ) {
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "SET_SYNC_FAILED" ] ,
data : {
error : error
}
} ) ;
} ) ;
} ;
}
function doGetSync ( passedPassword , callback ) {
var password = passedPassword === null || passedPassword === undefined ? '' : passedPassword ;
function handleCallback ( error , hasNewData ) {
if ( callback ) {
if ( typeof callback !== 'function' ) {
throw new Error ( 'Second argument passed to "doGetSync" must be a function' ) ;
}
callback ( error , hasNewData ) ;
}
}
return function ( dispatch ) {
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "GET_SYNC_STARTED" ]
} ) ;
var data = { } ;
lbry _redux _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "Lbry" ] . wallet _status ( ) . then ( function ( status ) {
if ( status . is _locked ) {
return lbry _redux _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "Lbry" ] . wallet _unlock ( {
password : password
} ) ;
} // Wallet is already unlocked
return true ;
} ) . then ( function ( isUnlocked ) {
if ( isUnlocked ) {
return lbry _redux _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "Lbry" ] . sync _hash ( ) ;
}
data . unlockFailed = true ;
throw new Error ( ) ;
} ) . then ( function ( hash ) {
return lbryio _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "default" ] . call ( 'sync' , 'get' , {
hash : hash
} , 'post' ) ;
} ) . then ( function ( response ) {
var syncHash = response . hash ;
data . syncHash = syncHash ;
data . syncData = response . data ;
data . changed = response . changed ;
data . hasSyncedWallet = true ;
if ( response . changed ) {
return lbry _redux _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "Lbry" ] . sync _apply ( {
password : password ,
data : response . data ,
blocking : true
} ) ;
}
} ) . then ( function ( response ) {
if ( ! response ) {
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "GET_SYNC_COMPLETED" ] ,
data : data
} ) ;
handleCallback ( null , data . changed ) ;
return ;
}
var walletHash = response . hash ,
walletData = response . data ;
if ( walletHash !== data . syncHash ) {
// different local hash, need to synchronise
dispatch ( doSetSync ( data . syncHash , walletHash , walletData ) ) ;
}
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "GET_SYNC_COMPLETED" ] ,
data : data
} ) ;
handleCallback ( null , data . changed ) ;
} ) [ "catch" ] ( function ( syncAttemptError ) {
if ( data . unlockFailed ) {
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "GET_SYNC_FAILED" ] ,
data : {
error : syncAttemptError
}
} ) ;
if ( password !== '' ) {
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "SYNC_APPLY_BAD_PASSWORD" ]
} ) ;
}
handleCallback ( syncAttemptError ) ;
} else if ( data . hasSyncedWallet ) {
var error = syncAttemptError && syncAttemptError . message || 'Error getting synced wallet' ;
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "GET_SYNC_FAILED" ] ,
data : {
error : error
}
} ) ; // Temp solution until we have a bad password error code
// Don't fail on blank passwords so we don't show a "password error" message
// before users have ever entered a password
if ( password !== '' ) {
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "SYNC_APPLY_BAD_PASSWORD" ]
} ) ;
}
handleCallback ( error ) ;
} else {
// user doesn't have a synced wallet
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "GET_SYNC_COMPLETED" ] ,
data : {
hasSyncedWallet : false ,
syncHash : null
}
} ) ; // call sync_apply to get data to sync
// first time sync. use any string for old hash
2020-10-24 03:15:58 +02:00
if ( syncAttemptError . message === NO _WALLET _ERROR ) {
lbry _redux _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "Lbry" ] . sync _apply ( {
password : password
} ) . then ( function ( _ref ) {
var walletHash = _ref . hash ,
syncApplyData = _ref . data ;
dispatch ( doSetSync ( '' , walletHash , syncApplyData , password ) ) ;
handleCallback ( ) ;
} ) [ "catch" ] ( function ( syncApplyError ) {
handleCallback ( syncApplyError ) ;
} ) ;
}
2020-10-24 02:49:02 +02:00
}
} ) ;
} ;
}
function doSyncApply ( syncHash , syncData , password ) {
return function ( dispatch ) {
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "SYNC_APPLY_STARTED" ]
} ) ;
lbry _redux _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "Lbry" ] . sync _apply ( {
password : password ,
data : syncData
} ) . then ( function ( _ref2 ) {
var walletHash = _ref2 . hash ,
walletData = _ref2 . data ;
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "SYNC_APPLY_COMPLETED" ]
} ) ;
if ( walletHash !== syncHash ) {
// different local hash, need to synchronise
dispatch ( doSetSync ( syncHash , walletHash , walletData ) ) ;
}
} ) [ "catch" ] ( function ( ) {
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "SYNC_APPLY_FAILED" ] ,
data : {
error : 'Invalid password specified. Please enter the password for your previously synchronised wallet.'
}
} ) ;
} ) ;
} ;
}
function doCheckSync ( ) {
return function ( dispatch ) {
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "GET_SYNC_STARTED" ]
} ) ;
lbry _redux _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "Lbry" ] . sync _hash ( ) . then ( function ( hash ) {
lbryio _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "default" ] . call ( 'sync' , 'get' , {
hash : hash
} , 'post' ) . then ( function ( response ) {
var data = {
hasSyncedWallet : true ,
syncHash : response . hash ,
syncData : response . data ,
hashChanged : response . changed
} ;
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "GET_SYNC_COMPLETED" ] ,
data : data
} ) ;
} ) [ "catch" ] ( function ( ) {
// user doesn't have a synced wallet
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "GET_SYNC_COMPLETED" ] ,
data : {
hasSyncedWallet : false ,
syncHash : null
}
} ) ;
} ) ;
} ) ;
} ;
}
function doResetSync ( ) {
return function ( dispatch ) {
return new Promise ( function ( resolve ) {
dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "SYNC_RESET" ]
} ) ;
resolve ( ) ;
} ) ;
} ;
}
function doSyncEncryptAndDecrypt ( oldPassword , newPassword , encrypt ) {
return function ( dispatch ) {
var data = { } ;
return lbry _redux _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "Lbry" ] . sync _hash ( ) . then ( function ( hash ) {
return lbryio _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "default" ] . call ( 'sync' , 'get' , {
hash : hash
} , 'post' ) ;
} ) . then ( function ( syncGetResponse ) {
data . oldHash = syncGetResponse . hash ;
return lbry _redux _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "Lbry" ] . sync _apply ( {
password : oldPassword ,
data : syncGetResponse . data
} ) ;
} ) . then ( function ( ) {
if ( encrypt ) {
dispatch ( Object ( lbry _redux _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "doWalletEncrypt" ] ) ( newPassword ) ) ;
} else {
dispatch ( Object ( lbry _redux _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "doWalletDecrypt" ] ) ( ) ) ;
}
} ) . then ( function ( ) {
return lbry _redux _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "Lbry" ] . sync _apply ( {
password : newPassword
} ) ;
} ) . then ( function ( syncApplyResponse ) {
if ( syncApplyResponse . hash !== data . oldHash ) {
return dispatch ( doSetSync ( data . oldHash , syncApplyResponse . hash , syncApplyResponse . data ) ) ;
}
} ) [ "catch" ] ( console . error ) ;
} ;
}
/***/ } ) ,
/* 22 */
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2020-06-15 22:29:48 +02:00
"use strict" ;
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "doUpdateUploadProgress" , function ( ) { return doUpdateUploadProgress ; } ) ;
/* harmony import */ var constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 1 ) ;
2020-01-16 23:52:53 +01:00
2020-06-15 22:29:48 +02:00
var doUpdateUploadProgress = function doUpdateUploadProgress ( progress , params , xhr ) {
return function ( dispatch ) {
return dispatch ( {
type : constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "UPDATE_UPLOAD_PROGRESS" ] ,
data : {
progress : progress ,
params : params ,
xhr : xhr
}
} ) ;
} ;
2020-04-13 15:40:25 +02:00
} ;
2020-06-15 22:29:48 +02:00
/***/ } ) ,
2020-10-24 02:49:02 +02:00
/* 23 */
2020-06-15 22:29:48 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2020-04-13 15:40:25 +02:00
2020-06-15 22:29:48 +02:00
"use strict" ;
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "authReducer" , function ( ) { return authReducer ; } ) ;
/* harmony import */ var constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 1 ) ;
2020-04-13 15:40:25 +02:00
2020-06-15 22:29:48 +02:00
var reducers = { } ;
var defaultState = {
authenticating : false
2020-04-13 15:40:25 +02:00
} ;
2020-06-15 22:29:48 +02:00
reducers [ constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "GENERATE_AUTH_TOKEN_FAILURE" ] ] = function ( state ) {
2020-04-13 15:40:25 +02:00
return Object . assign ( { } , state , {
2020-06-15 22:29:48 +02:00
authToken : null ,
authenticating : false
2020-04-13 15:40:25 +02:00
} ) ;
} ;
2020-06-15 22:29:48 +02:00
reducers [ constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "GENERATE_AUTH_TOKEN_STARTED" ] ] = function ( state ) {
2020-04-13 15:40:25 +02:00
return Object . assign ( { } , state , {
2020-06-15 22:29:48 +02:00
authenticating : true
2020-04-13 15:40:25 +02:00
} ) ;
} ;
2020-06-15 22:29:48 +02:00
reducers [ constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "GENERATE_AUTH_TOKEN_SUCCESS" ] ] = function ( state , action ) {
2020-04-13 15:40:25 +02:00
return Object . assign ( { } , state , {
2020-06-15 22:29:48 +02:00
authToken : action . data . authToken ,
authenticating : false
2020-04-13 15:40:25 +02:00
} ) ;
} ;
2020-06-15 22:29:48 +02:00
function authReducer ( ) {
2019-03-13 06:06:43 +01:00
var state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : defaultState ;
2019-04-03 23:34:07 +02:00
var action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2019-03-13 06:06:43 +01:00
var handler = reducers [ action . type ] ;
if ( handler ) return handler ( state , action ) ;
return state ;
2019-03-11 03:02:17 +01:00
}
/***/ } ) ,
2020-10-24 02:49:02 +02:00
/* 24 */
2019-04-03 23:34:07 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2019-03-11 03:02:17 +01:00
"use strict" ;
2019-04-03 23:34:07 +02:00
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "costInfoReducer" , function ( ) { return costInfoReducer ; } ) ;
2020-10-24 02:49:02 +02:00
/* harmony import */ var util _redux _utils _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 25 ) ;
2019-04-03 23:34:07 +02:00
/* harmony import */ var constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( 1 ) ;
2019-03-13 06:06:43 +01:00
var _handleActions ;
2019-03-11 03:02:17 +01:00
2019-04-03 23:34:07 +02:00
function _objectSpread ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] != null ? arguments [ i ] : { } ; var ownKeys = Object . keys ( source ) ; if ( typeof Object . getOwnPropertySymbols === 'function' ) { ownKeys = ownKeys . concat ( Object . getOwnPropertySymbols ( source ) . filter ( function ( sym ) { return Object . getOwnPropertyDescriptor ( source , sym ) . enumerable ; } ) ) ; } ownKeys . forEach ( function ( key ) { _defineProperty ( target , key , source [ key ] ) ; } ) ; } return target ; }
2019-03-11 03:02:17 +01:00
2019-04-03 23:34:07 +02:00
function _defineProperty ( obj , key , value ) { if ( key in obj ) { Object . defineProperty ( obj , key , { value : value , enumerable : true , configurable : true , writable : true } ) ; } else { obj [ key ] = value ; } return obj ; }
2019-03-11 03:02:17 +01:00
2019-03-13 06:06:43 +01:00
var defaultState = {
fetching : { } ,
byUri : { }
} ;
2019-04-03 23:34:07 +02:00
var costInfoReducer = Object ( util _redux _utils _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "handleActions" ] ) ( ( _handleActions = { } , _defineProperty ( _handleActions , constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "FETCH_COST_INFO_STARTED" ] , function ( state , action ) {
2019-03-13 06:06:43 +01:00
var uri = action . data . uri ;
var newFetching = Object . assign ( { } , state . fetching ) ;
newFetching [ uri ] = true ;
2019-04-03 23:34:07 +02:00
return _objectSpread ( { } , state , {
2019-03-13 06:06:43 +01:00
fetching : newFetching
} ) ;
2019-04-03 23:34:07 +02:00
} ) , _defineProperty ( _handleActions , constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "FETCH_COST_INFO_COMPLETED" ] , function ( state , action ) {
2019-03-13 06:06:43 +01:00
var _action$data = action . data ,
uri = _action$data . uri ,
costInfo = _action$data . costInfo ;
var newByUri = Object . assign ( { } , state . byUri ) ;
var newFetching = Object . assign ( { } , state . fetching ) ;
newByUri [ uri ] = costInfo ;
delete newFetching [ uri ] ;
2019-04-03 23:34:07 +02:00
return _objectSpread ( { } , state , {
2019-03-13 06:06:43 +01:00
byUri : newByUri ,
fetching : newFetching
} ) ;
} ) , _handleActions ) , defaultState ) ;
2019-03-11 03:02:17 +01:00
2019-03-13 06:06:43 +01:00
/***/ } ) ,
2020-10-24 02:49:02 +02:00
/* 25 */
2020-06-15 22:29:48 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "handleActions" , function ( ) { return handleActions ; } ) ;
// util for creating reducers
// based off of redux-actions
// https://redux-actions.js.org/docs/api/handleAction.html#handleactions
// eslint-disable-next-line import/prefer-default-export
var handleActions = function handleActions ( actionMap , defaultState ) {
return function ( ) {
var state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : defaultState ;
var action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
var handler = actionMap [ action . type ] ;
if ( handler ) {
var newState = handler ( state , action ) ;
return Object . assign ( { } , state , newState ) ;
} // just return the original state if no handler
// returning a copy here breaks redux-persist
return state ;
} ;
} ;
/***/ } ) ,
2020-10-24 02:49:02 +02:00
/* 26 */
2019-04-03 23:34:07 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2019-03-11 03:02:17 +01:00
"use strict" ;
2019-04-03 23:34:07 +02:00
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "blacklistReducer" , function ( ) { return blacklistReducer ; } ) ;
/* harmony import */ var constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 1 ) ;
2020-10-24 02:49:02 +02:00
/* harmony import */ var util _redux _utils _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( 25 ) ;
2019-03-11 03:02:17 +01:00
var _handleActions ;
2019-04-03 23:34:07 +02:00
function _objectSpread ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] != null ? arguments [ i ] : { } ; var ownKeys = Object . keys ( source ) ; if ( typeof Object . getOwnPropertySymbols === 'function' ) { ownKeys = ownKeys . concat ( Object . getOwnPropertySymbols ( source ) . filter ( function ( sym ) { return Object . getOwnPropertyDescriptor ( source , sym ) . enumerable ; } ) ) ; } ownKeys . forEach ( function ( key ) { _defineProperty ( target , key , source [ key ] ) ; } ) ; } return target ; }
2019-03-11 03:02:17 +01:00
2019-04-03 23:34:07 +02:00
function _defineProperty ( obj , key , value ) { if ( key in obj ) { Object . defineProperty ( obj , key , { value : value , enumerable : true , configurable : true , writable : true } ) ; } else { obj [ key ] = value ; } return obj ; }
2019-03-11 03:02:17 +01:00
var defaultState = {
fetchingBlackListedOutpoints : false ,
fetchingBlackListedOutpointsSucceed : undefined ,
blackListedOutpoints : undefined
} ;
2019-04-03 23:34:07 +02:00
var blacklistReducer = Object ( util _redux _utils _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "handleActions" ] ) ( ( _handleActions = { } , _defineProperty ( _handleActions , constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "FETCH_BLACK_LISTED_CONTENT_STARTED" ] , function ( state ) {
return _objectSpread ( { } , state , {
2019-03-11 03:02:17 +01:00
fetchingBlackListedOutpoints : true
} ) ;
2019-04-03 23:34:07 +02:00
} ) , _defineProperty ( _handleActions , constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "FETCH_BLACK_LISTED_CONTENT_COMPLETED" ] , function ( state , action ) {
2019-03-11 03:02:17 +01:00
var _action$data = action . data ,
outpoints = _action$data . outpoints ,
success = _action$data . success ;
2019-04-03 23:34:07 +02:00
return _objectSpread ( { } , state , {
2019-03-11 03:02:17 +01:00
fetchingBlackListedOutpoints : false ,
fetchingBlackListedOutpointsSucceed : success ,
blackListedOutpoints : outpoints
} ) ;
2019-04-03 23:34:07 +02:00
} ) , _defineProperty ( _handleActions , constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "FETCH_BLACK_LISTED_CONTENT_FAILED" ] , function ( state , action ) {
2019-03-11 03:02:17 +01:00
var _action$data2 = action . data ,
error = _action$data2 . error ,
success = _action$data2 . success ;
2019-04-03 23:34:07 +02:00
return _objectSpread ( { } , state , {
2019-03-11 03:02:17 +01:00
fetchingBlackListedOutpoints : false ,
fetchingBlackListedOutpointsSucceed : success ,
fetchingBlackListedOutpointsError : error
} ) ;
} ) , _handleActions ) , defaultState ) ;
/***/ } ) ,
2020-10-24 02:49:02 +02:00
/* 27 */
2019-07-09 16:20:01 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "filteredReducer" , function ( ) { return filteredReducer ; } ) ;
/* harmony import */ var constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 1 ) ;
2020-10-24 02:49:02 +02:00
/* harmony import */ var util _redux _utils _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( 25 ) ;
2019-07-09 16:20:01 +02:00
var _handleActions ;
function _objectSpread ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] != null ? arguments [ i ] : { } ; var ownKeys = Object . keys ( source ) ; if ( typeof Object . getOwnPropertySymbols === 'function' ) { ownKeys = ownKeys . concat ( Object . getOwnPropertySymbols ( source ) . filter ( function ( sym ) { return Object . getOwnPropertyDescriptor ( source , sym ) . enumerable ; } ) ) ; } ownKeys . forEach ( function ( key ) { _defineProperty ( target , key , source [ key ] ) ; } ) ; } return target ; }
function _defineProperty ( obj , key , value ) { if ( key in obj ) { Object . defineProperty ( obj , key , { value : value , enumerable : true , configurable : true , writable : true } ) ; } else { obj [ key ] = value ; } return obj ; }
var defaultState = {
2019-07-11 02:44:15 +02:00
loading : false ,
2019-07-09 16:20:01 +02:00
filteredOutpoints : undefined
} ;
var filteredReducer = Object ( util _redux _utils _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "handleActions" ] ) ( ( _handleActions = { } , _defineProperty ( _handleActions , constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "FETCH_FILTERED_CONTENT_STARTED" ] , function ( state ) {
return _objectSpread ( { } , state , {
2019-07-11 02:44:15 +02:00
loading : true
2019-07-09 16:20:01 +02:00
} ) ;
} ) , _defineProperty ( _handleActions , constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "FETCH_FILTERED_CONTENT_COMPLETED" ] , function ( state , action ) {
2019-07-11 02:44:15 +02:00
var outpoints = action . data . outpoints ;
2019-07-09 16:20:01 +02:00
return _objectSpread ( { } , state , {
2019-07-11 02:44:15 +02:00
loading : false ,
2019-07-09 16:20:01 +02:00
filteredOutpoints : outpoints
} ) ;
} ) , _defineProperty ( _handleActions , constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "FETCH_FILTERED_CONTENT_FAILED" ] , function ( state , action ) {
2019-07-11 02:44:15 +02:00
var error = action . data . error ;
2019-07-09 16:20:01 +02:00
return _objectSpread ( { } , state , {
2019-07-11 02:44:15 +02:00
loading : false ,
2019-07-09 16:20:01 +02:00
fetchingFilteredOutpointsError : error
} ) ;
} ) , _handleActions ) , defaultState ) ;
/***/ } ) ,
2020-10-24 02:49:02 +02:00
/* 28 */
2019-04-03 23:34:07 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2019-03-11 03:02:17 +01:00
"use strict" ;
2019-04-03 23:34:07 +02:00
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "homepageReducer" , function ( ) { return homepageReducer ; } ) ;
2020-10-24 02:49:02 +02:00
/* harmony import */ var util _redux _utils _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 25 ) ;
2019-04-03 23:34:07 +02:00
/* harmony import */ var constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( 1 ) ;
2019-03-11 03:02:17 +01:00
var _handleActions ;
2019-04-03 23:34:07 +02:00
function _objectSpread ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] != null ? arguments [ i ] : { } ; var ownKeys = Object . keys ( source ) ; if ( typeof Object . getOwnPropertySymbols === 'function' ) { ownKeys = ownKeys . concat ( Object . getOwnPropertySymbols ( source ) . filter ( function ( sym ) { return Object . getOwnPropertyDescriptor ( source , sym ) . enumerable ; } ) ) ; } ownKeys . forEach ( function ( key ) { _defineProperty ( target , key , source [ key ] ) ; } ) ; } return target ; }
2019-03-11 03:02:17 +01:00
2019-04-03 23:34:07 +02:00
function _defineProperty ( obj , key , value ) { if ( key in obj ) { Object . defineProperty ( obj , key , { value : value , enumerable : true , configurable : true , writable : true } ) ; } else { obj [ key ] = value ; } return obj ; }
2019-03-11 03:02:17 +01:00
var defaultState = {
2019-03-13 06:06:43 +01:00
fetchingFeaturedContent : false ,
fetchingFeaturedContentFailed : false ,
featuredUris : undefined ,
fetchingTrendingContent : false ,
fetchingTrendingContentFailed : false ,
trendingUris : undefined
2019-03-11 03:02:17 +01:00
} ;
2019-04-03 23:34:07 +02:00
var homepageReducer = Object ( util _redux _utils _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "handleActions" ] ) ( ( _handleActions = { } , _defineProperty ( _handleActions , constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "FETCH_FEATURED_CONTENT_STARTED" ] , function ( state ) {
return _objectSpread ( { } , state , {
2019-03-13 06:06:43 +01:00
fetchingFeaturedContent : true
2019-03-11 03:02:17 +01:00
} ) ;
2019-04-03 23:34:07 +02:00
} ) , _defineProperty ( _handleActions , constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "FETCH_FEATURED_CONTENT_COMPLETED" ] , function ( state , action ) {
2019-03-11 03:02:17 +01:00
var _action$data = action . data ,
2019-03-13 06:06:43 +01:00
uris = _action$data . uris ,
success = _action$data . success ;
2019-04-03 23:34:07 +02:00
return _objectSpread ( { } , state , {
2019-03-13 06:06:43 +01:00
fetchingFeaturedContent : false ,
fetchingFeaturedContentFailed : ! success ,
featuredUris : uris
} ) ;
2019-04-03 23:34:07 +02:00
} ) , _defineProperty ( _handleActions , constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "FETCH_TRENDING_CONTENT_STARTED" ] , function ( state ) {
return _objectSpread ( { } , state , {
2019-03-13 06:06:43 +01:00
fetchingTrendingContent : true
} ) ;
2019-04-03 23:34:07 +02:00
} ) , _defineProperty ( _handleActions , constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "FETCH_TRENDING_CONTENT_COMPLETED" ] , function ( state , action ) {
2019-03-13 06:06:43 +01:00
var _action$data2 = action . data ,
uris = _action$data2 . uris ,
success = _action$data2 . success ;
2019-04-03 23:34:07 +02:00
return _objectSpread ( { } , state , {
2019-03-13 06:06:43 +01:00
fetchingTrendingContent : false ,
fetchingTrendingContentFailed : ! success ,
trendingUris : uris
2019-03-11 03:02:17 +01:00
} ) ;
} ) , _handleActions ) , defaultState ) ;
2019-03-13 06:06:43 +01:00
/***/ } ) ,
2020-10-24 02:49:02 +02:00
/* 29 */
2019-04-03 23:34:07 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2019-03-14 19:39:39 +01:00
"use strict" ;
2019-04-03 23:34:07 +02:00
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "statsReducer" , function ( ) { return statsReducer ; } ) ;
2020-10-24 02:49:02 +02:00
/* harmony import */ var util _redux _utils _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 25 ) ;
2019-04-03 23:34:07 +02:00
/* harmony import */ var constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( 1 ) ;
2019-03-14 19:39:39 +01:00
var _handleActions ;
2019-04-03 23:34:07 +02:00
function _objectSpread ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] != null ? arguments [ i ] : { } ; var ownKeys = Object . keys ( source ) ; if ( typeof Object . getOwnPropertySymbols === 'function' ) { ownKeys = ownKeys . concat ( Object . getOwnPropertySymbols ( source ) . filter ( function ( sym ) { return Object . getOwnPropertyDescriptor ( source , sym ) . enumerable ; } ) ) ; } ownKeys . forEach ( function ( key ) { _defineProperty ( target , key , source [ key ] ) ; } ) ; } return target ; }
2019-03-14 19:39:39 +01:00
2019-04-03 23:34:07 +02:00
function _defineProperty ( obj , key , value ) { if ( key in obj ) { Object . defineProperty ( obj , key , { value : value , enumerable : true , configurable : true , writable : true } ) ; } else { obj [ key ] = value ; } return obj ; }
2019-03-14 19:39:39 +01:00
var defaultState = {
fetchingViewCount : false ,
viewCountError : undefined ,
2019-09-25 04:30:53 +02:00
viewCountById : { } ,
fetchingSubCount : false ,
subCountError : undefined ,
subCountById : { }
2019-03-14 19:39:39 +01:00
} ;
2019-04-03 23:34:07 +02:00
var statsReducer = Object ( util _redux _utils _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "handleActions" ] ) ( ( _handleActions = { } , _defineProperty ( _handleActions , constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "FETCH_VIEW_COUNT_STARTED" ] , function ( state ) {
return _objectSpread ( { } , state , {
fetchingViewCount : true
} ) ;
} ) , _defineProperty ( _handleActions , constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "FETCH_VIEW_COUNT_FAILED" ] , function ( state , action ) {
return _objectSpread ( { } , state , {
2019-03-14 19:39:39 +01:00
viewCountError : action . data
} ) ;
2019-04-03 23:34:07 +02:00
} ) , _defineProperty ( _handleActions , constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "FETCH_VIEW_COUNT_COMPLETED" ] , function ( state , action ) {
2019-03-14 19:39:39 +01:00
var _action$data = action . data ,
claimId = _action$data . claimId ,
viewCount = _action$data . viewCount ;
2019-04-03 23:34:07 +02:00
var viewCountById = _objectSpread ( { } , state . viewCountById , _defineProperty ( { } , claimId , viewCount ) ) ;
2019-03-14 19:39:39 +01:00
2019-04-03 23:34:07 +02:00
return _objectSpread ( { } , state , {
2019-03-14 19:39:39 +01:00
fetchingViewCount : false ,
viewCountById : viewCountById
} ) ;
2019-09-25 04:30:53 +02:00
} ) , _defineProperty ( _handleActions , constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "FETCH_SUB_COUNT_STARTED" ] , function ( state ) {
return _objectSpread ( { } , state , {
fetchingSubCount : true
} ) ;
} ) , _defineProperty ( _handleActions , constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "FETCH_SUB_COUNT_FAILED" ] , function ( state , action ) {
return _objectSpread ( { } , state , {
subCountError : action . data
} ) ;
} ) , _defineProperty ( _handleActions , constants _action _types _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "FETCH_SUB_COUNT_COMPLETED" ] , function ( state , action ) {
var _action$data2 = action . data ,
claimId = _action$data2 . claimId ,
subCount = _action$data2 . subCount ;
var subCountById = _objectSpread ( { } , state . subCountById , _defineProperty ( { } , claimId , subCount ) ) ;
return _objectSpread ( { } , state , {
fetchingSubCount : false ,
subCountById : subCountById
} ) ;
2019-03-14 19:39:39 +01:00
} ) , _handleActions ) , defaultState ) ;
/***/ } ) ,
2020-10-24 02:49:02 +02:00
/* 30 */
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "syncReducer" , function ( ) { return syncReducer ; } ) ;
/* harmony import */ var constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 1 ) ;
var reducers = { } ;
var defaultState = {
hasSyncedWallet : false ,
syncHash : null ,
syncData : null ,
setSyncErrorMessage : null ,
getSyncErrorMessage : null ,
syncApplyErrorMessage : '' ,
syncApplyIsPending : false ,
syncApplyPasswordError : false ,
getSyncIsPending : false ,
setSyncIsPending : false ,
hashChanged : false
} ;
reducers [ constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "GET_SYNC_STARTED" ] ] = function ( state ) {
return Object . assign ( { } , state , {
getSyncIsPending : true ,
getSyncErrorMessage : null
} ) ;
} ;
reducers [ constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "GET_SYNC_COMPLETED" ] ] = function ( state , action ) {
return Object . assign ( { } , state , {
syncHash : action . data . syncHash ,
syncData : action . data . syncData ,
hasSyncedWallet : action . data . hasSyncedWallet ,
getSyncIsPending : false ,
hashChanged : action . data . hashChanged
} ) ;
} ;
reducers [ constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "GET_SYNC_FAILED" ] ] = function ( state , action ) {
return Object . assign ( { } , state , {
getSyncIsPending : false ,
getSyncErrorMessage : action . data . error
} ) ;
} ;
reducers [ constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "SET_SYNC_STARTED" ] ] = function ( state ) {
return Object . assign ( { } , state , {
setSyncIsPending : true ,
setSyncErrorMessage : null
} ) ;
} ;
reducers [ constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "SET_SYNC_FAILED" ] ] = function ( state , action ) {
return Object . assign ( { } , state , {
setSyncIsPending : false ,
setSyncErrorMessage : action . data . error
} ) ;
} ;
reducers [ constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "SET_SYNC_COMPLETED" ] ] = function ( state , action ) {
return Object . assign ( { } , state , {
setSyncIsPending : false ,
setSyncErrorMessage : null ,
hasSyncedWallet : true ,
// sync was successful, so the user has a synced wallet at this point
syncHash : action . data . syncHash
} ) ;
} ;
reducers [ constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "SYNC_APPLY_STARTED" ] ] = function ( state ) {
return Object . assign ( { } , state , {
syncApplyPasswordError : false ,
syncApplyIsPending : true ,
syncApplyErrorMessage : ''
} ) ;
} ;
reducers [ constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "SYNC_APPLY_COMPLETED" ] ] = function ( state ) {
return Object . assign ( { } , state , {
syncApplyIsPending : false ,
syncApplyErrorMessage : ''
} ) ;
} ;
reducers [ constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "SYNC_APPLY_FAILED" ] ] = function ( state , action ) {
return Object . assign ( { } , state , {
syncApplyIsPending : false ,
syncApplyErrorMessage : action . data . error
} ) ;
} ;
reducers [ constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "SYNC_APPLY_BAD_PASSWORD" ] ] = function ( state ) {
return Object . assign ( { } , state , {
syncApplyPasswordError : true
} ) ;
} ;
reducers [ constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "SYNC_RESET" ] ] = function ( ) {
return defaultState ;
} ;
function syncReducer ( ) {
var state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : defaultState ;
var action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
var handler = reducers [ action . type ] ;
if ( handler ) return handler ( state , action ) ;
return state ;
}
/***/ } ) ,
/* 31 */
2019-10-22 21:21:42 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
2020-05-07 19:56:10 +02:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "webReducer" , function ( ) { return webReducer ; } ) ;
2019-10-22 21:21:42 +02:00
/* harmony import */ var constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 1 ) ;
function _objectSpread ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] != null ? arguments [ i ] : { } ; var ownKeys = Object . keys ( source ) ; if ( typeof Object . getOwnPropertySymbols === 'function' ) { ownKeys = ownKeys . concat ( Object . getOwnPropertySymbols ( source ) . filter ( function ( sym ) { return Object . getOwnPropertyDescriptor ( source , sym ) . enumerable ; } ) ) ; } ownKeys . forEach ( function ( key ) { _defineProperty ( target , key , source [ key ] ) ; } ) ; } return target ; }
function _defineProperty ( obj , key , value ) { if ( key in obj ) { Object . defineProperty ( obj , key , { value : value , enumerable : true , configurable : true , writable : true } ) ; } else { obj [ key ] = value ; } return obj ; }
/ *
test mock :
currentUploads : {
'test#upload' : {
progress : 50 ,
params : {
name : 'steve' ,
thumbnail _url : 'https://dev2.spee.ch/4/KMNtoSZ009fawGz59VG8PrID.jpeg' ,
} ,
} ,
} ,
* /
var reducers = { } ;
var defaultState = {
currentUploads : { }
} ;
reducers [ constants _action _types _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "UPDATE_UPLOAD_PROGRESS" ] ] = function ( state , action ) {
var _action$data = action . data ,
progress = _action$data . progress ,
params = _action$data . params ,
xhr = _action$data . xhr ;
var key = params . channel ? "" . concat ( params . name , "#" ) . concat ( params . channel ) : "" . concat ( params . name , "#anonymous" ) ;
var currentUploads ;
if ( ! progress ) {
currentUploads = Object . assign ( { } , state . currentUploads ) ;
Object . keys ( currentUploads ) . forEach ( function ( k ) {
if ( k === key ) {
delete currentUploads [ key ] ;
}
} ) ;
} else {
currentUploads = Object . assign ( { } , state . currentUploads ) ;
currentUploads [ key ] = {
progress : progress ,
params : params ,
xhr : xhr
} ;
}
return _objectSpread ( { } , state , {
currentUploads : currentUploads
} ) ;
} ;
2020-05-07 19:56:10 +02:00
function webReducer ( ) {
2019-10-22 21:21:42 +02:00
var state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : defaultState ;
var action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
var handler = reducers [ action . type ] ;
if ( handler ) return handler ( state , action ) ;
return state ;
}
/***/ } ) ,
2020-10-24 02:49:02 +02:00
/* 32 */
2019-04-03 23:34:07 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2019-03-13 06:06:43 +01:00
"use strict" ;
2019-04-03 23:34:07 +02:00
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectAuthToken" , function ( ) { return selectAuthToken ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectIsAuthenticating" , function ( ) { return selectIsAuthenticating ; } ) ;
2020-10-24 02:49:02 +02:00
/* harmony import */ var reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 33 ) ;
2019-04-03 23:34:07 +02:00
/* harmony import */ var reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
2019-03-13 06:06:43 +01:00
var selectState = function selectState ( state ) {
return state . auth || { } ;
} ;
2019-04-03 23:34:07 +02:00
var selectAuthToken = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectState , function ( state ) {
2019-03-13 06:06:43 +01:00
return state . authToken ;
} ) ;
2019-04-03 23:34:07 +02:00
var selectIsAuthenticating = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectState , function ( state ) {
2019-03-13 06:06:43 +01:00
return state . authenticating ;
} ) ;
2019-03-11 03:02:17 +01:00
/***/ } ) ,
2020-10-24 02:49:02 +02:00
/* 33 */
2020-06-15 22:29:48 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
exports . _ _esModule = true ;
exports . defaultMemoize = defaultMemoize ;
exports . createSelectorCreator = createSelectorCreator ;
exports . createStructuredSelector = createStructuredSelector ;
function defaultEqualityCheck ( a , b ) {
return a === b ;
}
function areArgumentsShallowlyEqual ( equalityCheck , prev , next ) {
if ( prev === null || next === null || prev . length !== next . length ) {
return false ;
}
// Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.
var length = prev . length ;
for ( var i = 0 ; i < length ; i ++ ) {
if ( ! equalityCheck ( prev [ i ] , next [ i ] ) ) {
return false ;
}
}
return true ;
}
function defaultMemoize ( func ) {
var equalityCheck = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : defaultEqualityCheck ;
var lastArgs = null ;
var lastResult = null ;
// we reference arguments instead of spreading them for performance reasons
return function ( ) {
if ( ! areArgumentsShallowlyEqual ( equalityCheck , lastArgs , arguments ) ) {
// apply arguments instead of spreading for performance.
lastResult = func . apply ( null , arguments ) ;
}
lastArgs = arguments ;
return lastResult ;
} ;
}
function getDependencies ( funcs ) {
var dependencies = Array . isArray ( funcs [ 0 ] ) ? funcs [ 0 ] : funcs ;
if ( ! dependencies . every ( function ( dep ) {
return typeof dep === 'function' ;
} ) ) {
var dependencyTypes = dependencies . map ( function ( dep ) {
return typeof dep ;
} ) . join ( ', ' ) ;
throw new Error ( 'Selector creators expect all input-selectors to be functions, ' + ( 'instead received the following types: [' + dependencyTypes + ']' ) ) ;
}
return dependencies ;
}
function createSelectorCreator ( memoize ) {
for ( var _len = arguments . length , memoizeOptions = Array ( _len > 1 ? _len - 1 : 0 ) , _key = 1 ; _key < _len ; _key ++ ) {
memoizeOptions [ _key - 1 ] = arguments [ _key ] ;
}
return function ( ) {
for ( var _len2 = arguments . length , funcs = Array ( _len2 ) , _key2 = 0 ; _key2 < _len2 ; _key2 ++ ) {
funcs [ _key2 ] = arguments [ _key2 ] ;
}
var recomputations = 0 ;
var resultFunc = funcs . pop ( ) ;
var dependencies = getDependencies ( funcs ) ;
var memoizedResultFunc = memoize . apply ( undefined , [ function ( ) {
recomputations ++ ;
// apply arguments instead of spreading for performance.
return resultFunc . apply ( null , arguments ) ;
} ] . concat ( memoizeOptions ) ) ;
// If a selector is called with the exact same arguments we don't need to traverse our dependencies again.
var selector = defaultMemoize ( function ( ) {
var params = [ ] ;
var length = dependencies . length ;
for ( var i = 0 ; i < length ; i ++ ) {
// apply arguments instead of spreading and mutate a local list of params for performance.
params . push ( dependencies [ i ] . apply ( null , arguments ) ) ;
}
// apply arguments instead of spreading for performance.
return memoizedResultFunc . apply ( null , params ) ;
} ) ;
selector . resultFunc = resultFunc ;
selector . recomputations = function ( ) {
return recomputations ;
} ;
selector . resetRecomputations = function ( ) {
return recomputations = 0 ;
} ;
return selector ;
} ;
}
var createSelector = exports . createSelector = createSelectorCreator ( defaultMemoize ) ;
function createStructuredSelector ( selectors ) {
var selectorCreator = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : createSelector ;
if ( typeof selectors !== 'object' ) {
throw new Error ( 'createStructuredSelector expects first argument to be an object ' + ( 'where each property is a selector, instead received a ' + typeof selectors ) ) ;
}
var objectKeys = Object . keys ( selectors ) ;
return selectorCreator ( objectKeys . map ( function ( key ) {
return selectors [ key ] ;
} ) , function ( ) {
for ( var _len3 = arguments . length , values = Array ( _len3 ) , _key3 = 0 ; _key3 < _len3 ; _key3 ++ ) {
values [ _key3 ] = arguments [ _key3 ] ;
}
return values . reduce ( function ( composition , value , index ) {
composition [ objectKeys [ index ] ] = value ;
return composition ;
} , { } ) ;
} ) ;
}
/***/ } ) ,
2020-10-24 02:49:02 +02:00
/* 34 */
2019-04-03 23:34:07 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2019-03-11 03:02:17 +01:00
"use strict" ;
2019-04-03 23:34:07 +02:00
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectState" , function ( ) { return selectState ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectAllCostInfoByUri" , function ( ) { return selectAllCostInfoByUri ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "makeSelectCostInfoForUri" , function ( ) { return makeSelectCostInfoForUri ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectFetchingCostInfo" , function ( ) { return selectFetchingCostInfo ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "makeSelectFetchingCostInfoForUri" , function ( ) { return makeSelectFetchingCostInfoForUri ; } ) ;
2020-10-24 02:49:02 +02:00
/* harmony import */ var reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 33 ) ;
2019-04-03 23:34:07 +02:00
/* harmony import */ var reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
2019-03-11 03:02:17 +01:00
2019-04-03 23:34:07 +02:00
var selectState = function selectState ( state ) {
2019-03-11 03:02:17 +01:00
return state . costInfo || { } ;
} ;
2019-04-03 23:34:07 +02:00
var selectAllCostInfoByUri = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectState , function ( state ) {
2019-03-11 03:02:17 +01:00
return state . byUri || { } ;
} ) ;
2019-04-03 23:34:07 +02:00
var makeSelectCostInfoForUri = function makeSelectCostInfoForUri ( uri ) {
return Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectAllCostInfoByUri , function ( costInfos ) {
2019-03-11 03:02:17 +01:00
return costInfos && costInfos [ uri ] ;
} ) ;
} ;
2019-04-03 23:34:07 +02:00
var selectFetchingCostInfo = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectState , function ( state ) {
2019-03-11 03:02:17 +01:00
return state . fetching || { } ;
} ) ;
2019-04-03 23:34:07 +02:00
var makeSelectFetchingCostInfoForUri = function makeSelectFetchingCostInfoForUri ( uri ) {
return Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectFetchingCostInfo , function ( fetchingByUri ) {
2019-03-11 03:02:17 +01:00
return fetchingByUri && fetchingByUri [ uri ] ;
} ) ;
} ;
/***/ } ) ,
2020-10-24 02:49:02 +02:00
/* 35 */
2019-04-03 23:34:07 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2019-03-11 03:02:17 +01:00
"use strict" ;
2019-04-03 23:34:07 +02:00
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectState" , function ( ) { return selectState ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectBlackListedOutpoints" , function ( ) { return selectBlackListedOutpoints ; } ) ;
2020-08-13 19:53:49 +02:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectBlacklistedOutpointMap" , function ( ) { return selectBlacklistedOutpointMap ; } ) ;
2020-10-24 02:49:02 +02:00
/* harmony import */ var reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 33 ) ;
2019-04-03 23:34:07 +02:00
/* harmony import */ var reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
2020-08-13 19:53:49 +02:00
function _objectSpread ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] != null ? arguments [ i ] : { } ; var ownKeys = Object . keys ( source ) ; if ( typeof Object . getOwnPropertySymbols === 'function' ) { ownKeys = ownKeys . concat ( Object . getOwnPropertySymbols ( source ) . filter ( function ( sym ) { return Object . getOwnPropertyDescriptor ( source , sym ) . enumerable ; } ) ) ; } ownKeys . forEach ( function ( key ) { _defineProperty ( target , key , source [ key ] ) ; } ) ; } return target ; }
function _defineProperty ( obj , key , value ) { if ( key in obj ) { Object . defineProperty ( obj , key , { value : value , enumerable : true , configurable : true , writable : true } ) ; } else { obj [ key ] = value ; } return obj ; }
2019-03-11 03:02:17 +01:00
2019-04-03 23:34:07 +02:00
var selectState = function selectState ( state ) {
2019-03-11 03:02:17 +01:00
return state . blacklist || { } ;
} ;
2019-04-03 23:34:07 +02:00
var selectBlackListedOutpoints = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectState , function ( state ) {
2019-03-11 03:02:17 +01:00
return state . blackListedOutpoints ;
} ) ;
2020-08-13 19:53:49 +02:00
var selectBlacklistedOutpointMap = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectBlackListedOutpoints , function ( outpoints ) {
2020-08-17 21:54:03 +02:00
return outpoints ? outpoints . reduce ( function ( acc , val ) {
2020-08-13 19:53:49 +02:00
var outpoint = "" . concat ( val . txid , ":" ) . concat ( val . nout ) ;
return _objectSpread ( { } , acc , _defineProperty ( { } , outpoint , 1 ) ) ;
2020-08-17 21:54:03 +02:00
} , { } ) : { } ;
2020-08-13 19:53:49 +02:00
} ) ;
2019-03-11 03:02:17 +01:00
/***/ } ) ,
2020-10-24 02:49:02 +02:00
/* 36 */
2019-07-09 16:20:01 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectState" , function ( ) { return selectState ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectFilteredOutpoints" , function ( ) { return selectFilteredOutpoints ; } ) ;
2020-08-13 19:53:49 +02:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectFilteredOutpointMap" , function ( ) { return selectFilteredOutpointMap ; } ) ;
2020-10-24 02:49:02 +02:00
/* harmony import */ var reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 33 ) ;
2019-07-09 16:20:01 +02:00
/* harmony import */ var reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
2020-08-13 19:53:49 +02:00
function _objectSpread ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] != null ? arguments [ i ] : { } ; var ownKeys = Object . keys ( source ) ; if ( typeof Object . getOwnPropertySymbols === 'function' ) { ownKeys = ownKeys . concat ( Object . getOwnPropertySymbols ( source ) . filter ( function ( sym ) { return Object . getOwnPropertyDescriptor ( source , sym ) . enumerable ; } ) ) ; } ownKeys . forEach ( function ( key ) { _defineProperty ( target , key , source [ key ] ) ; } ) ; } return target ; }
function _defineProperty ( obj , key , value ) { if ( key in obj ) { Object . defineProperty ( obj , key , { value : value , enumerable : true , configurable : true , writable : true } ) ; } else { obj [ key ] = value ; } return obj ; }
2019-07-09 16:20:01 +02:00
var selectState = function selectState ( state ) {
return state . filtered || { } ;
} ;
var selectFilteredOutpoints = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectState , function ( state ) {
return state . filteredOutpoints ;
} ) ;
2020-08-13 19:53:49 +02:00
var selectFilteredOutpointMap = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectFilteredOutpoints , function ( outpoints ) {
2020-08-17 21:54:03 +02:00
return outpoints ? outpoints . reduce ( function ( acc , val ) {
2020-08-13 19:53:49 +02:00
var outpoint = "" . concat ( val . txid , ":" ) . concat ( val . nout ) ;
return _objectSpread ( { } , acc , _defineProperty ( { } , outpoint , 1 ) ) ;
2020-08-17 21:54:03 +02:00
} , { } ) : { } ;
2020-08-13 19:53:49 +02:00
} ) ;
2019-07-09 16:20:01 +02:00
/***/ } ) ,
2020-10-24 02:49:02 +02:00
/* 37 */
2019-04-03 23:34:07 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2019-03-11 03:02:17 +01:00
"use strict" ;
2019-04-03 23:34:07 +02:00
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectFeaturedUris" , function ( ) { return selectFeaturedUris ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectFetchingFeaturedUris" , function ( ) { return selectFetchingFeaturedUris ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectTrendingUris" , function ( ) { return selectTrendingUris ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectFetchingTrendingUris" , function ( ) { return selectFetchingTrendingUris ; } ) ;
2020-10-24 02:49:02 +02:00
/* harmony import */ var reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 33 ) ;
2019-04-03 23:34:07 +02:00
/* harmony import */ var reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
2019-03-11 03:02:17 +01:00
2019-03-13 06:06:43 +01:00
var selectState = function selectState ( state ) {
return state . homepage || { } ;
} ;
2019-03-11 03:02:17 +01:00
2019-04-03 23:34:07 +02:00
var selectFeaturedUris = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectState , function ( state ) {
2019-03-13 06:06:43 +01:00
return state . featuredUris ;
} ) ;
2019-04-03 23:34:07 +02:00
var selectFetchingFeaturedUris = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectState , function ( state ) {
2019-03-13 06:06:43 +01:00
return state . fetchingFeaturedContent ;
} ) ;
2019-04-03 23:34:07 +02:00
var selectTrendingUris = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectState , function ( state ) {
2019-03-13 06:06:43 +01:00
return state . trendingUris ;
} ) ;
2019-04-03 23:34:07 +02:00
var selectFetchingTrendingUris = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectState , function ( state ) {
2019-03-13 06:06:43 +01:00
return state . fetchingTrendingContent ;
} ) ;
2019-03-11 03:02:17 +01:00
/***/ } ) ,
2020-10-24 02:49:02 +02:00
/* 38 */
2019-04-03 23:34:07 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2019-03-14 19:39:39 +01:00
"use strict" ;
2019-04-03 23:34:07 +02:00
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectViewCount" , function ( ) { return selectViewCount ; } ) ;
2019-09-25 04:30:53 +02:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectSubCount" , function ( ) { return selectSubCount ; } ) ;
2019-04-03 23:34:07 +02:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "makeSelectViewCountForUri" , function ( ) { return makeSelectViewCountForUri ; } ) ;
2019-09-25 04:30:53 +02:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "makeSelectSubCountForUri" , function ( ) { return makeSelectSubCountForUri ; } ) ;
2020-10-24 02:49:02 +02:00
/* harmony import */ var reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 33 ) ;
2019-04-03 23:34:07 +02:00
/* harmony import */ var reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
2020-01-10 04:28:46 +01:00
/* harmony import */ var lbry _redux _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( 5 ) ;
2019-04-03 23:34:07 +02:00
/* harmony import */ var lbry _redux _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( lbry _redux _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
2019-03-14 19:39:39 +01:00
var selectState = function selectState ( state ) {
return state . stats || { } ;
} ;
2019-04-03 23:34:07 +02:00
var selectViewCount = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectState , function ( state ) {
2019-03-14 19:39:39 +01:00
return state . viewCountById ;
} ) ;
2019-09-25 04:30:53 +02:00
var selectSubCount = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectState , function ( state ) {
return state . subCountById ;
} ) ;
2019-04-03 23:34:07 +02:00
var makeSelectViewCountForUri = function makeSelectViewCountForUri ( uri ) {
return Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( Object ( lbry _redux _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "makeSelectClaimForUri" ] ) ( uri ) , selectViewCount , function ( claim , viewCountById ) {
2019-12-20 08:45:03 +01:00
return claim ? viewCountById [ claim . claim _id ] || 0 : 0 ;
2019-03-14 19:39:39 +01:00
} ) ;
} ;
2019-09-25 04:30:53 +02:00
var makeSelectSubCountForUri = function makeSelectSubCountForUri ( uri ) {
return Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( Object ( lbry _redux _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "makeSelectClaimForUri" ] ) ( uri ) , selectSubCount , function ( claim , subCountById ) {
2019-12-20 08:45:03 +01:00
return claim ? subCountById [ claim . claim _id ] || 0 : 0 ;
2019-09-25 04:30:53 +02:00
} ) ;
} ;
2019-03-14 19:39:39 +01:00
2019-04-18 10:02:11 +02:00
/***/ } ) ,
2020-10-24 02:49:02 +02:00
/* 39 */
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectHasSyncedWallet" , function ( ) { return selectHasSyncedWallet ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectSyncHash" , function ( ) { return selectSyncHash ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectSyncData" , function ( ) { return selectSyncData ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectSetSyncErrorMessage" , function ( ) { return selectSetSyncErrorMessage ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectGetSyncErrorMessage" , function ( ) { return selectGetSyncErrorMessage ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectGetSyncIsPending" , function ( ) { return selectGetSyncIsPending ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectSetSyncIsPending" , function ( ) { return selectSetSyncIsPending ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectHashChanged" , function ( ) { return selectHashChanged ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectSyncApplyIsPending" , function ( ) { return selectSyncApplyIsPending ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectSyncApplyErrorMessage" , function ( ) { return selectSyncApplyErrorMessage ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectSyncApplyPasswordError" , function ( ) { return selectSyncApplyPasswordError ; } ) ;
/* harmony import */ var reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 33 ) ;
/* harmony import */ var reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
var selectState = function selectState ( state ) {
return state . sync || { } ;
} ;
var selectHasSyncedWallet = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectState , function ( state ) {
return state . hasSyncedWallet ;
} ) ;
var selectSyncHash = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectState , function ( state ) {
return state . syncHash ;
} ) ;
var selectSyncData = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectState , function ( state ) {
return state . syncData ;
} ) ;
var selectSetSyncErrorMessage = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectState , function ( state ) {
return state . setSyncErrorMessage ;
} ) ;
var selectGetSyncErrorMessage = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectState , function ( state ) {
return state . getSyncErrorMessage ;
} ) ;
var selectGetSyncIsPending = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectState , function ( state ) {
return state . getSyncIsPending ;
} ) ;
var selectSetSyncIsPending = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectState , function ( state ) {
return state . setSyncIsPending ;
} ) ;
var selectHashChanged = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectState , function ( state ) {
return state . hashChanged ;
} ) ;
var selectSyncApplyIsPending = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectState , function ( state ) {
return state . syncApplyIsPending ;
} ) ;
var selectSyncApplyErrorMessage = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectState , function ( state ) {
return state . syncApplyErrorMessage ;
} ) ;
var selectSyncApplyPasswordError = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectState , function ( state ) {
return state . syncApplyPasswordError ;
} ) ;
/***/ } ) ,
/* 40 */
2019-10-22 21:21:42 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectCurrentUploads" , function ( ) { return selectCurrentUploads ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "selectUploadCount" , function ( ) { return selectUploadCount ; } ) ;
2020-10-24 02:49:02 +02:00
/* harmony import */ var reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 33 ) ;
2019-10-22 21:21:42 +02:00
/* harmony import */ var reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
var selectState = function selectState ( state ) {
2020-05-07 19:56:10 +02:00
return state . web || { } ;
2019-10-22 21:21:42 +02:00
} ;
var selectCurrentUploads = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectState , function ( state ) {
return state . currentUploads ;
} ) ;
var selectUploadCount = Object ( reselect _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createSelector" ] ) ( selectCurrentUploads , function ( currentUploads ) {
return currentUploads && Object . keys ( currentUploads ) . length ;
} ) ;
2018-07-23 15:12:18 +02:00
/***/ } )
/******/ ] ) ;
} ) ;