2018-07-23 15:12:18 +02:00
( function webpackUniversalModuleDefinition ( root , factory ) {
if ( typeof exports === 'object' && typeof module === 'object' )
module . exports = factory ( ) ;
else if ( typeof define === 'function' && define . amd )
define ( [ ] , factory ) ;
else {
var a = factory ( ) ;
for ( var i in a ) ( typeof exports === 'object' ? exports : root ) [ i ] = a [ i ] ;
}
} ) ( window , function ( ) {
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 */
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
2018-07-23 16:12:22 +02:00
value : true
2018-07-23 15:12:18 +02:00
} ) ;
2018-09-18 23:56:12 +02:00
exports . selectUserInviteNewErrorMessage = exports . selectUserInviteNewIsPending = exports . selectUserInviteStatusFailed = exports . selectUserInvitees = exports . selectUserInvitesRemaining = exports . selectUserInviteStatusIsPending = exports . selectAccessToken = exports . selectUserIsVerificationCandidate = exports . selectIdentityVerifyErrorMessage = exports . selectIdentityVerifyIsPending = exports . selectPhoneVerifyIsPending = exports . selectPhoneVerifyErrorMessage = exports . selectEmailVerifyErrorMessage = exports . selectEmailVerifyIsPending = exports . selectPhoneNewIsPending = exports . selectPhoneNewErrorMessage = exports . selectEmailNewErrorMessage = exports . selectEmailNewIsPending = exports . selectUserIsRewardApproved = exports . selectPhoneToVerify = exports . selectEmailToVerify = exports . selectUserCountryCode = exports . selectUserPhone = exports . selectUserEmail = exports . selectUser = exports . selectUserIsPending = exports . selectAuthenticationIsPending = exports . selectRewardContentClaimIds = exports . selectRewardByType = exports . selectClaimRewardError = exports . selectClaimErrorsByType = exports . selectIsClaimRewardPending = exports . selectClaimsPendingByType = exports . selectUnclaimedRewardValue = exports . selectFetchingRewards = exports . selectUnclaimedRewards = exports . selectClaimedRewardsByTransactionId = exports . selectClaimedRewards = exports . selectClaimedRewardsById = exports . selectUnclaimedRewardsByType = exports . makeSelectRewardByType = exports . makeSelectRewardAmountByType = exports . makeSelectIsRewardClaimPending = exports . makeSelectClaimRewardError = exports . selectIsAuthenticating = exports . selectAuthToken = exports . userReducer = exports . rewardsReducer = exports . authReducer = exports . doUserInviteNew = exports . doUserIdentityVerify = exports . doUserResendVerificationEmail = exports . doFetchAccessToken = exports . doUserPhoneVerify = exports . doUserPhoneVerifyFailure = exports . doUserPhoneReset = exports . doUserPhoneNew = exports . doUserEmailVerify = exports . doUserEmailVerifyFailure = exports . doUserEmailToVerify = exports . doUserEmailNew = exports . doUserFetch = exports . doAuthenticate = exports . doInstallNew = exports . doFetchInviteStatus = exports . doFetchRewardedContent = exports . doClaimRewardClearError = exports . doClaimEligiblePurchaseRewards = exports . doClaimRewardType = exports . doRewardList = exports . doGenerateAuthToken = exports . rewards = exports . Lbryio = exports . LBRYINC _ACTIONS = undefined ;
2018-07-23 15:12:18 +02:00
2018-07-23 16:12:22 +02:00
var _auth = _ _webpack _require _ _ ( 1 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'doGenerateAuthToken' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _auth . doGenerateAuthToken ;
}
2018-07-23 15:12:18 +02:00
} ) ;
2018-12-04 17:08:20 +01:00
var _rewards = _ _webpack _require _ _ ( 8 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'doRewardList' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _rewards . doRewardList ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'doClaimRewardType' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _rewards . doClaimRewardType ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'doClaimEligiblePurchaseRewards' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _rewards . doClaimEligiblePurchaseRewards ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'doClaimRewardClearError' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _rewards . doClaimRewardClearError ;
}
2018-07-23 15:12:18 +02:00
} ) ;
2018-09-04 06:15:53 +02:00
Object . defineProperty ( exports , 'doFetchRewardedContent' , {
enumerable : true ,
get : function get ( ) {
return _rewards . doFetchRewardedContent ;
}
} ) ;
2018-07-23 15:12:18 +02:00
2018-12-04 17:08:20 +01:00
var _user = _ _webpack _require _ _ ( 13 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'doFetchInviteStatus' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user . doFetchInviteStatus ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'doInstallNew' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user . doInstallNew ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'doAuthenticate' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user . doAuthenticate ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'doUserFetch' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user . doUserFetch ;
}
2018-07-23 15:12:18 +02:00
} ) ;
2018-08-17 20:10:52 +02:00
Object . defineProperty ( exports , 'doUserEmailNew' , {
enumerable : true ,
get : function get ( ) {
return _user . doUserEmailNew ;
}
} ) ;
Object . defineProperty ( exports , 'doUserEmailToVerify' , {
enumerable : true ,
get : function get ( ) {
return _user . doUserEmailToVerify ;
}
} ) ;
Object . defineProperty ( exports , 'doUserEmailVerifyFailure' , {
enumerable : true ,
get : function get ( ) {
return _user . doUserEmailVerifyFailure ;
}
} ) ;
Object . defineProperty ( exports , 'doUserEmailVerify' , {
enumerable : true ,
get : function get ( ) {
return _user . doUserEmailVerify ;
}
} ) ;
2018-08-31 21:51:00 +02:00
Object . defineProperty ( exports , 'doUserPhoneNew' , {
enumerable : true ,
get : function get ( ) {
return _user . doUserPhoneNew ;
}
} ) ;
Object . defineProperty ( exports , 'doUserPhoneReset' , {
enumerable : true ,
get : function get ( ) {
return _user . doUserPhoneReset ;
}
} ) ;
Object . defineProperty ( exports , 'doUserPhoneVerifyFailure' , {
enumerable : true ,
get : function get ( ) {
return _user . doUserPhoneVerifyFailure ;
}
} ) ;
Object . defineProperty ( exports , 'doUserPhoneVerify' , {
enumerable : true ,
get : function get ( ) {
return _user . doUserPhoneVerify ;
}
} ) ;
2018-08-17 20:10:52 +02:00
Object . defineProperty ( exports , 'doFetchAccessToken' , {
enumerable : true ,
get : function get ( ) {
return _user . doFetchAccessToken ;
}
} ) ;
2018-09-18 23:56:12 +02:00
Object . defineProperty ( exports , 'doUserResendVerificationEmail' , {
enumerable : true ,
get : function get ( ) {
return _user . doUserResendVerificationEmail ;
}
} ) ;
Object . defineProperty ( exports , 'doUserIdentityVerify' , {
enumerable : true ,
get : function get ( ) {
return _user . doUserIdentityVerify ;
}
} ) ;
Object . defineProperty ( exports , 'doUserInviteNew' , {
enumerable : true ,
get : function get ( ) {
return _user . doUserInviteNew ;
}
} ) ;
2018-07-23 15:12:18 +02:00
2018-12-04 17:08:20 +01:00
var _auth2 = _ _webpack _require _ _ ( 14 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'authReducer' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _auth2 . authReducer ;
}
2018-07-23 15:12:18 +02:00
} ) ;
2018-12-04 17:08:20 +01:00
var _rewards2 = _ _webpack _require _ _ ( 15 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'rewardsReducer' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _rewards2 . rewardsReducer ;
}
2018-07-23 15:12:18 +02:00
} ) ;
2018-12-04 17:08:20 +01:00
var _user2 = _ _webpack _require _ _ ( 16 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'userReducer' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user2 . userReducer ;
}
2018-07-23 15:12:18 +02:00
} ) ;
2018-12-04 17:08:20 +01:00
var _auth3 = _ _webpack _require _ _ ( 17 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'selectAuthToken' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _auth3 . selectAuthToken ;
}
2018-07-23 15:12:18 +02:00
} ) ;
2018-08-17 20:10:52 +02:00
Object . defineProperty ( exports , 'selectIsAuthenticating' , {
enumerable : true ,
get : function get ( ) {
return _auth3 . selectIsAuthenticating ;
}
} ) ;
2018-07-23 15:12:18 +02:00
2018-12-04 17:08:20 +01:00
var _rewards3 = _ _webpack _require _ _ ( 9 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'makeSelectClaimRewardError' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _rewards3 . makeSelectClaimRewardError ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'makeSelectIsRewardClaimPending' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _rewards3 . makeSelectIsRewardClaimPending ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'makeSelectRewardAmountByType' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _rewards3 . makeSelectRewardAmountByType ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'makeSelectRewardByType' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _rewards3 . makeSelectRewardByType ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectUnclaimedRewardsByType' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _rewards3 . selectUnclaimedRewardsByType ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectClaimedRewardsById' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _rewards3 . selectClaimedRewardsById ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectClaimedRewards' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _rewards3 . selectClaimedRewards ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectClaimedRewardsByTransactionId' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _rewards3 . selectClaimedRewardsByTransactionId ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectUnclaimedRewards' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _rewards3 . selectUnclaimedRewards ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectFetchingRewards' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _rewards3 . selectFetchingRewards ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectUnclaimedRewardValue' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _rewards3 . selectUnclaimedRewardValue ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectClaimsPendingByType' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _rewards3 . selectClaimsPendingByType ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectIsClaimRewardPending' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _rewards3 . selectIsClaimRewardPending ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectClaimErrorsByType' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _rewards3 . selectClaimErrorsByType ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectClaimRewardError' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _rewards3 . selectClaimRewardError ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectRewardByType' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _rewards3 . selectRewardByType ;
}
2018-07-23 15:12:18 +02:00
} ) ;
2018-09-04 06:15:53 +02:00
Object . defineProperty ( exports , 'selectRewardContentClaimIds' , {
enumerable : true ,
get : function get ( ) {
return _rewards3 . selectRewardContentClaimIds ;
}
} ) ;
2018-07-23 15:12:18 +02:00
2018-12-04 17:08:20 +01:00
var _user3 = _ _webpack _require _ _ ( 11 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'selectAuthenticationIsPending' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user3 . selectAuthenticationIsPending ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectUserIsPending' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user3 . selectUserIsPending ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectUser' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user3 . selectUser ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectUserEmail' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user3 . selectUserEmail ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectUserPhone' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user3 . selectUserPhone ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectUserCountryCode' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user3 . selectUserCountryCode ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectEmailToVerify' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user3 . selectEmailToVerify ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectPhoneToVerify' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user3 . selectPhoneToVerify ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectUserIsRewardApproved' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user3 . selectUserIsRewardApproved ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectEmailNewIsPending' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user3 . selectEmailNewIsPending ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectEmailNewErrorMessage' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user3 . selectEmailNewErrorMessage ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectPhoneNewErrorMessage' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user3 . selectPhoneNewErrorMessage ;
}
2018-07-23 15:12:18 +02:00
} ) ;
2018-08-31 21:51:00 +02:00
Object . defineProperty ( exports , 'selectPhoneNewIsPending' , {
enumerable : true ,
get : function get ( ) {
return _user3 . selectPhoneNewIsPending ;
}
} ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'selectEmailVerifyIsPending' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user3 . selectEmailVerifyIsPending ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectEmailVerifyErrorMessage' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user3 . selectEmailVerifyErrorMessage ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectPhoneVerifyErrorMessage' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user3 . selectPhoneVerifyErrorMessage ;
}
2018-07-23 15:12:18 +02:00
} ) ;
2018-08-31 21:51:00 +02:00
Object . defineProperty ( exports , 'selectPhoneVerifyIsPending' , {
enumerable : true ,
get : function get ( ) {
return _user3 . selectPhoneVerifyIsPending ;
}
} ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'selectIdentityVerifyIsPending' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user3 . selectIdentityVerifyIsPending ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectIdentityVerifyErrorMessage' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user3 . selectIdentityVerifyErrorMessage ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectUserIsVerificationCandidate' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user3 . selectUserIsVerificationCandidate ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectAccessToken' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user3 . selectAccessToken ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectUserInviteStatusIsPending' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user3 . selectUserInviteStatusIsPending ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectUserInvitesRemaining' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user3 . selectUserInvitesRemaining ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectUserInvitees' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user3 . selectUserInvitees ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectUserInviteStatusFailed' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user3 . selectUserInviteStatusFailed ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectUserInviteNewIsPending' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user3 . selectUserInviteNewIsPending ;
}
2018-07-23 15:12:18 +02:00
} ) ;
Object . defineProperty ( exports , 'selectUserInviteNewErrorMessage' , {
2018-07-23 16:12:22 +02:00
enumerable : true ,
get : function get ( ) {
return _user3 . selectUserInviteNewErrorMessage ;
}
2018-07-23 15:12:18 +02:00
} ) ;
2018-07-23 16:12:22 +02:00
var _action _types = _ _webpack _require _ _ ( 2 ) ;
2018-07-23 15:12:18 +02:00
var LBRYINC _ACTIONS = _interopRequireWildcard ( _action _types ) ;
2018-07-23 16:12:22 +02:00
var _lbryio = _ _webpack _require _ _ ( 3 ) ;
var _lbryio2 = _interopRequireDefault ( _lbryio ) ;
2018-12-04 17:08:20 +01:00
var _rewards4 = _ _webpack _require _ _ ( 12 ) ;
2018-08-24 12:35:11 +02:00
var _rewards5 = _interopRequireDefault ( _rewards4 ) ;
2018-07-23 16:12:22 +02:00
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
2018-07-23 15:12:18 +02:00
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
// constants
exports . LBRYINC _ACTIONS = LBRYINC _ACTIONS ;
2018-08-24 12:35:11 +02:00
// Lbryio and rewards
2018-07-23 15:12:18 +02:00
2018-07-23 16:12:22 +02:00
exports . Lbryio = _lbryio2 . default ;
2018-08-24 12:35:11 +02:00
exports . rewards = _rewards5 . default ;
2018-07-23 16:12:22 +02:00
// actions
2018-07-23 15:12:18 +02:00
/***/ } ) ,
/* 1 */
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
2018-07-23 16:12:22 +02:00
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . doGenerateAuthToken = doGenerateAuthToken ;
var _action _types = _ _webpack _require _ _ ( 2 ) ;
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
var _lbryio = _ _webpack _require _ _ ( 3 ) ;
var _lbryio2 = _interopRequireDefault ( _lbryio ) ;
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
function doGenerateAuthToken ( installationId ) {
return function ( dispatch ) {
dispatch ( {
type : ACTIONS . GENERATE _AUTH _TOKEN _STARTED
} ) ;
_lbryio2 . default . call ( 'user' , 'new' , {
auth _token : '' ,
language : 'en' ,
app _id : installationId
} , 'post' ) . then ( function ( response ) {
if ( ! response . auth _token ) {
dispatch ( {
type : ACTIONS . GENERATE _AUTH _TOKEN _FAILURE
} ) ;
} else {
dispatch ( {
type : ACTIONS . GENERATE _AUTH _TOKEN _SUCCESS ,
data : { authToken : response . auth _token }
} ) ;
}
} ) . catch ( function ( ) {
dispatch ( {
type : ACTIONS . GENERATE _AUTH _TOKEN _FAILURE
} ) ;
} ) ;
} ;
}
/***/ } ) ,
/* 2 */
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
var GENERATE _AUTH _TOKEN _FAILURE = exports . GENERATE _AUTH _TOKEN _FAILURE = 'GENERATE_AUTH_TOKEN_FAILURE' ;
var GENERATE _AUTH _TOKEN _STARTED = exports . GENERATE _AUTH _TOKEN _STARTED = 'GENERATE_AUTH_TOKEN_STARTED' ;
var GENERATE _AUTH _TOKEN _SUCCESS = exports . GENERATE _AUTH _TOKEN _SUCCESS = 'GENERATE_AUTH_TOKEN_SUCCESS' ;
/***/ } ) ,
/* 3 */
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
2018-07-23 15:12:18 +02:00
"use strict" ;
2018-12-04 17:08:20 +01:00
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
var _extends = Object . assign || function ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] ; for ( var key in source ) { if ( Object . prototype . hasOwnProperty . call ( source , key ) ) { target [ key ] = source [ key ] ; } } } return target ; } ;
2018-12-04 17:08:20 +01:00
var _lbryRedux = _ _webpack _require _ _ ( 4 ) ;
2018-07-23 15:12:18 +02:00
2018-07-23 16:12:22 +02:00
var _auth = _ _webpack _require _ _ ( 1 ) ;
2018-07-23 15:12:18 +02:00
2018-12-04 17:08:20 +01:00
var _querystring = _ _webpack _require _ _ ( 5 ) ;
2018-07-23 15:12:18 +02:00
var _querystring2 = _interopRequireDefault ( _querystring ) ;
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
var Lbryio = {
enabled : true ,
authenticationPromise : null
} ;
2018-12-04 17:08:20 +01:00
// We can't use env's because they aren't passed into node_modules
2018-12-04 19:44:15 +01:00
var CONNECTION _STRING = 'https://api.lbry.io/' ;
2018-12-04 17:08:20 +01:00
Lbryio . setLocalApi = function ( endpoint ) {
CONNECTION _STRING = endpoint . replace ( /\/*$/ , '/' ) ; // exactly one slash at the end;
} ;
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 ( ) ;
}
return response . json ( ) . then ( function ( json ) {
var error = void 0 ;
if ( json . error ) {
error = new Error ( json . error ) ;
} else {
error = new Error ( 'Unknown API error signature' ) ;
}
error . response = response ; // This is primarily a hack used in actions/user.js
return Promise . reject ( error ) ;
} ) ;
}
function makeRequest ( url , options ) {
return fetch ( url , options ) . then ( checkAndParse ) ;
}
return Lbryio . getAuthToken ( ) . then ( function ( token ) {
var fullParams = _extends ( { auth _token : token } , params ) ;
var qs = _querystring2 . default . stringify ( fullParams ) ;
var url = '' + CONNECTION _STRING + resource + '/' + action + '?' + qs ;
var options = {
method : 'GET'
} ;
if ( method === 'post' ) {
options = {
method : 'POST' ,
headers : {
'Content-Type' : 'application/x-www-form-urlencoded'
} ,
body : qs
} ;
url = '' + CONNECTION _STRING + resource + '/' + action ;
}
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 ) ;
} ) ;
2018-07-23 15:12:18 +02:00
} else {
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 ) ;
}
resolve ( null ) ;
}
} ) ;
} ;
Lbryio . getCurrentUser = function ( ) {
return Lbryio . call ( 'user' , 'me' ) ;
} ;
Lbryio . authenticate = function ( ) {
if ( ! Lbryio . enabled ) {
return new Promise ( function ( resolve ) {
resolve ( {
id : 1 ,
language : 'en' ,
primary _email : 'disabled@lbry.io' ,
has _verified _email : true ,
is _identity _verified : true ,
is _reward _approved : false
} ) ;
} ) ;
}
if ( Lbryio . authenticationPromise === null ) {
Lbryio . authenticationPromise = new Promise ( function ( resolve , reject ) {
Lbryio . getAuthToken ( ) . then ( function ( token ) {
if ( ! token || token . length > 60 ) {
return false ;
}
// check that token works
return Lbryio . getCurrentUser ( ) . then ( function ( ) {
return true ;
} ) . catch ( function ( ) {
return false ;
} ) ;
} ) . then ( function ( isTokenValid ) {
if ( isTokenValid ) {
return reject ;
}
return _lbryRedux . Lbry . status ( ) . then ( function ( status ) {
2018-09-18 23:56:12 +02:00
if ( Lbryio . overrides . setAuthToken ) {
return Lbryio . overrides . setAuthToken ( status ) ;
}
2018-07-23 16:12:22 +02:00
var _window2 = window ,
store = _window2 . store ;
2018-07-23 15:12:18 +02:00
if ( store ) {
2018-07-23 16:12:22 +02:00
store . dispatch ( ( 0 , _auth . doGenerateAuthToken ) ( status . installation _id ) ) ;
2018-07-23 15:12:18 +02:00
return resolve ( ) ;
}
return reject ( ) ;
} ) ;
2018-08-17 20:10:52 +02:00
} ) . then ( Lbryio . getCurrentUser ) . then ( resolve , reject ) ;
2018-07-23 15:12:18 +02:00
} ) ;
}
return Lbryio . authenticationPromise ;
} ;
Lbryio . getStripeToken = function ( ) {
return CONNECTION _STRING . startsWith ( 'http://localhost:' ) ? 'pk_test_NoL1JWL7i1ipfhVId5KfDZgo' : 'pk_live_e8M4dRNnCCbmpZzduEUZBgJO' ;
} ;
2018-09-18 23:56:12 +02:00
// Allow overriding lbryio methods
// The desktop app will need to use it for getAuthToken because we use electron's ipcRenderer
Lbryio . overrides = { } ;
Lbryio . setOverride = function ( methodName , newMethod ) {
Lbryio . overrides [ methodName ] = newMethod ;
} ;
2018-07-23 15:12:18 +02:00
exports . default = Lbryio ;
/***/ } ) ,
2018-07-23 16:12:22 +02:00
/* 4 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
( function webpackUniversalModuleDefinition ( root , factory ) {
if ( true )
module . exports = factory ( ) ;
else { var i , a ; }
} ) ( window , function ( ) {
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 ) ) {
2018-10-18 18:36:55 +02:00
/******/ Object . defineProperty ( exports , name , {
/******/ configurable : false ,
/******/ enumerable : true ,
/******/ get : getter
/******/ } ) ;
2018-07-23 15:12:18 +02:00
/******/ }
/******/ } ;
/******/
/******/ // define __esModule on exports
/******/ _ _webpack _require _ _ . r = function ( exports ) {
/******/ Object . defineProperty ( exports , '__esModule' , { value : true } ) ;
/******/ } ;
/******/
/******/ // 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 */
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-11-29 07:07:43 +01:00
exports . selectTransactionListFilter = exports . selectWalletUnlockResult = exports . selectWalletUnlockSucceeded = exports . selectWalletUnlockPending = exports . selectWalletDecryptResult = exports . selectWalletDecryptSucceeded = exports . selectWalletDecryptPending = exports . selectWalletEncryptResult = exports . selectWalletEncryptSucceeded = exports . selectWalletEncryptPending = exports . selectWalletState = exports . selectWalletIsEncrypted = exports . selectBlocks = exports . selectDraftTransactionError = exports . selectDraftTransactionAddress = exports . selectDraftTransactionAmount = exports . selectDraftTransaction = exports . selectGettingNewAddress = exports . selectReceiveAddress = exports . selectIsSendingSupport = exports . selectIsFetchingTransactions = exports . selectHasTransactions = exports . selectRecentTransactions = exports . selectTransactionItems = exports . selectTransactionsById = exports . selectBalance = exports . makeSelectBlockDate = exports . selectSearchSuggestions = exports . selectSearchBarFocused = exports . selectWunderBarAddress = exports . selectSearchUrisByQuery = exports . selectIsSearching = exports . selectSearchValue = exports . selectSearchQuery = exports . makeSelectSearchUris = exports . selectSearchState = exports . selectActiveHistoryEntry = exports . selectHistoryStack = exports . selectHistoryIndex = exports . selectIsForwardDisabled = exports . selectIsBackDisabled = exports . selectPathAfterAuth = exports . selectPageTitle = exports . selectHeaderLinks = exports . selectCurrentParams = exports . selectCurrentPage = exports . selectCurrentPath = exports . makeSelectCurrentParam = exports . computePageFromPath = exports . selectFileListPublishedSort = exports . selectFileListDownloadedSort = exports . selectSearchDownloadUris = exports . selectTotalDownloadProgress = exports . selectDownloadingFileInfos = exports . selectFileInfosDownloaded = exports . selectUrisLoading = exports . selectDownloadingByOutpoint = exports . selectIsFetchingFileListDownloadedOrPublished = exports . selectIsFetchingFileList = exports . selectFileInfosByOutpoint = exports . makeSelectLoadingForUri = exports . makeSelectDownloadingForUri = exports . makeSelectFileInfoForUri = exports . selectFetchingCostInfo = exports . selectCostForCurrentPageUri = exports . selectAllCostInfoByUri = exports . makeSelectCostInfoForUri = exports . makeSelectFetchingCostInfoForUri = exports . selectChannelClaimCounts = exports . selectPlayingUri = exports . selectFetchingTrendingUris = exports . selectTrendingUris = exports . selectFetchingFeaturedUris = exports . selectFeaturedUris = exports . selectResolvingUris = exports . selectMyChannelClaims = exports . selectFetchingMyChannels = exports . selectMyClaimsOutpoints = exports . selectAllMyClaimsByOutpoint = exports . selectMyClaimsWithoutChannels = exports . selectMyClaims = undefined ;
exports . selectPendingClaims = exports . selectIsFetchingClaimListMine = exports . selectAllFetchingChannelClaims = exports . selectMyActiveClaims = exports . selectAbandoningIds = exports . selectMyClaimsRaw = exports . selectAllClaimsByChannel = exports . selectClaimsByUri = exports . selectClaimsById = exports . selectPendingById = exports . makeSelectPendingByUri = exports . makeSelectClaimIsPending = exports . makeSelectChannelForClaimUri = exports . makeSelectRecommendedContentForUri = exports . makeSelectNsfwCountForChannel = exports . makeSelectNsfwCountFromUris = exports . makeSelectTotalPagesForChannel = exports . makeSelectTotalItemsForChannel = exports . makeSelectIsUriResolving = exports . makeSelectContentTypeForUri = exports . makeSelectTitleForUri = exports . makeSelectMetadataForUri = exports . makeSelectClaimsInChannelForPage = exports . makeSelectClaimsInChannelForCurrentPage = exports . makeSelectFetchingChannelClaims = exports . makeSelectClaimIsMine = exports . makeSelectClaimForUri = exports . selectError = exports . selectToast = exports . selectBlackListedOutpoints = exports . blacklistReducer = exports . walletReducer = exports . searchReducer = exports . notificationsReducer = exports . fileInfoReducer = exports . costInfoReducer = exports . claimsReducer = exports . creditsToString = exports . formatFullPrice = exports . formatCredits = exports . toQueryString = exports . parseQueryParams = exports . batchActions = exports . doUpdateBlockHeight = exports . doSetTransactionListFilter = exports . doWalletStatus = exports . doWalletUnlock = exports . doWalletDecrypt = exports . doWalletEncrypt = exports . doSendTip = exports . doSetDraftTransactionAddress = exports . doSetDraftTransactionAmount = exports . doSendDraftTransaction = exports . doCheckAddressIsMine = exports . doGetNewAddress = exports . doFetchBlock = exports . doFetchTransactions = exports . doBalanceSubscribe = exports . doUpdateBalance = exports . doBlackListedOutpointsSubscribe = exports . doBlurSearchInput = exports . doFocusSearchInput = exports . doUpdateSearchQuery = exports . doSearch = exports . doSetFileListSort = exports . doFetchFileInfosAndPublishedClaims = exports . doFileList = exports . doFetchFileInfo = exports . doFetchCostInfoForUri = exports . doFetchTrendingUris = exports . doFetchFeaturedUris = exports . doResolveUri = exports . doResolveUris = exports . doAbandonClaim = exports . doFetchClaimListMine = exports . doFetchClaimCountByChannel = exports . doFetchClaimsByChannel = exports . doDismissError = exports . doError = exports . doDismissToast = exports . doToast = exports . convertToShareLink = exports . isNameValid = exports . isURIClaimable = exports . isURIValid = exports . normalizeURI = exports . buildURI = exports . parseURI = exports . regexAddress = exports . regexInvalidURI = exports . Lbryapi = exports . Lbry = exports . PAGES = exports . SORT _OPTIONS = exports . TRANSACTIONS = exports . SETTINGS = exports . SEARCH _TYPES = exports . THUMBNAIL _STATUSES = exports . ACTIONS = exports . Toast = undefined ;
2018-07-23 15:12:18 +02:00
var _Notification = _ _webpack _require _ _ ( 1 ) ;
2018-11-29 07:07:43 +01:00
Object . defineProperty ( exports , 'Toast' , {
2018-07-23 15:12:18 +02:00
enumerable : true ,
get : function get ( ) {
2018-11-29 07:07:43 +01:00
return _Notification . Toast ;
2018-07-23 15:12:18 +02:00
}
} ) ;
2018-11-29 07:07:43 +01:00
var _lbryURI = _ _webpack _require _ _ ( 3 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'regexInvalidURI' , {
enumerable : true ,
get : function get ( ) {
return _lbryURI . regexInvalidURI ;
}
} ) ;
Object . defineProperty ( exports , 'regexAddress' , {
enumerable : true ,
get : function get ( ) {
return _lbryURI . regexAddress ;
}
} ) ;
Object . defineProperty ( exports , 'parseURI' , {
enumerable : true ,
get : function get ( ) {
return _lbryURI . parseURI ;
}
} ) ;
Object . defineProperty ( exports , 'buildURI' , {
enumerable : true ,
get : function get ( ) {
return _lbryURI . buildURI ;
}
} ) ;
Object . defineProperty ( exports , 'normalizeURI' , {
enumerable : true ,
get : function get ( ) {
return _lbryURI . normalizeURI ;
}
} ) ;
Object . defineProperty ( exports , 'isURIValid' , {
enumerable : true ,
get : function get ( ) {
return _lbryURI . isURIValid ;
}
} ) ;
Object . defineProperty ( exports , 'isURIClaimable' , {
enumerable : true ,
get : function get ( ) {
return _lbryURI . isURIClaimable ;
}
} ) ;
Object . defineProperty ( exports , 'isNameValid' , {
enumerable : true ,
get : function get ( ) {
return _lbryURI . isNameValid ;
}
} ) ;
Object . defineProperty ( exports , 'convertToShareLink' , {
enumerable : true ,
get : function get ( ) {
return _lbryURI . convertToShareLink ;
}
} ) ;
2018-11-29 07:07:43 +01:00
var _notifications = _ _webpack _require _ _ ( 4 ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
Object . defineProperty ( exports , 'doToast' , {
2018-07-23 15:12:18 +02:00
enumerable : true ,
get : function get ( ) {
2018-11-29 07:07:43 +01:00
return _notifications . doToast ;
2018-07-23 15:12:18 +02:00
}
} ) ;
2018-11-29 07:07:43 +01:00
Object . defineProperty ( exports , 'doDismissToast' , {
2018-07-23 15:12:18 +02:00
enumerable : true ,
get : function get ( ) {
2018-11-29 07:07:43 +01:00
return _notifications . doDismissToast ;
}
} ) ;
Object . defineProperty ( exports , 'doError' , {
enumerable : true ,
get : function get ( ) {
return _notifications . doError ;
}
} ) ;
Object . defineProperty ( exports , 'doDismissError' , {
enumerable : true ,
get : function get ( ) {
return _notifications . doDismissError ;
2018-07-23 15:12:18 +02:00
}
} ) ;
2018-11-29 07:07:43 +01:00
var _claims = _ _webpack _require _ _ ( 8 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'doFetchClaimsByChannel' , {
enumerable : true ,
get : function get ( ) {
return _claims . doFetchClaimsByChannel ;
}
} ) ;
Object . defineProperty ( exports , 'doFetchClaimCountByChannel' , {
enumerable : true ,
get : function get ( ) {
return _claims . doFetchClaimCountByChannel ;
}
} ) ;
Object . defineProperty ( exports , 'doFetchClaimListMine' , {
enumerable : true ,
get : function get ( ) {
return _claims . doFetchClaimListMine ;
}
} ) ;
Object . defineProperty ( exports , 'doAbandonClaim' , {
enumerable : true ,
get : function get ( ) {
return _claims . doAbandonClaim ;
}
} ) ;
Object . defineProperty ( exports , 'doResolveUris' , {
enumerable : true ,
get : function get ( ) {
return _claims . doResolveUris ;
}
} ) ;
Object . defineProperty ( exports , 'doResolveUri' , {
enumerable : true ,
get : function get ( ) {
return _claims . doResolveUri ;
}
} ) ;
Object . defineProperty ( exports , 'doFetchFeaturedUris' , {
enumerable : true ,
get : function get ( ) {
return _claims . doFetchFeaturedUris ;
}
} ) ;
Object . defineProperty ( exports , 'doFetchTrendingUris' , {
enumerable : true ,
get : function get ( ) {
return _claims . doFetchTrendingUris ;
}
} ) ;
2018-11-29 07:07:43 +01:00
var _cost _info = _ _webpack _require _ _ ( 29 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'doFetchCostInfoForUri' , {
enumerable : true ,
get : function get ( ) {
return _cost _info . doFetchCostInfoForUri ;
}
} ) ;
2018-11-29 07:07:43 +01:00
var _file _info = _ _webpack _require _ _ ( 30 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'doFetchFileInfo' , {
enumerable : true ,
get : function get ( ) {
return _file _info . doFetchFileInfo ;
}
} ) ;
Object . defineProperty ( exports , 'doFileList' , {
enumerable : true ,
get : function get ( ) {
return _file _info . doFileList ;
}
} ) ;
Object . defineProperty ( exports , 'doFetchFileInfosAndPublishedClaims' , {
enumerable : true ,
get : function get ( ) {
return _file _info . doFetchFileInfosAndPublishedClaims ;
}
} ) ;
2018-10-26 20:10:50 +02:00
Object . defineProperty ( exports , 'doSetFileListSort' , {
enumerable : true ,
get : function get ( ) {
return _file _info . doSetFileListSort ;
}
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _search = _ _webpack _require _ _ ( 32 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'doSearch' , {
enumerable : true ,
get : function get ( ) {
return _search . doSearch ;
}
} ) ;
Object . defineProperty ( exports , 'doUpdateSearchQuery' , {
enumerable : true ,
get : function get ( ) {
return _search . doUpdateSearchQuery ;
}
} ) ;
Object . defineProperty ( exports , 'doFocusSearchInput' , {
enumerable : true ,
get : function get ( ) {
return _search . doFocusSearchInput ;
}
} ) ;
Object . defineProperty ( exports , 'doBlurSearchInput' , {
enumerable : true ,
get : function get ( ) {
return _search . doBlurSearchInput ;
}
} ) ;
2018-11-29 07:07:43 +01:00
var _blacklist = _ _webpack _require _ _ ( 34 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'doBlackListedOutpointsSubscribe' , {
enumerable : true ,
get : function get ( ) {
return _blacklist . doBlackListedOutpointsSubscribe ;
}
} ) ;
2018-11-29 07:07:43 +01:00
var _wallet = _ _webpack _require _ _ ( 25 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'doUpdateBalance' , {
enumerable : true ,
get : function get ( ) {
return _wallet . doUpdateBalance ;
}
} ) ;
Object . defineProperty ( exports , 'doBalanceSubscribe' , {
enumerable : true ,
get : function get ( ) {
return _wallet . doBalanceSubscribe ;
}
} ) ;
Object . defineProperty ( exports , 'doFetchTransactions' , {
enumerable : true ,
get : function get ( ) {
return _wallet . doFetchTransactions ;
}
} ) ;
Object . defineProperty ( exports , 'doFetchBlock' , {
enumerable : true ,
get : function get ( ) {
return _wallet . doFetchBlock ;
}
} ) ;
Object . defineProperty ( exports , 'doGetNewAddress' , {
enumerable : true ,
get : function get ( ) {
return _wallet . doGetNewAddress ;
}
} ) ;
Object . defineProperty ( exports , 'doCheckAddressIsMine' , {
enumerable : true ,
get : function get ( ) {
return _wallet . doCheckAddressIsMine ;
}
} ) ;
Object . defineProperty ( exports , 'doSendDraftTransaction' , {
enumerable : true ,
get : function get ( ) {
return _wallet . doSendDraftTransaction ;
}
} ) ;
Object . defineProperty ( exports , 'doSetDraftTransactionAmount' , {
enumerable : true ,
get : function get ( ) {
return _wallet . doSetDraftTransactionAmount ;
}
} ) ;
Object . defineProperty ( exports , 'doSetDraftTransactionAddress' , {
enumerable : true ,
get : function get ( ) {
return _wallet . doSetDraftTransactionAddress ;
}
} ) ;
2018-10-26 20:10:50 +02:00
Object . defineProperty ( exports , 'doSendTip' , {
enumerable : true ,
get : function get ( ) {
return _wallet . doSendTip ;
}
} ) ;
Object . defineProperty ( exports , 'doWalletEncrypt' , {
enumerable : true ,
get : function get ( ) {
return _wallet . doWalletEncrypt ;
}
} ) ;
Object . defineProperty ( exports , 'doWalletDecrypt' , {
enumerable : true ,
get : function get ( ) {
return _wallet . doWalletDecrypt ;
}
} ) ;
Object . defineProperty ( exports , 'doWalletUnlock' , {
enumerable : true ,
get : function get ( ) {
return _wallet . doWalletUnlock ;
}
} ) ;
Object . defineProperty ( exports , 'doWalletStatus' , {
enumerable : true ,
get : function get ( ) {
return _wallet . doWalletStatus ;
}
} ) ;
Object . defineProperty ( exports , 'doSetTransactionListFilter' , {
2018-07-23 15:12:18 +02:00
enumerable : true ,
get : function get ( ) {
2018-10-26 20:10:50 +02:00
return _wallet . doSetTransactionListFilter ;
2018-07-23 15:12:18 +02:00
}
} ) ;
2018-11-29 07:07:43 +01:00
Object . defineProperty ( exports , 'doUpdateBlockHeight' , {
enumerable : true ,
get : function get ( ) {
return _wallet . doUpdateBlockHeight ;
}
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _batchActions = _ _webpack _require _ _ ( 24 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'batchActions' , {
enumerable : true ,
get : function get ( ) {
return _batchActions . batchActions ;
}
} ) ;
2018-11-29 07:07:43 +01:00
var _query _params = _ _webpack _require _ _ ( 20 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'parseQueryParams' , {
enumerable : true ,
get : function get ( ) {
return _query _params . parseQueryParams ;
}
} ) ;
Object . defineProperty ( exports , 'toQueryString' , {
enumerable : true ,
get : function get ( ) {
return _query _params . toQueryString ;
}
} ) ;
2018-11-29 07:07:43 +01:00
var _formatCredits = _ _webpack _require _ _ ( 28 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'formatCredits' , {
enumerable : true ,
get : function get ( ) {
return _formatCredits . formatCredits ;
}
} ) ;
Object . defineProperty ( exports , 'formatFullPrice' , {
enumerable : true ,
get : function get ( ) {
return _formatCredits . formatFullPrice ;
}
} ) ;
2018-10-26 20:10:50 +02:00
Object . defineProperty ( exports , 'creditsToString' , {
enumerable : true ,
get : function get ( ) {
return _formatCredits . creditsToString ;
}
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _claims2 = _ _webpack _require _ _ ( 35 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'claimsReducer' , {
enumerable : true ,
get : function get ( ) {
return _claims2 . claimsReducer ;
}
} ) ;
2018-11-29 07:07:43 +01:00
var _cost _info2 = _ _webpack _require _ _ ( 36 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'costInfoReducer' , {
enumerable : true ,
get : function get ( ) {
return _cost _info2 . costInfoReducer ;
}
} ) ;
2018-11-29 07:07:43 +01:00
var _file _info2 = _ _webpack _require _ _ ( 37 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'fileInfoReducer' , {
enumerable : true ,
get : function get ( ) {
return _file _info2 . fileInfoReducer ;
}
} ) ;
2018-11-29 07:07:43 +01:00
var _notifications2 = _ _webpack _require _ _ ( 40 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'notificationsReducer' , {
enumerable : true ,
get : function get ( ) {
return _notifications2 . notificationsReducer ;
}
} ) ;
2018-11-29 07:07:43 +01:00
var _search2 = _ _webpack _require _ _ ( 42 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'searchReducer' , {
enumerable : true ,
get : function get ( ) {
return _search2 . searchReducer ;
}
} ) ;
2018-11-29 07:07:43 +01:00
var _wallet2 = _ _webpack _require _ _ ( 43 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'walletReducer' , {
enumerable : true ,
get : function get ( ) {
return _wallet2 . walletReducer ;
}
} ) ;
2018-11-29 07:07:43 +01:00
var _blacklist2 = _ _webpack _require _ _ ( 44 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'blacklistReducer' , {
enumerable : true ,
get : function get ( ) {
return _blacklist2 . blacklistReducer ;
}
} ) ;
2018-11-29 07:07:43 +01:00
var _blacklist3 = _ _webpack _require _ _ ( 45 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'selectBlackListedOutpoints' , {
enumerable : true ,
get : function get ( ) {
return _blacklist3 . selectBlackListedOutpoints ;
}
} ) ;
2018-11-29 07:07:43 +01:00
var _notifications3 = _ _webpack _require _ _ ( 46 ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
Object . defineProperty ( exports , 'selectToast' , {
2018-07-23 15:12:18 +02:00
enumerable : true ,
get : function get ( ) {
2018-11-29 07:07:43 +01:00
return _notifications3 . selectToast ;
2018-07-23 15:12:18 +02:00
}
} ) ;
2018-11-29 07:07:43 +01:00
Object . defineProperty ( exports , 'selectError' , {
2018-07-23 15:12:18 +02:00
enumerable : true ,
get : function get ( ) {
2018-11-29 07:07:43 +01:00
return _notifications3 . selectError ;
2018-07-23 15:12:18 +02:00
}
} ) ;
2018-11-29 07:07:43 +01:00
var _claims3 = _ _webpack _require _ _ ( 17 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'makeSelectClaimForUri' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . makeSelectClaimForUri ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectClaimIsMine' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . makeSelectClaimIsMine ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectFetchingChannelClaims' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . makeSelectFetchingChannelClaims ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectClaimsInChannelForCurrentPage' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . makeSelectClaimsInChannelForCurrentPage ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectClaimsInChannelForPage' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . makeSelectClaimsInChannelForPage ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectMetadataForUri' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . makeSelectMetadataForUri ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectTitleForUri' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . makeSelectTitleForUri ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectContentTypeForUri' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . makeSelectContentTypeForUri ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectIsUriResolving' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . makeSelectIsUriResolving ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectTotalItemsForChannel' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . makeSelectTotalItemsForChannel ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectTotalPagesForChannel' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . makeSelectTotalPagesForChannel ;
}
} ) ;
2018-10-26 20:10:50 +02:00
Object . defineProperty ( exports , 'makeSelectNsfwCountFromUris' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . makeSelectNsfwCountFromUris ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectNsfwCountForChannel' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . makeSelectNsfwCountForChannel ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectRecommendedContentForUri' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . makeSelectRecommendedContentForUri ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectChannelForClaimUri' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . makeSelectChannelForClaimUri ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectClaimIsPending' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . makeSelectClaimIsPending ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectPendingByUri' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . makeSelectPendingByUri ;
}
} ) ;
Object . defineProperty ( exports , 'selectPendingById' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectPendingById ;
}
} ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'selectClaimsById' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectClaimsById ;
}
} ) ;
Object . defineProperty ( exports , 'selectClaimsByUri' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectClaimsByUri ;
}
} ) ;
Object . defineProperty ( exports , 'selectAllClaimsByChannel' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectAllClaimsByChannel ;
}
} ) ;
Object . defineProperty ( exports , 'selectMyClaimsRaw' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectMyClaimsRaw ;
}
} ) ;
Object . defineProperty ( exports , 'selectAbandoningIds' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectAbandoningIds ;
}
} ) ;
Object . defineProperty ( exports , 'selectMyActiveClaims' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectMyActiveClaims ;
}
} ) ;
Object . defineProperty ( exports , 'selectAllFetchingChannelClaims' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectAllFetchingChannelClaims ;
}
} ) ;
Object . defineProperty ( exports , 'selectIsFetchingClaimListMine' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectIsFetchingClaimListMine ;
}
} ) ;
Object . defineProperty ( exports , 'selectPendingClaims' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectPendingClaims ;
}
} ) ;
Object . defineProperty ( exports , 'selectMyClaims' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectMyClaims ;
}
} ) ;
Object . defineProperty ( exports , 'selectMyClaimsWithoutChannels' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectMyClaimsWithoutChannels ;
}
} ) ;
Object . defineProperty ( exports , 'selectAllMyClaimsByOutpoint' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectAllMyClaimsByOutpoint ;
}
} ) ;
Object . defineProperty ( exports , 'selectMyClaimsOutpoints' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectMyClaimsOutpoints ;
}
} ) ;
Object . defineProperty ( exports , 'selectFetchingMyChannels' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectFetchingMyChannels ;
}
} ) ;
Object . defineProperty ( exports , 'selectMyChannelClaims' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectMyChannelClaims ;
}
} ) ;
Object . defineProperty ( exports , 'selectResolvingUris' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectResolvingUris ;
}
} ) ;
Object . defineProperty ( exports , 'selectFeaturedUris' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectFeaturedUris ;
}
} ) ;
Object . defineProperty ( exports , 'selectFetchingFeaturedUris' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectFetchingFeaturedUris ;
}
} ) ;
Object . defineProperty ( exports , 'selectTrendingUris' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectTrendingUris ;
}
} ) ;
Object . defineProperty ( exports , 'selectFetchingTrendingUris' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectFetchingTrendingUris ;
}
} ) ;
Object . defineProperty ( exports , 'selectPlayingUri' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectPlayingUri ;
}
} ) ;
Object . defineProperty ( exports , 'selectChannelClaimCounts' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectChannelClaimCounts ;
}
} ) ;
2018-11-29 07:07:43 +01:00
var _cost _info3 = _ _webpack _require _ _ ( 47 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'makeSelectFetchingCostInfoForUri' , {
enumerable : true ,
get : function get ( ) {
return _cost _info3 . makeSelectFetchingCostInfoForUri ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectCostInfoForUri' , {
enumerable : true ,
get : function get ( ) {
return _cost _info3 . makeSelectCostInfoForUri ;
}
} ) ;
Object . defineProperty ( exports , 'selectAllCostInfoByUri' , {
enumerable : true ,
get : function get ( ) {
return _cost _info3 . selectAllCostInfoByUri ;
}
} ) ;
Object . defineProperty ( exports , 'selectCostForCurrentPageUri' , {
enumerable : true ,
get : function get ( ) {
return _cost _info3 . selectCostForCurrentPageUri ;
}
} ) ;
Object . defineProperty ( exports , 'selectFetchingCostInfo' , {
enumerable : true ,
get : function get ( ) {
return _cost _info3 . selectFetchingCostInfo ;
}
} ) ;
2018-11-29 07:07:43 +01:00
var _file _info3 = _ _webpack _require _ _ ( 31 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'makeSelectFileInfoForUri' , {
enumerable : true ,
get : function get ( ) {
return _file _info3 . makeSelectFileInfoForUri ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectDownloadingForUri' , {
enumerable : true ,
get : function get ( ) {
return _file _info3 . makeSelectDownloadingForUri ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectLoadingForUri' , {
enumerable : true ,
get : function get ( ) {
return _file _info3 . makeSelectLoadingForUri ;
}
} ) ;
Object . defineProperty ( exports , 'selectFileInfosByOutpoint' , {
enumerable : true ,
get : function get ( ) {
return _file _info3 . selectFileInfosByOutpoint ;
}
} ) ;
Object . defineProperty ( exports , 'selectIsFetchingFileList' , {
enumerable : true ,
get : function get ( ) {
return _file _info3 . selectIsFetchingFileList ;
}
} ) ;
Object . defineProperty ( exports , 'selectIsFetchingFileListDownloadedOrPublished' , {
enumerable : true ,
get : function get ( ) {
return _file _info3 . selectIsFetchingFileListDownloadedOrPublished ;
}
} ) ;
Object . defineProperty ( exports , 'selectDownloadingByOutpoint' , {
enumerable : true ,
get : function get ( ) {
return _file _info3 . selectDownloadingByOutpoint ;
}
} ) ;
Object . defineProperty ( exports , 'selectUrisLoading' , {
enumerable : true ,
get : function get ( ) {
return _file _info3 . selectUrisLoading ;
}
} ) ;
Object . defineProperty ( exports , 'selectFileInfosDownloaded' , {
enumerable : true ,
get : function get ( ) {
return _file _info3 . selectFileInfosDownloaded ;
}
} ) ;
Object . defineProperty ( exports , 'selectDownloadingFileInfos' , {
enumerable : true ,
get : function get ( ) {
return _file _info3 . selectDownloadingFileInfos ;
}
} ) ;
Object . defineProperty ( exports , 'selectTotalDownloadProgress' , {
enumerable : true ,
get : function get ( ) {
return _file _info3 . selectTotalDownloadProgress ;
}
} ) ;
Object . defineProperty ( exports , 'selectSearchDownloadUris' , {
enumerable : true ,
get : function get ( ) {
return _file _info3 . selectSearchDownloadUris ;
}
} ) ;
2018-10-26 20:10:50 +02:00
Object . defineProperty ( exports , 'selectFileListDownloadedSort' , {
enumerable : true ,
get : function get ( ) {
return _file _info3 . selectFileListDownloadedSort ;
}
} ) ;
Object . defineProperty ( exports , 'selectFileListPublishedSort' , {
enumerable : true ,
get : function get ( ) {
return _file _info3 . selectFileListPublishedSort ;
}
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _navigation = _ _webpack _require _ _ ( 18 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'computePageFromPath' , {
enumerable : true ,
get : function get ( ) {
return _navigation . computePageFromPath ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectCurrentParam' , {
enumerable : true ,
get : function get ( ) {
return _navigation . makeSelectCurrentParam ;
}
} ) ;
Object . defineProperty ( exports , 'selectCurrentPath' , {
enumerable : true ,
get : function get ( ) {
return _navigation . selectCurrentPath ;
}
} ) ;
Object . defineProperty ( exports , 'selectCurrentPage' , {
enumerable : true ,
get : function get ( ) {
return _navigation . selectCurrentPage ;
}
} ) ;
Object . defineProperty ( exports , 'selectCurrentParams' , {
enumerable : true ,
get : function get ( ) {
return _navigation . selectCurrentParams ;
}
} ) ;
Object . defineProperty ( exports , 'selectHeaderLinks' , {
enumerable : true ,
get : function get ( ) {
return _navigation . selectHeaderLinks ;
}
} ) ;
Object . defineProperty ( exports , 'selectPageTitle' , {
enumerable : true ,
get : function get ( ) {
return _navigation . selectPageTitle ;
}
} ) ;
Object . defineProperty ( exports , 'selectPathAfterAuth' , {
enumerable : true ,
get : function get ( ) {
return _navigation . selectPathAfterAuth ;
}
} ) ;
Object . defineProperty ( exports , 'selectIsBackDisabled' , {
enumerable : true ,
get : function get ( ) {
return _navigation . selectIsBackDisabled ;
}
} ) ;
Object . defineProperty ( exports , 'selectIsForwardDisabled' , {
enumerable : true ,
get : function get ( ) {
return _navigation . selectIsForwardDisabled ;
}
} ) ;
Object . defineProperty ( exports , 'selectHistoryIndex' , {
enumerable : true ,
get : function get ( ) {
return _navigation . selectHistoryIndex ;
}
} ) ;
Object . defineProperty ( exports , 'selectHistoryStack' , {
enumerable : true ,
get : function get ( ) {
return _navigation . selectHistoryStack ;
}
} ) ;
Object . defineProperty ( exports , 'selectActiveHistoryEntry' , {
enumerable : true ,
get : function get ( ) {
return _navigation . selectActiveHistoryEntry ;
}
} ) ;
2018-11-29 07:07:43 +01:00
var _search3 = _ _webpack _require _ _ ( 21 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'makeSelectSearchUris' , {
enumerable : true ,
get : function get ( ) {
return _search3 . makeSelectSearchUris ;
}
} ) ;
Object . defineProperty ( exports , 'selectSearchQuery' , {
enumerable : true ,
get : function get ( ) {
return _search3 . selectSearchQuery ;
}
} ) ;
Object . defineProperty ( exports , 'selectSearchValue' , {
enumerable : true ,
get : function get ( ) {
return _search3 . selectSearchValue ;
}
} ) ;
Object . defineProperty ( exports , 'selectIsSearching' , {
enumerable : true ,
get : function get ( ) {
return _search3 . selectIsSearching ;
}
} ) ;
Object . defineProperty ( exports , 'selectSearchUrisByQuery' , {
enumerable : true ,
get : function get ( ) {
return _search3 . selectSearchUrisByQuery ;
}
} ) ;
Object . defineProperty ( exports , 'selectWunderBarAddress' , {
enumerable : true ,
get : function get ( ) {
return _search3 . selectWunderBarAddress ;
}
} ) ;
Object . defineProperty ( exports , 'selectSearchBarFocused' , {
enumerable : true ,
get : function get ( ) {
return _search3 . selectSearchBarFocused ;
}
} ) ;
2018-10-26 20:10:50 +02:00
Object . defineProperty ( exports , 'selectSearchSuggestions' , {
enumerable : true ,
get : function get ( ) {
return _search3 . selectSearchSuggestions ;
}
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _wallet3 = _ _webpack _require _ _ ( 26 ) ;
2018-07-23 15:12:18 +02:00
Object . defineProperty ( exports , 'makeSelectBlockDate' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . makeSelectBlockDate ;
}
} ) ;
Object . defineProperty ( exports , 'selectBalance' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectBalance ;
}
} ) ;
Object . defineProperty ( exports , 'selectTransactionsById' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectTransactionsById ;
}
} ) ;
Object . defineProperty ( exports , 'selectTransactionItems' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectTransactionItems ;
}
} ) ;
Object . defineProperty ( exports , 'selectRecentTransactions' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectRecentTransactions ;
}
} ) ;
Object . defineProperty ( exports , 'selectHasTransactions' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectHasTransactions ;
}
} ) ;
Object . defineProperty ( exports , 'selectIsFetchingTransactions' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectIsFetchingTransactions ;
}
} ) ;
Object . defineProperty ( exports , 'selectIsSendingSupport' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectIsSendingSupport ;
}
} ) ;
Object . defineProperty ( exports , 'selectReceiveAddress' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectReceiveAddress ;
}
} ) ;
Object . defineProperty ( exports , 'selectGettingNewAddress' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectGettingNewAddress ;
}
} ) ;
Object . defineProperty ( exports , 'selectDraftTransaction' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectDraftTransaction ;
}
} ) ;
Object . defineProperty ( exports , 'selectDraftTransactionAmount' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectDraftTransactionAmount ;
}
} ) ;
Object . defineProperty ( exports , 'selectDraftTransactionAddress' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectDraftTransactionAddress ;
}
} ) ;
Object . defineProperty ( exports , 'selectDraftTransactionError' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectDraftTransactionError ;
}
} ) ;
Object . defineProperty ( exports , 'selectBlocks' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectBlocks ;
}
} ) ;
2018-10-26 20:10:50 +02:00
Object . defineProperty ( exports , 'selectWalletIsEncrypted' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectWalletIsEncrypted ;
}
} ) ;
Object . defineProperty ( exports , 'selectWalletState' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectWalletState ;
}
} ) ;
Object . defineProperty ( exports , 'selectWalletEncryptPending' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectWalletEncryptPending ;
}
} ) ;
Object . defineProperty ( exports , 'selectWalletEncryptSucceeded' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectWalletEncryptSucceeded ;
}
} ) ;
Object . defineProperty ( exports , 'selectWalletEncryptResult' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectWalletEncryptResult ;
}
} ) ;
Object . defineProperty ( exports , 'selectWalletDecryptPending' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectWalletDecryptPending ;
}
} ) ;
Object . defineProperty ( exports , 'selectWalletDecryptSucceeded' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectWalletDecryptSucceeded ;
}
} ) ;
Object . defineProperty ( exports , 'selectWalletDecryptResult' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectWalletDecryptResult ;
}
} ) ;
Object . defineProperty ( exports , 'selectWalletUnlockPending' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectWalletUnlockPending ;
}
} ) ;
Object . defineProperty ( exports , 'selectWalletUnlockSucceeded' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectWalletUnlockSucceeded ;
}
} ) ;
Object . defineProperty ( exports , 'selectWalletUnlockResult' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectWalletUnlockResult ;
}
} ) ;
Object . defineProperty ( exports , 'selectTransactionListFilter' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectTransactionListFilter ;
}
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _action _types = _ _webpack _require _ _ ( 2 ) ;
2018-07-23 15:12:18 +02:00
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
2018-11-29 07:07:43 +01:00
var _thumbnail _upload _statuses = _ _webpack _require _ _ ( 48 ) ;
2018-07-23 15:12:18 +02:00
var THUMBNAIL _STATUSES = _interopRequireWildcard ( _thumbnail _upload _statuses ) ;
2018-11-29 07:07:43 +01:00
var _search4 = _ _webpack _require _ _ ( 22 ) ;
2018-07-23 15:12:18 +02:00
var SEARCH _TYPES = _interopRequireWildcard ( _search4 ) ;
2018-11-29 07:07:43 +01:00
var _settings = _ _webpack _require _ _ ( 49 ) ;
2018-07-23 15:12:18 +02:00
var SETTINGS = _interopRequireWildcard ( _settings ) ;
2018-11-29 07:07:43 +01:00
var _transaction _types = _ _webpack _require _ _ ( 27 ) ;
2018-10-26 20:10:50 +02:00
var TRANSACTIONS = _interopRequireWildcard ( _transaction _types ) ;
2018-11-29 07:07:43 +01:00
var _sort _options = _ _webpack _require _ _ ( 38 ) ;
2018-10-26 20:10:50 +02:00
var SORT _OPTIONS = _interopRequireWildcard ( _sort _options ) ;
2018-11-29 07:07:43 +01:00
var _pages = _ _webpack _require _ _ ( 39 ) ;
2018-10-26 20:10:50 +02:00
var PAGES = _interopRequireWildcard ( _pages ) ;
2018-11-29 07:07:43 +01:00
var _lbry = _ _webpack _require _ _ ( 9 ) ;
2018-07-23 15:12:18 +02:00
var _lbry2 = _interopRequireDefault ( _lbry ) ;
2018-11-29 07:07:43 +01:00
var _lbryapi = _ _webpack _require _ _ ( 12 ) ;
2018-07-23 15:12:18 +02:00
var _lbryapi2 = _interopRequireDefault ( _lbryapi ) ;
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
// constants
exports . ACTIONS = ACTIONS ;
exports . THUMBNAIL _STATUSES = THUMBNAIL _STATUSES ;
exports . SEARCH _TYPES = SEARCH _TYPES ;
exports . SETTINGS = SETTINGS ;
2018-10-26 20:10:50 +02:00
exports . TRANSACTIONS = TRANSACTIONS ;
exports . SORT _OPTIONS = SORT _OPTIONS ;
exports . PAGES = PAGES ;
2018-07-23 15:12:18 +02:00
// common
exports . Lbry = _lbry2 . default ;
exports . Lbryapi = _lbryapi2 . default ;
exports . selectSearchState = _search3 . selectState ;
/***/ } ) ,
/* 1 */
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
2018-11-29 07:07:43 +01:00
var _action _types = _ _webpack _require _ _ ( 2 ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
/ *
Toasts :
- First - in , first - out queue
- Simple messages that are shown in response to user interactions
- Never saved
- If they are the result of errors , use the isError flag when creating
- For errors that should interrupt user behavior , use Error
* /
/ * : : e x p o r t t y p e T o a s t P a r a m s = {
2018-07-23 15:12:18 +02:00
message : string ,
2018-11-29 07:07:43 +01:00
title ? : string ,
linkText ? : string ,
linkTarget ? : string ,
isError ? : boolean ,
} ; * / / / @ flow
/ * : : e x p o r t t y p e T o a s t = {
id : string ,
params : ToastParams ,
} ; * /
/ *
Notifications :
- List of notifications based on user interactions / app notifications
- Always saved , but can be manually deleted
- Can happen in the background , or because of user interaction ( ex : publish confirmed )
* /
/ * : : e x p o r t t y p e D o T o a s t = {
type : ACTIONS . CREATE _TOAST ,
data : Toast ,
} ; * /
/ * : : e x p o r t t y p e N o t i f i c a t i o n = {
id : string , // Unique id
dateCreated : number ,
isRead : boolean , // Used to display "new" notifications that a user hasn't seen yet
source ? : string , // The type/area an notification is from. Used for sorting (ex: publishes, transactions)
// We may want to use priority/isDismissed in the future to specify how urgent a notification is
// and if the user should see it immediately
// isDissmied: boolean,
// priority?: number
} ; * /
/ * : : e x p o r t t y p e D o N o t i f i c a t i o n = {
type : ACTIONS . CREATE _NOTIFICATION ,
data : Notification ,
} ; * /
/ * : : e x p o r t t y p e D o E d i t N o t i f i c a t i o n = {
type : ACTIONS . EDIT _NOTIFICATION ,
data : {
id : string ,
isRead : boolean ,
// In the future we can add `isDismissed` if we decide to show notifications as they come in
// Similar to Facebook's notifications in the corner of the screen
// isDismissed: boolean,
} ,
} ; * /
/ *
Errors :
- First - in , first - out queue
- Errors that should interupt user behavior
- For errors that can be shown without interrupting a user , use Toast with the isError flag
* /
/ * : : e x p o r t t y p e D o D e l e t e N o t i f i c a t i o n = {
type : ACTIONS . DELETE _NOTIFICATION ,
data : {
id : string , // The id to delete
} ,
} ; * /
/ * : : e x p o r t t y p e E r r o r = {
title : string ,
text : string ,
} ; * /
/ * : : e x p o r t t y p e D o E r r o r = {
type : ACTIONS . CREATE _ERROR ,
data : Error ,
} ; * /
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
/ *
NotificationState
* /
/ * : : e x p o r t t y p e D o D i s m i s s E r r o r = {
type : ACTIONS . DISMISS _ERROR ,
2018-07-23 15:12:18 +02:00
} ; * /
2018-11-29 07:07:43 +01:00
/ * : : e x p o r t t y p e N o t i f i c a t i o n S t a t e = {
notifications : Array < Notification > ,
errors : Array < Error > ,
toasts : Array < Toast > ,
2018-07-23 15:12:18 +02:00
} ; * /
/***/ } ) ,
/* 2 */
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-11-29 07:07:43 +01:00
var WINDOW _FOCUSED = exports . WINDOW _FOCUSED = 'WINDOW_FOCUSED' ;
var DAEMON _READY = exports . DAEMON _READY = 'DAEMON_READY' ;
var DAEMON _VERSION _MATCH = exports . DAEMON _VERSION _MATCH = 'DAEMON_VERSION_MATCH' ;
var DAEMON _VERSION _MISMATCH = exports . DAEMON _VERSION _MISMATCH = 'DAEMON_VERSION_MISMATCH' ;
var VOLUME _CHANGED = exports . VOLUME _CHANGED = 'VOLUME_CHANGED' ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
// Navigation
var CHANGE _AFTER _AUTH _PATH = exports . CHANGE _AFTER _AUTH _PATH = 'CHANGE_AFTER_AUTH_PATH' ;
var WINDOW _SCROLLED = exports . WINDOW _SCROLLED = 'WINDOW_SCROLLED' ;
var HISTORY _NAVIGATE = exports . HISTORY _NAVIGATE = 'HISTORY_NAVIGATE' ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
// Upgrades
var UPGRADE _CANCELLED = exports . UPGRADE _CANCELLED = 'UPGRADE_CANCELLED' ;
var DOWNLOAD _UPGRADE = exports . DOWNLOAD _UPGRADE = 'DOWNLOAD_UPGRADE' ;
var UPGRADE _DOWNLOAD _STARTED = exports . UPGRADE _DOWNLOAD _STARTED = 'UPGRADE_DOWNLOAD_STARTED' ;
var UPGRADE _DOWNLOAD _COMPLETED = exports . UPGRADE _DOWNLOAD _COMPLETED = 'UPGRADE_DOWNLOAD_COMPLETED' ;
var UPGRADE _DOWNLOAD _PROGRESSED = exports . UPGRADE _DOWNLOAD _PROGRESSED = 'UPGRADE_DOWNLOAD_PROGRESSED' ;
var CHECK _UPGRADE _AVAILABLE = exports . CHECK _UPGRADE _AVAILABLE = 'CHECK_UPGRADE_AVAILABLE' ;
var CHECK _UPGRADE _START = exports . CHECK _UPGRADE _START = 'CHECK_UPGRADE_START' ;
var CHECK _UPGRADE _SUCCESS = exports . CHECK _UPGRADE _SUCCESS = 'CHECK_UPGRADE_SUCCESS' ;
var CHECK _UPGRADE _FAIL = exports . CHECK _UPGRADE _FAIL = 'CHECK_UPGRADE_FAIL' ;
var CHECK _UPGRADE _SUBSCRIBE = exports . CHECK _UPGRADE _SUBSCRIBE = 'CHECK_UPGRADE_SUBSCRIBE' ;
var UPDATE _VERSION = exports . UPDATE _VERSION = 'UPDATE_VERSION' ;
var UPDATE _REMOTE _VERSION = exports . UPDATE _REMOTE _VERSION = 'UPDATE_REMOTE_VERSION' ;
var SKIP _UPGRADE = exports . SKIP _UPGRADE = 'SKIP_UPGRADE' ;
var START _UPGRADE = exports . START _UPGRADE = 'START_UPGRADE' ;
var AUTO _UPDATE _DECLINED = exports . AUTO _UPDATE _DECLINED = 'AUTO_UPDATE_DECLINED' ;
var AUTO _UPDATE _DOWNLOADED = exports . AUTO _UPDATE _DOWNLOADED = 'AUTO_UPDATE_DOWNLOADED' ;
var CLEAR _UPGRADE _TIMER = exports . CLEAR _UPGRADE _TIMER = 'CLEAR_UPGRADE_TIMER' ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
// Wallet
var GET _NEW _ADDRESS _STARTED = exports . GET _NEW _ADDRESS _STARTED = 'GET_NEW_ADDRESS_STARTED' ;
var GET _NEW _ADDRESS _COMPLETED = exports . GET _NEW _ADDRESS _COMPLETED = 'GET_NEW_ADDRESS_COMPLETED' ;
var FETCH _TRANSACTIONS _STARTED = exports . FETCH _TRANSACTIONS _STARTED = 'FETCH_TRANSACTIONS_STARTED' ;
var FETCH _TRANSACTIONS _COMPLETED = exports . FETCH _TRANSACTIONS _COMPLETED = 'FETCH_TRANSACTIONS_COMPLETED' ;
var UPDATE _BALANCE = exports . UPDATE _BALANCE = 'UPDATE_BALANCE' ;
var CHECK _ADDRESS _IS _MINE _STARTED = exports . CHECK _ADDRESS _IS _MINE _STARTED = 'CHECK_ADDRESS_IS_MINE_STARTED' ;
var CHECK _ADDRESS _IS _MINE _COMPLETED = exports . CHECK _ADDRESS _IS _MINE _COMPLETED = 'CHECK_ADDRESS_IS_MINE_COMPLETED' ;
var SEND _TRANSACTION _STARTED = exports . SEND _TRANSACTION _STARTED = 'SEND_TRANSACTION_STARTED' ;
var SEND _TRANSACTION _COMPLETED = exports . SEND _TRANSACTION _COMPLETED = 'SEND_TRANSACTION_COMPLETED' ;
var SEND _TRANSACTION _FAILED = exports . SEND _TRANSACTION _FAILED = 'SEND_TRANSACTION_FAILED' ;
var FETCH _BLOCK _SUCCESS = exports . FETCH _BLOCK _SUCCESS = 'FETCH_BLOCK_SUCCESS' ;
var SUPPORT _TRANSACTION _STARTED = exports . SUPPORT _TRANSACTION _STARTED = 'SUPPORT_TRANSACTION_STARTED' ;
var SUPPORT _TRANSACTION _COMPLETED = exports . SUPPORT _TRANSACTION _COMPLETED = 'SUPPORT_TRANSACTION_COMPLETED' ;
var SUPPORT _TRANSACTION _FAILED = exports . SUPPORT _TRANSACTION _FAILED = 'SUPPORT_TRANSACTION_FAILED' ;
var WALLET _ENCRYPT _START = exports . WALLET _ENCRYPT _START = 'WALLET_ENCRYPT_START' ;
var WALLET _ENCRYPT _COMPLETED = exports . WALLET _ENCRYPT _COMPLETED = 'WALLET_ENCRYPT_COMPLETED' ;
var WALLET _ENCRYPT _FAILED = exports . WALLET _ENCRYPT _FAILED = 'WALLET_ENCRYPT_FAILED' ;
var WALLET _UNLOCK _START = exports . WALLET _UNLOCK _START = 'WALLET_UNLOCK_START' ;
var WALLET _UNLOCK _COMPLETED = exports . WALLET _UNLOCK _COMPLETED = 'WALLET_UNLOCK_COMPLETED' ;
var WALLET _UNLOCK _FAILED = exports . WALLET _UNLOCK _FAILED = 'WALLET_UNLOCK_FAILED' ;
var WALLET _DECRYPT _START = exports . WALLET _DECRYPT _START = 'WALLET_DECRYPT_START' ;
var WALLET _DECRYPT _COMPLETED = exports . WALLET _DECRYPT _COMPLETED = 'WALLET_DECRYPT_COMPLETED' ;
var WALLET _DECRYPT _FAILED = exports . WALLET _DECRYPT _FAILED = 'WALLET_DECRYPT_FAILED' ;
var WALLET _LOCK _START = exports . WALLET _LOCK _START = 'WALLET_LOCK_START' ;
var WALLET _LOCK _COMPLETED = exports . WALLET _LOCK _COMPLETED = 'WALLET_LOCK_COMPLETED' ;
var WALLET _LOCK _FAILED = exports . WALLET _LOCK _FAILED = 'WALLET_LOCK_FAILED' ;
var WALLET _STATUS _START = exports . WALLET _STATUS _START = 'WALLET_STATUS_START' ;
var WALLET _STATUS _COMPLETED = exports . WALLET _STATUS _COMPLETED = 'WALLET_STATUS_COMPLETED' ;
var SET _TRANSACTION _LIST _FILTER = exports . SET _TRANSACTION _LIST _FILTER = 'SET_TRANSACTION_LIST_FILTER' ;
var UPDATE _CURRENT _HEIGHT = exports . UPDATE _CURRENT _HEIGHT = 'UPDATE_CURRENT_HEIGHT' ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
// Claims
var FETCH _FEATURED _CONTENT _STARTED = exports . FETCH _FEATURED _CONTENT _STARTED = 'FETCH_FEATURED_CONTENT_STARTED' ;
var FETCH _FEATURED _CONTENT _COMPLETED = exports . FETCH _FEATURED _CONTENT _COMPLETED = 'FETCH_FEATURED_CONTENT_COMPLETED' ;
var FETCH _TRENDING _CONTENT _STARTED = exports . FETCH _TRENDING _CONTENT _STARTED = 'FETCH_TRENDING_CONTENT_STARTED' ;
var FETCH _TRENDING _CONTENT _COMPLETED = exports . FETCH _TRENDING _CONTENT _COMPLETED = 'FETCH_TRENDING_CONTENT_COMPLETED' ;
var RESOLVE _URIS _STARTED = exports . RESOLVE _URIS _STARTED = 'RESOLVE_URIS_STARTED' ;
var RESOLVE _URIS _COMPLETED = exports . RESOLVE _URIS _COMPLETED = 'RESOLVE_URIS_COMPLETED' ;
var FETCH _CHANNEL _CLAIMS _STARTED = exports . FETCH _CHANNEL _CLAIMS _STARTED = 'FETCH_CHANNEL_CLAIMS_STARTED' ;
var FETCH _CHANNEL _CLAIMS _COMPLETED = exports . FETCH _CHANNEL _CLAIMS _COMPLETED = 'FETCH_CHANNEL_CLAIMS_COMPLETED' ;
var FETCH _CHANNEL _CLAIM _COUNT _STARTED = exports . FETCH _CHANNEL _CLAIM _COUNT _STARTED = 'FETCH_CHANNEL_CLAIM_COUNT_STARTED' ;
var FETCH _CHANNEL _CLAIM _COUNT _COMPLETED = exports . FETCH _CHANNEL _CLAIM _COUNT _COMPLETED = 'FETCH_CHANNEL_CLAIM_COUNT_COMPLETED' ;
var FETCH _CLAIM _LIST _MINE _STARTED = exports . FETCH _CLAIM _LIST _MINE _STARTED = 'FETCH_CLAIM_LIST_MINE_STARTED' ;
var FETCH _CLAIM _LIST _MINE _COMPLETED = exports . FETCH _CLAIM _LIST _MINE _COMPLETED = 'FETCH_CLAIM_LIST_MINE_COMPLETED' ;
var ABANDON _CLAIM _STARTED = exports . ABANDON _CLAIM _STARTED = 'ABANDON_CLAIM_STARTED' ;
var ABANDON _CLAIM _SUCCEEDED = exports . ABANDON _CLAIM _SUCCEEDED = 'ABANDON_CLAIM_SUCCEEDED' ;
var FETCH _CHANNEL _LIST _STARTED = exports . FETCH _CHANNEL _LIST _STARTED = 'FETCH_CHANNEL_LIST_STARTED' ;
var FETCH _CHANNEL _LIST _COMPLETED = exports . FETCH _CHANNEL _LIST _COMPLETED = 'FETCH_CHANNEL_LIST_COMPLETED' ;
var CREATE _CHANNEL _STARTED = exports . CREATE _CHANNEL _STARTED = 'CREATE_CHANNEL_STARTED' ;
var CREATE _CHANNEL _COMPLETED = exports . CREATE _CHANNEL _COMPLETED = 'CREATE_CHANNEL_COMPLETED' ;
var PUBLISH _STARTED = exports . PUBLISH _STARTED = 'PUBLISH_STARTED' ;
var PUBLISH _COMPLETED = exports . PUBLISH _COMPLETED = 'PUBLISH_COMPLETED' ;
var PUBLISH _FAILED = exports . PUBLISH _FAILED = 'PUBLISH_FAILED' ;
var FETCH _BLACK _LISTED _CONTENT _STARTED = exports . FETCH _BLACK _LISTED _CONTENT _STARTED = 'FETCH_BLACK_LISTED_CONTENT_STARTED' ;
var FETCH _BLACK _LISTED _CONTENT _COMPLETED = exports . FETCH _BLACK _LISTED _CONTENT _COMPLETED = 'FETCH_BLACK_LISTED_CONTENT_COMPLETED' ;
var FETCH _BLACK _LISTED _CONTENT _FAILED = exports . FETCH _BLACK _LISTED _CONTENT _FAILED = 'FETCH_BLACK_LISTED_CONTENT_FAILED' ;
var BLACK _LISTED _CONTENT _SUBSCRIBE = exports . BLACK _LISTED _CONTENT _SUBSCRIBE = 'BLACK_LISTED_CONTENT_SUBSCRIBE' ;
var SET _PLAYING _URI = exports . SET _PLAYING _URI = 'SET_PLAYING_URI' ;
var SET _CONTENT _POSITION = exports . SET _CONTENT _POSITION = 'SET_CONTENT_POSITION' ;
var SET _CONTENT _LAST _VIEWED = exports . SET _CONTENT _LAST _VIEWED = 'SET_CONTENT_LAST_VIEWED' ;
var CLEAR _CONTENT _HISTORY _URI = exports . CLEAR _CONTENT _HISTORY _URI = 'CLEAR_CONTENT_HISTORY_URI' ;
var CLEAR _CONTENT _HISTORY _ALL = exports . CLEAR _CONTENT _HISTORY _ALL = 'CLEAR_CONTENT_HISTORY_ALL' ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
// Files
var FILE _LIST _STARTED = exports . FILE _LIST _STARTED = 'FILE_LIST_STARTED' ;
var FILE _LIST _SUCCEEDED = exports . FILE _LIST _SUCCEEDED = 'FILE_LIST_SUCCEEDED' ;
var FETCH _FILE _INFO _STARTED = exports . FETCH _FILE _INFO _STARTED = 'FETCH_FILE_INFO_STARTED' ;
var FETCH _FILE _INFO _COMPLETED = exports . FETCH _FILE _INFO _COMPLETED = 'FETCH_FILE_INFO_COMPLETED' ;
var FETCH _COST _INFO _STARTED = exports . FETCH _COST _INFO _STARTED = 'FETCH_COST_INFO_STARTED' ;
var FETCH _COST _INFO _COMPLETED = exports . FETCH _COST _INFO _COMPLETED = 'FETCH_COST_INFO_COMPLETED' ;
var LOADING _VIDEO _STARTED = exports . LOADING _VIDEO _STARTED = 'LOADING_VIDEO_STARTED' ;
var LOADING _VIDEO _COMPLETED = exports . LOADING _VIDEO _COMPLETED = 'LOADING_VIDEO_COMPLETED' ;
var LOADING _VIDEO _FAILED = exports . LOADING _VIDEO _FAILED = 'LOADING_VIDEO_FAILED' ;
var DOWNLOADING _STARTED = exports . DOWNLOADING _STARTED = 'DOWNLOADING_STARTED' ;
var DOWNLOADING _PROGRESSED = exports . DOWNLOADING _PROGRESSED = 'DOWNLOADING_PROGRESSED' ;
var DOWNLOADING _COMPLETED = exports . DOWNLOADING _COMPLETED = 'DOWNLOADING_COMPLETED' ;
var DOWNLOADING _CANCELED = exports . DOWNLOADING _CANCELED = 'DOWNLOADING_CANCELED' ;
var PLAY _VIDEO _STARTED = exports . PLAY _VIDEO _STARTED = 'PLAY_VIDEO_STARTED' ;
var FETCH _AVAILABILITY _STARTED = exports . FETCH _AVAILABILITY _STARTED = 'FETCH_AVAILABILITY_STARTED' ;
var FETCH _AVAILABILITY _COMPLETED = exports . FETCH _AVAILABILITY _COMPLETED = 'FETCH_AVAILABILITY_COMPLETED' ;
var FILE _DELETE = exports . FILE _DELETE = 'FILE_DELETE' ;
var SET _FILE _LIST _SORT = exports . SET _FILE _LIST _SORT = 'SET_FILE_LIST_SORT' ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
// Search
var SEARCH _START = exports . SEARCH _START = 'SEARCH_START' ;
var SEARCH _SUCCESS = exports . SEARCH _SUCCESS = 'SEARCH_SUCCESS' ;
var SEARCH _FAIL = exports . SEARCH _FAIL = 'SEARCH_FAIL' ;
var UPDATE _SEARCH _QUERY = exports . UPDATE _SEARCH _QUERY = 'UPDATE_SEARCH_QUERY' ;
var UPDATE _SEARCH _SUGGESTIONS = exports . UPDATE _SEARCH _SUGGESTIONS = 'UPDATE_SEARCH_SUGGESTIONS' ;
var SEARCH _FOCUS = exports . SEARCH _FOCUS = 'SEARCH_FOCUS' ;
var SEARCH _BLUR = exports . SEARCH _BLUR = 'SEARCH_BLUR' ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
// Settings
var DAEMON _SETTINGS _RECEIVED = exports . DAEMON _SETTINGS _RECEIVED = 'DAEMON_SETTINGS_RECEIVED' ;
var CLIENT _SETTING _CHANGED = exports . CLIENT _SETTING _CHANGED = 'CLIENT_SETTING_CHANGED' ;
var UPDATE _IS _NIGHT = exports . UPDATE _IS _NIGHT = 'UPDATE_IS_NIGHT' ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
// User
var AUTHENTICATION _STARTED = exports . AUTHENTICATION _STARTED = 'AUTHENTICATION_STARTED' ;
var AUTHENTICATION _SUCCESS = exports . AUTHENTICATION _SUCCESS = 'AUTHENTICATION_SUCCESS' ;
var AUTHENTICATION _FAILURE = exports . AUTHENTICATION _FAILURE = 'AUTHENTICATION_FAILURE' ;
var USER _EMAIL _DECLINE = exports . USER _EMAIL _DECLINE = 'USER_EMAIL_DECLINE' ;
var USER _EMAIL _NEW _STARTED = exports . USER _EMAIL _NEW _STARTED = 'USER_EMAIL_NEW_STARTED' ;
var USER _EMAIL _NEW _SUCCESS = exports . USER _EMAIL _NEW _SUCCESS = 'USER_EMAIL_NEW_SUCCESS' ;
var USER _EMAIL _NEW _EXISTS = exports . USER _EMAIL _NEW _EXISTS = 'USER_EMAIL_NEW_EXISTS' ;
var USER _EMAIL _NEW _FAILURE = exports . USER _EMAIL _NEW _FAILURE = 'USER_EMAIL_NEW_FAILURE' ;
var USER _EMAIL _VERIFY _SET = exports . USER _EMAIL _VERIFY _SET = 'USER_EMAIL_VERIFY_SET' ;
var USER _EMAIL _VERIFY _STARTED = exports . USER _EMAIL _VERIFY _STARTED = 'USER_EMAIL_VERIFY_STARTED' ;
var USER _EMAIL _VERIFY _SUCCESS = exports . USER _EMAIL _VERIFY _SUCCESS = 'USER_EMAIL_VERIFY_SUCCESS' ;
var USER _EMAIL _VERIFY _FAILURE = exports . USER _EMAIL _VERIFY _FAILURE = 'USER_EMAIL_VERIFY_FAILURE' ;
2018-12-04 19:44:15 +01:00
var USER _EMAIL _VERIFY _RETRY = exports . USER _EMAIL _VERIFY _RETRY = 'USER_EMAIL_VERIFY_RETRY' ;
2018-11-29 07:07:43 +01:00
var USER _PHONE _RESET = exports . USER _PHONE _RESET = 'USER_PHONE_RESET' ;
var USER _PHONE _NEW _STARTED = exports . USER _PHONE _NEW _STARTED = 'USER_PHONE_NEW_STARTED' ;
var USER _PHONE _NEW _SUCCESS = exports . USER _PHONE _NEW _SUCCESS = 'USER_PHONE_NEW_SUCCESS' ;
var USER _PHONE _NEW _FAILURE = exports . USER _PHONE _NEW _FAILURE = 'USER_PHONE_NEW_FAILURE' ;
var USER _PHONE _VERIFY _STARTED = exports . USER _PHONE _VERIFY _STARTED = 'USER_PHONE_VERIFY_STARTED' ;
var USER _PHONE _VERIFY _SUCCESS = exports . USER _PHONE _VERIFY _SUCCESS = 'USER_PHONE_VERIFY_SUCCESS' ;
var USER _PHONE _VERIFY _FAILURE = exports . USER _PHONE _VERIFY _FAILURE = 'USER_PHONE_VERIFY_FAILURE' ;
var USER _IDENTITY _VERIFY _STARTED = exports . USER _IDENTITY _VERIFY _STARTED = 'USER_IDENTITY_VERIFY_STARTED' ;
var USER _IDENTITY _VERIFY _SUCCESS = exports . USER _IDENTITY _VERIFY _SUCCESS = 'USER_IDENTITY_VERIFY_SUCCESS' ;
var USER _IDENTITY _VERIFY _FAILURE = exports . USER _IDENTITY _VERIFY _FAILURE = 'USER_IDENTITY_VERIFY_FAILURE' ;
var USER _FETCH _STARTED = exports . USER _FETCH _STARTED = 'USER_FETCH_STARTED' ;
var USER _FETCH _SUCCESS = exports . USER _FETCH _SUCCESS = 'USER_FETCH_SUCCESS' ;
var USER _FETCH _FAILURE = exports . USER _FETCH _FAILURE = 'USER_FETCH_FAILURE' ;
var USER _INVITE _STATUS _FETCH _STARTED = exports . USER _INVITE _STATUS _FETCH _STARTED = 'USER_INVITE_STATUS_FETCH_STARTED' ;
var USER _INVITE _STATUS _FETCH _SUCCESS = exports . USER _INVITE _STATUS _FETCH _SUCCESS = 'USER_INVITE_STATUS_FETCH_SUCCESS' ;
var USER _INVITE _STATUS _FETCH _FAILURE = exports . USER _INVITE _STATUS _FETCH _FAILURE = 'USER_INVITE_STATUS_FETCH_FAILURE' ;
var USER _INVITE _NEW _STARTED = exports . USER _INVITE _NEW _STARTED = 'USER_INVITE_NEW_STARTED' ;
var USER _INVITE _NEW _SUCCESS = exports . USER _INVITE _NEW _SUCCESS = 'USER_INVITE_NEW_SUCCESS' ;
var USER _INVITE _NEW _FAILURE = exports . USER _INVITE _NEW _FAILURE = 'USER_INVITE_NEW_FAILURE' ;
var FETCH _ACCESS _TOKEN _SUCCESS = exports . FETCH _ACCESS _TOKEN _SUCCESS = 'FETCH_ACCESS_TOKEN_SUCCESS' ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
// Rewards
var FETCH _REWARDS _STARTED = exports . FETCH _REWARDS _STARTED = 'FETCH_REWARDS_STARTED' ;
var FETCH _REWARDS _COMPLETED = exports . FETCH _REWARDS _COMPLETED = 'FETCH_REWARDS_COMPLETED' ;
var CLAIM _REWARD _STARTED = exports . CLAIM _REWARD _STARTED = 'CLAIM_REWARD_STARTED' ;
var CLAIM _REWARD _SUCCESS = exports . CLAIM _REWARD _SUCCESS = 'CLAIM_REWARD_SUCCESS' ;
var CLAIM _REWARD _FAILURE = exports . CLAIM _REWARD _FAILURE = 'CLAIM_REWARD_FAILURE' ;
var CLAIM _REWARD _CLEAR _ERROR = exports . CLAIM _REWARD _CLEAR _ERROR = 'CLAIM_REWARD_CLEAR_ERROR' ;
var FETCH _REWARD _CONTENT _COMPLETED = exports . FETCH _REWARD _CONTENT _COMPLETED = 'FETCH_REWARD_CONTENT_COMPLETED' ;
// Language
var DOWNLOAD _LANGUAGE _SUCCEEDED = exports . DOWNLOAD _LANGUAGE _SUCCEEDED = 'DOWNLOAD_LANGUAGE_SUCCEEDED' ;
var DOWNLOAD _LANGUAGE _FAILED = exports . DOWNLOAD _LANGUAGE _FAILED = 'DOWNLOAD_LANGUAGE_FAILED' ;
// ShapeShift
var GET _SUPPORTED _COINS _START = exports . GET _SUPPORTED _COINS _START = 'GET_SUPPORTED_COINS_START' ;
var GET _SUPPORTED _COINS _SUCCESS = exports . GET _SUPPORTED _COINS _SUCCESS = 'GET_SUPPORTED_COINS_SUCCESS' ;
var GET _SUPPORTED _COINS _FAIL = exports . GET _SUPPORTED _COINS _FAIL = 'GET_SUPPORTED_COINS_FAIL' ;
var GET _COIN _STATS _START = exports . GET _COIN _STATS _START = 'GET_COIN_STATS_START' ;
var GET _COIN _STATS _SUCCESS = exports . GET _COIN _STATS _SUCCESS = 'GET_COIN_STATS_SUCCESS' ;
var GET _COIN _STATS _FAIL = exports . GET _COIN _STATS _FAIL = 'GET_COIN_STATS_FAIL' ;
var PREPARE _SHAPE _SHIFT _START = exports . PREPARE _SHAPE _SHIFT _START = 'PREPARE_SHAPE_SHIFT_START' ;
var PREPARE _SHAPE _SHIFT _SUCCESS = exports . PREPARE _SHAPE _SHIFT _SUCCESS = 'PREPARE_SHAPE_SHIFT_SUCCESS' ;
var PREPARE _SHAPE _SHIFT _FAIL = exports . PREPARE _SHAPE _SHIFT _FAIL = 'PREPARE_SHAPE_SHIFT_FAIL' ;
var GET _ACTIVE _SHIFT _START = exports . GET _ACTIVE _SHIFT _START = 'GET_ACTIVE_SHIFT_START' ;
var GET _ACTIVE _SHIFT _SUCCESS = exports . GET _ACTIVE _SHIFT _SUCCESS = 'GET_ACTIVE_SHIFT_SUCCESS' ;
var GET _ACTIVE _SHIFT _FAIL = exports . GET _ACTIVE _SHIFT _FAIL = 'GET_ACTIVE_SHIFT_FAIL' ;
var CLEAR _SHAPE _SHIFT = exports . CLEAR _SHAPE _SHIFT = 'CLEAR_SHAPE_SHIFT' ;
// Subscriptions
var CHANNEL _SUBSCRIBE = exports . CHANNEL _SUBSCRIBE = 'CHANNEL_SUBSCRIBE' ;
var CHANNEL _UNSUBSCRIBE = exports . CHANNEL _UNSUBSCRIBE = 'CHANNEL_UNSUBSCRIBE' ;
var HAS _FETCHED _SUBSCRIPTIONS = exports . HAS _FETCHED _SUBSCRIPTIONS = 'HAS_FETCHED_SUBSCRIPTIONS' ;
var SET _SUBSCRIPTION _LATEST = exports . SET _SUBSCRIPTION _LATEST = 'SET_SUBSCRIPTION_LATEST' ;
var SET _SUBSCRIPTION _NOTIFICATION = exports . SET _SUBSCRIPTION _NOTIFICATION = 'SET_SUBSCRIPTION_NOTIFICATION' ;
var SET _SUBSCRIPTION _NOTIFICATIONS = exports . SET _SUBSCRIPTION _NOTIFICATIONS = 'SET_SUBSCRIPTION_NOTIFICATIONS' ;
var CHECK _SUBSCRIPTION _STARTED = exports . CHECK _SUBSCRIPTION _STARTED = 'CHECK_SUBSCRIPTION_STARTED' ;
var CHECK _SUBSCRIPTION _COMPLETED = exports . CHECK _SUBSCRIPTION _COMPLETED = 'CHECK_SUBSCRIPTION_COMPLETED' ;
var CHECK _SUBSCRIPTIONS _SUBSCRIBE = exports . CHECK _SUBSCRIPTIONS _SUBSCRIBE = 'CHECK_SUBSCRIPTIONS_SUBSCRIBE' ;
// Publishing
var CLEAR _PUBLISH = exports . CLEAR _PUBLISH = 'CLEAR_PUBLISH' ;
var UPDATE _PUBLISH _FORM = exports . UPDATE _PUBLISH _FORM = 'UPDATE_PUBLISH_FORM' ;
var PUBLISH _START = exports . PUBLISH _START = 'PUBLISH_START' ;
var PUBLISH _SUCCESS = exports . PUBLISH _SUCCESS = 'PUBLISH_SUCCESS' ;
var PUBLISH _FAIL = exports . PUBLISH _FAIL = 'PUBLISH_FAIL' ;
var CLEAR _PUBLISH _ERROR = exports . CLEAR _PUBLISH _ERROR = 'CLEAR_PUBLISH_ERROR' ;
var REMOVE _PENDING _PUBLISH = exports . REMOVE _PENDING _PUBLISH = 'REMOVE_PENDING_PUBLISH' ;
var DO _PREPARE _EDIT = exports . DO _PREPARE _EDIT = 'DO_PREPARE_EDIT' ;
// Notifications
var CREATE _NOTIFICATION = exports . CREATE _NOTIFICATION = 'CREATE_NOTIFICATION' ;
var EDIT _NOTIFICATION = exports . EDIT _NOTIFICATION = 'EDIT_NOTIFICATION' ;
var DELETE _NOTIFICATION = exports . DELETE _NOTIFICATION = 'DELETE_NOTIFICATION' ;
var CREATE _TOAST = exports . CREATE _TOAST = 'CREATE_TOAST' ;
var DISMISS _TOAST = exports . DISMISS _TOAST = 'DISMISS_TOAST' ;
var CREATE _ERROR = exports . CREATE _ERROR = 'CREATE_ERROR' ;
var DISMISS _ERROR = exports . DISMISS _ERROR = 'DISMISS_ERROR' ;
/***/ } ) ,
/* 3 */
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
var _extends = Object . assign || function ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] ; for ( var key in source ) { if ( Object . prototype . hasOwnProperty . call ( source , key ) ) { target [ key ] = source [ key ] ; } } } return target ; } ;
var _slicedToArray = function ( ) { function sliceIterator ( 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" ] ) _i [ "return" ] ( ) ; } finally { if ( _d ) throw _e ; } } return _arr ; } return function ( arr , i ) { if ( Array . isArray ( arr ) ) { return arr ; } else if ( Symbol . iterator in Object ( arr ) ) { return sliceIterator ( arr , i ) ; } else { throw new TypeError ( "Invalid attempt to destructure non-iterable instance" ) ; } } ; } ( ) ;
exports . parseURI = parseURI ;
exports . buildURI = buildURI ;
exports . normalizeURI = normalizeURI ;
exports . isURIValid = isURIValid ;
exports . isNameValid = isNameValid ;
exports . isURIClaimable = isURIClaimable ;
exports . convertToShareLink = convertToShareLink ;
var channelNameMinLength = 1 ;
var claimIdMaxLength = 40 ;
var regexInvalidURI = exports . regexInvalidURI = /[^A-Za-z0-9-]/g ;
var regexAddress = exports . regexAddress = /^b(?=[^0OIl]{32,33})[0-9A-Za-z]{32,33}$/ ;
/ * *
* Parses a LBRY name into its component parts . Throws errors with user - friendly
* messages for invalid names .
*
* N . B . that "name" indicates the value in the name position of the URI . For
* claims for channel content , this will actually be the channel name , and
* the content name is in the path ( e . g . lbry : //@channel/content)
*
* In most situations , you ' ll want to use the contentName and channelName keys
* and ignore the name key .
*
* Returns a dictionary with keys :
* - name ( string ) : The value in the "name" position in the URI . Note that this
* could be either content name or channel name ; see above .
* - path ( string , if persent )
* - claimSequence ( int , if present )
* - bidPosition ( int , if present )
* - claimId ( string , if present )
* - isChannel ( boolean )
* - contentName ( string ) : For anon claims , the name ; for channel claims , the path
* - channelName ( string , if present ) : Channel name without @
* /
function parseURI ( URI ) {
var requireProto = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : false ;
// Break into components. Empty sub-matches are converted to null
var componentsRegex = new RegExp ( '^((?:lbry://)?)' + // protocol
'([^:$#/]*)' + // claim name (stops at the first separator or end)
'([:$#]?)([^/]*)' + // modifier separator, modifier (stops at the first path separator or end)
'(/?)(.*)' // path separator, path
) ;
var _componentsRegex$exec = componentsRegex . exec ( URI ) . slice ( 1 ) . map ( function ( match ) {
return match || null ;
} ) ,
_componentsRegex$exec2 = _slicedToArray ( _componentsRegex$exec , 6 ) ,
proto = _componentsRegex$exec2 [ 0 ] ,
claimName = _componentsRegex$exec2 [ 1 ] ,
modSep = _componentsRegex$exec2 [ 2 ] ,
modVal = _componentsRegex$exec2 [ 3 ] ,
pathSep = _componentsRegex$exec2 [ 4 ] ,
path = _componentsRegex$exec2 [ 5 ] ;
var contentName = void 0 ;
// Validate protocol
if ( requireProto && ! proto ) {
throw new Error ( _ _ ( 'LBRY URIs must include a protocol prefix (lbry://).' ) ) ;
}
// Validate and process name
2018-07-23 15:12:18 +02:00
if ( ! claimName ) {
throw new Error ( _ _ ( 'URI does not include name.' ) ) ;
}
var isChannel = claimName . startsWith ( '@' ) ;
var channelName = isChannel ? claimName . slice ( 1 ) : claimName ;
if ( isChannel ) {
if ( ! channelName ) {
throw new Error ( _ _ ( 'No channel name after @.' ) ) ;
}
if ( channelName . length < channelNameMinLength ) {
throw new Error ( _ _ ( 'Channel names must be at least %s characters.' , channelNameMinLength ) ) ;
}
contentName = path ;
}
var nameBadChars = ( channelName || claimName ) . match ( regexInvalidURI ) ;
if ( nameBadChars ) {
throw new Error ( _ _ ( 'Invalid character %s in name: %s.' , nameBadChars . length === 1 ? '' : 's' , nameBadChars . join ( ', ' ) ) ) ;
}
// Validate and process modifier (claim ID, bid position or claim sequence)
var claimId = void 0 ;
var claimSequence = void 0 ;
var bidPosition = void 0 ;
if ( modSep ) {
if ( ! modVal ) {
throw new Error ( _ _ ( 'No modifier provided after separator %s.' , modSep ) ) ;
}
if ( modSep === '#' ) {
claimId = modVal ;
} else if ( modSep === ':' ) {
claimSequence = modVal ;
} else if ( modSep === '$' ) {
bidPosition = modVal ;
}
}
2018-10-26 20:10:50 +02:00
if ( claimId && ( claimId . length > claimIdMaxLength || ! claimId . match ( /^[0-9a-f]+$/ ) ) ) {
throw new Error ( _ _ ( 'Invalid claim ID %s.' , claimId ) ) ;
}
2018-07-23 15:12:18 +02:00
if ( claimSequence && ! claimSequence . match ( /^-?[1-9][0-9]*$/ ) ) {
throw new Error ( _ _ ( 'Claim sequence must be a number.' ) ) ;
}
if ( bidPosition && ! bidPosition . match ( /^-?[1-9][0-9]*$/ ) ) {
throw new Error ( _ _ ( 'Bid position must be a number.' ) ) ;
}
// Validate and process path
if ( path ) {
if ( ! isChannel ) {
throw new Error ( _ _ ( 'Only channel URIs may have a path.' ) ) ;
}
var pathBadChars = path . match ( regexInvalidURI ) ;
if ( pathBadChars ) {
throw new Error ( _ _ ( 'Invalid character in path: %s' , pathBadChars . join ( ', ' ) ) ) ;
}
contentName = path ;
} else if ( pathSep ) {
throw new Error ( _ _ ( 'No path provided after /' ) ) ;
}
return _extends ( {
claimName : claimName ,
path : path ,
isChannel : isChannel
} , contentName ? { contentName : contentName } : { } , channelName ? { channelName : channelName } : { } , claimSequence ? { claimSequence : parseInt ( claimSequence , 10 ) } : { } , bidPosition ? { bidPosition : parseInt ( bidPosition , 10 ) } : { } , claimId ? { claimId : claimId } : { } , path ? { path : path } : { } ) ;
}
/ * *
* Takes an object in the same format returned by parse ( ) and builds a URI .
*
* The channelName key will accept names with or without the @ prefix .
* /
function buildURI ( URIObj ) {
var includeProto = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : true ;
var protoDefault = arguments . length > 2 && arguments [ 2 ] !== undefined ? arguments [ 2 ] : 'lbry://' ;
var claimId = URIObj . claimId ,
claimSequence = URIObj . claimSequence ,
bidPosition = URIObj . bidPosition ,
contentName = URIObj . contentName ,
channelName = URIObj . channelName ;
var claimName = URIObj . claimName ,
path = URIObj . path ;
if ( channelName ) {
var channelNameFormatted = channelName . startsWith ( '@' ) ? channelName : '@' + channelName ;
if ( ! claimName ) {
claimName = channelNameFormatted ;
} else if ( claimName !== channelNameFormatted ) {
throw new Error ( _ _ ( 'Received a channel content URI, but claim name and channelName do not match. "name" represents the value in the name position of the URI (lbry://name...), which for channel content will be the channel name. In most cases, to construct a channel URI you should just pass channelName and contentName.' ) ) ;
}
}
if ( contentName ) {
if ( ! claimName ) {
claimName = contentName ;
} else if ( ! path ) {
path = contentName ;
}
if ( path && path !== contentName ) {
throw new Error ( _ _ ( 'Path and contentName do not match. Only one is required; most likely you wanted contentName.' ) ) ;
}
}
return ( includeProto ? protoDefault : '' ) + claimName + ( claimId ? '#' + claimId : '' ) + ( claimSequence ? ':' + claimSequence : '' ) + ( bidPosition ? '' + bidPosition : '' ) + ( path ? '/' + path : '' ) ;
}
/* Takes a parseable LBRY URI and converts it to standard, canonical format */
function normalizeURI ( URI ) {
var _parseURI = parseURI ( URI ) ,
claimName = _parseURI . claimName ,
path = _parseURI . path ,
bidPosition = _parseURI . bidPosition ,
claimSequence = _parseURI . claimSequence ,
claimId = _parseURI . claimId ;
return buildURI ( { claimName : claimName , path : path , claimSequence : claimSequence , bidPosition : bidPosition , claimId : claimId } ) ;
}
function isURIValid ( URI ) {
var parts = void 0 ;
try {
parts = parseURI ( normalizeURI ( URI ) ) ;
} catch ( error ) {
return false ;
}
return parts && parts . claimName ;
}
function isNameValid ( claimName ) {
var checkCase = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : true ;
var regexp = new RegExp ( '^[a-z0-9-]+$' , checkCase ? '' : 'i' ) ;
return regexp . test ( claimName ) ;
}
function isURIClaimable ( URI ) {
var parts = void 0 ;
try {
parts = parseURI ( normalizeURI ( URI ) ) ;
} catch ( error ) {
return false ;
}
return parts && parts . claimName && ! parts . claimId && ! parts . bidPosition && ! parts . claimSequence && ! parts . isChannel && ! parts . path ;
}
function convertToShareLink ( URI ) {
var _parseURI2 = parseURI ( URI ) ,
claimName = _parseURI2 . claimName ,
path = _parseURI2 . path ,
bidPosition = _parseURI2 . bidPosition ,
claimSequence = _parseURI2 . claimSequence ,
claimId = _parseURI2 . claimId ;
return buildURI ( { claimName : claimName , path : path , claimSequence : claimSequence , bidPosition : bidPosition , claimId : claimId } , true , 'https://open.lbry.io/' ) ;
}
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 4 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-11-29 07:07:43 +01:00
exports . doToast = doToast ;
exports . doDismissToast = doDismissToast ;
exports . doError = doError ;
exports . doDismissError = doDismissError ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _action _types = _ _webpack _require _ _ ( 2 ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _v = _ _webpack _require _ _ ( 5 ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _v2 = _interopRequireDefault ( _v ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
2018-07-23 15:12:18 +02:00
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
2018-11-29 07:07:43 +01:00
// @flow
/*:: import type { ToastParams } from 'types/Notification';*/
function doToast ( params /*: ToastParams*/ ) {
if ( ! params ) {
throw Error ( "'params' object is required to create a toast notification" ) ;
}
return {
type : ACTIONS . CREATE _TOAST ,
data : {
id : ( 0 , _v2 . default ) ( ) ,
params : params
}
} ;
}
function doDismissToast ( ) {
return {
type : ACTIONS . DISMISS _TOAST
} ;
}
function doError ( error /*: string | {}*/ ) {
2018-07-23 15:12:18 +02:00
return {
2018-11-29 07:07:43 +01:00
type : ACTIONS . CREATE _ERROR ,
2018-07-23 15:12:18 +02:00
data : {
2018-11-29 07:07:43 +01:00
error : error
2018-07-23 15:12:18 +02:00
}
} ;
}
2018-11-29 07:07:43 +01:00
function doDismissError ( ) {
2018-07-23 15:12:18 +02:00
return {
2018-11-29 07:07:43 +01:00
type : ACTIONS . DISMISS _ERROR
2018-07-23 15:12:18 +02:00
} ;
}
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 5 */
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
var rng = _ _webpack _require _ _ ( 6 ) ;
var bytesToUuid = _ _webpack _require _ _ ( 7 ) ;
function v4 ( options , buf , offset ) {
var i = buf && offset || 0 ;
if ( typeof ( options ) == 'string' ) {
buf = options === 'binary' ? new Array ( 16 ) : null ;
options = null ;
}
options = options || { } ;
var rnds = options . random || ( options . rng || rng ) ( ) ;
// Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
rnds [ 6 ] = ( rnds [ 6 ] & 0x0f ) | 0x40 ;
rnds [ 8 ] = ( rnds [ 8 ] & 0x3f ) | 0x80 ;
// Copy bytes to buffer, if provided
if ( buf ) {
for ( var ii = 0 ; ii < 16 ; ++ ii ) {
buf [ i + ii ] = rnds [ ii ] ;
}
}
return buf || bytesToUuid ( rnds ) ;
}
module . exports = v4 ;
/***/ } ) ,
/* 6 */
/***/ ( function ( module , exports ) {
// Unique ID creation requires a high quality random # generator. In the
// browser this is a little complicated due to unknown quality of Math.random()
// and inconsistent support for the `crypto` API. We do the best we can via
// feature-detection
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
var getRandomValues = ( typeof ( crypto ) != 'undefined' && crypto . getRandomValues . bind ( crypto ) ) ||
( typeof ( msCrypto ) != 'undefined' && msCrypto . getRandomValues . bind ( msCrypto ) ) ;
if ( getRandomValues ) {
// WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
var rnds8 = new Uint8Array ( 16 ) ; // eslint-disable-line no-undef
module . exports = function whatwgRNG ( ) {
getRandomValues ( rnds8 ) ;
return rnds8 ;
} ;
} else {
// Math.random()-based (RNG)
//
// If all else fails, use Math.random(). It's fast, but is of unspecified
// quality.
var rnds = new Array ( 16 ) ;
module . exports = function mathRNG ( ) {
for ( var i = 0 , r ; i < 16 ; i ++ ) {
if ( ( i & 0x03 ) === 0 ) r = Math . random ( ) * 0x100000000 ;
rnds [ i ] = r >>> ( ( i & 0x03 ) << 3 ) & 0xff ;
}
return rnds ;
} ;
}
/***/ } ) ,
/* 7 */
/***/ ( function ( module , exports ) {
/ * *
* Convert array of 16 byte values to UUID string format of the form :
* XXXXXXXX - XXXX - XXXX - XXXX - XXXXXXXXXXXX
* /
var byteToHex = [ ] ;
for ( var i = 0 ; i < 256 ; ++ i ) {
byteToHex [ i ] = ( i + 0x100 ) . toString ( 16 ) . substr ( 1 ) ;
}
function bytesToUuid ( buf , offset ) {
var i = offset || 0 ;
var bth = byteToHex ;
return bth [ buf [ i ++ ] ] + bth [ buf [ i ++ ] ] +
bth [ buf [ i ++ ] ] + bth [ buf [ i ++ ] ] + '-' +
bth [ buf [ i ++ ] ] + bth [ buf [ i ++ ] ] + '-' +
bth [ buf [ i ++ ] ] + bth [ buf [ i ++ ] ] + '-' +
bth [ buf [ i ++ ] ] + bth [ buf [ i ++ ] ] + '-' +
bth [ buf [ i ++ ] ] + bth [ buf [ i ++ ] ] +
bth [ buf [ i ++ ] ] + bth [ buf [ i ++ ] ] +
bth [ buf [ i ++ ] ] + bth [ buf [ i ++ ] ] ;
}
module . exports = bytesToUuid ;
/***/ } ) ,
/* 8 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-11-29 07:07:43 +01:00
var _slicedToArray = function ( ) { function sliceIterator ( 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" ] ) _i [ "return" ] ( ) ; } finally { if ( _d ) throw _e ; } } return _arr ; } return function ( arr , i ) { if ( Array . isArray ( arr ) ) { return arr ; } else if ( Symbol . iterator in Object ( arr ) ) { return sliceIterator ( arr , i ) ; } else { throw new TypeError ( "Invalid attempt to destructure non-iterable instance" ) ; } } ; } ( ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
exports . doResolveUris = doResolveUris ;
exports . doResolveUri = doResolveUri ;
exports . doFetchClaimListMine = doFetchClaimListMine ;
exports . doAbandonClaim = doAbandonClaim ;
exports . doFetchFeaturedUris = doFetchFeaturedUris ;
exports . doFetchTrendingUris = doFetchTrendingUris ;
exports . doFetchClaimsByChannel = doFetchClaimsByChannel ;
exports . doFetchClaimCountByChannel = doFetchClaimCountByChannel ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _action _types = _ _webpack _require _ _ ( 2 ) ;
2018-07-23 15:12:18 +02:00
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
2018-11-29 07:07:43 +01:00
var _lbry = _ _webpack _require _ _ ( 9 ) ;
2018-07-23 15:12:18 +02:00
var _lbry2 = _interopRequireDefault ( _lbry ) ;
2018-11-29 07:07:43 +01:00
var _lbryapi = _ _webpack _require _ _ ( 12 ) ;
2018-07-23 15:12:18 +02:00
var _lbryapi2 = _interopRequireDefault ( _lbryapi ) ;
2018-11-29 07:07:43 +01:00
var _lbryURI = _ _webpack _require _ _ ( 3 ) ;
var _notifications = _ _webpack _require _ _ ( 4 ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _claims = _ _webpack _require _ _ ( 17 ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _batchActions = _ _webpack _require _ _ ( 24 ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _wallet = _ _webpack _require _ _ ( 25 ) ;
2018-07-23 15:12:18 +02:00
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
function _toConsumableArray ( arr ) { if ( Array . isArray ( arr ) ) { for ( var i = 0 , arr2 = Array ( arr . length ) ; i < arr . length ; i ++ ) { arr2 [ i ] = arr [ i ] ; } return arr2 ; } else { return Array . from ( arr ) ; } }
function doResolveUris ( uris ) {
return function ( dispatch , getState ) {
var normalizedUris = uris . map ( _lbryURI . normalizeURI ) ;
var state = getState ( ) ;
// Filter out URIs that are already resolving
var resolvingUris = ( 0 , _claims . selectResolvingUris ) ( state ) ;
var urisToResolve = normalizedUris . filter ( function ( uri ) {
return ! resolvingUris . includes ( uri ) ;
} ) ;
if ( urisToResolve . length === 0 ) {
return ;
}
dispatch ( {
type : ACTIONS . RESOLVE _URIS _STARTED ,
data : { uris : normalizedUris }
} ) ;
var resolveInfo = { } ;
_lbry2 . default . resolve ( { uris : urisToResolve } ) . then ( function ( result ) {
Object . entries ( result ) . forEach ( function ( _ref ) {
var _ref2 = _slicedToArray ( _ref , 2 ) ,
uri = _ref2 [ 0 ] ,
uriResolveInfo = _ref2 [ 1 ] ;
var fallbackResolveInfo = {
claim : null ,
claimsInChannel : null ,
certificate : null
} ;
var _ref3 = uriResolveInfo && ! uriResolveInfo . error ? uriResolveInfo : fallbackResolveInfo ,
claim = _ref3 . claim ,
certificate = _ref3 . certificate ,
claimsInChannel = _ref3 . claims _in _channel ;
resolveInfo [ uri ] = { claim : claim , certificate : certificate , claimsInChannel : claimsInChannel } ;
} ) ;
dispatch ( {
type : ACTIONS . RESOLVE _URIS _COMPLETED ,
data : { resolveInfo : resolveInfo }
} ) ;
} ) ;
} ;
}
function doResolveUri ( uri ) {
return doResolveUris ( [ uri ] ) ;
}
function doFetchClaimListMine ( ) {
return function ( dispatch ) {
dispatch ( {
type : ACTIONS . FETCH _CLAIM _LIST _MINE _STARTED
} ) ;
_lbry2 . default . claim _list _mine ( ) . then ( function ( claims ) {
dispatch ( {
type : ACTIONS . FETCH _CLAIM _LIST _MINE _COMPLETED ,
data : {
claims : claims
}
} ) ;
} ) ;
} ;
}
function doAbandonClaim ( txid , nout ) {
return function ( dispatch , getState ) {
var state = getState ( ) ;
var myClaims = ( 0 , _claims . selectMyClaimsRaw ) ( state ) ;
var _myClaims$find = myClaims . find ( function ( claim ) {
return claim . txid === txid && claim . nout === nout ;
} ) ,
2018-11-29 07:07:43 +01:00
claimId = _myClaims$find . claim _id ;
2018-07-23 15:12:18 +02:00
dispatch ( {
type : ACTIONS . ABANDON _CLAIM _STARTED ,
data : {
claimId : claimId
}
} ) ;
var errorCallback = function errorCallback ( ) {
2018-11-29 07:07:43 +01:00
dispatch ( ( 0 , _notifications . doToast ) ( {
2018-07-23 15:12:18 +02:00
message : 'Transaction failed' ,
2018-11-29 07:07:43 +01:00
isError : true
2018-07-23 15:12:18 +02:00
} ) ) ;
} ;
var successCallback = function successCallback ( results ) {
2018-11-29 07:07:43 +01:00
if ( results . success === true ) {
2018-07-23 15:12:18 +02:00
dispatch ( {
type : ACTIONS . ABANDON _CLAIM _SUCCEEDED ,
data : {
claimId : claimId
}
} ) ;
2018-11-29 07:07:43 +01:00
dispatch ( ( 0 , _notifications . doToast ) ( {
message : 'Successfully abandoned your claim'
} ) ) ;
// After abandoning, call claim_list_mine to show the claim as abandoned
// Also fetch transactions to show the new abandon transaction
2018-07-23 15:12:18 +02:00
dispatch ( doFetchClaimListMine ( ) ) ;
2018-11-29 07:07:43 +01:00
dispatch ( ( 0 , _wallet . doFetchTransactions ) ( ) ) ;
2018-07-23 15:12:18 +02:00
} else {
2018-11-29 07:07:43 +01:00
dispatch ( ( 0 , _notifications . doToast ) ( {
message : 'Error abandoning claim' ,
isError : true
2018-07-23 15:12:18 +02:00
} ) ) ;
}
} ;
_lbry2 . default . claim _abandon ( {
txid : txid ,
nout : nout
} ) . then ( successCallback , errorCallback ) ;
} ;
}
function doFetchFeaturedUris ( ) {
return function ( dispatch ) {
dispatch ( {
type : ACTIONS . FETCH _FEATURED _CONTENT _STARTED
} ) ;
var success = function success ( _ref4 ) {
var Uris = _ref4 . Uris ;
var urisToResolve = [ ] ;
Object . keys ( Uris ) . forEach ( function ( category ) {
urisToResolve = [ ] . concat ( _toConsumableArray ( urisToResolve ) , _toConsumableArray ( Uris [ category ] ) ) ;
} ) ;
var actions = [ doResolveUris ( urisToResolve ) , {
type : ACTIONS . FETCH _FEATURED _CONTENT _COMPLETED ,
data : {
uris : Uris ,
success : true
}
} ] ;
dispatch ( _batchActions . batchActions . apply ( undefined , actions ) ) ;
} ;
var failure = function failure ( ) {
dispatch ( {
type : ACTIONS . FETCH _FEATURED _CONTENT _COMPLETED ,
data : {
uris : { }
}
} ) ;
} ;
_lbryapi2 . default . call ( 'file' , 'list_homepage' ) . then ( success , failure ) ;
} ;
}
function doFetchTrendingUris ( ) {
return function ( dispatch ) {
dispatch ( {
type : ACTIONS . FETCH _TRENDING _CONTENT _STARTED
} ) ;
var success = function success ( data ) {
var urisToResolve = data . map ( function ( uri ) {
return uri . url ;
} ) ;
var actions = [ doResolveUris ( urisToResolve ) , {
type : ACTIONS . FETCH _TRENDING _CONTENT _COMPLETED ,
data : {
uris : data ,
success : true
}
} ] ;
dispatch ( _batchActions . batchActions . apply ( undefined , actions ) ) ;
} ;
var failure = function failure ( ) {
dispatch ( {
type : ACTIONS . FETCH _TRENDING _CONTENT _COMPLETED ,
data : {
uris : [ ]
}
} ) ;
} ;
_lbryapi2 . default . call ( 'file' , 'list_trending' ) . then ( success , failure ) ;
} ;
}
function doFetchClaimsByChannel ( uri , page ) {
return function ( dispatch ) {
dispatch ( {
type : ACTIONS . FETCH _CHANNEL _CLAIMS _STARTED ,
data : { uri : uri , page : page }
} ) ;
_lbry2 . default . claim _list _by _channel ( { uri : uri , page : page || 1 } ) . then ( function ( result ) {
var claimResult = result [ uri ] || { } ;
var claimsInChannel = claimResult . claims _in _channel ,
returnedPage = claimResult . returned _page ;
dispatch ( {
type : ACTIONS . FETCH _CHANNEL _CLAIMS _COMPLETED ,
data : {
uri : uri ,
claims : claimsInChannel || [ ] ,
page : returnedPage || undefined
}
} ) ;
} ) ;
} ;
}
function doFetchClaimCountByChannel ( uri ) {
return function ( dispatch ) {
dispatch ( {
type : ACTIONS . FETCH _CHANNEL _CLAIM _COUNT _STARTED ,
data : { uri : uri }
} ) ;
_lbry2 . default . claim _list _by _channel ( { uri : uri } ) . then ( function ( result ) {
var claimResult = result [ uri ] ;
var totalClaims = claimResult ? claimResult . claims _in _channel : 0 ;
dispatch ( {
type : ACTIONS . FETCH _CHANNEL _CLAIM _COUNT _COMPLETED ,
data : {
uri : uri ,
totalClaims : totalClaims
}
} ) ;
} ) ;
} ;
}
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 9 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-11-29 07:07:43 +01:00
_ _webpack _require _ _ ( 10 ) ;
2018-07-23 15:12:18 +02:00
var CHECK _DAEMON _STARTED _TRY _NUMBER = 200 ; // @flow
var Lbry = {
isConnected : false ,
daemonConnectionString : 'http://localhost:5279' ,
pendingPublishTimeout : 20 * 60 * 1000
} ;
function checkAndParse ( response ) {
if ( response . status >= 200 && response . status < 300 ) {
return response . json ( ) ;
}
return response . json ( ) . then ( function ( json ) {
var error = void 0 ;
if ( json . error ) {
error = new Error ( json . error ) ;
} else {
error = new Error ( 'Protocol error with unknown response signature' ) ;
}
return Promise . reject ( error ) ;
} ) ;
}
function apiCall ( method /*: string*/ , params /*: ?{}*/ , resolve /*: Function*/ , reject /*: Function*/ ) {
var counter = new Date ( ) . getTime ( ) ;
var options = {
method : 'POST' ,
body : JSON . stringify ( {
jsonrpc : '2.0' ,
method : method ,
params : params ,
id : counter
} )
} ;
return fetch ( Lbry . daemonConnectionString , options ) . then ( checkAndParse ) . then ( function ( response ) {
var error = response . error || response . result && response . result . error ;
if ( error ) {
return reject ( error ) ;
}
return resolve ( response . result ) ;
} ) . catch ( reject ) ;
}
var daemonCallWithResult = function daemonCallWithResult ( name ) {
var params = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : { } ;
return new Promise ( function ( resolve , reject ) {
apiCall ( name , params , function ( result ) {
resolve ( result ) ;
} , reject ) ;
} ) ;
} ;
2018-10-26 20:10:50 +02:00
// blobs
Lbry . blob _delete = function ( ) {
var params = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
return daemonCallWithResult ( 'blob_delete' , params ) ;
} ;
Lbry . blob _list = function ( ) {
var params = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
return daemonCallWithResult ( 'blob_list' , params ) ;
} ;
2018-07-23 15:12:18 +02:00
// core
Lbry . status = function ( ) {
var params = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
return daemonCallWithResult ( 'status' , params ) ;
} ;
Lbry . version = function ( ) {
return daemonCallWithResult ( 'version' , { } ) ;
} ;
Lbry . file _delete = function ( ) {
var params = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
return daemonCallWithResult ( 'file_delete' , params ) ;
} ;
Lbry . file _set _status = function ( ) {
var params = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
return daemonCallWithResult ( 'file_set_status' , params ) ;
} ;
// claims
Lbry . claim _list _by _channel = function ( ) {
var params = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
return daemonCallWithResult ( 'claim_list_by_channel' , params ) ;
} ;
// wallet
2018-10-26 20:10:50 +02:00
Lbry . account _balance = function ( ) {
var params = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
return daemonCallWithResult ( 'account_balance' , params ) ;
} ;
Lbry . account _decrypt = function ( ) {
return daemonCallWithResult ( 'account_decrypt' , { } ) ;
} ;
Lbry . account _encrypt = function ( ) {
2018-07-23 15:12:18 +02:00
var params = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
2018-10-26 20:10:50 +02:00
return daemonCallWithResult ( 'account_encrypt' , params ) ;
2018-07-23 15:12:18 +02:00
} ;
2018-10-26 20:10:50 +02:00
Lbry . address _is _mine = function ( ) {
2018-07-23 15:12:18 +02:00
var params = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
2018-10-26 20:10:50 +02:00
return daemonCallWithResult ( 'address_is_mine' , params ) ;
2018-07-23 15:12:18 +02:00
} ;
2018-10-26 20:10:50 +02:00
Lbry . wallet _lock = function ( ) {
return daemonCallWithResult ( 'wallet_lock' , { } ) ;
} ;
Lbry . address _unused = function ( ) {
2018-07-23 15:12:18 +02:00
var params = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
2018-10-26 20:10:50 +02:00
return daemonCallWithResult ( 'address_unused' , params ) ;
2018-07-23 15:12:18 +02:00
} ;
Lbry . wallet _send = function ( ) {
var params = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
return daemonCallWithResult ( 'wallet_send' , params ) ;
} ;
2018-10-26 20:10:50 +02:00
Lbry . account _unlock = function ( ) {
2018-10-18 18:36:55 +02:00
var params = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
2018-10-26 20:10:50 +02:00
return daemonCallWithResult ( 'account_unlock' , params ) ;
2018-10-18 18:36:55 +02:00
} ;
2018-10-26 20:10:50 +02:00
Lbry . address _unused = function ( ) {
return daemonCallWithResult ( 'address_unused' , { } ) ;
2018-10-18 18:36:55 +02:00
} ;
2018-10-26 20:10:50 +02:00
Lbry . claim _tip = function ( ) {
2018-07-23 15:12:18 +02:00
var params = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
2018-10-26 20:10:50 +02:00
return daemonCallWithResult ( 'claim_tip' , params ) ;
2018-07-23 15:12:18 +02:00
} ;
// transactions
Lbry . transaction _list = function ( ) {
var params = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
return daemonCallWithResult ( 'transaction_list' , params ) ;
} ;
Lbry . connectPromise = null ;
Lbry . connect = function ( ) {
if ( Lbry . connectPromise === null ) {
Lbry . connectPromise = new Promise ( function ( resolve , reject ) {
var tryNum = 0 ;
// Check every half second to see if the daemon is accepting connections
function checkDaemonStarted ( ) {
tryNum += 1 ;
Lbry . status ( ) . then ( resolve ) . catch ( function ( ) {
if ( tryNum <= CHECK _DAEMON _STARTED _TRY _NUMBER ) {
setTimeout ( checkDaemonStarted , tryNum < 50 ? 400 : 1000 ) ;
} else {
reject ( new Error ( 'Unable to connect to LBRY' ) ) ;
}
} ) ;
}
checkDaemonStarted ( ) ;
} ) ;
}
return Lbry . connectPromise ;
} ;
2018-10-26 20:10:50 +02:00
Lbry . getMediaType = function ( contentType , extname ) {
if ( extname ) {
var formats = [ [ /^(mp4|m4v|webm|flv|f4v|ogv)$/i , 'video' ] , [ /^(mp3|m4a|aac|wav|flac|ogg|opus)$/i , 'audio' ] , [ /^(html|htm|xml|pdf|odf|doc|docx|md|markdown|txt|epub|org)$/i , 'document' ] , [ /^(stl|obj|fbx|gcode)$/i , '3D-file' ] ] ;
2018-07-23 15:12:18 +02:00
var res = formats . reduce ( function ( ret , testpair ) {
switch ( testpair [ 0 ] . test ( ret ) ) {
case true :
return testpair [ 1 ] ;
default :
return ret ;
}
2018-10-26 20:10:50 +02:00
} , extname ) ;
return res === extname ? 'unknown' : res ;
} else if ( contentType ) {
return ( /^[^/]+/ . exec ( contentType ) [ 0 ]
) ;
2018-07-23 15:12:18 +02:00
}
return 'unknown' ;
} ;
/ * *
* Wrappers for API methods to simulate missing or future behavior . Unlike the old - style stubs ,
* these are designed to be transparent wrappers around the corresponding API methods .
* /
/ * *
* Returns results from the file _list API method , plus dummy entries for pending publishes .
* ( If a real publish with the same name is found , the pending publish will be ignored and removed . )
* /
Lbry . file _list = function ( ) {
var params = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
return new Promise ( function ( resolve , reject ) {
apiCall ( 'file_list' , params , function ( fileInfos ) {
resolve ( fileInfos ) ;
} , reject ) ;
} ) ;
} ;
Lbry . claim _list _mine = function ( ) {
var params = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
return new Promise ( function ( resolve , reject ) {
apiCall ( 'claim_list_mine' , params , function ( claims ) {
resolve ( claims ) ;
} , reject ) ;
} ) ;
} ;
Lbry . get = function ( ) {
var params = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
return new Promise ( function ( resolve , reject ) {
apiCall ( 'get' , params , function ( streamInfo ) {
resolve ( streamInfo ) ;
} , reject ) ;
} ) ;
} ;
Lbry . resolve = function ( ) {
var params = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
return new Promise ( function ( resolve , reject ) {
apiCall ( 'resolve' , params , function ( data ) {
if ( 'uri' in params ) {
// If only a single URI was requested, don't nest the results in an object
resolve ( data && data [ params . uri ] ? data [ params . uri ] : { } ) ;
} else {
resolve ( data || { } ) ;
}
} , reject ) ;
} ) ;
} ;
var lbryProxy = new Proxy ( Lbry , {
get : function get ( target , name ) {
if ( name in target ) {
return target [ name ] ;
}
return function ( ) {
var params = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
return new Promise ( function ( resolve , reject ) {
apiCall ( name , params , resolve , reject ) ;
} ) ;
} ;
}
} ) ;
exports . default = lbryProxy ;
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 10 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
/* WEBPACK VAR INJECTION */ ( function ( global ) { / *
* Copyright 2016 Google Inc . All rights reserved .
*
* Licensed under the Apache License , Version 2.0 ( the "License" ) ; you may not
* use this file except in compliance with the License . You may obtain a copy of
* the License at
*
* http : //www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing , software
* distributed under the License is distributed on an "AS IS" BASIS , WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . See the
* License for the specific language governing permissions and limitations under
* the License .
* /
( function ( scope ) {
if ( scope [ 'Proxy' ] ) {
return ;
}
let lastRevokeFn = null ;
/ * *
* @ param { * } o
* @ return { boolean } whether this is probably a ( non - null ) Object
* /
function isObject ( o ) {
return o ? ( typeof o == 'object' || typeof o == 'function' ) : false ;
}
/ * *
* @ constructor
* @ param { ! Object } target
* @ param { { apply , construct , get , set } } handler
* /
scope . Proxy = function ( target , handler ) {
if ( ! isObject ( target ) || ! isObject ( handler ) ) {
throw new TypeError ( 'Cannot create proxy with a non-object as target or handler' ) ;
}
// Construct revoke function, and set lastRevokeFn so that Proxy.revocable can steal it.
// The caller might get the wrong revoke function if a user replaces or wraps scope.Proxy
// to call itself, but that seems unlikely especially when using the polyfill.
let throwRevoked = function ( ) { } ;
lastRevokeFn = function ( ) {
throwRevoked = function ( trap ) {
throw new TypeError ( ` Cannot perform ' ${ trap } ' on a proxy that has been revoked ` ) ;
} ;
} ;
// Fail on unsupported traps: Chrome doesn't do this, but ensure that users of the polyfill
// are a bit more careful. Copy the internal parts of handler to prevent user changes.
let unsafeHandler = handler ;
handler = { 'get' : null , 'set' : null , 'apply' : null , 'construct' : null } ;
for ( let k in unsafeHandler ) {
if ( ! ( k in handler ) ) {
throw new TypeError ( ` Proxy polyfill does not support trap ' ${ k } ' ` ) ;
}
handler [ k ] = unsafeHandler [ k ] ;
}
if ( typeof unsafeHandler == 'function' ) {
// Allow handler to be a function (which has an 'apply' method). This matches what is
// probably a bug in native versions. It treats the apply call as a trap to be configured.
handler . apply = unsafeHandler . apply . bind ( unsafeHandler ) ;
}
// Define proxy as this, or a Function (if either it's callable, or apply is set).
// TODO(samthor): Closure compiler doesn't know about 'construct', attempts to rename it.
let proxy = this ;
let isMethod = false ;
let targetIsFunction = typeof target == 'function' ;
if ( handler . apply || handler [ 'construct' ] || targetIsFunction ) {
proxy = function Proxy ( ) {
let usingNew = ( this && this . constructor === proxy ) ;
throwRevoked ( usingNew ? 'construct' : 'apply' ) ;
if ( usingNew && handler [ 'construct' ] ) {
return handler [ 'construct' ] . call ( this , target , arguments ) ;
} else if ( ! usingNew && handler . apply ) {
return handler . apply ( target , this , arguments ) ;
} else if ( targetIsFunction ) {
// since the target was a function, fallback to calling it directly.
if ( usingNew ) {
// inspired by answers to https://stackoverflow.com/q/1606797
let all = Array . prototype . slice . call ( arguments ) ;
all . unshift ( target ) ; // pass class as first arg to constructor, although irrelevant
// nb. cast to convince Closure compiler that this is a constructor
let f = /** @type {!Function} */ ( target . bind . apply ( target , all ) ) ;
return new f ( ) ;
}
return target . apply ( this , arguments ) ;
}
throw new TypeError ( usingNew ? 'not a constructor' : 'not a function' ) ;
} ;
isMethod = true ;
}
// Create default getters/setters. Create different code paths as handler.get/handler.set can't
// change after creation.
let getter = handler . get ? function ( prop ) {
throwRevoked ( 'get' ) ;
return handler . get ( this , prop , proxy ) ;
} : function ( prop ) {
throwRevoked ( 'get' ) ;
return this [ prop ] ;
} ;
let setter = handler . set ? function ( prop , value ) {
throwRevoked ( 'set' ) ;
let status = handler . set ( this , prop , value , proxy ) ;
if ( ! status ) {
// TODO(samthor): If the calling code is in strict mode, throw TypeError.
// It's (sometimes) possible to work this out, if this code isn't strict- try to load the
// callee, and if it's available, that code is non-strict. However, this isn't exhaustive.
}
} : function ( prop , value ) {
throwRevoked ( 'set' ) ;
this [ prop ] = value ;
} ;
// Clone direct properties (i.e., not part of a prototype).
let propertyNames = Object . getOwnPropertyNames ( target ) ;
let propertyMap = { } ;
propertyNames . forEach ( function ( prop ) {
if ( isMethod && prop in proxy ) {
return ; // ignore properties already here, e.g. 'bind', 'prototype' etc
}
let real = Object . getOwnPropertyDescriptor ( target , prop ) ;
let desc = {
enumerable : ! ! real . enumerable ,
get : getter . bind ( target , prop ) ,
set : setter . bind ( target , prop ) ,
} ;
Object . defineProperty ( proxy , prop , desc ) ;
propertyMap [ prop ] = true ;
} ) ;
// Set the prototype, or clone all prototype methods (always required if a getter is provided).
// TODO(samthor): We don't allow prototype methods to be set. It's (even more) awkward.
// An alternative here would be to _just_ clone methods to keep behavior consistent.
let prototypeOk = true ;
if ( Object . setPrototypeOf ) {
Object . setPrototypeOf ( proxy , Object . getPrototypeOf ( target ) ) ;
} else if ( proxy . _ _proto _ _ ) {
proxy . _ _proto _ _ = target . _ _proto _ _ ;
} else {
prototypeOk = false ;
}
if ( handler . get || ! prototypeOk ) {
for ( let k in target ) {
if ( propertyMap [ k ] ) {
continue ;
}
Object . defineProperty ( proxy , k , { get : getter . bind ( target , k ) } ) ;
}
}
// The Proxy polyfill cannot handle adding new properties. Seal the target and proxy.
Object . seal ( target ) ;
Object . seal ( proxy ) ;
return proxy ; // nb. if isMethod is true, proxy != this
} ;
scope . Proxy . revocable = function ( target , handler ) {
let p = new scope . Proxy ( target , handler ) ;
return { 'proxy' : p , 'revoke' : lastRevokeFn } ;
} ;
scope . Proxy [ 'revocable' ] = scope . Proxy . revocable ;
scope [ 'Proxy' ] = scope . Proxy ;
} ) ( typeof module !== 'undefined' && module [ 'exports' ] ? global : window ) ;
2018-11-29 07:07:43 +01:00
/* WEBPACK VAR INJECTION */ } . call ( this , _ _webpack _require _ _ ( 11 ) ) )
2018-07-23 15:12:18 +02:00
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 11 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports ) {
2018-10-18 18:36:55 +02:00
var g ;
// This works in non-strict mode
g = ( function ( ) {
return this ;
} ) ( ) ;
try {
// This works if eval is allowed (see CSP)
g = g || Function ( "return this" ) ( ) || ( 1 , eval ) ( "this" ) ;
} catch ( e ) {
// This works if the window reference is available
if ( typeof window === "object" ) g = window ;
}
// 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) { ...}
module . exports = g ;
2018-07-23 15:12:18 +02:00
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 12 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
/* WEBPACK VAR INJECTION */ ( function ( process ) {
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
var _extends = Object . assign || function ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] ; for ( var key in source ) { if ( Object . prototype . hasOwnProperty . call ( source , key ) ) { target [ key ] = source [ key ] ; } } } return target ; } ;
2018-11-29 07:07:43 +01:00
var _querystring = _ _webpack _require _ _ ( 14 ) ;
2018-07-23 15:12:18 +02:00
var _querystring2 = _interopRequireDefault ( _querystring ) ;
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
var Lbryapi = {
enabled : true ,
exchangePromise : null ,
exchangeLastFetched : null
} ;
var CONNECTION _STRING = process . env . LBRY _APP _API _URL ? process . env . LBRY _APP _API _URL . replace ( /\/*$/ , '/' ) // exactly one slash at the end
: 'https://api.lbry.io/' ;
var EXCHANGE _RATE _TIMEOUT = 20 * 60 * 1000 ;
Lbryapi . getExchangeRates = function ( ) {
if ( ! Lbryapi . exchangeLastFetched || Date . now ( ) - Lbryapi . exchangeLastFetched > EXCHANGE _RATE _TIMEOUT ) {
Lbryapi . exchangePromise = new Promise ( function ( resolve , reject ) {
Lbryapi . 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 ;
var rates = { LBC _USD : LBC _USD , LBC _BTC : LBC _BTC , BTC _USD : BTC _USD } ;
resolve ( rates ) ;
} ) . catch ( reject ) ;
} ) ;
Lbryapi . exchangeLastFetched = Date . now ( ) ;
}
return Lbryapi . exchangePromise ;
} ;
Lbryapi . 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 ( ! Lbryapi . 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 ( ) ;
}
return response . json ( ) . then ( function ( json ) {
var error = void 0 ;
if ( json . error ) {
error = new Error ( json . error ) ;
} else {
error = new Error ( 'Unknown API error signature' ) ;
}
error . response = response ; // This is primarily a hack used in actions/user.js
return Promise . reject ( error ) ;
} ) ;
}
function makeRequest ( url , options ) {
return fetch ( url , options ) . then ( checkAndParse ) ;
}
var fullParams = _extends ( { } , params ) ;
var qs = _querystring2 . default . stringify ( fullParams ) ;
var url = '' + CONNECTION _STRING + resource + '/' + action + '?' + qs ;
var options = {
method : 'GET'
} ;
if ( method === 'post' ) {
options = {
method : 'POST' ,
headers : {
'Content-Type' : 'application/x-www-form-urlencoded'
} ,
body : qs
} ;
url = '' + CONNECTION _STRING + resource + '/' + action ;
}
return makeRequest ( url , options ) . then ( function ( response ) {
return response . data ;
} ) ;
} ;
exports . default = Lbryapi ;
2018-11-29 07:07:43 +01:00
/* WEBPACK VAR INJECTION */ } . call ( this , _ _webpack _require _ _ ( 13 ) ) )
2018-07-23 15:12:18 +02:00
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 13 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports ) {
// shim for using process in browser
var process = module . exports = { } ;
// cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.
var cachedSetTimeout ;
var cachedClearTimeout ;
function defaultSetTimout ( ) {
throw new Error ( 'setTimeout has not been defined' ) ;
}
function defaultClearTimeout ( ) {
throw new Error ( 'clearTimeout has not been defined' ) ;
}
( function ( ) {
try {
if ( typeof setTimeout === 'function' ) {
cachedSetTimeout = setTimeout ;
} else {
cachedSetTimeout = defaultSetTimout ;
}
} catch ( e ) {
cachedSetTimeout = defaultSetTimout ;
}
try {
if ( typeof clearTimeout === 'function' ) {
cachedClearTimeout = clearTimeout ;
} else {
cachedClearTimeout = defaultClearTimeout ;
}
} catch ( e ) {
cachedClearTimeout = defaultClearTimeout ;
}
} ( ) )
function runTimeout ( fun ) {
if ( cachedSetTimeout === setTimeout ) {
//normal enviroments in sane situations
return setTimeout ( fun , 0 ) ;
}
// if setTimeout wasn't available but was latter defined
if ( ( cachedSetTimeout === defaultSetTimout || ! cachedSetTimeout ) && setTimeout ) {
cachedSetTimeout = setTimeout ;
return setTimeout ( fun , 0 ) ;
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout ( fun , 0 ) ;
} catch ( e ) {
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout . call ( null , fun , 0 ) ;
} catch ( e ) {
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout . call ( this , fun , 0 ) ;
}
}
}
function runClearTimeout ( marker ) {
if ( cachedClearTimeout === clearTimeout ) {
//normal enviroments in sane situations
return clearTimeout ( marker ) ;
}
// if clearTimeout wasn't available but was latter defined
if ( ( cachedClearTimeout === defaultClearTimeout || ! cachedClearTimeout ) && clearTimeout ) {
cachedClearTimeout = clearTimeout ;
return clearTimeout ( marker ) ;
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout ( marker ) ;
} catch ( e ) {
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout . call ( null , marker ) ;
} catch ( e ) {
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout . call ( this , marker ) ;
}
}
}
var queue = [ ] ;
var draining = false ;
var currentQueue ;
var queueIndex = - 1 ;
function cleanUpNextTick ( ) {
if ( ! draining || ! currentQueue ) {
return ;
}
draining = false ;
if ( currentQueue . length ) {
queue = currentQueue . concat ( queue ) ;
} else {
queueIndex = - 1 ;
}
if ( queue . length ) {
drainQueue ( ) ;
}
}
function drainQueue ( ) {
if ( draining ) {
return ;
}
var timeout = runTimeout ( cleanUpNextTick ) ;
draining = true ;
var len = queue . length ;
while ( len ) {
currentQueue = queue ;
queue = [ ] ;
while ( ++ queueIndex < len ) {
if ( currentQueue ) {
currentQueue [ queueIndex ] . run ( ) ;
}
}
queueIndex = - 1 ;
len = queue . length ;
}
currentQueue = null ;
draining = false ;
runClearTimeout ( timeout ) ;
}
process . nextTick = function ( fun ) {
var args = new Array ( arguments . length - 1 ) ;
if ( arguments . length > 1 ) {
for ( var i = 1 ; i < arguments . length ; i ++ ) {
args [ i - 1 ] = arguments [ i ] ;
}
}
queue . push ( new Item ( fun , args ) ) ;
if ( queue . length === 1 && ! draining ) {
runTimeout ( drainQueue ) ;
}
} ;
// v8 likes predictible objects
function Item ( fun , array ) {
this . fun = fun ;
this . array = array ;
}
Item . prototype . run = function ( ) {
this . fun . apply ( null , this . array ) ;
} ;
process . title = 'browser' ;
process . browser = true ;
process . env = { } ;
process . argv = [ ] ;
process . version = '' ; // empty string to avoid regexp issues
process . versions = { } ;
function noop ( ) { }
process . on = noop ;
process . addListener = noop ;
process . once = noop ;
process . off = noop ;
process . removeListener = noop ;
process . removeAllListeners = noop ;
process . emit = noop ;
process . prependListener = noop ;
process . prependOnceListener = noop ;
process . listeners = function ( name ) { return [ ] }
process . binding = function ( name ) {
throw new Error ( 'process.binding is not supported' ) ;
} ;
process . cwd = function ( ) { return '/' } ;
process . chdir = function ( dir ) {
throw new Error ( 'process.chdir is not supported' ) ;
} ;
process . umask = function ( ) { return 0 ; } ;
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 14 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
2018-11-29 07:07:43 +01:00
exports . decode = exports . parse = _ _webpack _require _ _ ( 15 ) ;
exports . encode = exports . stringify = _ _webpack _require _ _ ( 16 ) ;
2018-07-23 15:12:18 +02:00
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 15 */
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]' ;
} ;
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 16 */
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 ;
} ;
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 17 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-10-26 20:10:50 +02:00
exports . makeSelectChannelForClaimUri = exports . makeSelectRecommendedContentForUri = exports . makeSelectNsfwCountForChannel = exports . makeSelectNsfwCountFromUris = exports . makeSelectTotalPagesForChannel = exports . makeSelectTotalItemsForChannel = exports . selectChannelClaimCounts = exports . selectPlayingUri = exports . selectFetchingTrendingUris = exports . selectTrendingUris = exports . selectFetchingFeaturedUris = exports . selectFeaturedUris = exports . makeSelectIsUriResolving = exports . selectResolvingUris = exports . selectMyChannelClaims = exports . selectFetchingMyChannels = exports . selectMyClaimsOutpoints = exports . selectAllMyClaimsByOutpoint = exports . selectMyClaimsWithoutChannels = exports . selectMyClaims = exports . selectIsFetchingClaimListMine = exports . makeSelectContentTypeForUri = exports . makeSelectTitleForUri = exports . makeSelectMetadataForUri = exports . makeSelectClaimsInChannelForCurrentPage = exports . makeSelectClaimsInChannelForPage = exports . makeSelectFetchingChannelClaims = exports . selectAllFetchingChannelClaims = exports . makeSelectClaimIsMine = exports . selectMyActiveClaims = exports . selectAbandoningIds = exports . selectMyClaimsRaw = exports . makeSelectClaimForUri = exports . makeSelectPendingByUri = exports . makeSelectClaimIsPending = exports . selectPendingClaims = exports . selectPendingById = exports . selectAllClaimsByChannel = exports . selectClaimsByUri = exports . selectClaimsById = undefined ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _lbryURI = _ _webpack _require _ _ ( 3 ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _navigation = _ _webpack _require _ _ ( 18 ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _search = _ _webpack _require _ _ ( 21 ) ;
2018-10-26 20:10:50 +02:00
2018-11-29 07:07:43 +01:00
var _reselect = _ _webpack _require _ _ ( 19 ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _claim = _ _webpack _require _ _ ( 23 ) ;
2018-10-26 20:10:50 +02:00
2018-07-23 15:12:18 +02:00
function _toConsumableArray ( arr ) { if ( Array . isArray ( arr ) ) { for ( var i = 0 , arr2 = Array ( arr . length ) ; i < arr . length ; i ++ ) { arr2 [ i ] = arr [ i ] ; } return arr2 ; } else { return Array . from ( arr ) ; } }
var selectState = function selectState ( state ) {
return state . claims || { } ;
} ;
var selectClaimsById = exports . selectClaimsById = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . byId || { } ;
} ) ;
var selectClaimsByUri = exports . selectClaimsByUri = ( 0 , _reselect . createSelector ) ( selectState , selectClaimsById , function ( state , byId ) {
var byUri = state . claimsByUri || { } ;
var claims = { } ;
Object . keys ( byUri ) . forEach ( function ( uri ) {
var claimId = byUri [ uri ] ;
// NOTE returning a null claim allows us to differentiate between an
// undefined (never fetched claim) and one which just doesn't exist. Not
// the cleanest solution but couldn't think of anything better right now
if ( claimId === null ) {
claims [ uri ] = null ;
} else {
claims [ uri ] = byId [ claimId ] ;
}
} ) ;
return claims ;
} ) ;
var selectAllClaimsByChannel = exports . selectAllClaimsByChannel = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . claimsByChannel || { } ;
} ) ;
2018-10-26 20:10:50 +02:00
var selectPendingById = exports . selectPendingById = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
2018-11-29 07:07:43 +01:00
return state . pendingById || { } ;
2018-10-26 20:10:50 +02:00
} ) ;
var selectPendingClaims = exports . selectPendingClaims = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
2018-11-29 07:07:43 +01:00
return Object . values ( state . pendingById || [ ] ) ;
2018-10-26 20:10:50 +02:00
} ) ;
var makeSelectClaimIsPending = exports . makeSelectClaimIsPending = function makeSelectClaimIsPending ( uri ) {
return ( 0 , _reselect . createSelector ) ( selectPendingById , function ( pendingById ) {
var _parseURI = ( 0 , _lbryURI . parseURI ) ( uri ) ,
claimId = _parseURI . claimId ;
return Boolean ( pendingById [ claimId ] ) ;
} ) ;
} ;
var makeSelectPendingByUri = exports . makeSelectPendingByUri = function makeSelectPendingByUri ( uri ) {
return ( 0 , _reselect . createSelector ) ( selectPendingById , function ( pendingById ) {
var _parseURI2 = ( 0 , _lbryURI . parseURI ) ( uri ) ,
claimId = _parseURI2 . claimId ;
return pendingById [ claimId ] ;
} ) ;
} ;
2018-07-23 15:12:18 +02:00
var makeSelectClaimForUri = exports . makeSelectClaimForUri = function makeSelectClaimForUri ( uri ) {
2018-10-26 20:10:50 +02:00
return ( 0 , _reselect . createSelector ) ( selectClaimsByUri , selectPendingById , function ( byUri , pendingById ) {
// Check if a claim is pending first
// It won't be in claimsByUri because resolving it will return nothing
var _parseURI3 = ( 0 , _lbryURI . parseURI ) ( uri ) ,
claimId = _parseURI3 . claimId ;
var pendingClaim = pendingById [ claimId ] ;
if ( pendingClaim ) {
return pendingClaim ;
}
return byUri && byUri [ ( 0 , _lbryURI . normalizeURI ) ( uri ) ] ;
2018-07-23 15:12:18 +02:00
} ) ;
} ;
var selectMyClaimsRaw = exports . selectMyClaimsRaw = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . myClaims ;
} ) ;
var selectAbandoningIds = exports . selectAbandoningIds = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return Object . keys ( state . abandoningById || { } ) ;
} ) ;
var selectMyActiveClaims = exports . selectMyActiveClaims = ( 0 , _reselect . createSelector ) ( selectMyClaimsRaw , selectAbandoningIds , function ( claims , abandoningIds ) {
return new Set ( claims && claims . map ( function ( claim ) {
return claim . claim _id ;
} ) . filter ( function ( claimId ) {
return Object . keys ( abandoningIds ) . indexOf ( claimId ) === - 1 ;
} ) ) ;
} ) ;
var makeSelectClaimIsMine = exports . makeSelectClaimIsMine = function makeSelectClaimIsMine ( rawUri ) {
var uri = ( 0 , _lbryURI . normalizeURI ) ( rawUri ) ;
return ( 0 , _reselect . createSelector ) ( selectClaimsByUri , selectMyActiveClaims , function ( claims , myClaims ) {
return claims && claims [ uri ] && claims [ uri ] . claim _id && myClaims . has ( claims [ uri ] . claim _id ) ;
} ) ;
} ;
var selectAllFetchingChannelClaims = exports . selectAllFetchingChannelClaims = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . fetchingChannelClaims || { } ;
} ) ;
var makeSelectFetchingChannelClaims = exports . makeSelectFetchingChannelClaims = function makeSelectFetchingChannelClaims ( uri ) {
return ( 0 , _reselect . createSelector ) ( selectAllFetchingChannelClaims , function ( fetching ) {
return fetching && fetching [ uri ] ;
} ) ;
} ;
var makeSelectClaimsInChannelForPage = exports . makeSelectClaimsInChannelForPage = function makeSelectClaimsInChannelForPage ( uri , page ) {
return ( 0 , _reselect . createSelector ) ( selectClaimsById , selectAllClaimsByChannel , function ( byId , allClaims ) {
var byChannel = allClaims [ uri ] || { } ;
var claimIds = byChannel [ page || 1 ] ;
if ( ! claimIds ) return claimIds ;
return claimIds . map ( function ( claimId ) {
return byId [ claimId ] ;
} ) ;
} ) ;
} ;
var makeSelectClaimsInChannelForCurrentPage = exports . makeSelectClaimsInChannelForCurrentPage = function makeSelectClaimsInChannelForCurrentPage ( uri ) {
var pageSelector = ( 0 , _navigation . makeSelectCurrentParam ) ( 'page' ) ;
return ( 0 , _reselect . createSelector ) ( selectClaimsById , selectAllClaimsByChannel , pageSelector , function ( byId , allClaims , page ) {
var byChannel = allClaims [ uri ] || { } ;
var claimIds = byChannel [ page || 1 ] ;
if ( ! claimIds ) return claimIds ;
return claimIds . map ( function ( claimId ) {
return byId [ claimId ] ;
} ) ;
} ) ;
} ;
var makeSelectMetadataForUri = exports . makeSelectMetadataForUri = function makeSelectMetadataForUri ( uri ) {
return ( 0 , _reselect . createSelector ) ( makeSelectClaimForUri ( uri ) , function ( claim ) {
var metadata = claim && claim . value && claim . value . stream && claim . value . stream . metadata ;
return metadata || ( claim === undefined ? undefined : null ) ;
} ) ;
} ;
var makeSelectTitleForUri = exports . makeSelectTitleForUri = function makeSelectTitleForUri ( uri ) {
return ( 0 , _reselect . createSelector ) ( makeSelectMetadataForUri ( uri ) , function ( metadata ) {
return metadata && metadata . title ;
} ) ;
} ;
var makeSelectContentTypeForUri = exports . makeSelectContentTypeForUri = function makeSelectContentTypeForUri ( uri ) {
return ( 0 , _reselect . createSelector ) ( makeSelectClaimForUri ( uri ) , function ( claim ) {
var source = claim && claim . value && claim . value . stream && claim . value . stream . source ;
return source ? source . contentType : undefined ;
} ) ;
} ;
var selectIsFetchingClaimListMine = exports . selectIsFetchingClaimListMine = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . isFetchingClaimListMine ;
} ) ;
var selectMyClaims = exports . selectMyClaims = ( 0 , _reselect . createSelector ) ( selectMyActiveClaims , selectClaimsById , selectAbandoningIds , selectPendingClaims , function ( myClaimIds , byId , abandoningIds , pendingClaims ) {
var claims = [ ] ;
myClaimIds . forEach ( function ( id ) {
var claim = byId [ id ] ;
if ( claim && abandoningIds . indexOf ( id ) === - 1 ) claims . push ( claim ) ;
} ) ;
return [ ] . concat ( claims , _toConsumableArray ( pendingClaims ) ) ;
} ) ;
var selectMyClaimsWithoutChannels = exports . selectMyClaimsWithoutChannels = ( 0 , _reselect . createSelector ) ( selectMyClaims , function ( myClaims ) {
return myClaims . filter ( function ( claim ) {
return ! claim . name . match ( /^@/ ) ;
} ) ;
} ) ;
var selectAllMyClaimsByOutpoint = exports . selectAllMyClaimsByOutpoint = ( 0 , _reselect . createSelector ) ( selectMyClaimsRaw , function ( claims ) {
return new Set ( claims && claims . length ? claims . map ( function ( claim ) {
return claim . txid + ':' + claim . nout ;
} ) : null ) ;
} ) ;
var selectMyClaimsOutpoints = exports . selectMyClaimsOutpoints = ( 0 , _reselect . createSelector ) ( selectMyClaims , function ( myClaims ) {
var outpoints = [ ] ;
myClaims . forEach ( function ( claim ) {
return outpoints . push ( claim . txid + ':' + claim . nout ) ;
} ) ;
return outpoints ;
} ) ;
var selectFetchingMyChannels = exports . selectFetchingMyChannels = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . fetchingMyChannels ;
} ) ;
var selectMyChannelClaims = exports . selectMyChannelClaims = ( 0 , _reselect . createSelector ) ( selectState , selectClaimsById , function ( state , byId ) {
var ids = state . myChannelClaims || [ ] ;
var claims = [ ] ;
ids . forEach ( function ( id ) {
if ( byId [ id ] ) {
2018-10-26 20:10:50 +02:00
// I'm not sure why this check is necessary, but it ought to be a quick fix for https://github.com/lbryio/lbry-desktop/issues/544
2018-07-23 15:12:18 +02:00
claims . push ( byId [ id ] ) ;
}
} ) ;
return claims ;
} ) ;
var selectResolvingUris = exports . selectResolvingUris = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . resolvingUris || [ ] ;
} ) ;
var makeSelectIsUriResolving = exports . makeSelectIsUriResolving = function makeSelectIsUriResolving ( uri ) {
return ( 0 , _reselect . createSelector ) ( selectResolvingUris , function ( resolvingUris ) {
return resolvingUris && resolvingUris . indexOf ( uri ) !== - 1 ;
} ) ;
} ;
var selectFeaturedUris = exports . selectFeaturedUris = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . featuredUris ;
} ) ;
var selectFetchingFeaturedUris = exports . selectFetchingFeaturedUris = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . fetchingFeaturedContent ;
} ) ;
var selectTrendingUris = exports . selectTrendingUris = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . trendingUris ;
} ) ;
var selectFetchingTrendingUris = exports . selectFetchingTrendingUris = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . fetchingTrendingContent ;
} ) ;
var selectPlayingUri = exports . selectPlayingUri = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . playingUri ;
} ) ;
var selectChannelClaimCounts = exports . selectChannelClaimCounts = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . channelClaimCounts || { } ;
} ) ;
var makeSelectTotalItemsForChannel = exports . makeSelectTotalItemsForChannel = function makeSelectTotalItemsForChannel ( uri ) {
return ( 0 , _reselect . createSelector ) ( selectChannelClaimCounts , function ( byUri ) {
return byUri && byUri [ uri ] ;
} ) ;
} ;
var makeSelectTotalPagesForChannel = exports . makeSelectTotalPagesForChannel = function makeSelectTotalPagesForChannel ( uri ) {
2018-11-29 07:07:43 +01:00
var pageSize = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : 10 ;
2018-07-23 15:12:18 +02:00
return ( 0 , _reselect . createSelector ) ( selectChannelClaimCounts , function ( byUri ) {
2018-11-29 07:07:43 +01:00
return byUri && byUri [ uri ] && Math . ceil ( byUri [ uri ] / pageSize ) ;
2018-07-23 15:12:18 +02:00
} ) ;
} ;
2018-10-26 20:10:50 +02:00
var makeSelectNsfwCountFromUris = exports . makeSelectNsfwCountFromUris = function makeSelectNsfwCountFromUris ( uris ) {
return ( 0 , _reselect . createSelector ) ( selectClaimsByUri , function ( claims ) {
return uris . reduce ( function ( acc , uri ) {
var claim = claims [ uri ] ;
if ( ( 0 , _claim . isClaimNsfw ) ( claim ) ) {
return acc + 1 ;
}
return acc ;
} , 0 ) ;
} ) ;
} ;
var makeSelectNsfwCountForChannel = exports . makeSelectNsfwCountForChannel = function makeSelectNsfwCountForChannel ( uri ) {
var pageSelector = ( 0 , _navigation . makeSelectCurrentParam ) ( 'page' ) ;
return ( 0 , _reselect . createSelector ) ( selectClaimsById , selectAllClaimsByChannel , pageSelector , function ( byId , allClaims , page ) {
var byChannel = allClaims [ uri ] || { } ;
var claimIds = byChannel [ page || 1 ] ;
if ( ! claimIds ) return 0 ;
return claimIds . reduce ( function ( acc , claimId ) {
var claim = byId [ claimId ] ;
if ( ( 0 , _claim . isClaimNsfw ) ( claim ) ) {
return acc + 1 ;
}
return acc ;
} , 0 ) ;
} ) ;
} ;
var makeSelectRecommendedContentForUri = exports . makeSelectRecommendedContentForUri = function makeSelectRecommendedContentForUri ( uri ) {
return ( 0 , _reselect . createSelector ) ( makeSelectClaimForUri ( uri ) , _search . selectSearchUrisByQuery , function ( claim , searchUrisByQuery ) {
var atVanityURI = ! uri . includes ( '#' ) ;
var recommendedContent = void 0 ;
if ( claim ) {
2018-11-29 07:07:43 +01:00
// If we are at a vanity uri, build the full uri so we can properly filter
var currentUri = atVanityURI ? ( 0 , _lbryURI . buildURI ) ( { claimId : claim . claim _id , claimName : claim . name } ) : uri ;
2018-10-26 20:10:50 +02:00
var title = claim . value . stream . metadata . title ;
2018-11-29 07:07:43 +01:00
2018-10-26 20:10:50 +02:00
var searchUris = searchUrisByQuery [ title . replace ( /\// , ' ' ) ] ;
if ( searchUris ) {
searchUris = searchUris . filter ( function ( searchUri ) {
2018-11-29 07:07:43 +01:00
return searchUri !== currentUri ;
2018-10-26 20:10:50 +02:00
} ) ;
recommendedContent = searchUris ;
}
}
return recommendedContent ;
} ) ;
} ;
// Returns the associated channel uri for a given claim uri
var makeSelectChannelForClaimUri = exports . makeSelectChannelForClaimUri = function makeSelectChannelForClaimUri ( uri ) {
var includePrefix = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : false ;
return ( 0 , _reselect . createSelector ) ( makeSelectClaimForUri ( uri ) , function ( claim ) {
if ( ! claim ) {
return null ;
}
var channelName = claim . channel _name ,
value = claim . value ;
var channelClaimId = value && value . publisherSignature && value . publisherSignature . certificateId ;
return channelName && channelClaimId ? ( 0 , _lbryURI . buildURI ) ( { channelName : channelName , claimId : channelClaimId } , includePrefix ) : null ;
} ) ;
} ;
2018-10-02 05:07:13 +02:00
2018-07-23 15:12:18 +02:00
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 18 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-10-26 20:10:50 +02:00
exports . selectPageTitle = exports . selectActiveHistoryEntry = exports . selectHistoryStack = exports . selectHistoryIndex = exports . selectIsHome = exports . selectIsForwardDisabled = exports . selectIsBackDisabled = exports . selectPathAfterAuth = exports . makeSelectCurrentParam = exports . selectCurrentParams = exports . selectCurrentPage = exports . computePageFromPath = exports . selectCurrentPath = exports . selectState = undefined ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _reselect = _ _webpack _require _ _ ( 19 ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _query _params = _ _webpack _require _ _ ( 20 ) ;
2018-07-23 15:12:18 +02:00
var selectState = exports . selectState = function selectState ( state ) {
return state . navigation || { } ;
} ;
var selectCurrentPath = exports . selectCurrentPath = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . currentPath ;
} ) ;
var computePageFromPath = exports . computePageFromPath = function computePageFromPath ( path ) {
return path . replace ( /^\// , '' ) . split ( '?' ) [ 0 ] ;
} ;
var selectCurrentPage = exports . selectCurrentPage = ( 0 , _reselect . createSelector ) ( selectCurrentPath , function ( path ) {
return computePageFromPath ( path ) ;
} ) ;
var selectCurrentParams = exports . selectCurrentParams = ( 0 , _reselect . createSelector ) ( selectCurrentPath , function ( path ) {
if ( path === undefined ) return { } ;
if ( ! path . match ( /\?/ ) ) return { } ;
return ( 0 , _query _params . parseQueryParams ) ( path . split ( '?' ) [ 1 ] ) ;
} ) ;
var makeSelectCurrentParam = exports . makeSelectCurrentParam = function makeSelectCurrentParam ( param ) {
return ( 0 , _reselect . createSelector ) ( selectCurrentParams , function ( params ) {
return params ? params [ param ] : undefined ;
} ) ;
} ;
var selectPathAfterAuth = exports . selectPathAfterAuth = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . pathAfterAuth ;
} ) ;
var selectIsBackDisabled = exports . selectIsBackDisabled = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . index === 0 ;
} ) ;
var selectIsForwardDisabled = exports . selectIsForwardDisabled = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . index === state . stack . length - 1 ;
} ) ;
var selectIsHome = exports . selectIsHome = ( 0 , _reselect . createSelector ) ( selectCurrentPage , function ( page ) {
return page === 'discover' ;
} ) ;
var selectHistoryIndex = exports . selectHistoryIndex = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . index ;
} ) ;
var selectHistoryStack = exports . selectHistoryStack = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . stack ;
} ) ;
// returns current page attributes (scrollY, path)
var selectActiveHistoryEntry = exports . selectActiveHistoryEntry = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . stack [ state . index ] ;
} ) ;
var selectPageTitle = exports . selectPageTitle = ( 0 , _reselect . createSelector ) ( selectCurrentPage , function ( page ) {
switch ( page ) {
default :
return '' ;
}
} ) ;
2018-10-26 20:10:50 +02:00
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 19 */
2018-10-26 20:10:50 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
2018-10-02 05:07:13 +02:00
2018-10-26 20:10:50 +02:00
"use strict" ;
2018-10-02 05:07:13 +02:00
2018-10-26 20:10:50 +02:00
exports . _ _esModule = true ;
exports . defaultMemoize = defaultMemoize ;
exports . createSelectorCreator = createSelectorCreator ;
exports . createStructuredSelector = createStructuredSelector ;
function defaultEqualityCheck ( a , b ) {
return a === b ;
}
2018-07-23 15:12:18 +02:00
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 ;
} , { } ) ;
} ) ;
}
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 20 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
var _slicedToArray = function ( ) { function sliceIterator ( 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" ] ) _i [ "return" ] ( ) ; } finally { if ( _d ) throw _e ; } } return _arr ; } return function ( arr , i ) { if ( Array . isArray ( arr ) ) { return arr ; } else if ( Symbol . iterator in Object ( arr ) ) { return sliceIterator ( arr , i ) ; } else { throw new TypeError ( "Invalid attempt to destructure non-iterable instance" ) ; } } ; } ( ) ;
exports . parseQueryParams = parseQueryParams ;
exports . toQueryString = toQueryString ;
function parseQueryParams ( queryString ) {
if ( queryString === '' ) return { } ;
var parts = queryString . split ( '?' ) . pop ( ) . split ( '&' ) . map ( function ( p ) {
return p . split ( '=' ) ;
} ) ;
var params = { } ;
parts . forEach ( function ( array ) {
var _array = _slicedToArray ( array , 2 ) ,
first = _array [ 0 ] ,
second = _array [ 1 ] ;
params [ first ] = second ;
} ) ;
return params ;
}
function toQueryString ( params ) {
if ( ! params ) return '' ;
var parts = [ ] ;
Object . keys ( params ) . forEach ( function ( key ) {
if ( Object . prototype . hasOwnProperty . call ( params , key ) && params [ key ] ) {
parts . push ( key + '=' + params [ key ] ) ;
}
} ) ;
return parts . join ( '&' ) ;
}
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 21 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
2018-10-26 20:10:50 +02:00
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . selectSearchSuggestions = exports . selectSearchBarFocused = exports . selectWunderBarAddress = exports . makeSelectSearchUris = exports . selectSearchUrisByQuery = exports . selectIsSearching = exports . selectSearchQuery = exports . selectSuggestions = exports . selectSearchValue = exports . selectState = undefined ;
2018-11-29 07:07:43 +01:00
var _search = _ _webpack _require _ _ ( 22 ) ;
2018-10-26 20:10:50 +02:00
var SEARCH _TYPES = _interopRequireWildcard ( _search ) ;
2018-11-29 07:07:43 +01:00
var _lbryURI = _ _webpack _require _ _ ( 3 ) ;
2018-10-26 20:10:50 +02:00
2018-11-29 07:07:43 +01:00
var _navigation = _ _webpack _require _ _ ( 18 ) ;
2018-10-26 20:10:50 +02:00
2018-11-29 07:07:43 +01:00
var _reselect = _ _webpack _require _ _ ( 19 ) ;
2018-10-26 20:10:50 +02:00
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
var selectState = exports . selectState = function selectState ( state ) {
return state . search || { } ;
} ;
var selectSearchValue = exports . selectSearchValue = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . searchQuery ;
} ) ;
var selectSuggestions = exports . selectSuggestions = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . suggestions ;
} ) ;
var selectSearchQuery = exports . selectSearchQuery = ( 0 , _reselect . createSelector ) ( _navigation . selectCurrentPage , _navigation . selectCurrentParams , function ( page , params ) {
return page === 'search' ? params && params . query : null ;
} ) ;
var selectIsSearching = exports . selectIsSearching = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . searching ;
} ) ;
var selectSearchUrisByQuery = exports . selectSearchUrisByQuery = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . urisByQuery ;
} ) ;
var makeSelectSearchUris = exports . makeSelectSearchUris = function makeSelectSearchUris ( query ) {
return (
// replace statement below is kind of ugly, and repeated in doSearch action
( 0 , _reselect . createSelector ) ( selectSearchUrisByQuery , function ( byQuery ) {
return byQuery [ query ? query . replace ( /^lbry:\/\//i , '' ) . replace ( /\// , ' ' ) : query ] ;
} )
) ;
} ;
var selectWunderBarAddress = exports . selectWunderBarAddress = ( 0 , _reselect . createSelector ) ( _navigation . selectCurrentPage , selectSearchQuery , _navigation . selectCurrentParams , function ( page , query , params ) {
// only populate the wunderbar address if we are on the file/channel pages
// or show the search query
if ( page === 'show' ) {
return params . uri ;
}
return query ;
} ) ;
var selectSearchBarFocused = exports . selectSearchBarFocused = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . focused ;
} ) ;
// export const selectSear
var selectSearchSuggestions = exports . selectSearchSuggestions = ( 0 , _reselect . createSelector ) ( selectSearchValue , selectSuggestions , function ( query , suggestions ) {
if ( ! query ) {
return [ ] ;
}
var queryIsPrefix = query === 'lbry:' || query === 'lbry:/' || query === 'lbry://' ;
if ( query . startsWith ( 'lbry://' ) && query !== 'lbry://' ) {
// If it starts with a prefix, don't show any autocomplete results
// They are probably typing/pasting in a lbry uri
return [ {
value : query ,
type : SEARCH _TYPES . FILE
} ] ;
} else if ( queryIsPrefix ) {
// If it is a prefix, wait until something else comes to figure out what to do
return [ ] ;
}
var searchSuggestions = [ ] ;
try {
var uri = ( 0 , _lbryURI . normalizeURI ) ( query ) ;
var _parseURI = ( 0 , _lbryURI . parseURI ) ( uri ) ,
claimName = _parseURI . claimName ,
isChannel = _parseURI . isChannel ;
searchSuggestions . push ( {
value : claimName ,
type : SEARCH _TYPES . SEARCH
} , {
value : uri ,
shorthand : isChannel ? claimName . slice ( 1 ) : claimName ,
type : isChannel ? SEARCH _TYPES . CHANNEL : SEARCH _TYPES . FILE
} ) ;
} catch ( e ) {
searchSuggestions . push ( {
value : query ,
type : SEARCH _TYPES . SEARCH
} ) ;
}
var apiSuggestions = suggestions [ query ] || [ ] ;
if ( apiSuggestions . length ) {
searchSuggestions = searchSuggestions . concat ( apiSuggestions . filter ( function ( suggestion ) {
return suggestion !== query ;
} ) . map ( function ( suggestion ) {
// determine if it's a channel
try {
var _uri = ( 0 , _lbryURI . normalizeURI ) ( suggestion ) ;
var _parseURI2 = ( 0 , _lbryURI . parseURI ) ( _uri ) ,
_claimName = _parseURI2 . claimName ,
_isChannel = _parseURI2 . isChannel ;
return {
value : _uri ,
shorthand : _isChannel ? _claimName . slice ( 1 ) : _claimName ,
type : _isChannel ? SEARCH _TYPES . CHANNEL : SEARCH _TYPES . FILE
} ;
} catch ( e ) {
// search result includes some character that isn't valid in claim names
return {
value : suggestion ,
type : SEARCH _TYPES . SEARCH
} ;
}
} ) ) ;
}
return searchSuggestions ;
} ) ;
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 22 */
2018-10-26 20:10:50 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
var FILE = exports . FILE = 'file' ;
var CHANNEL = exports . CHANNEL = 'channel' ;
var SEARCH = exports . SEARCH = 'search' ;
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 23 */
2018-10-26 20:10:50 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
var isClaimNsfw = exports . isClaimNsfw = function isClaimNsfw ( claim ) {
return claim && claim . value && claim . value . stream && claim . value . stream . metadata . nsfw ;
} ;
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 24 */
2018-10-26 20:10:50 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
2018-08-17 20:10:52 +02:00
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-10-18 18:36:55 +02:00
exports . batchActions = batchActions ;
// https://github.com/reactjs/redux/issues/911
function batchActions ( ) {
for ( var _len = arguments . length , actions = Array ( _len ) , _key = 0 ; _key < _len ; _key ++ ) {
actions [ _key ] = arguments [ _key ] ;
}
2018-08-17 20:10:52 +02:00
2018-10-18 18:36:55 +02:00
return {
type : 'BATCH_ACTIONS' ,
actions : actions
} ;
}
2018-10-02 02:38:16 +02:00
2018-10-18 18:36:55 +02:00
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 25 */
2018-10-18 18:36:55 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
2018-10-02 02:38:16 +02:00
2018-10-18 18:36:55 +02:00
"use strict" ;
2018-10-02 02:38:16 +02:00
2018-10-18 18:36:55 +02:00
Object . defineProperty ( exports , "__esModule" , {
value : true
2018-10-02 02:38:16 +02:00
} ) ;
2018-11-29 07:07:43 +01:00
exports . doUpdateBalance = doUpdateBalance ;
exports . doBalanceSubscribe = doBalanceSubscribe ;
exports . doFetchTransactions = doFetchTransactions ;
exports . doFetchBlock = doFetchBlock ;
exports . doGetNewAddress = doGetNewAddress ;
exports . doCheckAddressIsMine = doCheckAddressIsMine ;
exports . doSendDraftTransaction = doSendDraftTransaction ;
exports . doSetDraftTransactionAmount = doSetDraftTransactionAmount ;
exports . doSetDraftTransactionAddress = doSetDraftTransactionAddress ;
exports . doSendTip = doSendTip ;
exports . doWalletEncrypt = doWalletEncrypt ;
exports . doWalletUnlock = doWalletUnlock ;
exports . doWalletLock = doWalletLock ;
exports . doWalletDecrypt = doWalletDecrypt ;
exports . doWalletStatus = doWalletStatus ;
exports . doSetTransactionListFilter = doSetTransactionListFilter ;
exports . doUpdateBlockHeight = doUpdateBlockHeight ;
2018-10-02 02:38:16 +02:00
2018-11-29 07:07:43 +01:00
var _action _types = _ _webpack _require _ _ ( 2 ) ;
2018-10-02 02:38:16 +02:00
2018-10-18 18:36:55 +02:00
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
2018-10-02 02:38:16 +02:00
2018-11-29 07:07:43 +01:00
var _lbry = _ _webpack _require _ _ ( 9 ) ;
2018-10-02 02:38:16 +02:00
2018-11-29 07:07:43 +01:00
var _lbry2 = _interopRequireDefault ( _lbry ) ;
var _notifications = _ _webpack _require _ _ ( 4 ) ;
2018-10-02 02:38:16 +02:00
2018-11-29 07:07:43 +01:00
var _wallet = _ _webpack _require _ _ ( 26 ) ;
var _formatCredits = _ _webpack _require _ _ ( 28 ) ;
2018-10-02 02:38:16 +02:00
2018-10-18 18:36:55 +02:00
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
2018-10-02 02:38:16 +02:00
2018-10-18 18:36:55 +02:00
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
2018-10-02 02:38:16 +02:00
2018-11-29 07:07:43 +01:00
function doUpdateBalance ( ) {
2018-10-18 18:36:55 +02:00
return function ( dispatch , getState ) {
2018-11-29 07:07:43 +01:00
var _getState = getState ( ) ,
balanceInStore = _getState . wallet . balance ;
2018-10-02 02:38:16 +02:00
2018-11-29 07:07:43 +01:00
_lbry2 . default . account _balance ( ) . then ( function ( balance ) {
if ( balanceInStore !== balance ) {
dispatch ( {
type : ACTIONS . UPDATE _BALANCE ,
data : {
balance : balance
}
} ) ;
}
} ) ;
} ;
}
2018-10-02 02:38:16 +02:00
2018-11-29 07:07:43 +01:00
function doBalanceSubscribe ( ) {
return function ( dispatch ) {
dispatch ( doUpdateBalance ( ) ) ;
setInterval ( function ( ) {
return dispatch ( doUpdateBalance ( ) ) ;
} , 5000 ) ;
} ;
}
2018-10-02 02:38:16 +02:00
2018-11-29 07:07:43 +01:00
function doFetchTransactions ( ) {
return function ( dispatch ) {
dispatch ( {
type : ACTIONS . FETCH _TRANSACTIONS _STARTED
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
_lbry2 . default . transaction _list ( ) . then ( function ( results ) {
dispatch ( {
type : ACTIONS . FETCH _TRANSACTIONS _COMPLETED ,
data : {
transactions : results
}
2018-07-23 15:12:18 +02:00
} ) ;
2018-11-29 07:07:43 +01:00
} ) ;
2018-07-23 15:12:18 +02:00
} ;
}
2018-11-29 07:07:43 +01:00
function doFetchBlock ( height ) {
return function ( dispatch ) {
_lbry2 . default . block _show ( { height : height } ) . then ( function ( block ) {
dispatch ( {
type : ACTIONS . FETCH _BLOCK _SUCCESS ,
data : { block : block }
} ) ;
} ) ;
} ;
}
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
function doGetNewAddress ( ) {
return function ( dispatch ) {
dispatch ( {
type : ACTIONS . GET _NEW _ADDRESS _STARTED
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
// Removed localStorage use, since address is expected to be stored in redux store
_lbry2 . default . address _unused ( ) . then ( function ( address ) {
dispatch ( {
type : ACTIONS . GET _NEW _ADDRESS _COMPLETED ,
data : { address : address }
} ) ;
} ) ;
} ;
}
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
function doCheckAddressIsMine ( address ) {
return function ( dispatch ) {
dispatch ( {
type : ACTIONS . CHECK _ADDRESS _IS _MINE _STARTED
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
_lbry2 . default . address _is _mine ( { address : address } ) . then ( function ( isMine ) {
if ( ! isMine ) dispatch ( doGetNewAddress ( ) ) ;
2018-07-23 15:12:18 +02:00
dispatch ( {
2018-11-29 07:07:43 +01:00
type : ACTIONS . CHECK _ADDRESS _IS _MINE _COMPLETED
2018-07-23 15:12:18 +02:00
} ) ;
2018-11-29 07:07:43 +01:00
} ) ;
2018-07-23 15:12:18 +02:00
} ;
}
2018-11-29 07:07:43 +01:00
function doSendDraftTransaction ( address , amount ) {
2018-07-23 15:12:18 +02:00
return function ( dispatch , getState ) {
var state = getState ( ) ;
2018-11-29 07:07:43 +01:00
var balance = ( 0 , _wallet . selectBalance ) ( state ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
if ( balance - amount <= 0 ) {
dispatch ( ( 0 , _notifications . doToast ) ( {
title : 'Insufficient credits' ,
message : 'Insufficient credits'
} ) ) ;
return ;
}
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
dispatch ( {
type : ACTIONS . SEND _TRANSACTION _STARTED
} ) ;
var successCallback = function successCallback ( response ) {
if ( response . txid ) {
2018-07-23 15:12:18 +02:00
dispatch ( {
2018-11-29 07:07:43 +01:00
type : ACTIONS . SEND _TRANSACTION _COMPLETED
} ) ;
dispatch ( ( 0 , _notifications . doToast ) ( {
message : 'You sent ' + amount + ' LBC' ,
linkText : 'History' ,
linkTarget : '/wallet'
} ) ) ;
} else {
dispatch ( {
type : ACTIONS . SEND _TRANSACTION _FAILED ,
data : { error : response }
2018-07-23 15:12:18 +02:00
} ) ;
2018-11-29 07:07:43 +01:00
dispatch ( ( 0 , _notifications . doToast ) ( {
message : 'Transaction failed' ,
isError : true
} ) ) ;
}
} ;
var errorCallback = function errorCallback ( error ) {
dispatch ( {
type : ACTIONS . SEND _TRANSACTION _FAILED ,
data : { error : error . message }
2018-07-23 15:12:18 +02:00
} ) ;
2018-11-29 07:07:43 +01:00
dispatch ( ( 0 , _notifications . doToast ) ( {
message : 'Transaction failed' ,
isError : true
} ) ) ;
} ;
_lbry2 . default . wallet _send ( {
address : address ,
amount : ( 0 , _formatCredits . creditsToString ) ( amount )
} ) . then ( successCallback , errorCallback ) ;
2018-07-23 15:12:18 +02:00
} ;
}
2018-11-29 07:07:43 +01:00
function doSetDraftTransactionAmount ( amount ) {
return {
type : ACTIONS . SET _DRAFT _TRANSACTION _AMOUNT ,
data : { amount : amount }
2018-07-23 15:12:18 +02:00
} ;
}
2018-11-29 07:07:43 +01:00
function doSetDraftTransactionAddress ( address ) {
2018-10-26 20:10:50 +02:00
return {
2018-11-29 07:07:43 +01:00
type : ACTIONS . SET _DRAFT _TRANSACTION _ADDRESS ,
data : { address : address }
2018-10-26 20:10:50 +02:00
} ;
}
2018-11-29 07:07:43 +01:00
function doSendTip ( amount , claimId , uri , successCallback , errorCallback ) {
return function ( dispatch , getState ) {
var state = getState ( ) ;
var balance = ( 0 , _wallet . selectBalance ) ( state ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
if ( balance - amount <= 0 ) {
dispatch ( ( 0 , _notifications . doToast ) ( {
message : 'Insufficient credits' ,
isError : true
} ) ) ;
return ;
}
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var success = function success ( ) {
dispatch ( ( 0 , _notifications . doToast ) ( {
message : _ _ ( 'You sent ' + amount + ' LBC as a tip, Mahalo!' ) ,
linkText : _ _ ( 'History' ) ,
linkTarget : _ _ ( '/wallet' )
} ) ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
dispatch ( {
type : ACTIONS . SUPPORT _TRANSACTION _COMPLETED
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
if ( successCallback ) {
successCallback ( ) ;
}
} ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var error = function error ( err ) {
dispatch ( ( 0 , _notifications . doToast ) ( {
message : _ _ ( 'There was an error sending support funds.' ) ,
isError : true
} ) ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
dispatch ( {
type : ACTIONS . SUPPORT _TRANSACTION _FAILED ,
data : {
error : err
}
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
if ( errorCallback ) {
errorCallback ( ) ;
}
} ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
dispatch ( {
type : ACTIONS . SUPPORT _TRANSACTION _STARTED
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
_lbry2 . default . claim _tip ( {
claim _id : claimId ,
amount : ( 0 , _formatCredits . creditsToString ) ( amount )
} ) . then ( success , error ) ;
} ;
}
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
function doWalletEncrypt ( newPassword ) {
return function ( dispatch ) {
dispatch ( {
type : ACTIONS . WALLET _ENCRYPT _START
2018-07-23 15:12:18 +02:00
} ) ;
2018-11-29 07:07:43 +01:00
_lbry2 . default . account _encrypt ( { new _password : newPassword } ) . then ( function ( result ) {
if ( result === true ) {
dispatch ( {
type : ACTIONS . WALLET _ENCRYPT _COMPLETED ,
result : result
} ) ;
} else {
dispatch ( {
type : ACTIONS . WALLET _ENCRYPT _FAILED ,
result : result
} ) ;
}
} ) ;
} ;
}
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
function doWalletUnlock ( password ) {
return function ( dispatch ) {
dispatch ( {
type : ACTIONS . WALLET _UNLOCK _START
2018-07-23 15:12:18 +02:00
} ) ;
2018-11-29 07:07:43 +01:00
_lbry2 . default . account _unlock ( { password : password } ) . then ( function ( result ) {
if ( result === true ) {
dispatch ( {
type : ACTIONS . WALLET _UNLOCK _COMPLETED ,
result : result
} ) ;
} else {
dispatch ( {
type : ACTIONS . WALLET _UNLOCK _FAILED ,
result : result
} ) ;
2018-07-23 15:12:18 +02:00
}
2018-11-29 07:07:43 +01:00
} ) ;
} ;
}
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
function doWalletLock ( ) {
return function ( dispatch ) {
dispatch ( {
type : ACTIONS . WALLET _LOCK _START
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
_lbry2 . default . wallet _lock ( ) . then ( function ( result ) {
if ( result === true ) {
dispatch ( {
type : ACTIONS . WALLET _LOCK _COMPLETED ,
result : result
} ) ;
} else {
dispatch ( {
type : ACTIONS . WALLET _LOCK _FAILED ,
result : result
} ) ;
2018-07-23 15:12:18 +02:00
}
2018-11-29 07:07:43 +01:00
} ) ;
} ;
}
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
function doWalletDecrypt ( ) {
return function ( dispatch ) {
dispatch ( {
type : ACTIONS . WALLET _DECRYPT _START
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
_lbry2 . default . account _decrypt ( ) . then ( function ( result ) {
if ( result === true ) {
dispatch ( {
type : ACTIONS . WALLET _DECRYPT _COMPLETED ,
result : result
} ) ;
} else {
dispatch ( {
type : ACTIONS . WALLET _DECRYPT _FAILED ,
result : result
} ) ;
2018-07-23 15:12:18 +02:00
}
2018-11-29 07:07:43 +01:00
} ) ;
} ;
}
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
function doWalletStatus ( ) {
return function ( dispatch ) {
dispatch ( {
type : ACTIONS . WALLET _STATUS _START
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
_lbry2 . default . status ( ) . then ( function ( status ) {
if ( status && status . wallet ) {
dispatch ( {
type : ACTIONS . WALLET _STATUS _COMPLETED ,
result : status . wallet . is _encrypted
} ) ;
2018-07-23 15:12:18 +02:00
}
} ) ;
2018-11-29 07:07:43 +01:00
} ;
}
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
function doSetTransactionListFilter ( filterOption ) {
return {
type : ACTIONS . SET _TRANSACTION _LIST _FILTER ,
data : filterOption
} ;
}
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
function doUpdateBlockHeight ( ) {
return function ( dispatch ) {
return _lbry2 . default . status ( ) . then ( function ( status ) {
if ( status . wallet ) {
dispatch ( {
type : ACTIONS . UPDATE _CURRENT _HEIGHT ,
data : status . wallet . blocks
} ) ;
2018-07-23 15:12:18 +02:00
}
2018-11-29 07:07:43 +01:00
} ) ;
} ;
}
2018-10-26 20:10:50 +02:00
2018-07-23 15:12:18 +02:00
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 26 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-11-29 07:07:43 +01:00
exports . selectTransactionListFilter = exports . makeSelectBlockDate = exports . selectCurrentHeight = exports . selectBlocks = exports . selectDraftTransactionError = exports . selectDraftTransactionAddress = exports . selectDraftTransactionAmount = exports . selectDraftTransaction = exports . selectGettingNewAddress = exports . selectReceiveAddress = exports . selectIsSendingSupport = exports . selectIsFetchingTransactions = exports . selectHasTransactions = exports . selectRecentTransactions = exports . selectTransactionItems = exports . selectTransactionsById = exports . selectBalance = exports . selectWalletLockResult = exports . selectWalletLockSucceeded = exports . selectWalletLockPending = exports . selectWalletUnlockResult = exports . selectWalletUnlockSucceeded = exports . selectWalletUnlockPending = exports . selectWalletDecryptResult = exports . selectWalletDecryptSucceeded = exports . selectWalletDecryptPending = exports . selectWalletEncryptResult = exports . selectWalletEncryptSucceeded = exports . selectWalletEncryptPending = exports . selectWalletIsEncrypted = exports . selectWalletState = exports . selectState = undefined ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _reselect = _ _webpack _require _ _ ( 19 ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _transaction _types = _ _webpack _require _ _ ( 27 ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var TRANSACTIONS = _interopRequireWildcard ( _transaction _types ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
function _toConsumableArray ( arr ) { if ( Array . isArray ( arr ) ) { for ( var i = 0 , arr2 = Array ( arr . length ) ; i < arr . length ; i ++ ) { arr2 [ i ] = arr [ i ] ; } return arr2 ; } else { return Array . from ( arr ) ; } }
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectState = exports . selectState = function selectState ( state ) {
return state . wallet || { } ;
} ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectWalletState = exports . selectWalletState = selectState ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectWalletIsEncrypted = exports . selectWalletIsEncrypted = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . walletIsEncrypted ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectWalletEncryptPending = exports . selectWalletEncryptPending = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . walletEncryptPending ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectWalletEncryptSucceeded = exports . selectWalletEncryptSucceeded = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . walletEncryptSucceded ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectWalletEncryptResult = exports . selectWalletEncryptResult = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . walletEncryptResult ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectWalletDecryptPending = exports . selectWalletDecryptPending = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . walletDecryptPending ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectWalletDecryptSucceeded = exports . selectWalletDecryptSucceeded = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . walletDecryptSucceded ;
} ) ;
2018-10-26 20:10:50 +02:00
2018-11-29 07:07:43 +01:00
var selectWalletDecryptResult = exports . selectWalletDecryptResult = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . walletDecryptResult ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectWalletUnlockPending = exports . selectWalletUnlockPending = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . walletUnlockPending ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectWalletUnlockSucceeded = exports . selectWalletUnlockSucceeded = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . walletUnlockSucceded ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectWalletUnlockResult = exports . selectWalletUnlockResult = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . walletUnlockResult ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectWalletLockPending = exports . selectWalletLockPending = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . walletLockPending ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectWalletLockSucceeded = exports . selectWalletLockSucceeded = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . walletLockSucceded ;
} ) ;
2018-10-18 18:36:55 +02:00
2018-11-29 07:07:43 +01:00
var selectWalletLockResult = exports . selectWalletLockResult = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . walletLockResult ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectBalance = exports . selectBalance = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . balance ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectTransactionsById = exports . selectTransactionsById = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . transactions ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectTransactionItems = exports . selectTransactionItems = ( 0 , _reselect . createSelector ) ( selectTransactionsById , function ( byId ) {
var items = [ ] ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
Object . keys ( byId ) . forEach ( function ( txid ) {
var tx = byId [ txid ] ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
// ignore dust/fees
// it is fee only txn if all infos are also empty
if ( Math . abs ( tx . value ) === Math . abs ( tx . fee ) && tx . claim _info . length === 0 && tx . support _info . length === 0 && tx . update _info . length === 0 && tx . abandon _info . length === 0 ) {
return ;
}
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var append = [ ] ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
append . push . apply ( append , _toConsumableArray ( tx . claim _info . map ( function ( item ) {
return Object . assign ( { } , tx , item , {
type : item . claim _name [ 0 ] === '@' ? TRANSACTIONS . CHANNEL : TRANSACTIONS . PUBLISH
} ) ;
} ) ) ) ;
append . push . apply ( append , _toConsumableArray ( tx . support _info . map ( function ( item ) {
return Object . assign ( { } , tx , item , {
type : ! item . is _tip ? TRANSACTIONS . SUPPORT : TRANSACTIONS . TIP
} ) ;
} ) ) ) ;
append . push . apply ( append , _toConsumableArray ( tx . update _info . map ( function ( item ) {
return Object . assign ( { } , tx , item , { type : TRANSACTIONS . UPDATE } ) ;
} ) ) ) ;
append . push . apply ( append , _toConsumableArray ( tx . abandon _info . map ( function ( item ) {
return Object . assign ( { } , tx , item , { type : TRANSACTIONS . ABANDON } ) ;
} ) ) ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
if ( ! append . length ) {
append . push ( Object . assign ( { } , tx , {
type : tx . value < 0 ? TRANSACTIONS . SPEND : TRANSACTIONS . RECEIVE
} ) ) ;
}
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
items . push . apply ( items , _toConsumableArray ( append . map ( function ( item ) {
// value on transaction, amount on outpoint
// amount is always positive, but should match sign of value
var amount = parseFloat ( item . balance _delta ? item . balance _delta : item . value ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
return {
txid : txid ,
timestamp : tx . timestamp ,
date : tx . timestamp ? new Date ( Number ( tx . timestamp ) * 1000 ) : null ,
amount : amount ,
fee : amount < 0 ? - 1 * tx . fee / append . length : 0 ,
claim _id : item . claim _id ,
claim _name : item . claim _name ,
type : item . type || TRANSACTIONS . SPEND ,
nout : item . nout ,
confirmations : tx . confirmations
} ;
} ) ) ) ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
return items . sort ( function ( tx1 , tx2 ) {
if ( ! tx1 . timestamp && ! tx2 . timestamp ) {
return 0 ;
} else if ( ! tx1 . timestamp && tx2 . timestamp ) {
return - 1 ;
} else if ( tx1 . timestamp && ! tx2 . timestamp ) {
return 1 ;
}
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
return tx2 . timestamp - tx1 . timestamp ;
} ) ;
2018-07-23 15:12:18 +02:00
} ) ;
2018-11-29 07:07:43 +01:00
var selectRecentTransactions = exports . selectRecentTransactions = ( 0 , _reselect . createSelector ) ( selectTransactionItems , function ( transactions ) {
var threshold = new Date ( ) ;
threshold . setDate ( threshold . getDate ( ) - 7 ) ;
return transactions . filter ( function ( transaction ) {
if ( ! transaction . date ) {
return true ; // pending transaction
}
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
return transaction . date > threshold ;
} ) ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectHasTransactions = exports . selectHasTransactions = ( 0 , _reselect . createSelector ) ( selectTransactionItems , function ( transactions ) {
return transactions && transactions . length > 0 ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectIsFetchingTransactions = exports . selectIsFetchingTransactions = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . fetchingTransactions ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectIsSendingSupport = exports . selectIsSendingSupport = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . sendingSupport ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectReceiveAddress = exports . selectReceiveAddress = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . receiveAddress ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectGettingNewAddress = exports . selectGettingNewAddress = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . gettingNewAddress ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectDraftTransaction = exports . selectDraftTransaction = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . draftTransaction || { } ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectDraftTransactionAmount = exports . selectDraftTransactionAmount = ( 0 , _reselect . createSelector ) ( selectDraftTransaction , function ( draft ) {
return draft . amount ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectDraftTransactionAddress = exports . selectDraftTransactionAddress = ( 0 , _reselect . createSelector ) ( selectDraftTransaction , function ( draft ) {
return draft . address ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectDraftTransactionError = exports . selectDraftTransactionError = ( 0 , _reselect . createSelector ) ( selectDraftTransaction , function ( draft ) {
return draft . error ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectBlocks = exports . selectBlocks = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . blocks ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectCurrentHeight = exports . selectCurrentHeight = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . latestBlock ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var makeSelectBlockDate = exports . makeSelectBlockDate = function makeSelectBlockDate ( block ) {
return ( 0 , _reselect . createSelector ) ( selectBlocks , selectCurrentHeight , function ( blocks , latestBlock ) {
// If we have the block data, look at the actual date,
// If not, try to simulate it based on 2.5 minute blocks
// Adding this on 11/7/2018 because caling block_show for every claim is causing
// performance issues.
if ( blocks && blocks [ block ] ) {
return new Date ( blocks [ block ] . time * 1000 ) ;
}
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
// Pending claim
if ( block < 1 ) {
return null ;
}
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var difference = latestBlock - block ;
var msSincePublish = difference * 2.5 * 60 * 1000 ; // Number of blocks * 2.5 minutes in ms
var publishDate = Date . now ( ) - msSincePublish ;
return new Date ( publishDate ) ;
} ) ;
} ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectTransactionListFilter = exports . selectTransactionListFilter = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . transactionListFilter || '' ;
} ) ;
2018-07-23 15:12:18 +02:00
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 27 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-11-29 07:07:43 +01:00
// eslint-disable-next-line import/prefer-default-export
var ALL = exports . ALL = 'all' ;
var SPEND = exports . SPEND = 'spend' ;
var RECEIVE = exports . RECEIVE = 'receive' ;
var PUBLISH = exports . PUBLISH = 'publish' ;
var CHANNEL = exports . CHANNEL = 'channel' ;
var TIP = exports . TIP = 'tip' ;
var SUPPORT = exports . SUPPORT = 'support' ;
var UPDATE = exports . UPDATE = 'update' ;
var ABANDON = exports . ABANDON = 'abandon' ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
/***/ } ) ,
/* 28 */
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
"use strict" ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . formatCredits = formatCredits ;
exports . formatFullPrice = formatFullPrice ;
exports . creditsToString = creditsToString ;
function formatCredits ( amount , precision ) {
if ( Number . isNaN ( parseFloat ( amount ) ) ) return '0' ;
return parseFloat ( amount ) . toFixed ( precision || 1 ) . replace ( /\.?0+$/ , '' ) ;
2018-07-23 15:12:18 +02:00
}
2018-11-29 07:07:43 +01:00
function formatFullPrice ( amount ) {
var precision = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : 1 ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var formated = '' ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var quantity = amount . toString ( ) . split ( '.' ) ;
var fraction = quantity [ 1 ] ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
if ( fraction ) {
var decimals = fraction . split ( '' ) ;
var first = decimals . filter ( function ( number ) {
return number !== '0' ;
} ) [ 0 ] ;
var index = decimals . indexOf ( first ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
// Set format fraction
formated = '.' + fraction . substring ( 0 , index + precision ) ;
}
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
return parseFloat ( quantity [ 0 ] + formated ) ;
2018-07-23 15:12:18 +02:00
}
2018-11-29 07:07:43 +01:00
function creditsToString ( amount ) {
var creditString = parseFloat ( amount ) . toFixed ( 8 ) ;
return creditString ;
}
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
/***/ } ) ,
/* 29 */
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
"use strict" ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . doFetchCostInfoForUri = doFetchCostInfoForUri ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _action _types = _ _webpack _require _ _ ( 2 ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _lbryapi = _ _webpack _require _ _ ( 12 ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _lbryapi2 = _interopRequireDefault ( _lbryapi ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _claims = _ _webpack _require _ _ ( 17 ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
// eslint-disable-next-line import/prefer-default-export
function doFetchCostInfoForUri ( uri ) {
return function ( dispatch , getState ) {
var state = getState ( ) ;
var claim = ( 0 , _claims . selectClaimsByUri ) ( state ) [ uri ] ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
if ( ! claim ) return ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
function resolve ( costInfo ) {
2018-10-26 20:10:50 +02:00
dispatch ( {
2018-11-29 07:07:43 +01:00
type : ACTIONS . FETCH _COST _INFO _COMPLETED ,
2018-10-26 20:10:50 +02:00
data : {
2018-11-29 07:07:43 +01:00
uri : uri ,
costInfo : costInfo
2018-10-26 20:10:50 +02:00
}
} ) ;
2018-11-29 07:07:43 +01:00
}
2018-10-26 20:10:50 +02:00
2018-11-29 07:07:43 +01:00
var fee = claim . value && claim . value . stream && claim . value . stream . metadata ? claim . value . stream . metadata . fee : undefined ;
2018-10-26 20:10:50 +02:00
2018-11-29 07:07:43 +01:00
if ( fee === undefined ) {
resolve ( { cost : 0 , includesData : true } ) ;
} else if ( fee . currency === 'LBC' ) {
resolve ( { cost : fee . amount , includesData : true } ) ;
} else {
_lbryapi2 . default . getExchangeRates ( ) . then ( function ( _ref ) {
var LBC _USD = _ref . LBC _USD ;
2018-10-26 20:10:50 +02:00
2018-11-29 07:07:43 +01:00
resolve ( { cost : fee . amount / LBC _USD , includesData : true } ) ;
} ) ;
}
2018-10-26 20:10:50 +02:00
} ;
}
2018-11-29 07:07:43 +01:00
/***/ } ) ,
/* 30 */
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
2018-10-26 20:10:50 +02:00
2018-11-29 07:07:43 +01:00
"use strict" ;
2018-10-26 20:10:50 +02:00
2018-11-29 07:07:43 +01:00
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . doFetchFileInfo = doFetchFileInfo ;
exports . doFileList = doFileList ;
exports . doFetchFileInfosAndPublishedClaims = doFetchFileInfosAndPublishedClaims ;
exports . doSetFileListSort = doSetFileListSort ;
2018-10-26 20:10:50 +02:00
2018-11-29 07:07:43 +01:00
var _action _types = _ _webpack _require _ _ ( 2 ) ;
2018-10-26 20:10:50 +02:00
2018-11-29 07:07:43 +01:00
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
2018-10-26 20:10:50 +02:00
2018-11-29 07:07:43 +01:00
var _lbry = _ _webpack _require _ _ ( 9 ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _lbry2 = _interopRequireDefault ( _lbry ) ;
var _claims = _ _webpack _require _ _ ( 8 ) ;
var _claims2 = _ _webpack _require _ _ ( 17 ) ;
var _file _info = _ _webpack _require _ _ ( 31 ) ;
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
function doFetchFileInfo ( uri ) {
return function ( dispatch , getState ) {
var state = getState ( ) ;
var claim = ( 0 , _claims2 . selectClaimsByUri ) ( state ) [ uri ] ;
var outpoint = claim ? claim . txid + ':' + claim . nout : null ;
var alreadyFetching = ! ! ( 0 , _file _info . selectUrisLoading ) ( state ) [ uri ] ;
if ( ! alreadyFetching ) {
dispatch ( {
type : ACTIONS . FETCH _FILE _INFO _STARTED ,
data : {
outpoint : outpoint
}
} ) ;
_lbry2 . default . file _list ( { outpoint : outpoint , full _status : true } ) . then ( function ( fileInfos ) {
2018-10-26 20:10:50 +02:00
dispatch ( {
2018-11-29 07:07:43 +01:00
type : ACTIONS . FETCH _FILE _INFO _COMPLETED ,
data : {
outpoint : outpoint ,
fileInfo : fileInfos && fileInfos . length ? fileInfos [ 0 ] : null
}
2018-10-26 20:10:50 +02:00
} ) ;
2018-11-29 07:07:43 +01:00
} ) ;
}
2018-10-26 20:10:50 +02:00
} ;
}
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
function doFileList ( ) {
return function ( dispatch , getState ) {
var state = getState ( ) ;
var isFetching = ( 0 , _file _info . selectIsFetchingFileList ) ( state ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
if ( ! isFetching ) {
dispatch ( {
type : ACTIONS . FILE _LIST _STARTED
} ) ;
_lbry2 . default . file _list ( ) . then ( function ( fileInfos ) {
2018-10-26 20:10:50 +02:00
dispatch ( {
2018-11-29 07:07:43 +01:00
type : ACTIONS . FILE _LIST _SUCCEEDED ,
data : {
fileInfos : fileInfos
}
2018-10-26 20:10:50 +02:00
} ) ;
2018-11-29 07:07:43 +01:00
} ) ;
}
2018-10-26 20:10:50 +02:00
} ;
}
2018-11-29 07:07:43 +01:00
function doFetchFileInfosAndPublishedClaims ( ) {
return function ( dispatch , getState ) {
var state = getState ( ) ;
var isFetchingClaimListMine = ( 0 , _claims2 . selectIsFetchingClaimListMine ) ( state ) ;
var isFetchingFileInfo = ( 0 , _file _info . selectIsFetchingFileList ) ( state ) ;
if ( ! isFetchingClaimListMine ) dispatch ( ( 0 , _claims . doFetchClaimListMine ) ( ) ) ;
if ( ! isFetchingFileInfo ) dispatch ( doFileList ( ) ) ;
} ;
}
function doSetFileListSort ( page , value ) {
2018-10-26 20:10:50 +02:00
return {
2018-11-29 07:07:43 +01:00
type : ACTIONS . SET _FILE _LIST _SORT ,
data : { page : page , value : value }
2018-07-23 15:12:18 +02:00
} ;
}
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 31 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-11-29 07:07:43 +01:00
exports . selectFileListDownloadedSort = exports . selectFileListPublishedSort = exports . selectSearchDownloadUris = exports . selectTotalDownloadProgress = exports . selectDownloadingFileInfos = exports . selectFileInfosDownloaded = exports . makeSelectLoadingForUri = exports . selectUrisLoading = exports . makeSelectDownloadingForUri = exports . selectDownloadingByOutpoint = exports . makeSelectFileInfoForUri = exports . selectIsFetchingFileListDownloadedOrPublished = exports . selectIsFetchingFileList = exports . selectFileInfosByOutpoint = exports . selectState = undefined ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _claims = _ _webpack _require _ _ ( 17 ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _reselect = _ _webpack _require _ _ ( 19 ) ;
2018-10-26 20:10:50 +02:00
2018-11-29 07:07:43 +01:00
var _lbryURI = _ _webpack _require _ _ ( 3 ) ;
2018-10-26 20:10:50 +02:00
2018-11-29 07:07:43 +01:00
var selectState = exports . selectState = function selectState ( state ) {
return state . fileInfo || { } ;
} ;
2018-10-26 20:10:50 +02:00
2018-11-29 07:07:43 +01:00
var selectFileInfosByOutpoint = exports . selectFileInfosByOutpoint = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . byOutpoint || { } ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var selectIsFetchingFileList = exports . selectIsFetchingFileList = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . isFetchingFileList ;
} ) ;
var selectIsFetchingFileListDownloadedOrPublished = exports . selectIsFetchingFileListDownloadedOrPublished = ( 0 , _reselect . createSelector ) ( selectIsFetchingFileList , _claims . selectIsFetchingClaimListMine , function ( isFetchingFileList , isFetchingClaimListMine ) {
return isFetchingFileList || isFetchingClaimListMine ;
} ) ;
var makeSelectFileInfoForUri = exports . makeSelectFileInfoForUri = function makeSelectFileInfoForUri ( uri ) {
return ( 0 , _reselect . createSelector ) ( _claims . selectClaimsByUri , selectFileInfosByOutpoint , function ( claims , byOutpoint ) {
var claim = claims [ uri ] ;
var outpoint = claim ? claim . txid + ':' + claim . nout : undefined ;
return outpoint ? byOutpoint [ outpoint ] : undefined ;
} ) ;
2018-07-23 15:12:18 +02:00
} ;
2018-11-29 07:07:43 +01:00
var selectDownloadingByOutpoint = exports . selectDownloadingByOutpoint = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . downloadingByOutpoint || { } ;
} ) ;
2018-10-26 20:10:50 +02:00
2018-11-29 07:07:43 +01:00
var makeSelectDownloadingForUri = exports . makeSelectDownloadingForUri = function makeSelectDownloadingForUri ( uri ) {
return ( 0 , _reselect . createSelector ) ( selectDownloadingByOutpoint , makeSelectFileInfoForUri ( uri ) , function ( byOutpoint , fileInfo ) {
if ( ! fileInfo ) return false ;
return byOutpoint [ fileInfo . outpoint ] ;
} ) ;
} ;
var selectUrisLoading = exports . selectUrisLoading = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . urisLoading || { } ;
2018-10-26 20:10:50 +02:00
} ) ;
2018-11-29 07:07:43 +01:00
var makeSelectLoadingForUri = exports . makeSelectLoadingForUri = function makeSelectLoadingForUri ( uri ) {
return ( 0 , _reselect . createSelector ) ( selectUrisLoading , function ( byUri ) {
return byUri && byUri [ uri ] ;
} ) ;
} ;
var selectFileInfosDownloaded = exports . selectFileInfosDownloaded = ( 0 , _reselect . createSelector ) ( selectFileInfosByOutpoint , _claims . selectMyClaims , function ( byOutpoint , myClaims ) {
return Object . values ( byOutpoint ) . filter ( function ( fileInfo ) {
var myClaimIds = myClaims . map ( function ( claim ) {
return claim . claim _id ;
} ) ;
return fileInfo && myClaimIds . indexOf ( fileInfo . claim _id ) === - 1 && ( fileInfo . completed || fileInfo . written _bytes ) ;
} ) ;
2018-10-26 20:10:50 +02:00
} ) ;
2018-11-29 07:07:43 +01:00
// export const selectFileInfoForUri = (state, props) => {
// const claims = selectClaimsByUri(state),
// claim = claims[props.uri],
// fileInfos = selectAllFileInfos(state),
// outpoint = claim ? `${claim.txid}:${claim.nout}` : undefined;
// return outpoint && fileInfos ? fileInfos[outpoint] : undefined;
// };
var selectDownloadingFileInfos = exports . selectDownloadingFileInfos = ( 0 , _reselect . createSelector ) ( selectDownloadingByOutpoint , selectFileInfosByOutpoint , function ( downloadingByOutpoint , fileInfosByOutpoint ) {
var outpoints = Object . keys ( downloadingByOutpoint ) ;
var fileInfos = [ ] ;
outpoints . forEach ( function ( outpoint ) {
var fileInfo = fileInfosByOutpoint [ outpoint ] ;
if ( fileInfo ) fileInfos . push ( fileInfo ) ;
} ) ;
return fileInfos ;
2018-10-26 20:10:50 +02:00
} ) ;
2018-11-29 07:07:43 +01:00
var selectTotalDownloadProgress = exports . selectTotalDownloadProgress = ( 0 , _reselect . createSelector ) ( selectDownloadingFileInfos , function ( fileInfos ) {
var progress = [ ] ;
fileInfos . forEach ( function ( fileInfo ) {
progress . push ( fileInfo . written _bytes / fileInfo . total _bytes * 100 ) ;
} ) ;
var totalProgress = progress . reduce ( function ( a , b ) {
return a + b ;
} , 0 ) ;
if ( fileInfos . length > 0 ) return totalProgress / fileInfos . length / 100.0 ;
return - 1 ;
2018-10-26 20:10:50 +02:00
} ) ;
2018-11-29 07:07:43 +01:00
var selectSearchDownloadUris = exports . selectSearchDownloadUris = function selectSearchDownloadUris ( query ) {
return ( 0 , _reselect . createSelector ) ( selectFileInfosDownloaded , _claims . selectClaimsById , function ( fileInfos , claimsById ) {
if ( ! query || ! fileInfos . length ) {
return null ;
}
var queryParts = query . toLowerCase ( ) . split ( ' ' ) ;
var searchQueryDictionary = { } ;
queryParts . forEach ( function ( subQuery ) {
searchQueryDictionary [ subQuery ] = subQuery ;
} ) ;
var arrayContainsQueryPart = function arrayContainsQueryPart ( array ) {
for ( var i = 0 ; i < array . length ; i += 1 ) {
var subQuery = array [ i ] ;
if ( searchQueryDictionary [ subQuery ] ) {
return true ;
}
}
return false ;
} ;
var downloadResultsFromQuery = [ ] ;
fileInfos . forEach ( function ( fileInfo ) {
var channelName = fileInfo . channel _name ,
claimName = fileInfo . claim _name ,
metadata = fileInfo . metadata ;
var author = metadata . author ,
description = metadata . description ,
title = metadata . title ;
if ( channelName ) {
var lowerCaseChannel = channelName . toLowerCase ( ) ;
var strippedOutChannelName = lowerCaseChannel . slice ( 1 ) ; // trim off the @
if ( searchQueryDictionary [ channelName ] || searchQueryDictionary [ strippedOutChannelName ] ) {
downloadResultsFromQuery . push ( fileInfo ) ;
return ;
}
}
var nameParts = claimName . toLowerCase ( ) . split ( '-' ) ;
if ( arrayContainsQueryPart ( nameParts ) ) {
downloadResultsFromQuery . push ( fileInfo ) ;
return ;
}
var titleParts = title . toLowerCase ( ) . split ( ' ' ) ;
if ( arrayContainsQueryPart ( titleParts ) ) {
downloadResultsFromQuery . push ( fileInfo ) ;
return ;
}
if ( author ) {
var authorParts = author . toLowerCase ( ) . split ( ' ' ) ;
if ( arrayContainsQueryPart ( authorParts ) ) {
downloadResultsFromQuery . push ( fileInfo ) ;
return ;
}
}
if ( description ) {
var descriptionParts = description . toLowerCase ( ) . split ( ' ' ) ;
if ( arrayContainsQueryPart ( descriptionParts ) ) {
downloadResultsFromQuery . push ( fileInfo ) ;
}
}
} ) ;
return downloadResultsFromQuery . length ? downloadResultsFromQuery . map ( function ( fileInfo ) {
var channelName = fileInfo . channel _name ,
claimId = fileInfo . claim _id ,
claimName = fileInfo . claim _name ;
var uriParams = { } ;
if ( channelName ) {
var claim = claimsById [ claimId ] ;
if ( claim && claim . value ) {
uriParams . claimId = claim . value . publisherSignature . certificateId ;
} else {
uriParams . claimId = claimId ;
}
uriParams . channelName = channelName ;
uriParams . contentName = claimName ;
} else {
uriParams . claimId = claimId ;
uriParams . claimName = claimName ;
}
var uri = ( 0 , _lbryURI . buildURI ) ( uriParams ) ;
return uri ;
} ) : null ;
} ) ;
} ;
var selectFileListPublishedSort = exports . selectFileListPublishedSort = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . fileListPublishedSort ;
2018-10-26 20:10:50 +02:00
} ) ;
2018-11-29 07:07:43 +01:00
var selectFileListDownloadedSort = exports . selectFileListDownloadedSort = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . fileListDownloadedSort ;
2018-10-26 20:10:50 +02:00
} ) ;
2018-11-29 07:07:43 +01:00
/***/ } ) ,
/* 32 */
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
2018-10-26 20:10:50 +02:00
2018-11-29 07:07:43 +01:00
Object . defineProperty ( exports , "__esModule" , {
value : true
2018-10-26 20:10:50 +02:00
} ) ;
2018-11-29 07:07:43 +01:00
exports . doBlurSearchInput = exports . doFocusSearchInput = exports . doUpdateSearchQuery = exports . getSearchSuggestions = exports . doSearch = undefined ;
2018-10-26 20:10:50 +02:00
2018-11-29 07:07:43 +01:00
var _action _types = _ _webpack _require _ _ ( 2 ) ;
2018-10-26 20:10:50 +02:00
2018-11-29 07:07:43 +01:00
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
2018-10-26 20:10:50 +02:00
2018-11-29 07:07:43 +01:00
var _lbryURI = _ _webpack _require _ _ ( 3 ) ;
2018-10-26 20:10:50 +02:00
2018-11-29 07:07:43 +01:00
var _claims = _ _webpack _require _ _ ( 8 ) ;
2018-10-26 20:10:50 +02:00
2018-11-29 07:07:43 +01:00
var _search = _ _webpack _require _ _ ( 21 ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _batchActions = _ _webpack _require _ _ ( 24 ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _handleFetch = _ _webpack _require _ _ ( 33 ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _handleFetch2 = _interopRequireDefault ( _handleFetch ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
// @flow
var DEFAULTSEARCHRESULTSIZE = 10 ;
var DEFAULTSEARCHRESULTFROM = 0 ;
/*:: type Dispatch = (action: any) => any;*/
/*:: type GetState = () => {};*/
var doSearch = exports . doSearch = function doSearch ( rawQuery ) {
var size = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : DEFAULTSEARCHRESULTSIZE ;
var from = arguments . length > 2 && arguments [ 2 ] !== undefined ? arguments [ 2 ] : DEFAULTSEARCHRESULTFROM ;
var isBackgroundSearch = arguments [ 3 ] ;
return function ( dispatch /*: Dispatch*/ , getState /*: GetState*/ ) {
var state = getState ( ) ;
var query = rawQuery . replace ( /^lbry:\/\//i , '' ) . replace ( /\// , ' ' ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
if ( ! query ) {
dispatch ( {
type : ACTIONS . SEARCH _FAIL
} ) ;
return ;
2018-07-23 15:12:18 +02:00
}
2018-11-29 07:07:43 +01:00
// If we have already searched for something, we don't need to do anything
var urisForQuery = ( 0 , _search . makeSelectSearchUris ) ( query ) ( state ) ;
if ( urisForQuery && ! ! urisForQuery . length ) {
return ;
}
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
dispatch ( {
type : ACTIONS . SEARCH _START
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
// If the user is on the file page with a pre-populated uri and they select
// the search option without typing anything, searchQuery will be empty
// We need to populate it so the input is filled on the search page
// isBackgroundSearch means the search is happening in the background, don't update the search query
if ( ! state . search . searchQuery && ! isBackgroundSearch ) {
dispatch ( {
type : ACTIONS . UPDATE _SEARCH _QUERY ,
data : { searchQuery : query }
} ) ;
}
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var encodedQuery = encodeURIComponent ( query ) ;
fetch ( 'https://lighthouse.lbry.io/search?s=' + encodedQuery + '&size=' + size + '&from=' + from ) . then ( _handleFetch2 . default ) . then ( function ( data ) {
var uris = [ ] ;
var actions = [ ] ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
data . forEach ( function ( result ) {
var uri = ( 0 , _lbryURI . buildURI ) ( {
claimName : result . name ,
claimId : result . claimId
} ) ;
actions . push ( ( 0 , _claims . doResolveUri ) ( uri ) ) ;
uris . push ( uri ) ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
actions . push ( {
type : ACTIONS . SEARCH _SUCCESS ,
data : {
query : query ,
uris : uris
}
} ) ;
dispatch ( _batchActions . batchActions . apply ( undefined , actions ) ) ;
} ) . catch ( function ( ) {
dispatch ( {
type : ACTIONS . SEARCH _FAIL
} ) ;
} ) ;
} ;
} ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var getSearchSuggestions = exports . getSearchSuggestions = function getSearchSuggestions ( value /*: string*/ ) {
return function ( dispatch /*: Dispatch*/ , getState /*: GetState*/ ) {
var query = value . trim ( ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
// strip out any basic stuff for more accurate search results
var searchValue = query . replace ( /lbry:\/\//g , '' ) . replace ( /-/g , ' ' ) ;
if ( searchValue . includes ( '#' ) ) {
// This should probably be more robust, but I think it's fine for now
// Remove everything after # to get rid of the claim id
searchValue = searchValue . substring ( 0 , searchValue . indexOf ( '#' ) ) ;
}
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var suggestions = ( 0 , _search . selectSuggestions ) ( getState ( ) ) ;
if ( suggestions [ searchValue ] ) {
return ;
}
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
fetch ( 'https://lighthouse.lbry.io/autocomplete?s=' + searchValue ) . then ( _handleFetch2 . default ) . then ( function ( apiSuggestions ) {
dispatch ( {
type : ACTIONS . UPDATE _SEARCH _SUGGESTIONS ,
data : {
query : searchValue ,
suggestions : apiSuggestions
}
} ) ;
} ) . catch ( function ( ) {
// If the fetch fails, do nothing
// Basic search suggestions are already populated at this point
} ) ;
} ;
} ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var doUpdateSearchQuery = exports . doUpdateSearchQuery = function doUpdateSearchQuery ( query /*: string*/ , shouldSkipSuggestions /*: ?boolean*/ ) {
return function ( dispatch /*: Dispatch*/ ) {
dispatch ( {
type : ACTIONS . UPDATE _SEARCH _QUERY ,
data : { query : query }
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
// Don't fetch new suggestions if the user just added a space
if ( ! query . endsWith ( ' ' ) || ! shouldSkipSuggestions ) {
dispatch ( getSearchSuggestions ( query ) ) ;
}
} ;
} ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var doFocusSearchInput = exports . doFocusSearchInput = function doFocusSearchInput ( ) {
return function ( dispatch /*: Dispatch*/ ) {
return dispatch ( {
type : ACTIONS . SEARCH _FOCUS
} ) ;
} ;
2018-07-23 15:12:18 +02:00
} ;
2018-11-29 07:07:43 +01:00
var doBlurSearchInput = exports . doBlurSearchInput = function doBlurSearchInput ( ) {
return function ( dispatch /*: Dispatch*/ ) {
return dispatch ( {
type : ACTIONS . SEARCH _BLUR
} ) ;
} ;
} ;
2018-10-26 20:10:50 +02:00
2018-07-23 15:12:18 +02:00
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 33 */
2018-10-26 20:10:50 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
2018-11-29 07:07:43 +01:00
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . default = handleFetchResponse ;
function handleFetchResponse ( response ) {
return response . status === 200 ? Promise . resolve ( response . json ( ) ) : Promise . reject ( new Error ( response . statusText ) ) ;
}
2018-10-26 20:10:50 +02:00
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 34 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-11-29 07:07:43 +01:00
var _slicedToArray = function ( ) { function sliceIterator ( 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" ] ) _i [ "return" ] ( ) ; } finally { if ( _d ) throw _e ; } } return _arr ; } return function ( arr , i ) { if ( Array . isArray ( arr ) ) { return arr ; } else if ( Symbol . iterator in Object ( arr ) ) { return sliceIterator ( arr , i ) ; } else { throw new TypeError ( "Invalid attempt to destructure non-iterable instance" ) ; } } ; } ( ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
exports . doFetchBlackListedOutpoints = doFetchBlackListedOutpoints ;
exports . doBlackListedOutpointsSubscribe = doBlackListedOutpointsSubscribe ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _lbryapi = _ _webpack _require _ _ ( 12 ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _lbryapi2 = _interopRequireDefault ( _lbryapi ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _action _types = _ _webpack _require _ _ ( 2 ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
2018-10-26 20:10:50 +02:00
2018-11-29 07:07:43 +01:00
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
var CHECK _BLACK _LISTED _CONTENT _INTERVAL = 60 * 60 * 1000 ;
function doFetchBlackListedOutpoints ( ) {
return function ( dispatch ) {
dispatch ( {
type : ACTIONS . FETCH _BLACK _LISTED _CONTENT _STARTED
} ) ;
var success = function success ( _ref ) {
var outpoints = _ref . outpoints ;
var splitedOutpoints = [ ] ;
outpoints . forEach ( function ( outpoint , index ) {
var _outpoint$split = outpoint . split ( ':' ) ,
_outpoint$split2 = _slicedToArray ( _outpoint$split , 2 ) ,
txid = _outpoint$split2 [ 0 ] ,
nout = _outpoint$split2 [ 1 ] ;
splitedOutpoints [ index ] = { txid : txid , nout : Number . parseInt ( nout , 10 ) } ;
} ) ;
dispatch ( {
type : ACTIONS . FETCH _BLACK _LISTED _CONTENT _COMPLETED ,
data : {
outpoints : splitedOutpoints ,
success : true
}
} ) ;
} ;
var failure = function failure ( _ref2 ) {
var error = _ref2 . error ;
dispatch ( {
type : ACTIONS . FETCH _BLACK _LISTED _CONTENT _FAILED ,
data : {
error : error ,
success : false
}
} ) ;
} ;
_lbryapi2 . default . call ( 'file' , 'list_blocked' ) . then ( success , failure ) ;
} ;
}
function doBlackListedOutpointsSubscribe ( ) {
return function ( dispatch ) {
dispatch ( doFetchBlackListedOutpoints ( ) ) ;
setInterval ( function ( ) {
return dispatch ( doFetchBlackListedOutpoints ( ) ) ;
} , CHECK _BLACK _LISTED _CONTENT _INTERVAL ) ;
} ;
2018-10-26 20:10:50 +02:00
}
2018-07-23 15:12:18 +02:00
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 35 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
var _slicedToArray = function ( ) { function sliceIterator ( 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" ] ) _i [ "return" ] ( ) ; } finally { if ( _d ) throw _e ; } } return _arr ; } return function ( arr , i ) { if ( Array . isArray ( arr ) ) { return arr ; } else if ( Symbol . iterator in Object ( arr ) ) { return sliceIterator ( arr , i ) ; } else { throw new TypeError ( "Invalid attempt to destructure non-iterable instance" ) ; } } ; } ( ) ;
exports . claimsReducer = claimsReducer ;
2018-11-29 07:07:43 +01:00
var _action _types = _ _webpack _require _ _ ( 2 ) ;
2018-07-23 15:12:18 +02:00
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
2018-11-29 07:07:43 +01:00
var _lbryURI = _ _webpack _require _ _ ( 3 ) ;
2018-07-23 15:12:18 +02:00
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
var reducers = { } ;
var defaultState = {
channelClaimCounts : { }
} ;
reducers [ ACTIONS . RESOLVE _URIS _COMPLETED ] = function ( state , action ) {
var resolveInfo = action . data . resolveInfo ;
var byUri = Object . assign ( { } , state . claimsByUri ) ;
var byId = Object . assign ( { } , state . byId ) ;
var channelClaimCounts = Object . assign ( { } , state . channelClaimCounts ) ;
Object . entries ( resolveInfo ) . forEach ( function ( _ref ) {
var _ref2 = _slicedToArray ( _ref , 2 ) ,
uri = _ref2 [ 0 ] ,
_ref2$ = _ref2 [ 1 ] ,
certificate = _ref2$ . certificate ,
claimsInChannel = _ref2$ . claimsInChannel ;
if ( certificate && ! Number . isNaN ( claimsInChannel ) ) {
channelClaimCounts [ uri ] = claimsInChannel ;
}
} ) ;
Object . entries ( resolveInfo ) . forEach ( function ( _ref3 ) {
var _ref4 = _slicedToArray ( _ref3 , 2 ) ,
uri = _ref4 [ 0 ] ,
_ref4$ = _ref4 [ 1 ] ,
certificate = _ref4$ . certificate ,
claim = _ref4$ . claim ;
if ( claim ) {
byId [ claim . claim _id ] = claim ;
byUri [ uri ] = claim . claim _id ;
} else if ( claim === undefined && certificate !== undefined ) {
byId [ certificate . claim _id ] = certificate ;
// Don't point URI at the channel certificate unless it actually is
// a channel URI. This is brittle.
if ( ! uri . split ( certificate . name ) [ 1 ] . match ( /\// ) ) {
byUri [ uri ] = certificate . claim _id ;
} else {
byUri [ uri ] = null ;
}
} else {
byUri [ uri ] = null ;
}
} ) ;
return Object . assign ( { } , state , {
byId : byId ,
claimsByUri : byUri ,
channelClaimCounts : channelClaimCounts ,
resolvingUris : ( state . resolvingUris || [ ] ) . filter ( function ( uri ) {
return ! resolveInfo [ uri ] ;
} )
} ) ;
} ;
reducers [ ACTIONS . FETCH _CLAIM _LIST _MINE _STARTED ] = function ( state ) {
return Object . assign ( { } , state , {
isFetchingClaimListMine : true
} ) ;
} ;
reducers [ ACTIONS . FETCH _CLAIM _LIST _MINE _COMPLETED ] = function ( state , action ) {
var claims = action . data . claims ;
var byId = Object . assign ( { } , state . byId ) ;
2018-11-29 07:07:43 +01:00
var byUri = Object . assign ( { } , state . claimsByUri ) ;
2018-07-23 15:12:18 +02:00
var pendingById = Object . assign ( { } , state . pendingById ) ;
2018-11-29 07:07:43 +01:00
claims . forEach ( function ( claim ) {
var uri = ( 0 , _lbryURI . buildURI ) ( { claimName : claim . name , claimId : claim . claim _id } ) ;
if ( claim . type && claim . type . match ( /claim|update/ ) ) {
if ( claim . confirmations < 1 ) {
pendingById [ claim . claim _id ] = claim ;
delete byId [ claim . claim _id ] ;
delete byUri [ claim . claim _id ] ;
} else {
byId [ claim . claim _id ] = claim ;
byUri [ uri ] = claim . claim _id ;
}
2018-07-23 15:12:18 +02:00
}
} ) ;
2018-10-26 20:10:50 +02:00
// Remove old pending publishes
2018-07-23 15:12:18 +02:00
Object . values ( pendingById ) . filter ( function ( pendingClaim ) {
2018-10-26 20:10:50 +02:00
return byId [ pendingClaim . claim _id ] ;
2018-07-23 15:12:18 +02:00
} ) . forEach ( function ( pendingClaim ) {
delete pendingById [ pendingClaim . claim _id ] ;
} ) ;
return Object . assign ( { } , state , {
isFetchingClaimListMine : false ,
myClaims : claims ,
byId : byId ,
2018-11-29 07:07:43 +01:00
claimsByUri : byUri ,
2018-07-23 15:12:18 +02:00
pendingById : pendingById
} ) ;
} ;
reducers [ ACTIONS . FETCH _CHANNEL _LIST _STARTED ] = function ( state ) {
return Object . assign ( { } , state , { fetchingMyChannels : true } ) ;
} ;
reducers [ ACTIONS . FETCH _CHANNEL _LIST _COMPLETED ] = function ( state , action ) {
var claims = action . data . claims ;
var myChannelClaims = new Set ( state . myChannelClaims ) ;
var byId = Object . assign ( { } , state . byId ) ;
claims . forEach ( function ( claim ) {
myChannelClaims . add ( claim . claim _id ) ;
2018-10-26 20:10:50 +02:00
byId [ claim . claim _id ] = claim ;
2018-07-23 15:12:18 +02:00
} ) ;
return Object . assign ( { } , state , {
byId : byId ,
fetchingMyChannels : false ,
myChannelClaims : myChannelClaims
} ) ;
} ;
reducers [ ACTIONS . FETCH _CHANNEL _CLAIMS _STARTED ] = function ( state , action ) {
var _action$data = action . data ,
uri = _action$data . uri ,
page = _action$data . page ;
var fetchingChannelClaims = Object . assign ( { } , state . fetchingChannelClaims ) ;
fetchingChannelClaims [ uri ] = page ;
return Object . assign ( { } , state , {
fetchingChannelClaims : fetchingChannelClaims
} ) ;
} ;
reducers [ ACTIONS . FETCH _CHANNEL _CLAIMS _COMPLETED ] = function ( state , action ) {
var _action$data2 = action . data ,
uri = _action$data2 . uri ,
claims = _action$data2 . claims ,
page = _action$data2 . page ;
var claimsByChannel = Object . assign ( { } , state . claimsByChannel ) ;
var byChannel = Object . assign ( { } , claimsByChannel [ uri ] ) ;
var allClaimIds = new Set ( byChannel . all ) ;
var currentPageClaimIds = [ ] ;
var byId = Object . assign ( { } , state . byId ) ;
var fetchingChannelClaims = Object . assign ( { } , state . fetchingChannelClaims ) ;
2018-10-26 20:10:50 +02:00
var claimsByUri = Object . assign ( { } , state . claimsByUri ) ;
2018-07-23 15:12:18 +02:00
if ( claims !== undefined ) {
claims . forEach ( function ( claim ) {
allClaimIds . add ( claim . claim _id ) ;
currentPageClaimIds . push ( claim . claim _id ) ;
byId [ claim . claim _id ] = claim ;
2018-10-26 20:10:50 +02:00
claimsByUri [ 'lbry://' + claim . name + '#' + claim . claim _id ] = claim . claim _id ;
2018-07-23 15:12:18 +02:00
} ) ;
}
byChannel . all = allClaimIds ;
byChannel [ page ] = currentPageClaimIds ;
claimsByChannel [ uri ] = byChannel ;
delete fetchingChannelClaims [ uri ] ;
return Object . assign ( { } , state , {
claimsByChannel : claimsByChannel ,
byId : byId ,
2018-10-26 20:10:50 +02:00
fetchingChannelClaims : fetchingChannelClaims ,
claimsByUri : claimsByUri
2018-07-23 15:12:18 +02:00
} ) ;
} ;
reducers [ ACTIONS . ABANDON _CLAIM _STARTED ] = function ( state , action ) {
var claimId = action . data . claimId ;
var abandoningById = Object . assign ( { } , state . abandoningById ) ;
abandoningById [ claimId ] = true ;
return Object . assign ( { } , state , {
abandoningById : abandoningById
} ) ;
} ;
reducers [ ACTIONS . ABANDON _CLAIM _SUCCEEDED ] = function ( state , action ) {
var claimId = action . data . claimId ;
var byId = Object . assign ( { } , state . byId ) ;
var claimsByUri = Object . assign ( { } , state . claimsByUri ) ;
Object . keys ( claimsByUri ) . forEach ( function ( uri ) {
if ( claimsByUri [ uri ] === claimId ) {
delete claimsByUri [ uri ] ;
}
} ) ;
delete byId [ claimId ] ;
return Object . assign ( { } , state , {
byId : byId ,
claimsByUri : claimsByUri
} ) ;
} ;
reducers [ ACTIONS . CREATE _CHANNEL _COMPLETED ] = function ( state , action ) {
var channelClaim = action . data . channelClaim ;
var byId = Object . assign ( { } , state . byId ) ;
var myChannelClaims = new Set ( state . myChannelClaims ) ;
byId [ channelClaim . claim _id ] = channelClaim ;
myChannelClaims . add ( channelClaim . claim _id ) ;
return Object . assign ( { } , state , {
byId : byId ,
myChannelClaims : myChannelClaims
} ) ;
} ;
reducers [ ACTIONS . FETCH _FEATURED _CONTENT _STARTED ] = function ( state ) {
return Object . assign ( { } , state , {
fetchingFeaturedContent : true
} ) ;
} ;
reducers [ ACTIONS . FETCH _FEATURED _CONTENT _COMPLETED ] = function ( state , action ) {
var _action$data3 = action . data ,
uris = _action$data3 . uris ,
success = _action$data3 . success ;
return Object . assign ( { } , state , {
fetchingFeaturedContent : false ,
fetchingFeaturedContentFailed : ! success ,
featuredUris : uris
} ) ;
} ;
reducers [ ACTIONS . FETCH _TRENDING _CONTENT _STARTED ] = function ( state ) {
return Object . assign ( { } , state , {
fetchingTrendingContent : true
} ) ;
} ;
reducers [ ACTIONS . FETCH _TRENDING _CONTENT _COMPLETED ] = function ( state , action ) {
var _action$data4 = action . data ,
uris = _action$data4 . uris ,
success = _action$data4 . success ;
return Object . assign ( { } , state , {
fetchingTrendingContent : false ,
fetchingTrendingContentFailed : ! success ,
trendingUris : uris
} ) ;
} ;
reducers [ ACTIONS . RESOLVE _URIS _STARTED ] = function ( state , action ) {
var uris = action . data . uris ;
var oldResolving = state . resolvingUris || [ ] ;
var newResolving = Object . assign ( [ ] , oldResolving ) ;
uris . forEach ( function ( uri ) {
if ( ! newResolving . includes ( uri ) ) {
newResolving . push ( uri ) ;
}
} ) ;
return Object . assign ( { } , state , {
resolvingUris : newResolving
} ) ;
} ;
reducers [ ACTIONS . FETCH _CHANNEL _CLAIM _COUNT _COMPLETED ] = function ( state , action ) {
var channelClaimCounts = Object . assign ( { } , state . channelClaimCounts ) ;
var _action$data5 = action . data ,
uri = _action$data5 . uri ,
totalClaims = _action$data5 . totalClaims ;
channelClaimCounts [ uri ] = totalClaims ;
return Object . assign ( { } , state , {
channelClaimCounts : channelClaimCounts
} ) ;
} ;
function claimsReducer ( ) {
var state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : defaultState ;
var action = arguments [ 1 ] ;
var handler = reducers [ action . type ] ;
if ( handler ) return handler ( state , action ) ;
return state ;
}
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 36 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . costInfoReducer = costInfoReducer ;
2018-11-29 07:07:43 +01:00
var _action _types = _ _webpack _require _ _ ( 2 ) ;
2018-07-23 15:12:18 +02:00
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
var reducers = { } ;
var defaultState = { } ;
reducers [ ACTIONS . FETCH _COST _INFO _STARTED ] = function ( state , action ) {
var uri = action . data . uri ;
var newFetching = Object . assign ( { } , state . fetching ) ;
newFetching [ uri ] = true ;
return Object . assign ( { } , state , {
fetching : newFetching
} ) ;
} ;
reducers [ ACTIONS . FETCH _COST _INFO _COMPLETED ] = function ( state , action ) {
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 ] ;
return Object . assign ( { } , state , {
byUri : newByUri ,
fetching : newFetching
} ) ;
} ;
function costInfoReducer ( ) {
var state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : defaultState ;
var action = arguments [ 1 ] ;
var handler = reducers [ action . type ] ;
if ( handler ) return handler ( state , action ) ;
return state ;
}
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 37 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-10-26 20:10:50 +02:00
var _extends = Object . assign || function ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] ; for ( var key in source ) { if ( Object . prototype . hasOwnProperty . call ( source , key ) ) { target [ key ] = source [ key ] ; } } } return target ; } ;
2018-07-23 15:12:18 +02:00
exports . fileInfoReducer = fileInfoReducer ;
2018-11-29 07:07:43 +01:00
var _action _types = _ _webpack _require _ _ ( 2 ) ;
2018-07-23 15:12:18 +02:00
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
2018-11-29 07:07:43 +01:00
var _sort _options = _ _webpack _require _ _ ( 38 ) ;
2018-10-26 20:10:50 +02:00
var SORT _OPTIONS = _interopRequireWildcard ( _sort _options ) ;
2018-11-29 07:07:43 +01:00
var _pages = _ _webpack _require _ _ ( 39 ) ;
2018-10-26 20:10:50 +02:00
var PAGES = _interopRequireWildcard ( _pages ) ;
2018-07-23 15:12:18 +02:00
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
2018-10-26 20:10:50 +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 ; }
2018-07-23 15:12:18 +02:00
var reducers = { } ;
2018-10-26 20:10:50 +02:00
var defaultState = {
fileListPublishedSort : SORT _OPTIONS . DATE _NEW ,
fileListDownloadedSort : SORT _OPTIONS . DATE _NEW
} ;
2018-07-23 15:12:18 +02:00
reducers [ ACTIONS . FILE _LIST _STARTED ] = function ( state ) {
return Object . assign ( { } , state , {
isFetchingFileList : true
} ) ;
} ;
reducers [ ACTIONS . FILE _LIST _SUCCEEDED ] = function ( state , action ) {
var fileInfos = action . data . fileInfos ;
var newByOutpoint = Object . assign ( { } , state . byOutpoint ) ;
var pendingByOutpoint = Object . assign ( { } , state . pendingByOutpoint ) ;
fileInfos . forEach ( function ( fileInfo ) {
var outpoint = fileInfo . outpoint ;
if ( outpoint ) newByOutpoint [ fileInfo . outpoint ] = fileInfo ;
} ) ;
return Object . assign ( { } , state , {
isFetchingFileList : false ,
byOutpoint : newByOutpoint ,
pendingByOutpoint : pendingByOutpoint
} ) ;
} ;
reducers [ ACTIONS . FETCH _FILE _INFO _STARTED ] = function ( state , action ) {
var outpoint = action . data . outpoint ;
var newFetching = Object . assign ( { } , state . fetching ) ;
newFetching [ outpoint ] = true ;
return Object . assign ( { } , state , {
fetching : newFetching
} ) ;
} ;
reducers [ ACTIONS . FETCH _FILE _INFO _COMPLETED ] = function ( state , action ) {
var _action$data = action . data ,
fileInfo = _action$data . fileInfo ,
outpoint = _action$data . outpoint ;
var newByOutpoint = Object . assign ( { } , state . byOutpoint ) ;
var newFetching = Object . assign ( { } , state . fetching ) ;
newByOutpoint [ outpoint ] = fileInfo ;
delete newFetching [ outpoint ] ;
return Object . assign ( { } , state , {
byOutpoint : newByOutpoint ,
fetching : newFetching
} ) ;
} ;
reducers [ ACTIONS . DOWNLOADING _STARTED ] = function ( state , action ) {
var _action$data2 = action . data ,
uri = _action$data2 . uri ,
outpoint = _action$data2 . outpoint ,
fileInfo = _action$data2 . fileInfo ;
var newByOutpoint = Object . assign ( { } , state . byOutpoint ) ;
var newDownloading = Object . assign ( { } , state . downloadingByOutpoint ) ;
var newLoading = Object . assign ( { } , state . urisLoading ) ;
newDownloading [ outpoint ] = true ;
newByOutpoint [ outpoint ] = fileInfo ;
delete newLoading [ uri ] ;
return Object . assign ( { } , state , {
downloadingByOutpoint : newDownloading ,
urisLoading : newLoading ,
byOutpoint : newByOutpoint
} ) ;
} ;
reducers [ ACTIONS . DOWNLOADING _PROGRESSED ] = function ( state , action ) {
var _action$data3 = action . data ,
outpoint = _action$data3 . outpoint ,
fileInfo = _action$data3 . fileInfo ;
var newByOutpoint = Object . assign ( { } , state . byOutpoint ) ;
var newDownloading = Object . assign ( { } , state . downloadingByOutpoint ) ;
newByOutpoint [ outpoint ] = fileInfo ;
newDownloading [ outpoint ] = true ;
return Object . assign ( { } , state , {
byOutpoint : newByOutpoint ,
downloadingByOutpoint : newDownloading
} ) ;
} ;
2018-10-26 20:10:50 +02:00
reducers [ ACTIONS . DOWNLOADING _CANCELED ] = function ( state , action ) {
var outpoint = action . data . outpoint ;
var newDownloading = Object . assign ( { } , state . downloadingByOutpoint ) ;
delete newDownloading [ outpoint ] ;
return Object . assign ( { } , state , {
downloadingByOutpoint : newDownloading
} ) ;
} ;
2018-07-23 15:12:18 +02:00
reducers [ ACTIONS . DOWNLOADING _COMPLETED ] = function ( state , action ) {
var _action$data4 = action . data ,
outpoint = _action$data4 . outpoint ,
fileInfo = _action$data4 . fileInfo ;
var newByOutpoint = Object . assign ( { } , state . byOutpoint ) ;
var newDownloading = Object . assign ( { } , state . downloadingByOutpoint ) ;
newByOutpoint [ outpoint ] = fileInfo ;
delete newDownloading [ outpoint ] ;
return Object . assign ( { } , state , {
byOutpoint : newByOutpoint ,
downloadingByOutpoint : newDownloading
} ) ;
} ;
reducers [ ACTIONS . FILE _DELETE ] = function ( state , action ) {
var outpoint = action . data . outpoint ;
var newByOutpoint = Object . assign ( { } , state . byOutpoint ) ;
var downloadingByOutpoint = Object . assign ( { } , state . downloadingByOutpoint ) ;
delete newByOutpoint [ outpoint ] ;
delete downloadingByOutpoint [ outpoint ] ;
return Object . assign ( { } , state , {
byOutpoint : newByOutpoint ,
downloadingByOutpoint : downloadingByOutpoint
} ) ;
} ;
reducers [ ACTIONS . LOADING _VIDEO _STARTED ] = function ( state , action ) {
var uri = action . data . uri ;
var newLoading = Object . assign ( { } , state . urisLoading ) ;
2018-10-18 18:36:55 +02:00
newLoading [ uri ] = true ;
2018-10-02 02:38:16 +02:00
2018-10-26 20:10:50 +02:00
var newErrors = _extends ( { } , state . errors ) ;
if ( uri in newErrors ) delete newErrors [ uri ] ;
2018-07-23 15:12:18 +02:00
return Object . assign ( { } , state , {
2018-10-26 20:10:50 +02:00
urisLoading : newLoading ,
errors : _extends ( { } , newErrors )
2018-07-23 15:12:18 +02:00
} ) ;
} ;
reducers [ ACTIONS . LOADING _VIDEO _FAILED ] = function ( state , action ) {
var uri = action . data . uri ;
var newLoading = Object . assign ( { } , state . urisLoading ) ;
2018-10-18 18:36:55 +02:00
delete newLoading [ uri ] ;
2018-10-02 02:38:16 +02:00
2018-10-26 20:10:50 +02:00
var newErrors = _extends ( { } , state . errors ) ;
newErrors [ uri ] = true ;
2018-07-23 15:12:18 +02:00
return Object . assign ( { } , state , {
2018-10-26 20:10:50 +02:00
urisLoading : newLoading ,
errors : _extends ( { } , newErrors )
2018-07-23 15:12:18 +02:00
} ) ;
} ;
reducers [ ACTIONS . FETCH _DATE ] = function ( state , action ) {
var time = action . data . time ;
if ( time ) {
return Object . assign ( { } , state , {
publishedDate : time
} ) ;
}
return null ;
} ;
2018-10-26 20:10:50 +02:00
reducers [ ACTIONS . SET _FILE _LIST _SORT ] = function ( state , action ) {
var _pageSortStates ;
var pageSortStates = ( _pageSortStates = { } , _defineProperty ( _pageSortStates , PAGES . PUBLISHED , 'fileListPublishedSort' ) , _defineProperty ( _pageSortStates , PAGES . DOWNLOADED , 'fileListDownloadedSort' ) , _pageSortStates ) ;
var pageSortState = pageSortStates [ action . data . page ] ;
var value = action . data . value ;
return Object . assign ( { } , state , _defineProperty ( { } , pageSortState , value ) ) ;
} ;
2018-07-23 15:12:18 +02:00
function fileInfoReducer ( ) {
var state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : defaultState ;
var action = arguments [ 1 ] ;
var handler = reducers [ action . type ] ;
if ( handler ) return handler ( state , action ) ;
return state ;
}
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 38 */
2018-10-26 20:10:50 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
var DATE _NEW = exports . DATE _NEW = 'dateNew' ;
var DATE _OLD = exports . DATE _OLD = 'dateOld' ;
var TITLE = exports . TITLE = 'title' ;
var FILENAME = exports . FILENAME = 'filename' ;
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 39 */
2018-10-26 20:10:50 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
var AUTH = exports . AUTH = 'auth' ;
var BACKUP = exports . BACKUP = 'backup' ;
var CHANNEL = exports . CHANNEL = 'channel' ;
var DISCOVER = exports . DISCOVER = 'discover' ;
var FILE = exports . FILE = 'file' ;
var DOWNLOADED = exports . DOWNLOADED = 'downloaded' ;
var PUBLISHED = exports . PUBLISHED = 'published' ;
var GET _CREDITS = exports . GET _CREDITS = 'getcredits' ;
var HELP = exports . HELP = 'help' ;
var INVITE = exports . INVITE = 'invite' ;
var PUBLISH = exports . PUBLISH = 'publish' ;
var REPORT = exports . REPORT = 'report' ;
var REWARDS = exports . REWARDS = 'rewards' ;
var SEARCH = exports . SEARCH = 'search' ;
var SEND _CREDITS = exports . SEND _CREDITS = 'send' ;
var SETTINGS = exports . SETTINGS = 'settings' ;
var SHOW = exports . SHOW = 'show' ;
var SUBSCRIPTIONS = exports . SUBSCRIPTIONS = 'subscriptions' ;
var TRANSACTION _HISTORY = exports . TRANSACTION _HISTORY = 'history' ;
var HISTORY = exports . HISTORY = 'user_history' ;
var WALLET = exports . WALLET = 'wallet' ;
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 40 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-11-29 07:07:43 +01:00
exports . notificationsReducer = undefined ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _handleActions ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _extends = Object . assign || function ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] ; for ( var key in source ) { if ( Object . prototype . hasOwnProperty . call ( source , key ) ) { target [ key ] = source [ key ] ; } } } return target ; } ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _action _types = _ _webpack _require _ _ ( 2 ) ;
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _reduxUtils = _ _webpack _require _ _ ( 41 ) ;
2018-07-23 15:12:18 +02:00
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
2018-11-29 07:07:43 +01: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 ; }
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
// @flow
/ * : : i m p o r t t y p e {
NotificationState ,
DoToast ,
DoNotification ,
DoEditNotification ,
DoDeleteNotification ,
} from 'types/Notification' ; * /
var defaultState /*: NotificationState*/ = {
notifications : [ ] ,
toasts : [ ] ,
errors : [ ]
2018-07-23 15:12:18 +02:00
} ;
2018-11-29 07:07:43 +01:00
var notificationsReducer = ( 0 , _reduxUtils . handleActions ) ( ( _handleActions = { } , _defineProperty ( _handleActions , ACTIONS . CREATE _TOAST , function ( state /*: NotificationState*/ , action /*: DoToast*/ ) {
var toast = action . data ;
var newToasts = state . toasts . slice ( ) ;
newToasts . push ( toast ) ;
return _extends ( { } , state , {
toasts : newToasts
2018-07-23 15:12:18 +02:00
} ) ;
2018-11-29 07:07:43 +01:00
} ) , _defineProperty ( _handleActions , ACTIONS . DISMISS _TOAST , function ( state /*: NotificationState*/ ) {
var newToasts = state . toasts . slice ( ) ;
newToasts . shift ( ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
return _extends ( { } , state , {
toasts : newToasts
2018-07-23 15:12:18 +02:00
} ) ;
2018-11-29 07:07:43 +01:00
} ) , _defineProperty ( _handleActions , ACTIONS . CREATE _NOTIFICATION , function ( state /*: NotificationState*/ , action /*: DoNotification*/ ) {
var notification = action . data ;
var newNotifications = state . notifications . slice ( ) ;
newNotifications . push ( notification ) ;
return _extends ( { } , state , {
notifications : newNotifications
} ) ;
} ) , _defineProperty ( _handleActions , ACTIONS . EDIT _NOTIFICATION , function ( state /*: NotificationState*/ , action /*: DoEditNotification*/ ) {
var notification = action . data . notification ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var notifications = state . notifications . slice ( ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
notifications = notifications . map ( function ( pastNotification ) {
return pastNotification . id === notification . id ? notification : pastNotification ;
2018-07-23 15:12:18 +02:00
} ) ;
2018-11-29 07:07:43 +01:00
return _extends ( { } , state , {
notifications : notifications
} ) ;
} ) , _defineProperty ( _handleActions , ACTIONS . DELETE _NOTIFICATION , function ( state /*: NotificationState*/ , action /*: DoDeleteNotification*/ ) {
var id = action . data . id ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var newNotifications = state . notifications . slice ( ) ;
newNotifications = newNotifications . filter ( function ( notification ) {
return notification . id !== id ;
} ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
return _extends ( { } , state , {
notifications : newNotifications
} ) ;
} ) , _defineProperty ( _handleActions , ACTIONS . CREATE _ERROR , function ( state /*: NotificationState*/ , action /*: DoToast*/ ) {
var error = action . data ;
var newErrors = state . errors . slice ( ) ;
newErrors . push ( error ) ;
return _extends ( { } , state , {
errors : newErrors
} ) ;
} ) , _defineProperty ( _handleActions , ACTIONS . DISMISS _ERROR , function ( state /*: NotificationState*/ ) {
var newErrors = state . errors . slice ( ) ;
newErrors . shift ( ) ;
return _extends ( { } , state , {
errors : newErrors
} ) ;
} ) , _handleActions ) , defaultState ) ;
exports . notificationsReducer = notificationsReducer ;
2018-07-23 15:12:18 +02:00
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 41 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-11-29 07:07:43 +01:00
// 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 = exports . handleActions = function handleActions ( actionMap , defaultState ) {
return function ( ) {
var state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : defaultState ;
var action = arguments [ 1 ] ;
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 ;
} ;
} ;
2018-07-23 15:12:18 +02:00
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 42 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . searchReducer = undefined ;
var _handleActions ;
var _extends = Object . assign || function ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] ; for ( var key in source ) { if ( Object . prototype . hasOwnProperty . call ( source , key ) ) { target [ key ] = source [ key ] ; } } } return target ; } ; // @flow
2018-11-29 07:07:43 +01:00
var _action _types = _ _webpack _require _ _ ( 2 ) ;
2018-07-23 15:12:18 +02:00
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
2018-11-29 07:07:43 +01:00
var _reduxUtils = _ _webpack _require _ _ ( 41 ) ;
2018-07-23 15:12:18 +02:00
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
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 ; }
/ * : : t y p e S e a r c h S u c c e s s = {
type : ACTIONS . SEARCH _SUCCESS ,
data : {
query : string ,
uris : Array < string > ,
} ,
} ; * /
/ * : : t y p e U p d a t e S e a r c h Q u e r y = {
type : ACTIONS . UPDATE _SEARCH _QUERY ,
data : {
query : string ,
} ,
} ; * /
/ * : : t y p e S e a r c h S u g g e s t i o n = {
value : string ,
shorthand : string ,
type : string ,
} ; * /
/ * : : t y p e U p d a t e S e a r c h S u g g e s t i o n s = {
type : ACTIONS . UPDATE _SEARCH _SUGGESTIONS ,
data : {
2018-10-26 20:10:50 +02:00
query : string ,
2018-07-23 15:12:18 +02:00
suggestions : Array < SearchSuggestion > ,
} ,
} ; * /
/ * : : t y p e S e a r c h S t a t e = {
isActive : boolean ,
searchQuery : string ,
suggestions : Array < SearchSuggestion > ,
urisByQuery : { } ,
} ; * /
/ * : : t y p e H i s t o r y N a v i g a t e = {
type : ACTIONS . HISTORY _NAVIGATE ,
data : {
url : string ,
index ? : number ,
scrollY ? : number ,
} ,
} ; * /
var defaultState = {
isActive : false , // does the user have any typed text in the search input
focused : false , // is the search input focused
searchQuery : '' , // needs to be an empty string for input focusing
2018-10-26 20:10:50 +02:00
suggestions : { } ,
2018-07-23 15:12:18 +02:00
urisByQuery : { }
} ;
var searchReducer = exports . searchReducer = ( 0 , _reduxUtils . handleActions ) ( ( _handleActions = { } , _defineProperty ( _handleActions , ACTIONS . SEARCH _START , function ( state /*: SearchState*/ ) /*: SearchState*/ {
return _extends ( { } , state , {
searching : true
} ) ;
} ) , _defineProperty ( _handleActions , ACTIONS . SEARCH _SUCCESS , function ( state /*: SearchState*/ , action /*: SearchSuccess*/ ) /*: SearchState*/ {
var _action$data = action . data ,
query = _action$data . query ,
uris = _action$data . uris ;
return _extends ( { } , state , {
searching : false ,
urisByQuery : Object . assign ( { } , state . urisByQuery , _defineProperty ( { } , query , uris ) )
} ) ;
} ) , _defineProperty ( _handleActions , ACTIONS . SEARCH _FAIL , function ( state /*: SearchState*/ ) /*: SearchState*/ {
return _extends ( { } , state , {
searching : false
} ) ;
} ) , _defineProperty ( _handleActions , ACTIONS . UPDATE _SEARCH _QUERY , function ( state /*: SearchState*/ , action /*: UpdateSearchQuery*/ ) /*: SearchState*/ {
return _extends ( { } , state , {
searchQuery : action . data . query ,
isActive : true
} ) ;
} ) , _defineProperty ( _handleActions , ACTIONS . UPDATE _SEARCH _SUGGESTIONS , function ( state /*: SearchState*/ , action /*: UpdateSearchSuggestions*/ ) /*: SearchState*/ {
return _extends ( { } , state , {
2018-10-26 20:10:50 +02:00
suggestions : _extends ( { } , state . suggestions , _defineProperty ( { } , action . data . query , action . data . suggestions ) )
2018-07-23 15:12:18 +02:00
} ) ;
} ) , _defineProperty ( _handleActions , ACTIONS . HISTORY _NAVIGATE , function ( state /*: SearchState*/ , action /*: HistoryNavigate*/ ) /*: SearchState*/ {
var url = action . data . url ;
return _extends ( { } , state , {
searchQuery : url . indexOf ( '/search' ) === 0 ? url . slice ( 14 ) : '' ,
2018-10-26 20:10:50 +02:00
isActive : url . indexOf ( '/search' ) === 0 ,
suggestions : { }
2018-07-23 15:12:18 +02:00
} ) ;
} ) , _defineProperty ( _handleActions , ACTIONS . DISMISS _NOTIFICATION , function ( state /*: SearchState*/ ) /*: SearchState*/ {
return _extends ( { } , state , {
isActive : false
} ) ;
} ) , _defineProperty ( _handleActions , ACTIONS . SEARCH _FOCUS , function ( state /*: SearchState*/ ) /*: SearchState*/ {
return _extends ( { } , state , {
focused : true
} ) ;
} ) , _defineProperty ( _handleActions , ACTIONS . SEARCH _BLUR , function ( state /*: SearchState*/ ) /*: SearchState*/ {
return _extends ( { } , state , {
focused : false
} ) ;
} ) , _handleActions ) , defaultState ) ;
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 43 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . walletReducer = walletReducer ;
2018-11-29 07:07:43 +01:00
var _action _types = _ _webpack _require _ _ ( 2 ) ;
2018-07-23 15:12:18 +02:00
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
2018-10-26 20:10:50 +02:00
var reducers = { } ; // @flow
2018-07-23 15:12:18 +02:00
var buildDraftTransaction = function buildDraftTransaction ( ) {
return {
amount : undefined ,
address : undefined
} ;
} ;
2018-10-26 20:10:50 +02:00
// TODO: Split into common success and failure types
// See details in https://github.com/lbryio/lbry/issues/1307
/ * : : t y p e A c t i o n R e s u l t = {
type : any ,
result : any ,
} ; * /
/ * : : t y p e W a l l e t S t a t e = {
balance : any ,
blocks : any ,
2018-11-29 07:07:43 +01:00
latestBlock : number ,
2018-10-26 20:10:50 +02:00
transactions : any ,
fetchingTransactions : boolean ,
gettingNewAddress : boolean ,
draftTransaction : any ,
sendingSupport : boolean ,
walletIsEncrypted : boolean ,
walletEncryptPending : boolean ,
walletEncryptSucceded : ? boolean ,
walletEncryptResult : ? boolean ,
walletDecryptPending : boolean ,
walletDecryptSucceded : ? boolean ,
walletDecryptResult : ? boolean ,
walletUnlockPending : boolean ,
walletUnlockSucceded : ? boolean ,
walletUnlockResult : ? boolean ,
walletLockPending : boolean ,
walletLockSucceded : ? boolean ,
walletLockResult : ? boolean ,
} ; * /
2018-07-23 15:12:18 +02:00
var defaultState = {
balance : undefined ,
blocks : { } ,
2018-11-29 07:07:43 +01:00
latestBlock : undefined ,
2018-07-23 15:12:18 +02:00
transactions : { } ,
fetchingTransactions : false ,
gettingNewAddress : false ,
draftTransaction : buildDraftTransaction ( ) ,
2018-10-26 20:10:50 +02:00
sendingSupport : false ,
walletIsEncrypted : false ,
walletEncryptPending : false ,
walletEncryptSucceded : null ,
walletEncryptResult : null ,
walletDecryptPending : false ,
walletDecryptSucceded : null ,
walletDecryptResult : null ,
walletUnlockPending : false ,
walletUnlockSucceded : null ,
walletUnlockResult : null ,
walletLockPending : false ,
walletLockSucceded : null ,
walletLockResult : null ,
transactionListFilter : 'all'
} ;
reducers [ ACTIONS . FETCH _TRANSACTIONS _STARTED ] = function ( state /*: WalletState*/ ) {
2018-07-23 15:12:18 +02:00
return Object . assign ( { } , state , {
fetchingTransactions : true
} ) ;
} ;
2018-10-26 20:10:50 +02:00
reducers [ ACTIONS . FETCH _TRANSACTIONS _COMPLETED ] = function ( state /*: WalletState*/ , action ) {
2018-07-23 15:12:18 +02:00
var byId = Object . assign ( { } , state . transactions ) ;
var transactions = action . data . transactions ;
transactions . forEach ( function ( transaction ) {
byId [ transaction . txid ] = transaction ;
} ) ;
return Object . assign ( { } , state , {
transactions : byId ,
fetchingTransactions : false
} ) ;
} ;
2018-10-26 20:10:50 +02:00
reducers [ ACTIONS . GET _NEW _ADDRESS _STARTED ] = function ( state /*: WalletState*/ ) {
2018-07-23 15:12:18 +02:00
return Object . assign ( { } , state , {
gettingNewAddress : true
} ) ;
} ;
2018-10-26 20:10:50 +02:00
reducers [ ACTIONS . GET _NEW _ADDRESS _COMPLETED ] = function ( state /*: WalletState*/ , action ) {
2018-07-23 15:12:18 +02:00
var address = action . data . address ;
// Say no to localStorage!
return Object . assign ( { } , state , {
gettingNewAddress : false ,
receiveAddress : address
} ) ;
} ;
2018-10-26 20:10:50 +02:00
reducers [ ACTIONS . UPDATE _BALANCE ] = function ( state /*: WalletState*/ , action ) {
2018-07-23 15:12:18 +02:00
return Object . assign ( { } , state , {
balance : action . data . balance
} ) ;
} ;
2018-10-26 20:10:50 +02:00
reducers [ ACTIONS . CHECK _ADDRESS _IS _MINE _STARTED ] = function ( state /*: WalletState*/ ) {
2018-07-23 15:12:18 +02:00
return Object . assign ( { } , state , {
checkingAddressOwnership : true
} ) ;
} ;
2018-10-26 20:10:50 +02:00
reducers [ ACTIONS . CHECK _ADDRESS _IS _MINE _COMPLETED ] = function ( state /*: WalletState*/ ) {
2018-07-23 15:12:18 +02:00
return Object . assign ( { } , state , {
checkingAddressOwnership : false
} ) ;
} ;
2018-10-26 20:10:50 +02:00
reducers [ ACTIONS . SET _DRAFT _TRANSACTION _AMOUNT ] = function ( state /*: WalletState*/ , action ) {
2018-07-23 15:12:18 +02:00
var oldDraft = state . draftTransaction ;
var newDraft = Object . assign ( { } , oldDraft , {
amount : parseFloat ( action . data . amount )
} ) ;
return Object . assign ( { } , state , {
draftTransaction : newDraft
} ) ;
} ;
2018-10-26 20:10:50 +02:00
reducers [ ACTIONS . SET _DRAFT _TRANSACTION _ADDRESS ] = function ( state /*: WalletState*/ , action ) {
2018-07-23 15:12:18 +02:00
var oldDraft = state . draftTransaction ;
var newDraft = Object . assign ( { } , oldDraft , {
address : action . data . address
} ) ;
return Object . assign ( { } , state , {
draftTransaction : newDraft
} ) ;
} ;
2018-10-26 20:10:50 +02:00
reducers [ ACTIONS . SEND _TRANSACTION _STARTED ] = function ( state /*: WalletState*/ ) {
2018-07-23 15:12:18 +02:00
var newDraftTransaction = Object . assign ( { } , state . draftTransaction , {
sending : true
} ) ;
return Object . assign ( { } , state , {
draftTransaction : newDraftTransaction
} ) ;
} ;
2018-10-26 20:10:50 +02:00
reducers [ ACTIONS . SEND _TRANSACTION _COMPLETED ] = function ( state /*: WalletState*/ ) {
2018-07-23 15:12:18 +02:00
return Object . assign ( { } , state , {
draftTransaction : buildDraftTransaction ( )
} ) ;
} ;
2018-10-26 20:10:50 +02:00
reducers [ ACTIONS . SEND _TRANSACTION _FAILED ] = function ( state /*: WalletState*/ , action ) {
2018-07-23 15:12:18 +02:00
var newDraftTransaction = Object . assign ( { } , state . draftTransaction , {
sending : false ,
error : action . data . error
} ) ;
return Object . assign ( { } , state , {
draftTransaction : newDraftTransaction
} ) ;
} ;
2018-10-26 20:10:50 +02:00
reducers [ ACTIONS . SUPPORT _TRANSACTION _STARTED ] = function ( state /*: WalletState*/ ) {
2018-07-23 15:12:18 +02:00
return Object . assign ( { } , state , {
sendingSupport : true
} ) ;
} ;
2018-10-26 20:10:50 +02:00
reducers [ ACTIONS . SUPPORT _TRANSACTION _COMPLETED ] = function ( state /*: WalletState*/ ) {
2018-07-23 15:12:18 +02:00
return Object . assign ( { } , state , {
sendingSupport : false
} ) ;
} ;
2018-10-26 20:10:50 +02:00
reducers [ ACTIONS . SUPPORT _TRANSACTION _FAILED ] = function ( state /*: WalletState*/ , action ) {
2018-07-23 15:12:18 +02:00
return Object . assign ( { } , state , {
error : action . data . error ,
sendingSupport : false
} ) ;
} ;
2018-10-26 20:10:50 +02:00
reducers [ ACTIONS . FETCH _BLOCK _SUCCESS ] = function ( state /*: WalletState*/ , action ) {
2018-07-23 15:12:18 +02:00
var _action$data = action . data ,
block = _action$data . block ,
height = _action$data . block . height ;
var blocks = Object . assign ( { } , state . blocks ) ;
blocks [ height ] = block ;
return Object . assign ( { } , state , { blocks : blocks } ) ;
} ;
2018-10-26 20:10:50 +02:00
reducers [ ACTIONS . WALLET _STATUS _COMPLETED ] = function ( state /*: WalletState*/ , action ) {
return Object . assign ( { } , state , {
walletIsEncrypted : action . result
} ) ;
} ;
reducers [ ACTIONS . WALLET _ENCRYPT _START ] = function ( state /*: WalletState*/ ) {
return Object . assign ( { } , state , {
walletEncryptPending : true ,
walletEncryptSucceded : null ,
walletEncryptResult : null
} ) ;
} ;
reducers [ ACTIONS . WALLET _ENCRYPT _COMPLETED ] = function ( state /*: WalletState*/ , action /*: ActionResult*/ ) {
return Object . assign ( { } , state , {
walletEncryptPending : false ,
walletEncryptSucceded : true ,
walletEncryptResult : action . result
} ) ;
} ;
reducers [ ACTIONS . WALLET _ENCRYPT _FAILED ] = function ( state /*: WalletState*/ , action /*: ActionResult*/ ) {
return Object . assign ( { } , state , {
walletEncryptPending : false ,
walletEncryptSucceded : false ,
walletEncryptResult : action . result
} ) ;
} ;
reducers [ ACTIONS . WALLET _DECRYPT _START ] = function ( state /*: WalletState*/ ) {
return Object . assign ( { } , state , {
walletDecryptPending : true ,
walletDecryptSucceded : null ,
walletDecryptResult : null
} ) ;
} ;
reducers [ ACTIONS . WALLET _DECRYPT _COMPLETED ] = function ( state /*: WalletState*/ , action /*: ActionResult*/ ) {
return Object . assign ( { } , state , {
walletDecryptPending : false ,
walletDecryptSucceded : true ,
walletDecryptResult : action . result
} ) ;
} ;
reducers [ ACTIONS . WALLET _DECRYPT _FAILED ] = function ( state /*: WalletState*/ , action /*: ActionResult*/ ) {
return Object . assign ( { } , state , {
walletDecryptPending : false ,
walletDecryptSucceded : false ,
walletDecryptResult : action . result
} ) ;
} ;
reducers [ ACTIONS . WALLET _UNLOCK _START ] = function ( state /*: WalletState*/ ) {
return Object . assign ( { } , state , {
walletUnlockPending : true ,
walletUnlockSucceded : null ,
walletUnlockResult : null
} ) ;
} ;
reducers [ ACTIONS . WALLET _UNLOCK _COMPLETED ] = function ( state /*: WalletState*/ , action /*: ActionResult*/ ) {
return Object . assign ( { } , state , {
walletUnlockPending : false ,
walletUnlockSucceded : true ,
walletUnlockResult : action . result
} ) ;
} ;
reducers [ ACTIONS . WALLET _UNLOCK _FAILED ] = function ( state /*: WalletState*/ , action /*: ActionResult*/ ) {
return Object . assign ( { } , state , {
walletUnlockPending : false ,
walletUnlockSucceded : false ,
walletUnlockResult : action . result
} ) ;
} ;
reducers [ ACTIONS . WALLET _LOCK _START ] = function ( state /*: WalletState*/ ) {
return Object . assign ( { } , state , {
walletLockPending : false ,
walletLockSucceded : null ,
walletLockResult : null
} ) ;
} ;
reducers [ ACTIONS . WALLET _LOCK _COMPLETED ] = function ( state /*: WalletState*/ , action /*: ActionResult*/ ) {
return Object . assign ( { } , state , {
walletLockPending : false ,
walletLockSucceded : true ,
walletLockResult : action . result
} ) ;
} ;
reducers [ ACTIONS . WALLET _LOCK _FAILED ] = function ( state /*: WalletState*/ , action /*: ActionResult*/ ) {
return Object . assign ( { } , state , {
walletLockPending : false ,
walletLockSucceded : false ,
walletLockResult : action . result
} ) ;
} ;
reducers [ ACTIONS . SET _TRANSACTION _LIST _FILTER ] = function ( state /*: WalletState*/ , action /*: {}*/ ) {
return Object . assign ( { } , state , {
transactionListFilter : action . data
} ) ;
} ;
2018-11-29 07:07:43 +01:00
reducers [ ACTIONS . UPDATE _CURRENT _HEIGHT ] = function ( state /*: WalletState*/ , action /*: { data: number }*/ ) {
return Object . assign ( { } , state , {
latestBlock : action . data
} ) ;
} ;
2018-07-23 15:12:18 +02:00
function walletReducer ( ) {
2018-10-26 20:10:50 +02:00
var state /*: WalletState*/ = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : defaultState ;
var action /*: ActionResult*/ = arguments [ 1 ] ;
2018-07-23 15:12:18 +02:00
var handler = reducers [ action . type ] ;
if ( handler ) return handler ( state , action ) ;
return state ;
}
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 44 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . blacklistReducer = undefined ;
var _handleActions ;
var _extends = Object . assign || function ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] ; for ( var key in source ) { if ( Object . prototype . hasOwnProperty . call ( source , key ) ) { target [ key ] = source [ key ] ; } } } return target ; } ;
2018-11-29 07:07:43 +01:00
var _action _types = _ _webpack _require _ _ ( 2 ) ;
2018-07-23 15:12:18 +02:00
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
2018-11-29 07:07:43 +01:00
var _reduxUtils = _ _webpack _require _ _ ( 41 ) ;
2018-07-23 15:12:18 +02:00
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
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 = {
fetchingBlackListedOutpoints : false ,
fetchingBlackListedOutpointsSucceed : undefined ,
blackListedOutpoints : undefined
} ;
var blacklistReducer = exports . blacklistReducer = ( 0 , _reduxUtils . handleActions ) ( ( _handleActions = { } , _defineProperty ( _handleActions , ACTIONS . FETCH _BLACK _LISTED _CONTENT _STARTED , function ( state ) {
return _extends ( { } , state , {
fetchingBlackListedOutpoints : true
} ) ;
} ) , _defineProperty ( _handleActions , ACTIONS . FETCH _BLACK _LISTED _CONTENT _COMPLETED , function ( state , action ) {
var _action$data = action . data ,
outpoints = _action$data . outpoints ,
success = _action$data . success ;
return _extends ( { } , state , {
fetchingBlackListedOutpoints : false ,
fetchingBlackListedOutpointsSucceed : success ,
blackListedOutpoints : outpoints
} ) ;
} ) , _defineProperty ( _handleActions , ACTIONS . FETCH _BLACK _LISTED _CONTENT _FAILED , function ( state , action ) {
var _action$data2 = action . data ,
error = _action$data2 . error ,
success = _action$data2 . success ;
return _extends ( { } , state , {
fetchingBlackListedOutpoints : false ,
fetchingBlackListedOutpointsSucceed : success ,
fetchingBlackListedOutpointsError : error
} ) ;
} ) , _handleActions ) , defaultState ) ;
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 45 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . selectBlackListedOutpoints = exports . selectState = undefined ;
2018-11-29 07:07:43 +01:00
var _reselect = _ _webpack _require _ _ ( 19 ) ;
2018-07-23 15:12:18 +02:00
var selectState = exports . selectState = function selectState ( state ) {
return state . blacklist || { } ;
} ;
var selectBlackListedOutpoints = exports . selectBlackListedOutpoints = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . blackListedOutpoints ;
} ) ;
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 46 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-11-29 07:07:43 +01:00
exports . selectError = exports . selectToast = exports . selectState = undefined ;
var _extends = Object . assign || function ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] ; for ( var key in source ) { if ( Object . prototype . hasOwnProperty . call ( source , key ) ) { target [ key ] = source [ key ] ; } } } return target ; } ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _reselect = _ _webpack _require _ _ ( 19 ) ;
2018-07-23 15:12:18 +02:00
var selectState = exports . selectState = function selectState ( state ) {
return state . notifications || { } ;
} ;
2018-11-29 07:07:43 +01:00
var selectToast = exports . selectToast = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
if ( state . toasts . length ) {
var _state$toasts$ = state . toasts [ 0 ] ,
id = _state$toasts$ . id ,
params = _state$toasts$ . params ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
return _extends ( {
id : id
} , params ) ;
}
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
return null ;
2018-07-23 15:12:18 +02:00
} ) ;
2018-11-29 07:07:43 +01:00
var selectError = exports . selectError = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
if ( state . errors . length ) {
var error = state . errors [ 0 ] . error ;
return {
error : error
} ;
2018-07-23 15:12:18 +02:00
}
2018-11-29 07:07:43 +01:00
return null ;
2018-07-23 15:12:18 +02:00
} ) ;
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 47 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . makeSelectFetchingCostInfoForUri = exports . selectFetchingCostInfo = exports . selectCostForCurrentPageUri = exports . makeSelectCostInfoForUri = exports . selectAllCostInfoByUri = exports . selectState = undefined ;
2018-11-29 07:07:43 +01:00
var _reselect = _ _webpack _require _ _ ( 19 ) ;
2018-07-23 15:12:18 +02:00
2018-11-29 07:07:43 +01:00
var _navigation = _ _webpack _require _ _ ( 18 ) ;
2018-07-23 15:12:18 +02:00
var selectState = exports . selectState = function selectState ( state ) {
return state . costInfo || { } ;
} ;
var selectAllCostInfoByUri = exports . selectAllCostInfoByUri = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . byUri || { } ;
} ) ;
var makeSelectCostInfoForUri = exports . makeSelectCostInfoForUri = function makeSelectCostInfoForUri ( uri ) {
return ( 0 , _reselect . createSelector ) ( selectAllCostInfoByUri , function ( costInfos ) {
return costInfos && costInfos [ uri ] ;
} ) ;
} ;
var selectCostForCurrentPageUri = exports . selectCostForCurrentPageUri = ( 0 , _reselect . createSelector ) ( selectAllCostInfoByUri , _navigation . selectCurrentParams , function ( costInfo , params ) {
return params . uri && costInfo [ params . uri ] ? costInfo [ params . uri ] . cost : undefined ;
} ) ;
var selectFetchingCostInfo = exports . selectFetchingCostInfo = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . fetching || { } ;
} ) ;
var makeSelectFetchingCostInfoForUri = exports . makeSelectFetchingCostInfoForUri = function makeSelectFetchingCostInfoForUri ( uri ) {
return ( 0 , _reselect . createSelector ) ( selectFetchingCostInfo , function ( fetchingByUri ) {
return fetchingByUri && fetchingByUri [ uri ] ;
} ) ;
} ;
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 48 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
var API _DOWN = exports . API _DOWN = 'apiDown' ;
var READY = exports . READY = 'ready' ;
var IN _PROGRESS = exports . IN _PROGRESS = 'inProgress' ;
var COMPLETE = exports . COMPLETE = 'complete' ;
var MANUAL = exports . MANUAL = 'manual' ;
/***/ } ) ,
2018-11-29 07:07:43 +01:00
/* 49 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
/* hardcoded names still exist for these in reducers/settings.js - only discovered when debugging */
/ * M a n y S E T T I N G S a r e s t o r e d i n t h e l o c a l S t o r a g e b y t h e i r n a m e -
be careful about changing the value of a SETTINGS constant , as doing so can invalidate existing SETTINGS * /
var CREDIT _REQUIRED _ACKNOWLEDGED = exports . CREDIT _REQUIRED _ACKNOWLEDGED = 'credit_required_acknowledged' ;
var NEW _USER _ACKNOWLEDGED = exports . NEW _USER _ACKNOWLEDGED = 'welcome_acknowledged' ;
var EMAIL _COLLECTION _ACKNOWLEDGED = exports . EMAIL _COLLECTION _ACKNOWLEDGED = 'email_collection_acknowledged' ;
var LANGUAGE = exports . LANGUAGE = 'language' ;
var SHOW _NSFW = exports . SHOW _NSFW = 'showNsfw' ;
var SHOW _UNAVAILABLE = exports . SHOW _UNAVAILABLE = 'showUnavailable' ;
var INSTANT _PURCHASE _ENABLED = exports . INSTANT _PURCHASE _ENABLED = 'instantPurchaseEnabled' ;
var INSTANT _PURCHASE _MAX = exports . INSTANT _PURCHASE _MAX = 'instantPurchaseMax' ;
var THEME = exports . THEME = 'theme' ;
var THEMES = exports . THEMES = 'themes' ;
var AUTOMATIC _DARK _MODE _ENABLED = exports . AUTOMATIC _DARK _MODE _ENABLED = 'automaticDarkModeEnabled' ;
// mobile settings
var BACKGROUND _PLAY _ENABLED = exports . BACKGROUND _PLAY _ENABLED = 'backgroundPlayEnabled' ;
var FOREGROUND _NOTIFICATION _ENABLED = exports . FOREGROUND _NOTIFICATION _ENABLED = 'foregroundNotificationEnabled' ;
var KEEP _DAEMON _RUNNING = exports . KEEP _DAEMON _RUNNING = 'keepDaemonRunning' ;
/***/ } )
/******/ ] ) ;
} ) ;
/***/ } ) ,
2018-12-04 17:08:20 +01:00
/* 5 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
2018-12-04 17:08:20 +01:00
exports . decode = exports . parse = _ _webpack _require _ _ ( 6 ) ;
exports . encode = exports . stringify = _ _webpack _require _ _ ( 7 ) ;
2018-07-23 15:12:18 +02:00
/***/ } ) ,
2018-12-04 17:08:20 +01:00
/* 6 */
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]' ;
} ;
/***/ } ) ,
2018-12-04 17:08:20 +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.
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 ;
} ;
/***/ } ) ,
2018-12-04 17:08:20 +01:00
/* 8 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . doRewardList = doRewardList ;
exports . doClaimRewardType = doClaimRewardType ;
exports . doClaimEligiblePurchaseRewards = doClaimEligiblePurchaseRewards ;
exports . doClaimRewardClearError = doClaimRewardClearError ;
2018-09-04 06:15:53 +02:00
exports . doFetchRewardedContent = doFetchRewardedContent ;
2018-07-23 15:12:18 +02:00
2018-07-23 16:12:22 +02:00
var _lbryio = _ _webpack _require _ _ ( 3 ) ;
2018-07-23 15:12:18 +02:00
var _lbryio2 = _interopRequireDefault ( _lbryio ) ;
2018-12-04 17:08:20 +01:00
var _lbryRedux = _ _webpack _require _ _ ( 4 ) ;
2018-07-23 15:12:18 +02:00
2018-12-04 17:08:20 +01:00
var _rewards = _ _webpack _require _ _ ( 9 ) ;
2018-07-23 15:12:18 +02:00
2018-12-04 17:08:20 +01:00
var _user = _ _webpack _require _ _ ( 11 ) ;
2018-07-23 15:12:18 +02:00
2018-12-04 17:08:20 +01:00
var _rewards2 = _ _webpack _require _ _ ( 12 ) ;
2018-07-23 15:12:18 +02:00
var _rewards3 = _interopRequireDefault ( _rewards2 ) ;
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
function doRewardList ( ) {
return function ( dispatch ) {
dispatch ( {
2018-07-23 16:12:22 +02:00
type : _lbryRedux . ACTIONS . FETCH _REWARDS _STARTED
2018-07-23 15:12:18 +02:00
} ) ;
_lbryio2 . default . call ( 'reward' , 'list' , { multiple _rewards _per _type : true } ) . then ( function ( userRewards ) {
dispatch ( {
2018-07-23 16:12:22 +02:00
type : _lbryRedux . ACTIONS . FETCH _REWARDS _COMPLETED ,
2018-07-23 15:12:18 +02:00
data : { userRewards : userRewards }
} ) ;
} ) . catch ( function ( ) {
dispatch ( {
2018-07-23 16:12:22 +02:00
type : _lbryRedux . ACTIONS . FETCH _REWARDS _COMPLETED ,
2018-07-23 15:12:18 +02:00
data : { userRewards : [ ] }
} ) ;
} ) ;
} ;
}
2018-10-02 02:38:16 +02:00
function doClaimRewardType ( rewardType ) {
var options = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : { } ;
2018-07-23 15:12:18 +02:00
return function ( dispatch , getState ) {
var state = getState ( ) ;
2018-10-02 02:38:16 +02:00
var userIsRewardApproved = ( 0 , _user . selectUserIsRewardApproved ) ( state ) ;
2018-07-23 15:12:18 +02:00
var unclaimedRewards = ( 0 , _rewards . selectUnclaimedRewards ) ( state ) ;
2018-10-02 02:38:16 +02:00
var reward = rewardType === _rewards3 . default . TYPE _REWARD _CODE ? { reward _type : _rewards3 . default . TYPE _REWARD _CODE } : unclaimedRewards . find ( function ( ur ) {
2018-07-23 15:12:18 +02:00
return ur . reward _type === rewardType ;
} ) ;
2018-10-18 19:28:01 +02:00
if ( rewardType !== _rewards3 . default . TYPE _REWARD _CODE ) {
2018-10-02 02:38:16 +02:00
if ( ! reward || reward . transaction _id ) {
// already claimed or doesn't exist, do nothing
return ;
}
2018-07-23 15:12:18 +02:00
}
if ( ! userIsRewardApproved && rewardType !== _rewards3 . default . TYPE _CONFIRM _EMAIL ) {
2018-11-28 16:36:40 +01:00
if ( ! options || ! options . failSilently && _rewards3 . default . callbacks . rewardApprovalRequested ) {
_rewards3 . default . callbacks . rewardApprovalRequested ( ) ;
2018-10-18 18:36:55 +02:00
}
2018-07-23 15:12:18 +02:00
return ;
}
dispatch ( {
2018-07-23 16:12:22 +02:00
type : _lbryRedux . ACTIONS . CLAIM _REWARD _STARTED ,
2018-07-23 15:12:18 +02:00
data : { reward : reward }
} ) ;
var success = function success ( successReward ) {
dispatch ( {
2018-07-23 16:12:22 +02:00
type : _lbryRedux . ACTIONS . CLAIM _REWARD _SUCCESS ,
2018-07-23 15:12:18 +02:00
data : {
reward : successReward
}
} ) ;
2018-11-28 16:36:40 +01:00
if ( successReward . reward _type === _rewards3 . default . TYPE _NEW _USER && _rewards3 . default . callbacks . claimFirstRewardSuccess ) {
_rewards3 . default . callbacks . claimFirstRewardSuccess ( ) ;
2018-07-23 15:12:18 +02:00
}
2018-10-04 15:08:28 +02:00
dispatch ( doRewardList ( ) ) ;
2018-07-23 15:12:18 +02:00
} ;
var failure = function failure ( error ) {
dispatch ( {
2018-07-23 16:12:22 +02:00
type : _lbryRedux . ACTIONS . CLAIM _REWARD _FAILURE ,
2018-07-23 15:12:18 +02:00
data : {
reward : reward ,
error : ! options || ! options . failSilently ? error : undefined
}
} ) ;
} ;
2018-10-02 02:38:16 +02:00
_rewards3 . default . claimReward ( rewardType , options . params ) . then ( success , failure ) ;
2018-07-23 15:12:18 +02:00
} ;
}
function doClaimEligiblePurchaseRewards ( ) {
return function ( dispatch , getState ) {
var state = getState ( ) ;
var unclaimedRewards = ( 0 , _rewards . selectUnclaimedRewards ) ( state ) ;
var userIsRewardApproved = ( 0 , _user . selectUserIsRewardApproved ) ( state ) ;
if ( ! userIsRewardApproved || ! _lbryio2 . default . enabled ) {
return ;
}
if ( unclaimedRewards . find ( function ( ur ) {
return ur . reward _type === _rewards3 . default . TYPE _FIRST _STREAM ;
} ) ) {
dispatch ( doClaimRewardType ( _rewards3 . default . TYPE _FIRST _STREAM ) ) ;
} else {
[ _rewards3 . default . TYPE _MANY _DOWNLOADS , _rewards3 . default . TYPE _FEATURED _DOWNLOAD ] . forEach ( function ( type ) {
dispatch ( doClaimRewardType ( type , { failSilently : true } ) ) ;
} ) ;
}
} ;
}
function doClaimRewardClearError ( reward ) {
return function ( dispatch ) {
dispatch ( {
2018-07-23 16:12:22 +02:00
type : _lbryRedux . ACTIONS . CLAIM _REWARD _CLEAR _ERROR ,
2018-07-23 15:12:18 +02:00
data : { reward : reward }
} ) ;
} ;
}
2018-09-04 06:15:53 +02:00
function doFetchRewardedContent ( ) {
return function ( dispatch ) {
var success = function success ( nameToClaimId ) {
dispatch ( {
type : _lbryRedux . ACTIONS . FETCH _REWARD _CONTENT _COMPLETED ,
data : {
claimIds : Object . values ( nameToClaimId ) ,
success : true
}
} ) ;
} ;
var failure = function failure ( ) {
dispatch ( {
type : _lbryRedux . ACTIONS . FETCH _REWARD _CONTENT _COMPLETED ,
data : {
claimIds : [ ] ,
success : false
}
} ) ;
} ;
_lbryio2 . default . call ( 'reward' , 'list_featured' ) . then ( success , failure ) ;
} ;
}
2018-07-23 15:12:18 +02:00
/***/ } ) ,
2018-12-04 17:08:20 +01:00
/* 9 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-09-04 06:15:53 +02:00
exports . selectRewardContentClaimIds = exports . makeSelectRewardAmountByType = exports . makeSelectRewardByType = exports . makeSelectClaimRewardError = exports . selectClaimErrorsByType = exports . makeSelectIsRewardClaimPending = exports . selectClaimsPendingByType = exports . selectUnclaimedRewardValue = exports . selectFetchingRewards = exports . selectUnclaimedRewards = exports . selectClaimedRewardsByTransactionId = exports . selectClaimedRewards = exports . selectClaimedRewardsById = exports . selectUnclaimedRewardsByType = undefined ;
2018-07-23 15:12:18 +02:00
2018-12-04 17:08:20 +01:00
var _reselect = _ _webpack _require _ _ ( 10 ) ;
2018-07-23 15:12:18 +02:00
var selectState = function selectState ( state ) {
return state . rewards || { } ;
} ;
var selectUnclaimedRewardsByType = exports . selectUnclaimedRewardsByType = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . unclaimedRewardsByType ;
} ) ;
var selectClaimedRewardsById = exports . selectClaimedRewardsById = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . claimedRewardsById ;
} ) ;
var selectClaimedRewards = exports . selectClaimedRewards = ( 0 , _reselect . createSelector ) ( selectClaimedRewardsById , function ( byId ) {
return Object . values ( byId ) || [ ] ;
} ) ;
var selectClaimedRewardsByTransactionId = exports . selectClaimedRewardsByTransactionId = ( 0 , _reselect . createSelector ) ( selectClaimedRewards , function ( rewards ) {
return rewards . reduce ( function ( mapParam , reward ) {
var map = mapParam ;
map [ reward . transaction _id ] = reward ;
return map ;
} , { } ) ;
} ) ;
var selectUnclaimedRewards = exports . selectUnclaimedRewards = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . unclaimedRewards ;
} ) ;
var selectFetchingRewards = exports . selectFetchingRewards = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return ! ! state . fetching ;
} ) ;
var selectUnclaimedRewardValue = exports . selectUnclaimedRewardValue = ( 0 , _reselect . createSelector ) ( selectUnclaimedRewards , function ( rewards ) {
return rewards . reduce ( function ( sum , reward ) {
return sum + reward . reward _amount ;
} , 0 ) ;
} ) ;
var selectClaimsPendingByType = exports . selectClaimsPendingByType = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . claimPendingByType ;
} ) ;
var selectIsClaimRewardPending = function selectIsClaimRewardPending ( state , props ) {
return selectClaimsPendingByType ( state , props ) [ props . reward _type ] ;
} ;
var makeSelectIsRewardClaimPending = exports . makeSelectIsRewardClaimPending = function makeSelectIsRewardClaimPending ( ) {
return ( 0 , _reselect . createSelector ) ( selectIsClaimRewardPending , function ( isClaiming ) {
return isClaiming ;
} ) ;
} ;
var selectClaimErrorsByType = exports . selectClaimErrorsByType = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . claimErrorsByType ;
} ) ;
var selectClaimRewardError = function selectClaimRewardError ( state , props ) {
return selectClaimErrorsByType ( state , props ) [ props . reward _type ] ;
} ;
var makeSelectClaimRewardError = exports . makeSelectClaimRewardError = function makeSelectClaimRewardError ( ) {
return ( 0 , _reselect . createSelector ) ( selectClaimRewardError , function ( errorMessage ) {
return errorMessage ;
} ) ;
} ;
var selectRewardByType = function selectRewardByType ( state , rewardType ) {
return selectUnclaimedRewards ( state ) . find ( function ( reward ) {
return reward . reward _type === rewardType ;
} ) ;
} ;
var makeSelectRewardByType = exports . makeSelectRewardByType = function makeSelectRewardByType ( ) {
return ( 0 , _reselect . createSelector ) ( selectRewardByType , function ( reward ) {
return reward ;
} ) ;
} ;
var makeSelectRewardAmountByType = exports . makeSelectRewardAmountByType = function makeSelectRewardAmountByType ( ) {
return ( 0 , _reselect . createSelector ) ( selectRewardByType , function ( reward ) {
return reward ? reward . reward _amount : 0 ;
} ) ;
} ;
2018-09-04 06:15:53 +02:00
var selectRewardContentClaimIds = exports . selectRewardContentClaimIds = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . rewardedContentClaimIds ;
} ) ;
2018-07-23 15:12:18 +02:00
/***/ } ) ,
2018-12-04 17:08:20 +01:00
/* 10 */
2018-07-23 15:12:18 +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 ;
} , { } ) ;
} ) ;
}
/***/ } ) ,
2018-12-04 17:08:20 +01:00
/* 11 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-08-31 21:51:00 +02:00
exports . selectUserInviteNewErrorMessage = exports . selectUserInviteNewIsPending = exports . selectUserInviteStatusFailed = exports . selectUserInvitees = exports . selectUserInvitesRemaining = exports . selectUserInviteStatusIsPending = exports . selectAccessToken = exports . selectUserIsVerificationCandidate = exports . selectIdentityVerifyErrorMessage = exports . selectIdentityVerifyIsPending = exports . selectPhoneVerifyErrorMessage = exports . selectPhoneVerifyIsPending = exports . selectPhoneNewIsPending = exports . selectEmailVerifyErrorMessage = exports . selectEmailVerifyIsPending = exports . selectPhoneNewErrorMessage = exports . selectEmailNewErrorMessage = exports . selectEmailNewIsPending = exports . selectUserIsRewardApproved = exports . selectPhoneToVerify = exports . selectEmailToVerify = exports . selectUserCountryCode = exports . selectUserPhone = exports . selectUserEmail = exports . selectUser = exports . selectUserIsPending = exports . selectAuthenticationIsPending = exports . selectState = undefined ;
2018-07-23 15:12:18 +02:00
2018-12-04 17:08:20 +01:00
var _reselect = _ _webpack _require _ _ ( 10 ) ;
2018-07-23 15:12:18 +02:00
var selectState = exports . selectState = function selectState ( state ) {
return state . user || { } ;
} ;
var selectAuthenticationIsPending = exports . selectAuthenticationIsPending = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . authenticationIsPending ;
} ) ;
var selectUserIsPending = exports . selectUserIsPending = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . userIsPending ;
} ) ;
var selectUser = exports . selectUser = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . user ;
} ) ;
var selectUserEmail = exports . selectUserEmail = ( 0 , _reselect . createSelector ) ( selectUser , function ( user ) {
return user ? user . primary _email : null ;
} ) ;
var selectUserPhone = exports . selectUserPhone = ( 0 , _reselect . createSelector ) ( selectUser , function ( user ) {
return user ? user . phone _number : null ;
} ) ;
var selectUserCountryCode = exports . selectUserCountryCode = ( 0 , _reselect . createSelector ) ( selectUser , function ( user ) {
return user ? user . country _code : null ;
} ) ;
var selectEmailToVerify = exports . selectEmailToVerify = ( 0 , _reselect . createSelector ) ( selectState , selectUserEmail , function ( state , userEmail ) {
return state . emailToVerify || userEmail ;
} ) ;
var selectPhoneToVerify = exports . selectPhoneToVerify = ( 0 , _reselect . createSelector ) ( selectState , selectUserPhone , function ( state , userPhone ) {
return state . phoneToVerify || userPhone ;
} ) ;
var selectUserIsRewardApproved = exports . selectUserIsRewardApproved = ( 0 , _reselect . createSelector ) ( selectUser , function ( user ) {
return user && user . is _reward _approved ;
} ) ;
var selectEmailNewIsPending = exports . selectEmailNewIsPending = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . emailNewIsPending ;
} ) ;
var selectEmailNewErrorMessage = exports . selectEmailNewErrorMessage = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . emailNewErrorMessage ;
} ) ;
var selectPhoneNewErrorMessage = exports . selectPhoneNewErrorMessage = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . phoneNewErrorMessage ;
} ) ;
var selectEmailVerifyIsPending = exports . selectEmailVerifyIsPending = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . emailVerifyIsPending ;
} ) ;
var selectEmailVerifyErrorMessage = exports . selectEmailVerifyErrorMessage = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . emailVerifyErrorMessage ;
} ) ;
2018-08-31 21:51:00 +02:00
var selectPhoneNewIsPending = exports . selectPhoneNewIsPending = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . phoneNewIsPending ;
} ) ;
var selectPhoneVerifyIsPending = exports . selectPhoneVerifyIsPending = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . phoneVerifyIsPending ;
} ) ;
2018-07-23 15:12:18 +02:00
var selectPhoneVerifyErrorMessage = exports . selectPhoneVerifyErrorMessage = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . phoneVerifyErrorMessage ;
} ) ;
var selectIdentityVerifyIsPending = exports . selectIdentityVerifyIsPending = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . identityVerifyIsPending ;
} ) ;
var selectIdentityVerifyErrorMessage = exports . selectIdentityVerifyErrorMessage = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . identityVerifyErrorMessage ;
} ) ;
var selectUserIsVerificationCandidate = exports . selectUserIsVerificationCandidate = ( 0 , _reselect . createSelector ) ( selectUser , function ( user ) {
return user && ( ! user . has _verified _email || ! user . is _identity _verified ) ;
} ) ;
var selectAccessToken = exports . selectAccessToken = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . accessToken ;
} ) ;
var selectUserInviteStatusIsPending = exports . selectUserInviteStatusIsPending = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . inviteStatusIsPending ;
} ) ;
var selectUserInvitesRemaining = exports . selectUserInvitesRemaining = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . invitesRemaining ;
} ) ;
var selectUserInvitees = exports . selectUserInvitees = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . invitees ;
} ) ;
var selectUserInviteStatusFailed = exports . selectUserInviteStatusFailed = ( 0 , _reselect . createSelector ) ( selectUserInvitesRemaining , function ( ) {
return selectUserInvitesRemaining === null ;
} ) ;
var selectUserInviteNewIsPending = exports . selectUserInviteNewIsPending = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . inviteNewIsPending ;
} ) ;
var selectUserInviteNewErrorMessage = exports . selectUserInviteNewErrorMessage = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . inviteNewErrorMessage ;
} ) ;
/***/ } ) ,
2018-12-04 17:08:20 +01:00
/* 12 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-10-02 02:38:16 +02:00
var _extends = Object . assign || function ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] ; for ( var key in source ) { if ( Object . prototype . hasOwnProperty . call ( source , key ) ) { target [ key ] = source [ key ] ; } } } return target ; } ;
2018-12-04 17:08:20 +01:00
var _lbryRedux = _ _webpack _require _ _ ( 4 ) ;
2018-07-23 15:12:18 +02:00
2018-07-23 16:12:22 +02:00
var _lbryio = _ _webpack _require _ _ ( 3 ) ;
2018-07-23 15:12:18 +02:00
var _lbryio2 = _interopRequireDefault ( _lbryio ) ;
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
var rewards = { } ;
rewards . TYPE _NEW _DEVELOPER = 'new_developer' ;
rewards . TYPE _NEW _USER = 'new_user' ;
rewards . TYPE _CONFIRM _EMAIL = 'verified_email' ;
rewards . TYPE _FIRST _CHANNEL = 'new_channel' ;
rewards . TYPE _FIRST _STREAM = 'first_stream' ;
rewards . TYPE _MANY _DOWNLOADS = 'many_downloads' ;
rewards . TYPE _FIRST _PUBLISH = 'first_publish' ;
rewards . TYPE _FEATURED _DOWNLOAD = 'featured_download' ;
rewards . TYPE _REFERRAL = 'referral' ;
2018-10-02 02:38:16 +02:00
rewards . TYPE _REWARD _CODE = 'reward_code' ;
2018-10-18 19:28:01 +02:00
rewards . TYPE _SUBSCRIPTION = 'subscription' ;
2018-07-23 15:12:18 +02:00
rewards . YOUTUBE _CREATOR = 'youtube_creator' ;
2018-10-02 02:38:16 +02:00
rewards . claimReward = function ( type , rewardParams ) {
2018-07-23 15:12:18 +02:00
function requestReward ( resolve , reject , params ) {
if ( ! _lbryio2 . default . enabled ) {
reject ( new Error ( _ _ ( 'Rewards are not enabled.' ) ) ) ;
return ;
}
2018-10-02 02:38:16 +02:00
2018-07-23 15:12:18 +02:00
_lbryio2 . default . call ( 'reward' , 'new' , params , 'post' ) . then ( function ( reward ) {
var message = reward . reward _notification || 'You have claimed a ' + reward . reward _amount + ' LBC reward.' ;
// Display global notice
2018-11-28 16:36:40 +01:00
var action = ( 0 , _lbryRedux . doToast ) ( {
2018-07-23 15:12:18 +02:00
message : message ,
linkText : _ _ ( 'Show All' ) ,
2018-11-28 16:36:40 +01:00
linkTarget : '/rewards'
2018-07-23 15:12:18 +02:00
} ) ;
window . store . dispatch ( action ) ;
2018-11-29 21:52:32 +01:00
if ( rewards . callbacks . claimRewardSuccess ) {
rewards . callbacks . claimRewardSuccess ( ) ;
}
2018-07-23 15:12:18 +02:00
resolve ( reward ) ;
} , reject ) ;
}
return new Promise ( function ( resolve , reject ) {
2018-11-12 20:19:33 +01:00
_lbryRedux . Lbry . address _unused ( ) . then ( function ( address ) {
2018-10-02 02:38:16 +02:00
var params = _extends ( {
2018-07-23 15:12:18 +02:00
reward _type : type ,
wallet _address : address
2018-10-02 02:38:16 +02:00
} , rewardParams ) ;
2018-07-23 15:12:18 +02:00
switch ( type ) {
case rewards . TYPE _FIRST _CHANNEL :
_lbryRedux . Lbry . claim _list _mine ( ) . then ( function ( claims ) {
2018-11-27 16:53:44 +01:00
var claim = claims . find ( function ( foundClaim ) {
2018-11-12 20:19:33 +01:00
return foundClaim . name . length && foundClaim . name [ 0 ] === '@' && foundClaim . txid . length && foundClaim . type === 'claim' ;
2018-07-23 15:12:18 +02:00
} ) ;
if ( claim ) {
params . transaction _id = claim . txid ;
requestReward ( resolve , reject , params ) ;
} else {
reject ( new Error ( _ _ ( 'Please create a channel identity first.' ) ) ) ;
}
} ) . catch ( reject ) ;
break ;
case rewards . TYPE _FIRST _PUBLISH :
_lbryRedux . Lbry . claim _list _mine ( ) . then ( function ( claims ) {
2018-11-27 16:53:44 +01:00
var claim = claims . find ( function ( foundClaim ) {
2018-11-12 20:19:33 +01:00
return foundClaim . name . length && foundClaim . name [ 0 ] !== '@' && foundClaim . txid . length && foundClaim . type === 'claim' ;
2018-07-23 15:12:18 +02:00
} ) ;
if ( claim ) {
params . transaction _id = claim . txid ;
requestReward ( resolve , reject , params ) ;
} else {
reject ( claims . length ? new Error ( _ _ ( 'Please publish something and wait for confirmation by the network to claim this reward.' ) ) : new Error ( _ _ ( 'Please publish something to claim this reward.' ) ) ) ;
}
} ) . catch ( reject ) ;
break ;
case rewards . TYPE _FIRST _STREAM :
case rewards . TYPE _NEW _USER :
default :
requestReward ( resolve , reject , params ) ;
}
} ) ;
} ) ;
} ;
2018-11-28 16:36:40 +01:00
rewards . callbacks = {
// Set any callbacks that require code not found in this project
2018-11-29 21:52:32 +01:00
claimRewardSuccess : null ,
2018-11-28 16:36:40 +01:00
claimFirstRewardSuccess : null ,
rewardApprovalRequired : null
} ;
rewards . setCallback = function ( name , method ) {
rewards . callbacks [ name ] = method ;
} ;
2018-07-23 15:12:18 +02:00
exports . default = rewards ;
/***/ } ) ,
2018-12-04 17:08:20 +01:00
/* 13 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . doFetchInviteStatus = doFetchInviteStatus ;
exports . doInstallNew = doInstallNew ;
exports . doAuthenticate = doAuthenticate ;
exports . doUserFetch = doUserFetch ;
2018-08-31 21:51:00 +02:00
exports . doUserPhoneReset = doUserPhoneReset ;
exports . doUserPhoneNew = doUserPhoneNew ;
exports . doUserPhoneVerifyFailure = doUserPhoneVerifyFailure ;
exports . doUserPhoneVerify = doUserPhoneVerify ;
2018-08-17 20:10:52 +02:00
exports . doUserEmailToVerify = doUserEmailToVerify ;
exports . doUserEmailNew = doUserEmailNew ;
2018-09-18 23:56:12 +02:00
exports . doUserResendVerificationEmail = doUserResendVerificationEmail ;
2018-08-17 20:10:52 +02:00
exports . doUserEmailVerifyFailure = doUserEmailVerifyFailure ;
exports . doUserEmailVerify = doUserEmailVerify ;
exports . doFetchAccessToken = doFetchAccessToken ;
2018-09-18 23:56:12 +02:00
exports . doUserIdentityVerify = doUserIdentityVerify ;
exports . doUserInviteNew = doUserInviteNew ;
2018-07-23 15:12:18 +02:00
2018-12-04 17:08:20 +01:00
var _lbryRedux = _ _webpack _require _ _ ( 4 ) ;
2018-07-23 15:12:18 +02:00
2018-12-04 17:08:20 +01:00
var _rewards = _ _webpack _require _ _ ( 8 ) ;
2018-08-31 21:51:00 +02:00
2018-12-04 17:08:20 +01:00
var _user = _ _webpack _require _ _ ( 11 ) ;
2018-08-17 20:10:52 +02:00
2018-12-04 17:08:20 +01:00
var _rewards2 = _ _webpack _require _ _ ( 12 ) ;
2018-08-31 21:51:00 +02:00
var _rewards3 = _interopRequireDefault ( _rewards2 ) ;
2018-07-23 15:12:18 +02:00
2018-07-23 16:12:22 +02:00
var _lbryio = _ _webpack _require _ _ ( 3 ) ;
var _lbryio2 = _interopRequireDefault ( _lbryio ) ;
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
2018-07-23 15:12:18 +02:00
function doFetchInviteStatus ( ) {
return function ( dispatch ) {
dispatch ( {
type : _lbryRedux . ACTIONS . USER _INVITE _STATUS _FETCH _STARTED
} ) ;
2018-07-23 16:12:22 +02:00
_lbryio2 . default . call ( 'user' , 'invite_status' ) . then ( function ( status ) {
2018-07-23 15:12:18 +02:00
dispatch ( {
type : _lbryRedux . ACTIONS . USER _INVITE _STATUS _FETCH _SUCCESS ,
data : {
invitesRemaining : status . invites _remaining ? status . invites _remaining : 0 ,
invitees : status . invitees
}
} ) ;
} ) . catch ( function ( error ) {
dispatch ( {
type : _lbryRedux . ACTIONS . USER _INVITE _STATUS _FETCH _FAILURE ,
data : { error : error }
} ) ;
} ) ;
} ;
}
function doInstallNew ( appVersion ) {
2018-09-04 06:15:53 +02:00
var os = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : null ;
2018-07-23 15:12:18 +02:00
2018-09-03 20:50:43 +02:00
var payload = { app _version : appVersion } ;
2018-07-23 15:12:18 +02:00
_lbryRedux . Lbry . status ( ) . then ( function ( status ) {
payload . app _id = status . installation _id ;
payload . node _id = status . lbry _id ;
_lbryRedux . Lbry . version ( ) . then ( function ( version ) {
payload . daemon _version = version . lbrynet _version ;
2018-09-04 06:15:53 +02:00
payload . operating _system = os || version . os _system ;
2018-07-23 15:12:18 +02:00
payload . platform = version . platform ;
2018-07-23 16:12:22 +02:00
_lbryio2 . default . call ( 'install' , 'new' , payload ) ;
2018-07-23 15:12:18 +02:00
} ) ;
} ) ;
}
2018-09-03 20:50:43 +02:00
// TODO: Call doInstallNew separately so we don't have to pass appVersion and os_system params?
2018-07-23 15:12:18 +02:00
function doAuthenticate ( appVersion ) {
2018-09-04 06:15:53 +02:00
var os = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : null ;
2018-07-23 15:12:18 +02:00
return function ( dispatch ) {
dispatch ( {
type : _lbryRedux . ACTIONS . AUTHENTICATION _STARTED
} ) ;
2018-11-28 16:36:40 +01:00
2018-07-23 16:12:22 +02:00
_lbryio2 . default . authenticate ( ) . then ( function ( user ) {
// analytics.setUser(user);
2018-07-23 15:12:18 +02:00
dispatch ( {
type : _lbryRedux . ACTIONS . AUTHENTICATION _SUCCESS ,
data : { user : user }
} ) ;
dispatch ( ( 0 , _rewards . doRewardList ) ( ) ) ;
dispatch ( doFetchInviteStatus ( ) ) ;
2018-09-04 06:15:53 +02:00
doInstallNew ( appVersion , os ) ;
2018-07-23 15:12:18 +02:00
} ) . catch ( function ( error ) {
dispatch ( {
type : _lbryRedux . ACTIONS . AUTHENTICATION _FAILURE ,
data : { error : error }
} ) ;
} ) ;
} ;
}
function doUserFetch ( ) {
return function ( dispatch ) {
dispatch ( {
type : _lbryRedux . ACTIONS . USER _FETCH _STARTED
} ) ;
2018-07-23 16:12:22 +02:00
_lbryio2 . default . getCurrentUser ( ) . then ( function ( user ) {
// analytics.setUser(user);
2018-07-23 15:12:18 +02:00
dispatch ( ( 0 , _rewards . doRewardList ) ( ) ) ;
dispatch ( {
type : _lbryRedux . ACTIONS . USER _FETCH _SUCCESS ,
data : { user : user }
} ) ;
} ) . catch ( function ( error ) {
dispatch ( {
type : _lbryRedux . ACTIONS . USER _FETCH _FAILURE ,
data : { error : error }
} ) ;
} ) ;
} ;
}
2018-08-31 21:51:00 +02:00
function doUserPhoneReset ( ) {
return {
type : _lbryRedux . ACTIONS . USER _PHONE _RESET
} ;
}
function doUserPhoneNew ( phone , countryCode ) {
return function ( dispatch ) {
dispatch ( {
type : _lbryRedux . ACTIONS . USER _PHONE _NEW _STARTED ,
data : { phone : phone , country _code : countryCode }
} ) ;
var success = function success ( ) {
dispatch ( {
type : _lbryRedux . ACTIONS . USER _PHONE _NEW _SUCCESS ,
data : { phone : phone }
} ) ;
} ;
var failure = function failure ( error ) {
dispatch ( {
type : _lbryRedux . ACTIONS . USER _PHONE _NEW _FAILURE ,
data : { error : error }
} ) ;
} ;
_lbryio2 . default . call ( 'user' , 'phone_number_new' , { phone _number : phone , country _code : countryCode } , 'post' ) . then ( success , failure ) ;
} ;
}
function doUserPhoneVerifyFailure ( error ) {
return {
type : _lbryRedux . ACTIONS . USER _PHONE _VERIFY _FAILURE ,
data : { error : error }
} ;
}
function doUserPhoneVerify ( verificationCode ) {
return function ( dispatch , getState ) {
var phoneNumber = ( 0 , _user . selectPhoneToVerify ) ( getState ( ) ) ;
var countryCode = ( 0 , _user . selectUserCountryCode ) ( getState ( ) ) ;
dispatch ( {
type : _lbryRedux . ACTIONS . USER _PHONE _VERIFY _STARTED ,
code : verificationCode
} ) ;
_lbryio2 . default . call ( 'user' , 'phone_number_confirm' , {
verification _code : verificationCode ,
phone _number : phoneNumber ,
country _code : countryCode
} , 'post' ) . then ( function ( user ) {
if ( user . is _identity _verified ) {
dispatch ( {
type : _lbryRedux . ACTIONS . USER _PHONE _VERIFY _SUCCESS ,
data : { user : user }
} ) ;
dispatch ( ( 0 , _rewards . doClaimRewardType ) ( _rewards3 . default . TYPE _NEW _USER ) ) ;
}
} ) . catch ( function ( error ) {
return dispatch ( doUserPhoneVerifyFailure ( error ) ) ;
} ) ;
} ;
}
2018-08-17 20:10:52 +02:00
function doUserEmailToVerify ( email ) {
return function ( dispatch ) {
dispatch ( {
type : _lbryRedux . ACTIONS . USER _EMAIL _VERIFY _SET ,
data : { email : email }
} ) ;
} ;
}
function doUserEmailNew ( email ) {
return function ( dispatch ) {
dispatch ( {
type : _lbryRedux . ACTIONS . USER _EMAIL _NEW _STARTED ,
email : email
} ) ;
var success = function success ( ) {
dispatch ( {
type : _lbryRedux . ACTIONS . USER _EMAIL _NEW _SUCCESS ,
data : { email : email }
} ) ;
dispatch ( doUserFetch ( ) ) ;
} ;
var failure = function failure ( error ) {
dispatch ( {
type : _lbryRedux . ACTIONS . USER _EMAIL _NEW _FAILURE ,
data : { error : error }
} ) ;
} ;
_lbryio2 . default . call ( 'user_email' , 'new' , { email : email , send _verification _email : true } , 'post' ) . catch ( function ( error ) {
if ( error . response && error . response . status === 409 ) {
return _lbryio2 . default . call ( 'user_email' , 'resend_token' , { email : email , only _if _expired : true } , 'post' ) . then ( success , failure ) ;
}
throw error ;
} ) . then ( success , failure ) ;
} ;
}
2018-09-18 23:56:12 +02:00
function doUserResendVerificationEmail ( email ) {
return function ( dispatch ) {
dispatch ( {
type : _lbryRedux . ACTIONS . USER _EMAIL _VERIFY _RETRY ,
email : email
} ) ;
var success = function success ( ) {
dispatch ( {
type : _lbryRedux . ACTIONS . USER _EMAIL _NEW _SUCCESS ,
data : { email : email }
} ) ;
dispatch ( doUserFetch ( ) ) ;
} ;
var failure = function failure ( error ) {
dispatch ( {
type : _lbryRedux . ACTIONS . USER _EMAIL _NEW _FAILURE ,
data : { error : error }
} ) ;
} ;
_lbryio2 . default . call ( 'user_email' , 'resend_token' , { email : email } , 'post' ) . catch ( function ( error ) {
if ( error . response && error . response . status === 409 ) {
throw error ;
}
} ) . then ( success , failure ) ;
} ;
}
2018-08-17 20:10:52 +02:00
function doUserEmailVerifyFailure ( error ) {
return {
type : _lbryRedux . ACTIONS . USER _EMAIL _VERIFY _FAILURE ,
data : { error : error }
} ;
}
function doUserEmailVerify ( verificationToken , recaptcha ) {
return function ( dispatch , getState ) {
var email = ( 0 , _user . selectEmailToVerify ) ( getState ( ) ) ;
dispatch ( {
type : _lbryRedux . ACTIONS . USER _EMAIL _VERIFY _STARTED ,
code : verificationToken ,
recaptcha : recaptcha
} ) ;
_lbryio2 . default . call ( 'user_email' , 'confirm' , {
verification _token : verificationToken ,
email : email ,
recaptcha : recaptcha
} , 'post' ) . then ( function ( userEmail ) {
if ( userEmail . is _verified ) {
dispatch ( {
type : _lbryRedux . ACTIONS . USER _EMAIL _VERIFY _SUCCESS ,
data : { email : email }
} ) ;
dispatch ( doUserFetch ( ) ) ;
} else {
throw new Error ( 'Your email is still not verified.' ) ; // shouldn't happen
}
} ) . catch ( function ( error ) {
return dispatch ( doUserEmailVerifyFailure ( error ) ) ;
} ) ;
} ;
}
function doFetchAccessToken ( ) {
return function ( dispatch ) {
var success = function success ( token ) {
return dispatch ( {
type : _lbryRedux . ACTIONS . FETCH _ACCESS _TOKEN _SUCCESS ,
data : { token : token }
} ) ;
} ;
_lbryio2 . default . getAuthToken ( ) . then ( success ) ;
} ;
}
2018-09-18 23:56:12 +02:00
function doUserIdentityVerify ( stripeToken ) {
return function ( dispatch ) {
dispatch ( {
type : _lbryRedux . ACTIONS . USER _IDENTITY _VERIFY _STARTED ,
token : stripeToken
} ) ;
_lbryio2 . default . call ( 'user' , 'verify_identity' , { stripe _token : stripeToken } , 'post' ) . then ( function ( user ) {
if ( user . is _identity _verified ) {
dispatch ( {
type : _lbryRedux . ACTIONS . USER _IDENTITY _VERIFY _SUCCESS ,
data : { user : user }
} ) ;
dispatch ( ( 0 , _rewards . doClaimRewardType ) ( _rewards3 . default . TYPE _NEW _USER ) ) ;
} else {
throw new Error ( 'Your identity is still not verified. This should not happen.' ) ; // shouldn't happen
}
} ) . catch ( function ( error ) {
dispatch ( {
type : _lbryRedux . ACTIONS . USER _IDENTITY _VERIFY _FAILURE ,
data : { error : error . toString ( ) }
} ) ;
} ) ;
} ;
}
function doUserInviteNew ( email ) {
return function ( dispatch ) {
dispatch ( {
type : _lbryRedux . ACTIONS . USER _INVITE _NEW _STARTED
} ) ;
_lbryio2 . default . call ( 'user' , 'invite' , { email : email } , 'post' ) . then ( function ( ) {
dispatch ( {
type : _lbryRedux . ACTIONS . USER _INVITE _NEW _SUCCESS ,
data : { email : email }
} ) ;
2018-11-28 16:36:40 +01:00
dispatch ( ( 0 , _lbryRedux . doToast ) ( {
2018-09-18 23:56:12 +02:00
message : _ _ ( 'Invite sent to %s' , email )
} ) ) ;
dispatch ( doFetchInviteStatus ( ) ) ;
} ) . catch ( function ( error ) {
dispatch ( {
type : _lbryRedux . ACTIONS . USER _INVITE _NEW _FAILURE ,
data : { error : error }
} ) ;
} ) ;
} ;
}
2018-07-23 15:12:18 +02:00
/***/ } ) ,
2018-12-04 17:08:20 +01:00
/* 14 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . authReducer = authReducer ;
2018-07-23 16:12:22 +02:00
var _action _types = _ _webpack _require _ _ ( 2 ) ;
2018-07-23 15:12:18 +02:00
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
var reducers = { } ;
var defaultState = {
authenticating : false
} ;
reducers [ ACTIONS . GENERATE _AUTH _TOKEN _FAILURE ] = function ( state ) {
return Object . assign ( { } , state , {
authToken : null ,
authenticating : false
} ) ;
} ;
reducers [ ACTIONS . GENERATE _AUTH _TOKEN _STARTED ] = function ( state ) {
return Object . assign ( { } , state , {
authenticating : true
} ) ;
} ;
reducers [ ACTIONS . GENERATE _AUTH _TOKEN _SUCCESS ] = function ( state , action ) {
return Object . assign ( { } , state , {
2018-08-17 20:10:52 +02:00
authToken : action . data . authToken ,
2018-07-23 15:12:18 +02:00
authenticating : false
} ) ;
} ;
function authReducer ( ) {
var state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : defaultState ;
var action = arguments [ 1 ] ;
var handler = reducers [ action . type ] ;
if ( handler ) return handler ( state , action ) ;
return state ;
}
/***/ } ) ,
2018-12-04 17:08:20 +01:00
/* 15 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
var _extends = Object . assign || function ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] ; for ( var key in source ) { if ( Object . prototype . hasOwnProperty . call ( source , key ) ) { target [ key ] = source [ key ] ; } } } return target ; } ;
exports . rewardsReducer = rewardsReducer ;
2018-12-04 17:08:20 +01:00
var _lbryRedux = _ _webpack _require _ _ ( 4 ) ;
2018-07-23 15:12:18 +02:00
function _toConsumableArray ( arr ) { if ( Array . isArray ( arr ) ) { for ( var i = 0 , arr2 = Array ( arr . length ) ; i < arr . length ; i ++ ) { arr2 [ i ] = arr [ i ] ; } return arr2 ; } else { return Array . from ( arr ) ; } }
var reducers = { } ;
var defaultState = {
fetching : false ,
claimedRewardsById : { } , // id => reward
unclaimedRewards : [ ] ,
claimPendingByType : { } ,
2018-09-04 06:15:53 +02:00
claimErrorsByType : { } ,
rewardedContentClaimIds : [ ]
2018-07-23 15:12:18 +02:00
} ;
reducers [ _lbryRedux . ACTIONS . FETCH _REWARDS _STARTED ] = function ( state ) {
return Object . assign ( { } , state , {
fetching : true
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . FETCH _REWARDS _COMPLETED ] = function ( state , action ) {
var userRewards = action . data . userRewards ;
var unclaimedRewards = [ ] ;
var claimedRewards = { } ;
userRewards . forEach ( function ( reward ) {
if ( reward . transaction _id ) {
claimedRewards [ reward . id ] = reward ;
} else {
unclaimedRewards . push ( reward ) ;
}
} ) ;
return Object . assign ( { } , state , {
claimedRewardsById : claimedRewards ,
unclaimedRewards : unclaimedRewards ,
fetching : false
} ) ;
} ;
function setClaimRewardState ( state , reward , isClaiming ) {
var errorMessage = arguments . length > 3 && arguments [ 3 ] !== undefined ? arguments [ 3 ] : '' ;
var newClaimPendingByType = Object . assign ( { } , state . claimPendingByType ) ;
var newClaimErrorsByType = Object . assign ( { } , state . claimErrorsByType ) ;
if ( isClaiming ) {
newClaimPendingByType [ reward . reward _type ] = isClaiming ;
} else {
delete newClaimPendingByType [ reward . reward _type ] ;
}
if ( errorMessage ) {
newClaimErrorsByType [ reward . reward _type ] = errorMessage ;
} else {
delete newClaimErrorsByType [ reward . reward _type ] ;
}
return Object . assign ( { } , state , {
claimPendingByType : newClaimPendingByType ,
claimErrorsByType : newClaimErrorsByType
} ) ;
}
reducers [ _lbryRedux . ACTIONS . CLAIM _REWARD _STARTED ] = function ( state , action ) {
var reward = action . data . reward ;
return setClaimRewardState ( state , reward , true , '' ) ;
} ;
reducers [ _lbryRedux . ACTIONS . CLAIM _REWARD _SUCCESS ] = function ( state , action ) {
var reward = action . data . reward ;
var unclaimedRewards = state . unclaimedRewards ;
var index = unclaimedRewards . findIndex ( function ( ur ) {
return ur . reward _type === reward . reward _type ;
} ) ;
unclaimedRewards . splice ( index , 1 ) ;
var claimedRewardsById = state . claimedRewardsById ;
claimedRewardsById [ reward . id ] = reward ;
var newState = _extends ( { } , state , {
unclaimedRewards : [ ] . concat ( _toConsumableArray ( unclaimedRewards ) ) ,
claimedRewardsById : _extends ( { } , claimedRewardsById )
} ) ;
return setClaimRewardState ( newState , reward , false , '' ) ;
} ;
reducers [ _lbryRedux . ACTIONS . CLAIM _REWARD _FAILURE ] = function ( state , action ) {
var _action$data = action . data ,
reward = _action$data . reward ,
error = _action$data . error ;
return setClaimRewardState ( state , reward , false , error ? error . message : '' ) ;
} ;
reducers [ _lbryRedux . ACTIONS . CLAIM _REWARD _CLEAR _ERROR ] = function ( state , action ) {
var reward = action . data . reward ;
return setClaimRewardState ( state , reward , state . claimPendingByType [ reward . reward _type ] , '' ) ;
} ;
2018-09-04 06:15:53 +02:00
reducers [ _lbryRedux . ACTIONS . FETCH _REWARD _CONTENT _COMPLETED ] = function ( state , action ) {
var claimIds = action . data . claimIds ;
return Object . assign ( { } , state , {
rewardedContentClaimIds : claimIds
} ) ;
} ;
2018-07-23 15:12:18 +02:00
function rewardsReducer ( ) {
var state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : defaultState ;
var action = arguments [ 1 ] ;
var handler = reducers [ action . type ] ;
if ( handler ) return handler ( state , action ) ;
return state ;
}
/***/ } ) ,
2018-12-04 17:08:20 +01:00
/* 16 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . userReducer = userReducer ;
2018-12-04 17:08:20 +01:00
var _lbryRedux = _ _webpack _require _ _ ( 4 ) ;
2018-07-23 15:12:18 +02:00
var reducers = { } ;
var defaultState = {
authenticationIsPending : false ,
userIsPending : false ,
emailNewIsPending : false ,
emailNewErrorMessage : '' ,
emailToVerify : '' ,
inviteNewErrorMessage : '' ,
inviteNewIsPending : false ,
inviteStatusIsPending : false ,
invitesRemaining : undefined ,
invitees : undefined ,
user : undefined
} ;
reducers [ _lbryRedux . ACTIONS . AUTHENTICATION _STARTED ] = function ( state ) {
return Object . assign ( { } , state , {
authenticationIsPending : true ,
userIsPending : true ,
user : defaultState . user
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . AUTHENTICATION _SUCCESS ] = function ( state , action ) {
return Object . assign ( { } , state , {
authenticationIsPending : false ,
userIsPending : false ,
user : action . data . user
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . AUTHENTICATION _FAILURE ] = function ( state ) {
return Object . assign ( { } , state , {
authenticationIsPending : false ,
userIsPending : false ,
user : null
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . USER _FETCH _STARTED ] = function ( state ) {
return Object . assign ( { } , state , {
userIsPending : true ,
user : defaultState . user
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . USER _FETCH _SUCCESS ] = function ( state , action ) {
return Object . assign ( { } , state , {
userIsPending : false ,
user : action . data . user
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . USER _FETCH _FAILURE ] = function ( state ) {
return Object . assign ( { } , state , {
userIsPending : true ,
user : null
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . USER _PHONE _NEW _STARTED ] = function ( state , action ) {
var user = Object . assign ( { } , state . user ) ;
user . country _code = action . data . country _code ;
return Object . assign ( { } , state , {
phoneNewIsPending : true ,
phoneNewErrorMessage : '' ,
user : user
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . USER _PHONE _NEW _SUCCESS ] = function ( state , action ) {
return Object . assign ( { } , state , {
phoneToVerify : action . data . phone ,
phoneNewIsPending : false
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . USER _PHONE _RESET ] = function ( state ) {
return Object . assign ( { } , state , {
phoneToVerify : null
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . USER _PHONE _NEW _FAILURE ] = function ( state , action ) {
return Object . assign ( { } , state , {
phoneNewIsPending : false ,
phoneNewErrorMessage : action . data . error
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . USER _PHONE _VERIFY _STARTED ] = function ( state ) {
return Object . assign ( { } , state , {
phoneVerifyIsPending : true ,
phoneVerifyErrorMessage : ''
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . USER _PHONE _VERIFY _SUCCESS ] = function ( state , action ) {
return Object . assign ( { } , state , {
phoneToVerify : '' ,
phoneVerifyIsPending : false ,
user : action . data . user
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . USER _PHONE _VERIFY _FAILURE ] = function ( state , action ) {
return Object . assign ( { } , state , {
phoneVerifyIsPending : false ,
phoneVerifyErrorMessage : action . data . error
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . USER _EMAIL _NEW _STARTED ] = function ( state ) {
return Object . assign ( { } , state , {
emailNewIsPending : true ,
emailNewErrorMessage : ''
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . USER _EMAIL _NEW _SUCCESS ] = function ( state , action ) {
var user = Object . assign ( { } , state . user ) ;
user . primary _email = action . data . email ;
return Object . assign ( { } , state , {
emailToVerify : action . data . email ,
emailNewIsPending : false ,
user : user
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . USER _EMAIL _NEW _EXISTS ] = function ( state , action ) {
return Object . assign ( { } , state , {
emailToVerify : action . data . email ,
emailNewIsPending : false
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . USER _EMAIL _NEW _FAILURE ] = function ( state , action ) {
return Object . assign ( { } , state , {
emailNewIsPending : false ,
emailNewErrorMessage : action . data . error
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . USER _EMAIL _VERIFY _STARTED ] = function ( state ) {
return Object . assign ( { } , state , {
emailVerifyIsPending : true ,
emailVerifyErrorMessage : ''
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . USER _EMAIL _VERIFY _SUCCESS ] = function ( state , action ) {
var user = Object . assign ( { } , state . user ) ;
user . primary _email = action . data . email ;
return Object . assign ( { } , state , {
emailToVerify : '' ,
emailVerifyIsPending : false ,
user : user
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . USER _EMAIL _VERIFY _FAILURE ] = function ( state , action ) {
return Object . assign ( { } , state , {
emailVerifyIsPending : false ,
emailVerifyErrorMessage : action . data . error
} ) ;
} ;
2018-08-17 20:10:52 +02:00
reducers [ _lbryRedux . ACTIONS . USER _EMAIL _VERIFY _SET ] = function ( state , action ) {
return Object . assign ( { } , state , {
emailToVerify : action . data . email
} ) ;
} ;
2018-07-23 15:12:18 +02:00
reducers [ _lbryRedux . ACTIONS . USER _IDENTITY _VERIFY _STARTED ] = function ( state ) {
return Object . assign ( { } , state , {
identityVerifyIsPending : true ,
identityVerifyErrorMessage : ''
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . USER _IDENTITY _VERIFY _SUCCESS ] = function ( state , action ) {
return Object . assign ( { } , state , {
identityVerifyIsPending : false ,
identityVerifyErrorMessage : '' ,
user : action . data . user
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . USER _IDENTITY _VERIFY _FAILURE ] = function ( state , action ) {
return Object . assign ( { } , state , {
identityVerifyIsPending : false ,
identityVerifyErrorMessage : action . data . error
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . FETCH _ACCESS _TOKEN _SUCCESS ] = function ( state , action ) {
var token = action . data . token ;
return Object . assign ( { } , state , {
accessToken : token
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . USER _INVITE _STATUS _FETCH _STARTED ] = function ( state ) {
return Object . assign ( { } , state , {
inviteStatusIsPending : true
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . USER _INVITE _STATUS _FETCH _SUCCESS ] = function ( state , action ) {
return Object . assign ( { } , state , {
inviteStatusIsPending : false ,
invitesRemaining : action . data . invitesRemaining ,
invitees : action . data . invitees
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . USER _INVITE _NEW _STARTED ] = function ( state ) {
return Object . assign ( { } , state , {
inviteNewIsPending : true ,
inviteNewErrorMessage : ''
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . USER _INVITE _NEW _SUCCESS ] = function ( state ) {
return Object . assign ( { } , state , {
inviteNewIsPending : false ,
inviteNewErrorMessage : ''
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . USER _INVITE _NEW _FAILURE ] = function ( state , action ) {
return Object . assign ( { } , state , {
inviteNewIsPending : false ,
inviteNewErrorMessage : action . data . error . message
} ) ;
} ;
reducers [ _lbryRedux . ACTIONS . USER _INVITE _STATUS _FETCH _FAILURE ] = function ( state ) {
return Object . assign ( { } , state , {
inviteStatusIsPending : false ,
invitesRemaining : null ,
invitees : null
} ) ;
} ;
function userReducer ( ) {
var state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : defaultState ;
var action = arguments [ 1 ] ;
var handler = reducers [ action . type ] ;
if ( handler ) return handler ( state , action ) ;
return state ;
}
/***/ } ) ,
2018-12-04 17:08:20 +01:00
/* 17 */
2018-07-23 15:12:18 +02:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-08-17 20:10:52 +02:00
exports . selectIsAuthenticating = exports . selectAuthToken = undefined ;
2018-07-23 15:12:18 +02:00
2018-12-04 17:08:20 +01:00
var _reselect = _ _webpack _require _ _ ( 10 ) ;
2018-07-23 15:12:18 +02:00
var selectState = function selectState ( state ) {
2018-08-17 20:10:52 +02:00
return state . auth || { } ;
2018-07-23 15:12:18 +02:00
} ;
var selectAuthToken = exports . selectAuthToken = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . authToken ;
} ) ;
2018-08-17 20:10:52 +02:00
var selectIsAuthenticating = exports . selectIsAuthenticating = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . authenticating ;
} ) ;
2018-07-23 15:12:18 +02:00
/***/ } )
/******/ ] ) ;
} ) ;