spee.ch/index.js
2018-03-20 15:59:52 -07:00

2 lines
No EOL
137 KiB
JavaScript

module.exports=function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=57)}([function(e,t){e.exports=require("react")},function(e,t){e.exports=require("winston")},function(e,t){e.exports=require("react-redux")},function(e,t,n){"use strict";function r(){var e=this;this.analytics={googleId:"default"},this.assetDefaults={description:"An asset published on Spee.ch",thumbnail:"https://spee.ch/assets/img/video_thumb_default.png",title:"Spee.ch"},this.auth={sessionKey:"default"},this.componentsConfig={components:{},containers:{},pages:{}},this.details={description:"Open-source, decentralized image and video sharing.",host:"default",port:3e3,title:"Spee.ch",twitter:"@spee_ch"},this.publishing={additionalClaimAddresses:[],disabled:!1,disabledMessage:"Please check back soon.",primaryClaimAddress:"default",thumbnailChannel:"default",thumbnailChannelId:"default",uploadDirectory:"/home/lbry/Uploads"},this.configure=function(t){if(!t)return console.log("No site config received.");var n=t.analytics,r=t.assetDefaults,a=t.auth,o=t.componentsConfig,l=t.details,i=t.publishing;e.analytics=n,e.assetDefaults=r,e.auth=a,e.details=l,e.publishing=i,e.componentsConfig=o}}e.exports=new r},function(e,t){e.exports=require("react-router-dom")},function(e,t,n){"use strict";var r=n(32),a=n(1);console.log("exporting sequelize models");var o=n(29),l=o.database,i=o.username,u=o.password,s={},c=new r(l,i,u,{host:"localhost",dialect:"mysql",dialectOptions:{decimalNumbers:!0},logging:!1,pool:{max:5,min:0,idle:1e4,acquire:1e4}});c.authenticate().then(function(){a.info("Sequelize has established mysql connection successfully.")}).catch(function(e){a.error("Sequelize was unable to connect to the database:",e)});var f=n(74),d=n(75),p=n(76),m=n(77),h=n(78),g=n(79);s.Certificate=c.import("Certificate",f),s.Channel=c.import("Channel",d),s.Claim=c.import("Claim",p),s.File=c.import("File",m),s.Request=c.import("Request",h),s.User=c.import("User",g),Object.keys(s).forEach(function(e){s[e].associate&&(a.info("Associating model:",e),s[e].associate(s))}),s.sequelize=c,s.Sequelize=r,s.upsert=function(e,t,n,r){return e.findOne({where:n}).then(function(n){return n?(a.debug("updating record in db."+r),n.update(t)):(a.debug("creating record in db."+r),e.create(t))}).catch(function(e){throw a.error(r+".upsert error",e),e})},e.exports=s},function(e,t,n){"use strict";function r(e){return 204===e.status||205===e.status?null:e.json()}function a(e,t){if(e.status>=200&&e.status<300)return t;var n=new Error(t.message);throw n.response=e,n}function o(e,t){return fetch(e,t).then(function(e){return Promise.all([e,r(e)])}).then(function(e){var t=l(e,2);return a(t[0],t[1])})}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){var n=[],r=!0,a=!1,o=void 0;try{for(var l,i=e[Symbol.iterator]();!(r=(l=i.next()).done)&&(n.push(l.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.default=o,n(96)},function(e,t,n){"use strict";function r(e){return{type:y.HANDLE_SHOW_URI,data:e}}function a(e){return{type:y.REQUEST_ERROR,data:e}}function o(e,t){var n=v.CHANNEL,r="cr#"+e+"#"+t;return{type:y.CHANNEL_REQUEST_NEW,data:{requestType:n,requestId:r,channelName:e,channelId:t}}}function l(e,t,n,r,a){var o=a?v.ASSET_LITE:v.ASSET_DETAILS,l="ar#"+e+"#"+t+"#"+n+"#"+r;return{type:y.ASSET_REQUEST_NEW,data:{requestType:o,requestId:l,name:e,modifier:{id:t,channel:{name:n,id:r}}}}}function i(e,t){return{type:y.REQUEST_UPDATE,data:{requestType:e,requestId:t}}}function u(e,t,n){return{type:y.REQUEST_LIST_ADD,data:{id:e,error:t,key:n}}}function s(e,t,n,r,a,o){return{type:y.ASSET_ADD,data:{id:e,error:t,name:n,claimId:r,shortId:a,claimData:o}}}function c(e,t,n,r,a){return{type:y.CHANNEL_ADD,data:{id:e,name:t,shortId:n,longId:r,claimsData:a}}}function f(e,t,n,r){return{type:y.CHANNEL_CLAIMS_UPDATE_ASYNC,data:{channelKey:e,name:t,longId:n,page:r}}}function d(e,t){return{type:y.CHANNEL_CLAIMS_UPDATE_SUCCESS,data:{channelListId:e,claimsData:t}}}function p(e,t){return{type:y.FILE_REQUESTED,data:{name:e,claimId:t}}}function m(e){return{type:y.FILE_AVAILABILITY_UPDATE,data:e}}function h(e){return{type:y.DISPLAY_ASSET_ERROR,data:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.onHandleShowPageUri=r,t.onRequestError=a,t.onNewChannelRequest=o,t.onNewAssetRequest=l,t.onRequestUpdate=i,t.addRequestToRequestList=u,t.addAssetToAssetList=s,t.addNewChannelToChannelList=c,t.onUpdateChannelClaims=f,t.updateChannelClaims=d,t.fileRequested=p,t.updateFileAvailability=m,t.updateDisplayAssetError=h;var g=n(11),y=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(g),v=n(52)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),a=n(24),o=n(25),l=n(98),i=function(e){return e&&e.__esModule?e:{default:e}}(l),u=function(e){var t=e.channel,n=e.site;return{channelName:t.loggedInChannel.name,channelShortId:t.loggedInChannel.shortId,channelLongId:t.loggedInChannel.longId,siteDescription:n.description}},s=function(e){return{onChannelLogin:function(t,n,r){e((0,a.updateLoggedInChannel)(t,n,r)),e((0,o.updateSelectedChannel)(t))},onChannelLogout:function(){e((0,a.updateLoggedInChannel)(null,null,null))}}};t.default=(0,r.connect)(u,s)(i.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),a=n(99),o=function(e){return e&&e.__esModule?e:{default:e}}(a),l=function(e){var t=e.site;return{defaultDescription:t.defaultDescription,defaultThumbnail:t.defaultThumbnail,siteDescription:t.description,siteHost:t.host,siteTitle:t.title,siteTwitter:t.twitter}};t.default=(0,r.connect)(l,null)(o.default)},function(e,t){e.exports=require("prop-types")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.HANDLE_SHOW_URI="HANDLE_SHOW_URI",t.REQUEST_ERROR="REQUEST_ERROR",t.REQUEST_UPDATE="REQUEST_UPDATE",t.ASSET_REQUEST_NEW="ASSET_REQUEST_NEW",t.CHANNEL_REQUEST_NEW="CHANNEL_REQUEST_NEW",t.REQUEST_LIST_ADD="REQUEST_LIST_ADD",t.ASSET_ADD="ASSET_ADD",t.CHANNEL_ADD="CHANNEL_ADD",t.CHANNEL_CLAIMS_UPDATE_ASYNC="CHANNEL_CLAIMS_UPDATE_ASYNC",t.CHANNEL_CLAIMS_UPDATE_SUCCESS="CHANNEL_CLAIMS_UPDATE_SUCCESS",t.FILE_REQUESTED="FILE_REQUESTED",t.FILE_AVAILABILITY_UPDATE="FILE_AVAILABILITY_UPDATE",t.DISPLAY_ASSET_ERROR="DISPLAY_ASSET_ERROR"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.selectAsset=function(e){var t=e.requestList[e.request.id],n=t.key;return e.assetList[n]},t.selectShowState=function(e){return e.show}},function(e,t){e.exports=require("react-helmet")},function(e,t){e.exports=require("redux-saga/effects")},function(e,t,n){"use strict";var r=n(71),a=n(1),o=n(72),l=o.api,i=l.apiHost,u=l.apiPort,s="http://"+i+":"+u,c=n(16),f=c.chooseGaLbrynetPublishLabel,d=c.sendGATimingEvent,p=function(e,t,n){var r=e.data;if(a.debug("lbry api data:",r),r.result)return r.result.error?(a.debug("Lbrynet api error:",r.result.error),void n(new Error(r.result.error))):void t(r.result);n(JSON.stringify(r))};e.exports={publishClaim:function(e){a.debug('lbryApi >> Publishing claim to "'+e.name+'"');var t=Date.now();return new Promise(function(n,a){r.post(s,{method:"publish",params:e}).then(function(r){d("lbrynet","publish",f(e),t,Date.now()),p(r,n,a)}).catch(function(e){a(e)})})},getClaim:function(e){a.debug('lbryApi >> Getting Claim for "'+e+'"');var t=Date.now();return new Promise(function(n,a){r.post(s,{method:"get",params:{uri:e,timeout:20}}).then(function(e){d("lbrynet","getClaim","GET",t,Date.now()),p(e,n,a)}).catch(function(e){a(e)})})},getClaimList:function(e){a.debug('lbryApi >> Getting claim_list for "'+e+'"');var t=Date.now();return new Promise(function(n,a){r.post(s,{method:"claim_list",params:{name:e}}).then(function(e){d("lbrynet","getClaimList","CLAIM_LIST",t,Date.now()),p(e,n,a)}).catch(function(e){a(e)})})},resolveUri:function(e){a.debug('lbryApi >> Resolving URI for "'+e+'"');var t=Date.now();return new Promise(function(n,a){r.post(s,{method:"resolve",params:{uri:e}}).then(function(r){var o=r.data;d("lbrynet","resolveUri","RESOLVE",t,Date.now()),o.result[e].error?a(o.result[e].error):n(o.result[e])}).catch(function(e){a(e)})})},getDownloadDirectory:function(){a.debug("lbryApi >> Retrieving the download directory path from lbry daemon...");var e=Date.now();return new Promise(function(t,n){r.post(s,{method:"settings_get"}).then(function(n){var r=n.data;if(d("lbrynet","getDownloadDirectory","SETTINGS_GET",e,Date.now()),!r.result)return new Error("Successfully connected to lbry daemon, but unable to retrieve the download directory.");t(r.result.download_directory)}).catch(function(e){a.error("Lbrynet Error:",e),t("/home/lbry/Downloads/")})})},createChannel:function(e){a.debug("lbryApi >> Creating channel for "+e+"...");var t=Date.now();return new Promise(function(n,a){r.post(s,{method:"channel_new",params:{channel_name:e,amount:.1}}).then(function(e){d("lbrynet","createChannel","CHANNEL_NEW",t,Date.now()),p(e,n,a)}).catch(function(e){a(e)})})}}},function(e,t,n){"use strict";function r(e,t,n){return{eventCategory:"client requests",eventAction:"serve request",eventLabel:n,ipOverride:t,userAgentOverride:e["user-agent"]}}function a(e,t,n,r,a){return{userTimingCategory:e,userTimingVariableName:t,userTimingTime:a-r,userTimingLabel:n}}function o(e,t){var n=e.replace(/\./g,"-");u(c,n,{strictCidFormat:!1,https:!0}).event(t,function(e){e&&i.error("Google Analytics Event Error >>",e)})}function l(e,t){u(c,e,{strictCidFormat:!1,https:!0}).timing(t,function(e){e&&i.error("Google Analytics Event Error >>",e),i.debug("Timing event successfully sent to google analytics")})}var i=n(1),u=n(73),s=n(3),c=s.analytics.googleId,f=s.details.title;e.exports={sendGAServeEvent:function(e,t,n){o(t,r(e,t,n))},sendGATimingEvent:function(e,t,n,r,o){var i=a(e,t,n,r,o);l(f,i)},chooseGaLbrynetPublishLabel:function(e){var t=e.channel_name,n=e.channel_id;return t||n?"PUBLISH_IN_CHANNEL_CLAIM":"PUBLISH_ANONYMOUS_CLAIM"}}},function(e,t){e.exports=require("redux")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(95),f=r(c),d=n(4),p=n(3),m=p.analytics.googleId;f.default.initialize(m);var h=function(e){function t(){return a(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return l(t,e),i(t,[{key:"componentDidMount",value:function(){this.sendPageView(this.props.history.location),this.props.history.listen(this.sendPageView)}},{key:"sendPageView",value:function(e){f.default.set({page:e.pathname}),f.default.pageview(e.pathname)}},{key:"render",value:function(){return this.props.children}}]),t}(s.default.Component);t.default=(0,d.withRouter)(h)},function(e,t,n){"use strict";function r(e,t){var n=t.shift(),a=e[n];return t.length>=1?r(a,t):a}Object.defineProperty(t,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=n(3),l=o.componentsConfig;t.dynamicImport=function(e){if(!e)throw new Error("no file path provided to dynamicImport()");if("string"!=typeof e)throw console.log("dynamicImport > filePath:",e),console.log("dynamicImport > filePath type:",void 0===e?"undefined":a(e)),new Error("file path provided to dynamicImport() must be a string");if(!l)return console.log("no componentsConfig found in siteConfig.js"),n(44)(""+e);var t=e.split("/").filter(function(e){return e.replace(/\s/g,"").length}),o=r(l,t);return o||n(44)(""+e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){return t+"/"+e},a=function(e,t){var n=void 0,r=void 0,a=void 0,o=void 0;if(e.claimData){var l=e.claimData;n=l.channelName,r=l.certificateId,a=l.name,o=l.claimId}return n?t+"/"+n+":"+r+"/"+a:t+"/"+o+"/"+a},o=function(e,t){return t+"/"+e.name+":"+e.longId};t.createCanonicalLink=function(e,t,n,l){return e?a(e,l):t?o(t,l):r(n,l)}},function(e,t,n){"use strict";var r=function(){function e(e,t){var n=[],r=!0,a=!1,o=void 0;try{for(var l,i=e[Symbol.iterator]();!(r=(l=i.next()).done)&&(n.push(l.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.exports={REGEXP_INVALID_CLAIM:/[^A-Za-z0-9-]/g,REGEXP_INVALID_CHANNEL:/[^A-Za-z0-9-@]/g,REGEXP_ADDRESS:/^b(?=[^0OIl]{32,33})[0-9A-Za-z]{32,33}$/,CHANNEL_CHAR:"@",parseIdentifier:function(t){var n=new RegExp("([^:$#/]*)([:$#]?)([^/]*)"),a=n.exec(t).map(function(e){return e||null}),o=r(a,4),l=(o[0],o[1]),i=o[2],u=o[3];if(!l)throw new Error('Check your URL. No channel name provided before "'+i+'"');var s=l.startsWith(e.exports.CHANNEL_CHAR),c=s?l:null,f=void 0;if(s){if(!c)throw new Error('Check your URL. No channel name after "@".');var d=c.match(e.exports.REGEXP_INVALID_CHANNEL);if(d)throw new Error('Check your URL. Invalid characters in channel name: "'+d.join(", ")+'".')}else f=l;var p=void 0;if(i){if(!u)throw new Error('Check your URL. No modifier provided after separator "'+i+'"');if(":"!==i)throw new Error('Check your URL. The "'+i+'" modifier is not currently supported');p=u}return{isChannel:s,channelName:c,channelClaimId:p||null,claimId:f||null}},parseClaim:function(t){var n=new RegExp("([^:$#/.]*)([:$#.]?)([^/]*)"),a=n.exec(t).map(function(e){return e||null}),o=r(a,4),l=(o[0],o[1]),i=o[2],u=o[3];if(!l)throw new Error('Check your URL. No claim name provided before "."');var s=l.match(e.exports.REGEXP_INVALID_CLAIM);if(s)throw new Error('Check your URL. Invalid characters in claim name: "'+s.join(", ")+'".');if(i){if(!u)throw new Error('Check your URL. No file extension provided after separator "'+i+'".');if("."!==i)throw new Error('Check your URL. The "'+i+'" separator is not supported in the claim name.')}return{claimName:l,extension:u||null}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){if(e){switch(e.substring(e.lastIndexOf("."))){case"jpeg":case"jpg":return"image/jpeg";case"png":return"image/png";case"gif":return"image/gif";case"mp4":return"video/mp4";default:return"image/jpeg"}}return""},a=function(e,t,n,r){return[{property:"og:title",content:n},{property:"og:url",content:e},{property:"og:site_name",content:n},{property:"og:description",content:t},{property:"twitter:site",content:r},{property:"twitter:card",content:"summary"}]},o=function(e,t,n,r){var a=r.name;return[{property:"og:title",content:a+" on "+e},{property:"og:url",content:t+"/"+a+":"+r.longId},{property:"og:site_name",content:e},{property:"og:description",content:a+", a channel on "+e},{property:"twitter:site",content:n},{property:"twitter:card",content:"summary"}]},l=function(e,t,n,a,o,l){var i=a.claimData,u=i.contentType,s=e+"/"+i.claimId+"/"+i.name,c=e+"/"+i.claimId+"/"+i.name,f=e+"/"+i.claimId+"/"+i.name+"."+i.fileExt,d=i.title||i.name,p=i.description||o,m=r(i.thumbnail),h=i.thumbnail||l,g=[{property:"og:title",content:d},{property:"og:url",content:c},{property:"og:site_name",content:t},{property:"og:description",content:p},{property:"og:image:width",content:600},{property:"og:image:height",content:315},{property:"twitter:site",content:n}];return"video/mp4"===u||"video/webm"===u?(g.push({property:"og:video",content:f}),g.push({property:"og:video:secure_url",content:f}),g.push({property:"og:video:type",content:u}),g.push({property:"og:image",content:h}),g.push({property:"og:image:type",content:m}),g.push({property:"og:type",content:"video"}),g.push({property:"twitter:card",content:"player"}),g.push({property:"twitter:player",content:s}),g.push({property:"twitter:player:width",content:600}),g.push({property:"twitter:text:player_width",content:600}),g.push({property:"twitter:player:height",content:337}),g.push({property:"twitter:player:stream",content:f}),g.push({property:"twitter:player:stream:content_type",content:u})):(g.push({property:"og:image",content:f}),g.push({property:"og:image:type",content:u}),g.push({property:"og:type",content:"article"}),g.push({property:"twitter:card",content:"summary_large_image"})),g};t.createMetaTags=function(e,t,n,r,i,u,s,c){return i?l(t,n,r,i,s,c):u?o(t,n,r,u):a(e,t,n,r)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.createPageTitle=function(e,t){return t?e+" - "+t:""+e}},function(e,t,n){"use strict";function r(e,t,n){return{type:o.CHANNEL_UPDATE,data:{name:e,shortId:t,longId:n}}}Object.defineProperty(t,"__esModule",{value:!0}),t.updateLoggedInChannel=r;var a=n(41),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(a)},function(e,t,n){"use strict";function r(e){return{type:h.FILE_SELECTED,data:e}}function a(){return{type:h.FILE_CLEAR}}function o(e,t){return{type:h.METADATA_UPDATE,data:{name:e,value:t}}}function l(e){return{type:h.CLAIM_UPDATE,data:e}}function i(e){return{type:h.SET_PUBLISH_IN_CHANNEL,channel:e}}function u(e,t){return{type:h.PUBLISH_STATUS_UPDATE,data:{status:e,message:t}}}function s(e,t){return{type:h.ERROR_UPDATE,data:{name:e,value:t}}}function c(e){return{type:h.SELECTED_CHANNEL_UPDATE,data:e}}function f(e){return{type:h.TOGGLE_METADATA_INPUTS,data:e}}function d(e){return{type:h.THUMBNAIL_NEW,data:e}}function p(e){return{type:h.PUBLISH_START,data:{history:e}}}Object.defineProperty(t,"__esModule",{value:!0}),t.selectFile=r,t.clearFile=a,t.updateMetadata=o,t.updateClaim=l,t.setPublishInChannel=i,t.updatePublishStatus=u,t.updateError=s,t.updateSelectedChannel=c,t.toggleMetadataInputs=f,t.onNewThumbnail=d,t.startPublish=p;var m=n(40),h=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(m)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(10),f=r(c),d=n(50),p=r(d),m=n(51),h=r(m),g=function(e){function t(e){a(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={bars:[],index:0,incrementer:1},n.createBars=n.createBars.bind(n),n.startProgressBar=n.startProgressBar.bind(n),n.updateProgressBar=n.updateProgressBar.bind(n),n.stopProgressBar=n.stopProgressBar.bind(n),n}return l(t,e),i(t,[{key:"componentDidMount",value:function(){this.createBars(),this.startProgressBar()}},{key:"componentWillUnmount",value:function(){this.stopProgressBar()}},{key:"createBars",value:function(){for(var e=[],t=0;t<=this.props.size;t++)e.push({isActive:!1});this.setState({bars:e})}},{key:"startProgressBar",value:function(){this.updateInterval=setInterval(this.updateProgressBar.bind(this),300)}},{key:"updateProgressBar",value:function(){var e=this.state.index,t=this.state.incrementer,n=this.state.bars;(e<0||e>this.props.size)&&(t*=-1,e+=t),n[e].isActive=t>0,e+=t,this.setState({bars:n,incrementer:t,index:e})}},{key:"stopProgressBar",value:function(){clearInterval(this.updateInterval)}},{key:"render",value:function(){return s.default.createElement("div",null,this.state.bars.map(function(e,t){return e.isActive?s.default.createElement(p.default,{key:t}):s.default.createElement(h.default,{key:t})}))}}]),t}(s.default.Component);g.propTypes={size:f.default.number.isRequired},t.default=g},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(10),f=r(c),d=n(8),p=r(d),m=function(e){function t(){return a(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return l(t,e),i(t,[{key:"render",value:function(){var e=this.props.error;return s.default.createElement("div",null,s.default.createElement(p.default,null),s.default.createElement("div",{className:"row row--padded"},s.default.createElement("p",null,e)))}}]),t}(s.default.Component);m.propTypes={error:f.default.string.isRequired},t.default=m},function(e,t){e.exports=require("passport")},function(e,t,n){"use strict";function r(){var e=this;this.database="default",this.username="default",this.password="default",this.configure=function(t){if(!t)return console.log("No MySQL config received.");var n=t.database,r=t.username,a=t.password;e.database=n,e.username=r,e.password=a}}e.exports=new r},function(e,t,n){"use strict";function r(){var e=this;this.slackWebHook="default",this.slackErrorChannel="default",this.slackInfoChannel="default",this.configure=function(t){if(!t)return console.log("No slack config received.");var n=t.slackWebHook,r=t.slackErrorChannel,a=t.slackInfoChannel;e.slackWebHook=n,e.slackErrorChannel=r,e.slackInfoChannel=a}}e.exports=new r},function(e,t){e.exports=require("passport-local")},function(e,t){e.exports=require("sequelize")},function(e,t,n){"use strict";e.exports={returnShortId:function(e,t){var n=void 0,r=t.substring(0,1),a=0;if((n=e.findIndex(function(e){return e.claimId===t}))<0)throw new Error("claim id not found in claims list");for(var o=e.slice(0,n);o.length>0;)a+=1,r=t.substring(0,a),o=o.filter(function(e){return e.claimId&&e.claimId.substring(0,a)===r});return r}}},function(e,t,n){"use strict";var r=n(1),a=n(86),o=n(3),l=o.details,i=o.publishing;e.exports={parsePublishApiRequestBody:function(e){var t=e.name,n=e.nsfw,r=e.license,a=e.title,o=e.description,l=e.thumbnail;if(!t)throw new Error("no name field found in request");if(/[^A-Za-z0-9,-]/.exec(t))throw new Error('The claim name you provided is not allowed. Only the following characters are allowed: A-Z, a-z, 0-9, and "-"');return n="true"===n,r=r||null,a=a||null,o=o||null,l=l||null,{name:t,nsfw:n,license:r,title:a,description:o,thumbnail:l}},parsePublishApiRequestFiles:function(t){var n=t.file,r=t.thumbnail;if(!n)throw new Error("no file with key of [file] found in request");if(!n.path)throw new Error("no file path found");if(!n.type)throw new Error("no file type found");if(!n.size)throw new Error("no file type found");if(/'/.test(n.name))throw new Error("apostrophes are not allowed in the file name");return e.exports.validateFileTypeAndSize(n),{fileName:n.name,filePath:n.path,fileType:n.type,thumbnailFileName:r?r.name:null,thumbnailFilePath:r?r.path:null,thumbnailFileType:r?r.type:null}},validateFileTypeAndSize:function(e){switch(e.type){case"image/jpeg":case"image/jpg":case"image/png":if(e.size>1e7)throw r.debug("publish > file validation > .jpeg/.jpg/.png was too big"),new Error("Sorry, images are limited to 10 megabytes.");break;case"image/gif":if(e.size>5e7)throw r.debug("publish > file validation > .gif was too big"),new Error("Sorry, .gifs are limited to 50 megabytes.");break;case"video/mp4":if(e.size>5e7)throw r.debug("publish > file validation > .mp4 was too big"),new Error("Sorry, videos are limited to 50 megabytes.");break;default:throw r.debug("publish > file validation > unrecognized file type"),new Error("The "+e.type+" content type is not supported. Only, .jpeg, .png, .gif, and .mp4 files are currently supported.")}return e},createBasicPublishParams:function(e,t,n,a,o,u,s){r.debug("Creating Publish Parameters"),null!==n&&""!==n.trim()||(n=t),null!==a&&""!==a.trim()||(a=""),null!==o&&""!==o.trim()||(o=" ");var c={name:t,file_path:e,bid:.01,metadata:{description:a,title:n,author:l.title,language:"en",license:o,nsfw:u},claim_address:i.primaryClaimAddress};return s&&(c.metadata.thumbnail=s),c},createThumbnailPublishParams:function(e,t,n,a){if(e)return r.debug("Creating Thumbnail Publish Parameters"),{name:t+"-thumb",file_path:e,bid:.01,metadata:{title:t+" thumbnail",description:"a thumbnail for "+t,author:l.title,language:"en",license:n,nsfw:a},claim_address:i.primaryClaimAddress,channel_name:i.thumbnailChannel,channel_id:i.thumbnailChannelId}},deleteTemporaryFile:function(e){a.unlink(e,function(t){if(t)throw r.error("error deleting temporary file "+e),t;r.debug("successfully deleted "+e)})},addGetResultsToFileData:function(e,t){return e.fileName=t.file_name,e.filePath=t.download_path,e},createFileData:function(e){var t=e.name,n=e.claimId,r=e.outpoint,a=e.height,o=e.address,l=e.nsfw;return{name:t,claimId:n,outpoint:r,height:a,address:o,fileName:"",filePath:"",fileType:e.contentType,nsfw:l}}}},function(e,t,n){"use strict";var r=function(){function e(e,t){var n=[],r=!0,a=!1,o=void 0;try{for(var l,i=e[Symbol.iterator]();!(r=(l=i.next()).done)&&(n.push(l.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=n(1);e.exports={handleErrorResponse:function(t,n,o,l){a.error("Error on "+t,e.exports.useObjectPropertiesIfNoKeys(o));var i=e.exports.returnErrorMessageAndStatus(o),u=r(i,2),s=u[0],c=u[1];l.status(s).json(e.exports.createErrorResponsePayload(s,c))},returnErrorMessageAndStatus:function(e){var t=void 0,n=void 0;return"ECONNREFUSED"===e.code?(t=503,n="Connection refused. The daemon may not be running."):(t=400,n=e.message?e.message:e),[t,n]},useObjectPropertiesIfNoKeys:function(e){if(0===Object.keys(e).length){var t={};return Object.getOwnPropertyNames(e).forEach(function(n){t[n]=e[n]}),t}return e},createErrorResponsePayload:function(e,t){return{status:e,success:!1,message:t}}}},function(e,t,n){"use strict";var r=function(){function e(e,t){var n=[],r=!0,a=!1,o=void 0;try{for(var l,i=e[Symbol.iterator]();!(r=(l=i.next()).done)&&(n.push(l.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=n(5),o=n(1),l=n(88),i=l.returnPaginatedChannelClaims;e.exports={getClaimId:function(t,n,r,a){return t?e.exports.getClaimIdByChannel(t,n,r):e.exports.getClaimIdByClaim(r,a)},getClaimIdByClaim:function(e,t){return o.debug("getClaimIdByClaim("+e+", "+t+")"),new Promise(function(n,r){a.Claim.getLongClaimId(e,t).then(function(e){e||n("NO_CLAIM"),n(e)}).catch(function(e){r(e)})})},getClaimIdByChannel:function(e,t,n){return o.debug("getClaimIdByChannel("+e+", "+t+", "+n+")"),new Promise(function(o,l){a.Certificate.getLongChannelId(e,t).then(function(e){return e?Promise.all([e,a.Claim.getClaimIdByLongChannelId(e,n)]):[null,null]}).then(function(e){var t=r(e,2),n=t[0],a=t[1];return n?a?void o(a):o("NO_CLAIM"):o("NO_CHANNEL")}).catch(function(e){l(e)})})},getChannelData:function(e,t,n){return new Promise(function(n,o){a.Certificate.getLongChannelId(e,t).then(function(t){return t?Promise.all([t,a.Certificate.getShortChannelIdFromLongChannelId(t,e)]):[null,null,null]}).then(function(t){var a=r(t,2),o=a[0],l=a[1];if(!o)return n("NO_CHANNEL");n({channelName:e,longChannelClaimId:o,shortChannelClaimId:l})}).catch(function(e){o(e)})})},getChannelClaims:function(e,t,n){return new Promise(function(o,l){a.Certificate.getLongChannelId(e,t).then(function(e){return e?Promise.all([e,a.Claim.getAllChannelClaims(e)]):[null,null,null]}).then(function(t){var a=r(t,2),l=a[0],u=a[1];if(!l)return o("NO_CHANNEL");var s=i(e,l,u,n);o(s)}).catch(function(e){l(e)})})},getLocalFileRecord:function(e,t){return a.File.findOne({where:{claimId:e,name:t}}).then(function(e){return e?e.dataValues:"NO_FILE"})}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var a=n(0),o=r(a),l=n(38),i=n(17),u=n(39),s=r(u),c=n(2),f=n(4),d=n(18),p=r(d),m=n(43),h=r(m),g=n(55),y=r(g),v=n(13),b=r(v);e.exports=function(e,t){var n={},r=(0,i.createStore)(s.default),a=(0,l.renderToString)(o.default.createElement(c.Provider,{store:r},o.default.createElement(f.StaticRouter,{location:e.url,context:n},o.default.createElement(p.default,null,o.default.createElement(h.default,null))))),u=b.default.renderStatic();if(n.url)return t.redirect(301,n.url);var d=r.getState();t.send((0,y.default)(u,a,d))}},function(e,t){e.exports=require("react-dom/server")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(17),o=n(90),l=r(o),i=n(92),u=r(i),s=n(93),c=r(s),f=n(94),d=r(f);t.default=(0,a.combineReducers)({channel:u.default,publish:l.default,show:c.default,site:d.default})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.FILE_SELECTED="FILE_SELECTED",t.FILE_CLEAR="FILE_CLEAR",t.METADATA_UPDATE="METADATA_UPDATE",t.CLAIM_UPDATE="CLAIM_UPDATE",t.SET_PUBLISH_IN_CHANNEL="SET_PUBLISH_IN_CHANNEL",t.PUBLISH_STATUS_UPDATE="PUBLISH_STATUS_UPDATE",t.ERROR_UPDATE="ERROR_UPDATE",t.SELECTED_CHANNEL_UPDATE="SELECTED_CHANNEL_UPDATE",t.TOGGLE_METADATA_INPUTS="TOGGLE_METADATA_INPUTS",t.THUMBNAIL_NEW="THUMBNAIL_NEW",t.PUBLISH_START="PUBLISH_START"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CHANNEL_UPDATE="CHANNEL_UPDATE"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.LOCAL_CHECK="LOCAL_CHECK",t.UNAVAILABLE="UNAVAILABLE",t.ERROR="ERROR",t.AVAILABLE="AVAILABLE"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=r(a),l=n(4),i=n(19),u=n(97),s=r(u),c=n(100),f=r(c),d=n(106),p=r(d),m=n(122),h=r(m),g=(0,i.dynamicImport)("pages/HomePage"),y=function(){return o.default.createElement(l.Switch,null,o.default.createElement(l.Route,{exact:!0,path:"/",component:g}),o.default.createElement(l.Route,{exact:!0,path:"/about",component:s.default}),o.default.createElement(l.Route,{exact:!0,path:"/login",component:f.default}),o.default.createElement(l.Route,{exact:!0,path:"/:identifier/:claim",component:p.default}),o.default.createElement(l.Route,{exact:!0,path:"/:claim",component:p.default}),o.default.createElement(l.Route,{component:h.default}))};t.default=y},function(e,t,n){function r(e){return n(a(e))}function a(e){var t=o[e];if(!(t+1))throw new Error("Cannot find module '"+e+"'.");return t}var o={"./canonicalLink":20,"./canonicalLink.js":20,"./dynamicImport":19,"./dynamicImport.js":19,"./file":45,"./file.js":45,"./lbryUri":21,"./lbryUri.js":21,"./metaTags":22,"./metaTags.js":22,"./pageTitle":23,"./pageTitle.js":23,"./publish":46,"./publish.js":46,"./request":6,"./request.js":6,"./validate":47,"./validate.js":47};r.keys=function(){return Object.keys(o)},r.resolve=a,e.exports=r,r.id=44},function(e,t,n){"use strict";e.exports={validateFile:function(e){if(!e)throw new Error("no file provided");if(/'/.test(e.name))throw new Error("apostrophes are not allowed in the file name");switch(e.type){case"image/jpeg":case"image/jpg":case"image/png":if(e.size>1e7)throw new Error("Sorry, images are limited to 10 megabytes.");break;case"image/gif":if(e.size>5e7)throw new Error("Sorry, GIFs are limited to 50 megabytes.");break;case"video/mp4":if(e.size>5e7)throw new Error("Sorry, videos are limited to 50 megabytes.");break;default:throw new Error(e.type+" is not a supported file type. Only, .jpeg, .png, .gif, and .mp4 files are currently supported.")}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.createPublishMetadata=function(e,t,n,r,a){var o=t.type,l=n.title,i=n.description,u=n.license,s=n.nsfw,c={name:e,title:l,description:i,license:u,nsfw:s,type:o};return r&&(c.channelName=a),c},t.createPublishFormData=function(e,t,n){var r=new FormData;r.append("file",e),t&&r.append("thumbnail",t);for(var a in n)n.hasOwnProperty(a)&&r.append(a,n[a]);return r},t.createThumbnailUrl=function(e,t,n,r){return r+"/"+e+":"+t+"/"+n+"-thumb.png"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.validateChannelSelection=function(e,t,n){if(e&&t!==n.name)throw new Error("Log in to a channel or select Anonymous")},t.validatePublishParams=function(e,t,n){if(!e)throw new Error("Please choose a file");if(!t)throw new Error("Please enter a URL");if(n)throw new Error("Fix the url")}},function(e,t,n){"use strict";function r(){return o.default.createElement("svg",{version:"1.1",id:"Layer_1",x:"0px",y:"0px",height:"24px",viewBox:"0 0 80 31",enableBackground:"new 0 0 80 31",className:"nav-bar-logo"},o.default.createElement(l.Link,{to:"/"},o.default.createElement("title",null,"Logo"),o.default.createElement("desc",null,"Spee.ch logo"),o.default.createElement("g",{id:"About"},o.default.createElement("g",{id:"Publish-Form-V2-_x28_filled_x29_",transform:"translate(-42.000000, -23.000000)"},o.default.createElement("g",{id:"Group-17",transform:"translate(42.000000, 22.000000)"},o.default.createElement("text",{transform:"matrix(1 0 0 1 0 20)",fontSize:"25",fontFamily:"Roboto"},"Spee<h"),o.default.createElement("g",{id:"Group-16",transform:"translate(0.000000, 30.000000)"},o.default.createElement("path",{id:"Line-8",fill:"none",stroke:"#09F911",strokeWidth:"1",strokeLinecap:"square",d:"M0.5,1.5h15"}),o.default.createElement("path",{id:"Line-8-Copy",fill:"none",stroke:"#029D74",strokeWidth:"1",strokeLinecap:"square",d:"M16.5,1.5h15"}),o.default.createElement("path",{id:"Line-8-Copy-2",fill:"none",stroke:"#E35BD8",strokeWidth:"1",strokeLinecap:"square",d:"M32.5,1.5h15"}),o.default.createElement("path",{id:"Line-8-Copy-3",fill:"none",stroke:"#4156C5",strokeWidth:"1",strokeLinecap:"square",d:"M48.5,1.5h15"}),o.default.createElement("path",{id:"Line-8-Copy-4",fill:"none",stroke:"#635688",strokeWidth:"1",strokeLinecap:"square",d:"M64.5,1.5h15"})))))))}Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=function(e){return e&&e.__esModule?e:{default:e}}(a),l=n(4);t.default=r},function(e,t,n){"use strict";function r(e){var t=e.channelName,n=e.handleSelection,r=e.defaultSelection,a=e.VIEW,l=e.LOGOUT;return o.default.createElement("select",{type:"text",id:"nav-bar-channel-select",className:"select select--arrow link--nav",onChange:n,value:r},o.default.createElement("option",{id:"nav-bar-channel-select-channel-option"},t),o.default.createElement("option",{value:a},"View"),o.default.createElement("option",{value:l},"Logout"))}Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=function(e){return e&&e.__esModule?e:{default:e}}(a);t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=function(e){return e&&e.__esModule?e:{default:e}}(r),o=function(){return a.default.createElement("span",{className:"progress-bar progress-bar--active"},"| ")};t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=function(e){return e&&e.__esModule?e:{default:e}}(r),o=function(){return a.default.createElement("span",{className:"progress-bar progress-bar--inactive"},"| ")};t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CHANNEL="CHANNEL",t.ASSET_LITE="ASSET_LITE",t.ASSET_DETAILS="ASSET_DETAILS"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),a=n(110),o=function(e){return e&&e.__esModule?e:{default:e}}(a),l=n(7),i=n(12),u=function(e){var t=e.show;return{error:t.displayAsset.error,status:t.displayAsset.status,asset:(0,i.selectAsset)(t)}},s=function(e){return{onFileRequest:function(t,n){e((0,l.fileRequested)(t,n))}}};t.default=(0,r.connect)(u,s)(o.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),a=n(121),o=function(e){return e&&e.__esModule?e:{default:e}}(a),l=function(e){return{defaultThumbnail:e.site.defaults.defaultThumbnail}};t.default=(0,r.connect)(l,null)(o.default)},function(e,t,n){"use strict";e.exports=function(e,t,n){return'\n <!DOCTYPE html>\n <html lang="en" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">\n <head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">\n <meta http-equiv="X-UA-Compatible" content="ie=edge">\n \x3c!--helmet--\x3e\n '+e.title.toString()+"\n "+e.meta.toString()+"\n "+e.link.toString()+'\n \x3c!--style sheets--\x3e\n <link rel="stylesheet" href="/assets/css/reset.css" type="text/css">\n <link rel="stylesheet" href="/assets/css/general.css" type="text/css">\n <link rel="stylesheet" href="/assets/css/mediaQueries.css" type="text/css">\n \x3c!--google font--\x3e\n <link href="https://fonts.googleapis.com/css?family=Roboto:300" rel="stylesheet">\n </head>\n <body id="main-body">\n <div class="row row--tall flex-container--column">\n <div id="react-app" class="row row--tall flex-container--column">'+t+"</div>\n </div>\n <script>\n window.__PRELOADED_STATE__ = "+JSON.stringify(n).replace(/</g,"\\<")+'\n <\/script>\n <script src="/bundle/bundle.js"><\/script>\n </body>\n </html>\n '}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.selectSiteState=function(e){return e.site},t.selectSiteHost=function(e){return e.site.host}},function(e,t,n){n(58),n(59),e.exports=n(60)},function(e,t){e.exports=require("babel-polyfill")},function(e,t){e.exports=require("whatwg-fetch")},function(e,t,n){"use strict";var r=n(61),a=n(139),o={server:r,components:a};e.exports=o},function(e,t,n){"use strict";function r(){var e=this;this.configureMysql=function(e){n(29).configure(e)},this.configureSite=function(t){n(3).configure(t),console.log(n(3)),e.sessionKey=t.auth.sessionKey,e.PORT=t.details.port},this.configureSlack=function(e){n(30).configure(e)},this.createApp=function(){var t=a();t.enable("trust proxy"),t.use(u()),t.use(a.static(__dirname+"/public")),t.use(o.json()),t.use(o.urlencoded({extended:!0})),t.use(function(e,t,n){h.verbose("Request on "+e.originalUrl+" from "+e.ip),n()}),s.serializeUser(f),s.deserializeUser(d);var r=n(70),c=n(81);s.use("local-signup",r),s.use("local-login",c),t.use(p({name:"session",keys:[e.sessionKey],maxAge:864e5})),t.use(s.initialize()),t.use(s.session());var m=l.create({defaultLayout:"embed",handlebars:i});t.engine("handlebars",m.engine),t.set("view engine","handlebars"),n(82)(t),n(83)(t),n(89)(t),n(124)(t),n(134)(t),e.app=t},this.initialize=function(){n(135)(h),n(137)(h),e.createApp(),e.server=m.Server(e.app)},this.start=function(){n(5).sequelize.sync().then(function(){e.server.listen(e.PORT,function(){h.info("Server is listening on PORT "+e.PORT)})}).catch(function(e){h.error("Startup Error:",e)})}}var a=n(62),o=n(63),l=n(64),i=n(65),u=n(66),s=n(28),c=n(67),f=c.serializeSpeechUser,d=c.deserializeSpeechUser,p=n(68),m=n(69),h=n(1);e.exports=r},function(e,t){e.exports=require("express")},function(e,t){e.exports=require("body-parser")},function(e,t){e.exports=require("express-handlebars")},function(e,t){e.exports=require("handlebars")},function(e,t){e.exports=require("helmet")},function(e,t,n){"use strict";var r=n(1);e.exports={serializeSpeechUser:function(e,t){r.debug("serializing user"),t(null,e)},deserializeSpeechUser:function(e,t){r.debug("deserializing user"),t(null,e)}}},function(e,t){e.exports=require("cookie-session")},function(e,t){e.exports=require("http")},function(e,t,n){"use strict";var r=function(){function e(e,t){var n=[],r=!0,a=!1,o=void 0;try{for(var l,i=e[Symbol.iterator]();!(r=(l=i.next()).done)&&(n.push(l.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=n(31).Strategy,o=n(15),l=n(1),i=n(5);e.exports=new a({usernameField:"username",passwordField:"password"},function(e,t,n){l.verbose("new channel signup request. user: "+e+" pass: "+t+" .");var a={};return o.createChannel("@"+e).then(function(n){var r={userName:e,password:t};l.verbose("userData >",r);var a={channelName:"@"+e,channelClaimId:n.claim_id};l.verbose("channelData >",a);var o={claimId:n.claim_id,name:"@"+e};return l.verbose("certificateData >",o),Promise.all([i.User.create(r),i.Channel.create(a),i.Certificate.create(o)])}).then(function(e){var t=r(e,3),n=t[0],o=t[1],i=t[2];return l.verbose("user and certificate successfully created"),a.id=n.id,a.userName=n.userName,a.channelName=o.channelName,a.channelClaimId=o.channelClaimId,Promise.all([i.setChannel(o),o.setUser(n)])}).then(function(){return l.verbose("user and certificate successfully associated"),i.Certificate.getShortChannelIdFromLongChannelId(a.channelClaimId,a.channelName)}).then(function(e){return a.shortChannelId=e,n(null,a)}).catch(function(e){return l.error("signup error",e),n(e)})})},function(e,t){e.exports=require("axios")},function(e,t,n){"use strict";var r={api:{apiHost:"localhost",apiPort:"5279"}};e.exports=r},function(e,t){e.exports=require("universal-analytics")},function(e,t,n){"use strict";var r=n(1),a=n(33),o=a.returnShortId;e.exports=function(e,t){var n=t.STRING,a=t.BOOLEAN,l=t.INTEGER,i=t.TEXT,u=t.DECIMAL,s=e.define("Certificate",{address:{type:n,default:null},amount:{type:u(19,8),default:null},claimId:{type:n,default:null},claimSequence:{type:l,default:null},decodedClaim:{type:a,default:null},depth:{type:l,default:null},effectiveAmount:{type:u(19,8),default:null},hasSignature:{type:a,default:null},height:{type:l,default:null},hex:{type:i("long"),default:null},name:{type:n,default:null},nout:{type:l,default:null},txid:{type:n,default:null},validAtHeight:{type:l,default:null},outpoint:{type:n,default:null},valueVersion:{type:n,default:null},claimType:{type:n,default:null},certificateVersion:{type:n,default:null},keyType:{type:n,default:null},publicKey:{type:i("long"),default:null}},{freezeTableName:!0});return s.associate=function(e){s.belongsTo(e.Channel,{foreignKey:{allowNull:!0}})},s.getShortChannelIdFromLongChannelId=function(e,t){var n=this;return r.debug("getShortChannelIdFromLongChannelId "+t+":"+e),new Promise(function(r,a){n.findAll({where:{name:t},order:[["height","ASC"]]}).then(function(t){switch(t.length){case 0:throw new Error("No channel(s) found with that channel name");default:return r(o(t,e))}}).catch(function(e){a(e)})})},s.getLongChannelIdFromShortChannelId=function(e,t){var n=this;return r.debug("getLongChannelIdFromShortChannelId("+e+", "+t+")"),new Promise(function(r,a){n.findAll({where:{name:e,claimId:{$like:t+"%"}},order:[["height","ASC"]]}).then(function(e){switch(e.length){case 0:return r(null);default:return r(e[0].claimId)}}).catch(function(e){a(e)})})},s.getLongChannelIdFromChannelName=function(e){var t=this;return r.debug("getLongChannelIdFromChannelName("+e+")"),new Promise(function(n,r){t.findAll({where:{name:e},order:[["effectiveAmount","DESC"],["height","ASC"]]}).then(function(e){switch(e.length){case 0:return n(null);default:return n(e[0].claimId)}}).catch(function(e){r(e)})})},s.validateLongChannelId=function(e,t){var n=this;return r.debug("validateLongChannelId("+e+", "+t+")"),new Promise(function(r,a){n.findOne({where:{name:e,claimId:t}}).then(function(e){if(!e)return r(null);r(t)}).catch(function(e){a(e)})})},s.getLongChannelId=function(e,t){return r.debug("getLongChannelId("+e+", "+t+")"),t&&40===t.length?this.validateLongChannelId(e,t):t&&t.length<40?this.getLongChannelIdFromShortChannelId(e,t):this.getLongChannelIdFromChannelName(e)},s}},function(e,t,n){"use strict";e.exports=function(e,t){var n=t.STRING,r=e.define("Channel",{channelName:{type:n,allowNull:!1},channelClaimId:{type:n,allowNull:!1}},{freezeTableName:!0});return r.associate=function(e){r.belongsTo(e.User),r.hasOne(e.Certificate)},r}},function(e,t,n){"use strict";function r(e){switch(e){case"image/jpeg":case"image/jpg":return"jpeg";case"image/png":return"png";case"image/gif":return"gif";case"video/mp4":return"mp4";default:return l.debug("setting unknown file type as file extension jpeg"),"jpeg"}}function a(e,t){return""===e?t:e}function o(e){return e.thumbnail=a(e.thumbnail,c),e.fileExt=r(e.contentType),e.host=f,e}var l=n(1),i=n(33),u=i.returnShortId,s=n(3),c=s.assetDefaults.thumbnail,f=s.details.host;e.exports=function(e,t){var n=t.STRING,i=t.BOOLEAN,s=t.INTEGER,f=t.TEXT,d=t.DECIMAL,p=e.define("Claim",{address:{type:n,default:null},amount:{type:d(19,8),default:null},claimId:{type:n,default:null},claimSequence:{type:s,default:null},decodedClaim:{type:i,default:null},depth:{type:s,default:null},effectiveAmount:{type:d(19,8),default:null},hasSignature:{type:i,default:null},height:{type:s,default:null},hex:{type:f("long"),default:null},name:{type:n,default:null},nout:{type:s,default:null},txid:{type:n,default:null},validAtHeight:{type:s,default:null},outpoint:{type:n,default:null},claimType:{type:n,default:null},certificateId:{type:n,default:null},author:{type:n,default:null},description:{type:f("long"),default:null},language:{type:n,default:null},license:{type:n,default:null},licenseUrl:{type:n,default:null},nsfw:{type:i,default:null},preview:{type:n,default:null},thumbnail:{type:n,default:null},title:{type:n,default:null},metadataVersion:{type:n,default:null},contentType:{type:n,default:null},source:{type:n,default:null},sourceType:{type:n,default:null},sourceVersion:{type:n,default:null},streamVersion:{type:n,default:null},valueVersion:{type:n,default:null},channelName:{type:n,allowNull:!0,default:null}},{freezeTableName:!0});return p.associate=function(e){p.belongsTo(e.File,{foreignKey:{allowNull:!0}})},p.getShortClaimIdFromLongClaimId=function(e,t){var n=this;return l.debug("Claim.getShortClaimIdFromLongClaimId for "+t+"#"+e),new Promise(function(r,a){n.findAll({where:{name:t},order:[["height","ASC"]]}).then(function(t){switch(t.length){case 0:throw new Error("No claim(s) found with that claim name");default:r(u(t,e))}}).catch(function(e){a(e)})})},p.getAllChannelClaims=function(e){var t=this;return l.debug("Claim.getAllChannelClaims for "+e),new Promise(function(n,o){t.findAll({where:{certificateId:e},order:[["height","ASC"]],raw:!0}).then(function(e){switch(e.length){case 0:return n(null);default:return e.forEach(function(e){return e.fileExt=r(e.contentType),e.thumbnail=a(e.thumbnail,c),e}),n(e)}}).catch(function(e){o(e)})})},p.getClaimIdByLongChannelId=function(e,t){var n=this;return l.debug("finding claim id for claim "+t+" from channel "+e),new Promise(function(r,a){n.findAll({where:{name:t,certificateId:e},order:[["id","ASC"]]}).then(function(n){switch(n.length){case 0:return r(null);case 1:return r(n[0].claimId);default:return l.error(n.length+' records found for "'+t+'" in channel "'+e+'"'),r(n[0].claimId)}}).catch(function(e){a(e)})})},p.getLongClaimIdFromShortClaimId=function(e,t){var n=this;return new Promise(function(r,a){n.findAll({where:{name:e,claimId:{$like:t+"%"}},order:[["height","ASC"]]}).then(function(e){switch(e.length){case 0:return r(null);default:return r(e[0].claimId)}}).catch(function(e){a(e)})})},p.getTopFreeClaimIdByClaimName=function(e){var t=this;return new Promise(function(n,r){t.findAll({where:{name:e},order:[["effectiveAmount","DESC"],["height","ASC"]]}).then(function(e){switch(l.debug("length of result",e.length),e.length){case 0:return n(null);default:return n(e[0].dataValues.claimId)}}).catch(function(e){r(e)})})},p.validateLongClaimId=function(e,t){var n=this;return new Promise(function(r,a){n.findOne({where:{name:e,claimId:t}}).then(function(e){if(!e)return r(null);r(t)}).catch(function(e){a(e)})})},p.getLongClaimId=function(e,t){return l.debug("getLongClaimId("+e+", "+t+")"),t&&40===t.length?this.validateLongClaimId(e,t):t&&t.length<40?this.getLongClaimIdFromShortClaimId(e,t):this.getTopFreeClaimIdByClaimName(e)},p.resolveClaim=function(e,t){var n=this;return l.debug("Claim.resolveClaim: "+e+" "+t),new Promise(function(r,a){n.findAll({where:{name:e,claimId:t}}).then(function(n){switch(n.length){case 0:return r(null);case 1:return r(o(n[0].dataValues));default:return l.error("more than one record matches "+e+"#"+t+" in db.Claim"),r(o(n[0].dataValues))}}).catch(function(e){a(e)})})},p}},function(e,t,n){"use strict";e.exports=function(e,t){var n=t.STRING,r=t.BOOLEAN,a=t.INTEGER,o=e.define("File",{name:{type:n,allowNull:!1},claimId:{type:n,allowNull:!1},address:{type:n,allowNull:!1},outpoint:{type:n,allowNull:!1},height:{type:a,allowNull:!1,default:0},fileName:{type:n,allowNull:!1},filePath:{type:n,allowNull:!1},fileType:{type:n},nsfw:{type:r,allowNull:!1,defaultValue:!1},trendingEligible:{type:r,allowNull:!1,defaultValue:!0}},{freezeTableName:!0});return o.associate=function(e){o.hasMany(e.Request),o.hasOne(e.Claim)},o.getRecentClaims=function(){return this.findAll({where:{nsfw:!1,trendingEligible:!0},order:[["createdAt","DESC"]],limit:25})},o}},function(e,t,n){"use strict";e.exports=function(e,t){var n=t.STRING,r=(t.BOOLEAN,t.TEXT),a=e.define("Request",{action:{type:n,allowNull:!1},url:{type:n,allowNull:!1},ipAddress:{type:n,allowNull:!0},result:{type:r("long"),allowNull:!0,default:null}},{freezeTableName:!0});return a.associate=function(e){a.belongsTo(e.File,{foreignKey:{allowNull:!0}})},a}},function(e,t,n){"use strict";var r=n(80),a=n(1);e.exports=function(e,t){var n=t.STRING,o=e.define("User",{userName:{type:n,allowNull:!1},password:{type:n,allowNull:!1}},{freezeTableName:!0});return o.associate=function(e){o.hasOne(e.Channel)},o.prototype.comparePassword=function(e){return r.compare(e,this.password)},o.prototype.changePassword=function(e){var t=this;return new Promise(function(n,o){r.genSalt(function(l,i){if(l)return a.error("salt error",l),void o(l);r.hash(e,i,function(e,r){if(e)return a.error("hash error",e),void o(e);t.update({password:r}).then(function(){n()}).catch(function(e){o(e)})})})})},o.hook("beforeCreate",function(e,t){return a.debug("User.beforeCreate hook..."),new Promise(function(t,n){r.genSalt(function(o,l){if(o)return a.error("salt error",o),void n(o);r.hash(e.password,l,function(r,o){if(r)return a.error("hash error",r),void n(r);e.password=o,t()})})})}),o}},function(e,t){e.exports=require("bcrypt")},function(e,t,n){"use strict";var r=n(31).Strategy,a=n(1),o=n(5),l=function(e){return new Promise(function(t,n){var r={};r.id=e.id,r.userName=e.userName,e.getChannel().then(function(e){var t=e.channelName,n=e.channelClaimId;return r.channelName=t,r.channelClaimId=n,o.Certificate.getShortChannelIdFromLongChannelId(n,t)}).then(function(e){r.shortChannelId=e,t(r)}).catch(function(e){n(e)})})};e.exports=new r({usernameField:"username",passwordField:"password"},function(e,t,n){return o.User.findOne({where:{userName:e}}).then(function(e){return e?e.comparePassword(t).then(function(t){return t?(a.debug("Password was a match, returning User"),l(e).then(function(e){return n(null,e)}).catch(function(e){return e})):(a.debug("incorrect password"),n(null,!1,{message:"Incorrect username or password"}))}).catch(function(e){return e}):(a.debug("no user found"),n(null,!1,{message:"Incorrect username or password"}))}).catch(function(e){return n(e)})})},function(e,t,n){"use strict";var r=n(1),a=n(28);e.exports=function(e){e.post("/signup",a.authenticate("local-signup"),function(e,t){r.verbose("successful signup for "+e.user.channelName),t.status(200).json({success:!0,channelName:e.user.channelName,channelClaimId:e.user.channelClaimId,shortChannelId:e.user.shortChannelId})}),e.post("/login",function(e,t,n){a.authenticate("local-login",function(a,o,l){return a?n(a):o?(r.debug("successful login"),void e.logIn(o,function(r){return r?n(r):t.status(200).json({success:!0,channelName:e.user.channelName,channelClaimId:e.user.channelClaimId,shortChannelId:e.user.shortChannelId})})):t.status(400).json({success:!1,message:l.message})})(e,t,n)}),e.get("/logout",function(e,t){e.logout(),t.status(200).json({success:!0,message:"you successfully logged out"})}),e.get("/user",function(e,t){e.user?t.status(200).json({success:!0,data:e.user}):t.status(401).json({success:!1,message:"user is not logged in"})})}},function(e,t,n){"use strict";var r=function(){function e(e,t){var n=[],r=!0,a=!1,o=void 0;try{for(var l,i=e[Symbol.iterator]();!(r=(l=i.next()).done)&&(n.push(l.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=n(1),o=n(84),l=n(3),i=l.publishing.uploadDirectory,u=l.details.host,s=o({uploadDir:i}),c=n(5),f=n(85),d=f.claimNameIsAvailable,p=f.checkChannelAvailability,m=f.publish,h=n(15),g=h.getClaimList,y=h.resolveUri,v=h.getClaim,b=n(34),w=b.addGetResultsToFileData,E=b.createBasicPublishParams,_=b.createThumbnailPublishParams,C=b.parsePublishApiRequestBody,N=b.parsePublishApiRequestFiles,I=b.createFileData,P=n(35),O=n(16),A=O.sendGATimingEvent,S=n(87),T=S.authenticateUser,L=n(36),x=L.getChannelData,j=L.getChannelClaims,k=L.getClaimId;e.exports=function(e){e.get("/api/channel/availability/:name",function(e,t){var n=e.ip,r=e.originalUrl,a=e.params.name,o=Date.now();p(a).then(function(e){t.status(200).json(e),A("end-to-end","claim name availability",a,o,Date.now())}).catch(function(e){P.handleErrorResponse(r,n,e,t)})}),e.get("/api/channel/short-id/:longId/:name",function(e,t){var n=e.ip,r=e.originalUrl,a=e.params;c.Certificate.getShortChannelIdFromLongChannelId(a.longId,a.name).then(function(e){t.status(200).json(e)}).catch(function(e){P.handleErrorResponse(r,n,e,t)})}),e.get("/api/channel/data/:channelName/:channelClaimId",function(e,t){var n=e.ip,r=e.originalUrl,a=(e.body,e.params),o=a.channelName,l=a.channelClaimId;"none"===l&&(l=null),x(o,l,0).then(function(e){if("NO_CHANNEL"===e)return t.status(404).json({success:!1,message:"No matching channel was found"});t.status(200).json({success:!0,data:e})}).catch(function(e){P.handleErrorResponse(r,n,e,t)})}),e.get("/api/channel/claims/:channelName/:channelClaimId/:page",function(e,t){var n=e.ip,r=e.originalUrl,a=(e.body,e.params),o=a.channelName,l=a.channelClaimId;"none"===l&&(l=null);var i=a.page;j(o,l,i).then(function(e){if("NO_CHANNEL"===e)return t.status(404).json({success:!1,message:"No matching channel was found"});t.status(200).json({success:!0,data:e})}).catch(function(e){P.handleErrorResponse(r,n,e,t)})}),e.get("/api/claim/list/:name",function(e,t){var n=e.ip,r=e.originalUrl,a=e.params;g(a.name).then(function(e){t.status(200).json(e)}).catch(function(e){P.handleErrorResponse(r,n,e,t)})}),e.get("/api/claim/get/:name/:claimId",function(e,t){var n=e.ip,a=e.originalUrl,o=e.params,l=o.name,i=o.claimId;c.Claim.resolveClaim(l,i).then(function(e){if(!e)throw new Error("No matching uri found in Claim table");var t=I(e);return Promise.all([t,v(l+"#"+i)])}).then(function(e){var t=r(e,2),n=t[0],a=t[1];return n=w(n,a),Promise.all([c.upsert(c.File,n,{name:l,claimId:i},"File"),a])}).then(function(e){var n=r(e,2),a=(n[0],n[1]),o=a.message,l=a.completed;t.status(200).json({success:!0,message:o,completed:l})}).catch(function(e){P.handleErrorResponse(a,n,e,t)})}),e.get("/api/claim/availability/:name",function(e,t){var n=e.ip,r=e.originalUrl,a=e.params.name,o=Date.now();d(a).then(function(e){t.status(200).json(e),A("end-to-end","claim name availability",a,o,Date.now())}).catch(function(e){P.handleErrorResponse(r,n,e,t)})}),e.get("/api/claim/resolve/:name/:claimId",function(e,t){var n=(e.headers,e.ip),r=e.originalUrl,a=e.params;y(a.name+"#"+a.claimId).then(function(e){t.status(200).json(e)}).catch(function(e){P.handleErrorResponse(r,n,e,t)})}),e.post("/api/claim/publish",s,function(e,t){var n=e.body,a=e.files,o=(e.headers,e.ip),l=e.originalUrl,i=e.user,s=void 0,c=void 0,f=void 0,p=void 0,h=void 0,g=void 0,y=void 0,v=void 0,b=void 0,w=void 0,I=void 0,O=void 0,S=void 0,L=void 0,x=void 0,j=void 0;v=Date.now();try{var k=C(n);w=k.name,I=k.nsfw,b=k.license,j=k.title,p=k.description,O=k.thumbnail;var R=N(a);h=R.fileName,g=R.filePath,y=R.fileType,S=R.thumbnailFileName,L=R.thumbnailFilePath,x=R.thumbnailFileType,s=n.channelName,c=n.channelId,f=n.channelPassword}catch(e){return t.status(400).json({success:!1,message:e.message})}Promise.all([T(s,c,f,i),d(w),E(g,w,j,p,b,I,O),_(L,w,b,I)]).then(function(e){var t=r(e,4),n=t[0],a=n.channelName,o=n.channelClaimId,l=(t[1],t[2]),i=t[3];return a&&o&&(l.channel_name=a,l.channel_id=o),i&&m(i,S,x),m(l,h,y)}).then(function(e){t.status(200).json({success:!0,message:"publish completed successfully",data:{name:w,claimId:e.claim_id,url:u+"/"+e.claim_id+"/"+w,lbryTx:e}}),A("end-to-end","publish",y,v,Date.now())}).catch(function(e){P.handleErrorResponse(l,o,e,t)})}),e.get("/api/claim/short-id/:longId/:name",function(e,t){var n=e.ip,r=e.originalUrl,a=(e.body,e.params);c.Claim.getShortClaimIdFromLongClaimId(a.longId,a.name).then(function(e){t.status(200).json({success:!0,data:e})}).catch(function(e){P.handleErrorResponse(r,n,e,t)})}),e.post("/api/claim/long-id",function(e,t){var n=e.ip,r=e.originalUrl,o=e.body;e.params;a.debug("body:",o);var l=o.channelName,i=o.channelClaimId,u=o.claimName,s=o.claimId;k(l,i,u,s).then(function(e){return"NO_CHANNEL"===e?t.status(404).json({success:!1,message:"No matching channel could be found"}):"NO_CLAIM"===e?t.status(404).json({success:!1,message:"No matching claim id could be found"}):void t.status(200).json({success:!0,data:e})}).catch(function(e){P.handleErrorResponse(r,n,e,t)})}),e.get("/api/claim/data/:claimName/:claimId",function(e,t){var n=e.ip,r=e.originalUrl,a=(e.body,e.params),o=a.claimName,l=a.claimId;"none"===l&&(l=null),c.Claim.resolveClaim(o,l).then(function(e){if(!e)return t.status(404).json({success:!1,message:"No claim could be found"});t.status(200).json({success:!0,data:e})}).catch(function(e){P.handleErrorResponse(r,n,e,t)})}),e.get("/api/file/availability/:name/:claimId",function(e,t){var n=e.ip,r=e.originalUrl,a=e.params,o=a.name,l=a.claimId;c.File.findOne({where:{name:o,claimId:l}}).then(function(e){if(e)return t.status(200).json({success:!0,data:!0});t.status(200).json({success:!0,data:!1})}).catch(function(e){P.handleErrorResponse(r,n,e,t)})})}},function(e,t){e.exports=require("connect-multiparty")},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=function(){function e(e,t){var n=[],r=!0,a=!1,o=void 0;try{for(var l,i=e[Symbol.iterator]();!(r=(l=i.next()).done)&&(n.push(l.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=n(1),l=n(5),i=n(15),u=n(34),s=n(3),c=s.publishing,f=c.primaryClaimAddress,d=c.additionalClaimAddresses,p=n(32),m=p.Op;e.exports={publish:function(e,t,n){return new Promise(function(r,s){var c=void 0,f=void 0,d=void 0;return i.publishClaim(e).then(function(n){return o.info("Successfully published "+e.name+" "+t,n),c=n,e.channel_name?(o.debug("this claim was published in channel: "+e.channel_name),l.Channel.findOne({where:{channelName:e.channel_name}})):(o.debug("this claim was not published in a channel"),null)}).then(function(e){f=null,d=null,e&&(f=e.channelClaimId,d=e.channelName),o.debug("certificateId: "+f)}).then(function(){var r={name:e.name,claimId:c.claim_id,title:e.metadata.title,description:e.metadata.description,address:e.claim_address,outpoint:c.txid+":"+c.nout,height:0,fileName:t,filePath:e.file_path,fileType:n,nsfw:e.metadata.nsfw},a={name:e.name,claimId:c.claim_id,title:e.metadata.title,description:e.metadata.description,address:e.claim_address,thumbnail:e.metadata.thumbnail,outpoint:c.txid+":"+c.nout,height:0,contentType:n,nsfw:e.metadata.nsfw,amount:e.bid,certificateId:f,channelName:d},o={name:e.name,claimId:c.claim_id};return Promise.all([l.upsert(l.File,r,o,"File"),l.upsert(l.Claim,a,o,"Claim")])}).then(function(e){var t=a(e,2),n=t[0],r=t[1];return o.debug("File and Claim records successfully created"),Promise.all([n.setClaim(r),r.setFile(n)])}).then(function(){o.debug("File and Claim records successfully associated"),r(c)}).catch(function(t){o.error("PUBLISH ERROR",t),u.deleteTemporaryFile(e.file_path),s(t)})})},claimNameIsAvailable:function(e){var t=d||[];return t.push(f),l.Claim.findAll({attributes:["address"],where:{name:e,address:r({},m.or,t)}}).then(function(t){if(t.length>=1)throw new Error("That claim is already in use");return e}).catch(function(e){throw e})},checkChannelAvailability:function(e){return l.Channel.findAll({where:{channelName:e}}).then(function(t){if(t.length>=1)throw new Error("That channel has already been claimed");return e}).catch(function(e){throw e})}}},function(e,t){e.exports=require("fs")},function(e,t,n){"use strict";var r=n(5),a=n(1);e.exports={authenticateUser:function(t,n,r,a){if(!t&&!n)return{channelName:null,channelClaimId:null};if(a){if(t&&t!==a.channelName)throw new Error("the provided channel name does not match user credentials");if(n&&n!==a.channelClaimId)throw new Error("the provided channel id does not match user credentials");return{channelName:a.channelName,channelClaimId:a.channelClaimId}}if(!r)throw new Error("no channel password provided");return e.exports.authenticateChannelCredentials(t,n,r)},authenticateChannelCredentials:function(e,t,n){return new Promise(function(o,l){var i=void 0,u={};e&&(u.channelName=e),t&&(u.channelClaimId=t),r.Channel.findOne({where:u}).then(function(e){if(!e)throw a.debug("no channel found"),new Error("Authentication failed, you do not have access to that channel");return i=e.get(),a.debug("channel data:",i),r.User.findOne({where:{userName:i.channelName.substring(1)}})}).then(function(e){if(!e)throw a.debug("no user found"),new Error("Authentication failed, you do not have access to that channel");return e.comparePassword(n)}).then(function(e){if(!e)throw a.debug("incorrect password"),new Error("Authentication failed, you do not have access to that channel");a.debug("...password was a match..."),o(i)}).catch(function(e){l(e)})})}}},function(e,t,n){"use strict";e.exports={returnPaginatedChannelClaims:function(t,n,r,a){var o=e.exports.determineTotalPages(r),l=e.exports.getPageFromQuery(a);return{channelName:t,longChannelClaimId:n,claims:e.exports.extractPageFromClaims(r,l),previousPage:e.exports.determinePreviousPage(l),currentPage:l,nextPage:e.exports.determineNextPage(o,l),totalPages:o,totalResults:e.exports.determineTotalClaims(r)}},getPageFromQuery:function(e){return e?parseInt(e):1},extractPageFromClaims:function(e,t){if(!e)return[];var n=12*(t-1),r=n+12;return e.slice(n,r)},determineTotalPages:function(e){if(e){var t=e.length;if(t<12)return 1;var n=Math.floor(t/12);return 0===t%12?n:n+1}return 0},determinePreviousPage:function(e){return 1===e?null:e-1},determineNextPage:function(e,t){return t===e?null:t+1},determineTotalClaims:function(e){return e?e.length:0}}},function(e,t,n){"use strict";var r=n(3),a=r.details,o=n(37);e.exports=function(e){e.get("/",function(e,t){o(e,t)}),e.get("/login",function(e,t){o(e,t)}),e.get("/about",function(e,t){o(e,t)}),e.get("/trending",function(e,t){t.status(301).redirect("/popular")}),e.get("/popular",function(e,t){o(e,t)}),e.get("/new",function(e,t){o(e,t)}),e.get("/embed/:claimId/:name",function(e,t){var n=e.params,r=n.claimId,o=n.name;t.status(200).render("embed",{layout:"embed",host:a,claimId:r,name:o})})}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,t=arguments[1];switch(t.type){case o.FILE_SELECTED:return Object.assign({},s,{file:t.data});case o.FILE_CLEAR:return s;case o.METADATA_UPDATE:return Object.assign({},e,{metadata:Object.assign({},e.metadata,r({},t.data.name,t.data.value))});case o.CLAIM_UPDATE:return Object.assign({},e,{claim:t.data});case o.SET_PUBLISH_IN_CHANNEL:return Object.assign({},e,{publishInChannel:t.channel});case o.PUBLISH_STATUS_UPDATE:return Object.assign({},e,{status:t.data});case o.ERROR_UPDATE:return Object.assign({},e,{error:Object.assign({},e.error,r({},t.data.name,t.data.value))});case o.SELECTED_CHANNEL_UPDATE:return Object.assign({},e,{selectedChannel:t.data});case o.TOGGLE_METADATA_INPUTS:return Object.assign({},e,{showMetadataInputs:t.data});case o.THUMBNAIL_NEW:return Object.assign({},e,{thumbnail:t.data});default:return e}};var a=n(40),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(a),l=n(91),i=n(3),u=i.publishing,s={disabled:u.disabled,disabledMessage:u.disabledMessage,publishInChannel:!1,selectedChannel:l.LOGIN,showMetadataInputs:!1,status:{status:null,message:null},error:{file:null,url:null,channel:null,publishSubmit:null},file:null,claim:"",metadata:{title:"",description:"",license:"",nsfw:!1},thumbnail:null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.LOGIN="Existing",t.CREATE="New"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,t=arguments[1];switch(t.type){case a.CHANNEL_UPDATE:return Object.assign({},e,{loggedInChannel:t.data});default:return e}};var r=n(41),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(r),o={loggedInChannel:{name:null,shortId:null,longId:null}}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t=arguments[1];switch(t.type){case o.REQUEST_ERROR:return Object.assign({},e,{request:Object.assign({},e.request,{error:t.data})});case o.REQUEST_UPDATE:return Object.assign({},e,{request:Object.assign({},e.request,{type:t.data.requestType,id:t.data.requestId})});case o.REQUEST_LIST_ADD:return Object.assign({},e,{requestList:Object.assign({},e.requestList,r({},t.data.id,{error:t.data.error,key:t.data.key}))});case o.ASSET_ADD:return Object.assign({},e,{assetList:Object.assign({},e.assetList,r({},t.data.id,{error:t.data.error,name:t.data.name,claimId:t.data.claimId,shortId:t.data.shortId,claimData:t.data.claimData}))});case o.CHANNEL_ADD:return Object.assign({},e,{channelList:Object.assign({},e.channelList,r({},t.data.id,{name:t.data.name,longId:t.data.longId,shortId:t.data.shortId,claimsData:t.data.claimsData}))});case o.CHANNEL_CLAIMS_UPDATE_SUCCESS:return Object.assign({},e,{channelList:Object.assign({},e.channelList,r({},t.data.channelListId,Object.assign({},e.channelList[t.data.channelListId],{claimsData:t.data.claimsData})))});case o.FILE_AVAILABILITY_UPDATE:return Object.assign({},e,{displayAsset:Object.assign({},e.displayAsset,{status:t.data})});case o.DISPLAY_ASSET_ERROR:return Object.assign({},e,{displayAsset:Object.assign({},e.displayAsset,{error:t.data,status:l.ERROR})});default:return e}};var a=n(11),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(a),l=n(42),i={request:{error:null,type:null,id:null},requestList:{},channelList:{},assetList:{},displayAsset:{error:null,status:l.LOCAL_CHECK}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p;return arguments[1].type,e};var r=n(3),a=r.analytics.googleId,o=r.assetDefaults,l=o.thumbnail,i=o.description,u=r.details,s=u.description,c=u.host,f=u.title,d=u.twitter,p={description:s,googleAnalyticsId:a,host:c,title:f,twitter:d,defaultDescription:i,defaultThumbnail:l}},function(e,t){e.exports=require("react-ga")},function(e,t){e.exports=require("cross-fetch/polyfill")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(8),f=r(c),d=n(9),p=r(d),m=function(e){function t(){return a(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return l(t,e),i(t,[{key:"render",value:function(){return s.default.createElement("div",null,s.default.createElement(p.default,{pageTitle:"About",pageUri:"about"}),s.default.createElement(f.default,null),s.default.createElement("div",{className:"row row--padded"},s.default.createElement("div",{className:"column column--5 column--med-10 align-content-top"},s.default.createElement("div",{className:"column column--8 column--med-10"},s.default.createElement("p",{className:"pull-quote"},"Spee.ch is an open-source project. Please contribute to the existing site, or fork it and make your own."),s.default.createElement("p",null,s.default.createElement("a",{className:"link--primary",target:"_blank",href:"https://twitter.com/spee_ch"},"TWITTER")),s.default.createElement("p",null,s.default.createElement("a",{className:"link--primary",target:"_blank",href:"https://github.com/lbryio/spee.ch"},"GITHUB")),s.default.createElement("p",null,s.default.createElement("a",{className:"link--primary",target:"_blank",href:"https://discord.gg/YjYbwhS"},"DISCORD CHANNEL")),s.default.createElement("p",null,s.default.createElement("a",{className:"link--primary",target:"_blank",href:"https://github.com/lbryio/spee.ch/blob/master/README.md"},"DOCUMENTATION")))),s.default.createElement("div",{className:"column column--5 column--med-10 align-content-top"},s.default.createElement("div",{className:"column column--8 column--med-10"},s.default.createElement("p",null,"Spee.ch is a media-hosting site that reads from and publishes content to the ",s.default.createElement("a",{className:"link--primary",href:"https://lbry.io"},"LBRY")," blockchain."),s.default.createElement("p",null,"Spee.ch is a hosting service, but with the added benefit that it stores your content on a decentralized network of computers -- the ",s.default.createElement("a",{className:"link--primary",href:"https://lbry.io/get"},"LBRY")," network. This means that your images are stored in multiple locations without a single point of failure."),s.default.createElement("h3",null,"Contribute"),s.default.createElement("p",null,"If you have an idea for your own spee.ch-like site on top of LBRY, fork our ",s.default.createElement("a",{className:"link--primary",href:"https://github.com/lbryio/spee.ch"},"github repo")," and go to town!"),s.default.createElement("p",null,"If you want to improve spee.ch, join our ",s.default.createElement("a",{className:"link--primary",href:"https://discord.gg/YjYbwhS"},"discord channel")," or solve one of our ",s.default.createElement("a",{className:"link--primary",href:"https://github.com/lbryio/spee.ch/issues"},"github issues"),".")))))}}]),t}(s.default.Component);t.default=m},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(4),f=n(48),d=r(f),p=n(49),m=r(p),h=n(6),g=r(h),y=function(e){function t(e){a(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.checkForLoggedInUser=n.checkForLoggedInUser.bind(n),n.logoutUser=n.logoutUser.bind(n),n.handleSelection=n.handleSelection.bind(n),n}return l(t,e),i(t,[{key:"componentDidMount",value:function(){this.checkForLoggedInUser()}},{key:"checkForLoggedInUser",value:function(){var e=this,t={credentials:"include"};(0,g.default)("/user",t).then(function(t){var n=t.data;e.props.onChannelLogin(n.channelName,n.shortChannelId,n.channelClaimId)}).catch(function(e){console.log("/user error:",e.message)})}},{key:"logoutUser",value:function(){var e=this,t={credentials:"include"};(0,g.default)("/logout",t).then(function(){e.props.onChannelLogout()}).catch(function(e){console.log("/logout error",e.message)})}},{key:"handleSelection",value:function(e){switch(e.target.selectedOptions[0].value){case"LOGOUT":this.logoutUser();break;case"VIEW":this.props.history.push("/"+this.props.channelName+":"+this.props.channelLongId)}}},{key:"render",value:function(){var e=this.props.siteDescription;return s.default.createElement("div",{className:"row row--wide nav-bar"},s.default.createElement("div",{className:"row row--padded row--short flex-container--row flex-container--space-between-center"},s.default.createElement(d.default,null),s.default.createElement("div",{className:"nav-bar--center"},s.default.createElement("span",{className:"nav-bar-tagline"},e)),s.default.createElement("div",{className:"nav-bar--right"},s.default.createElement(c.NavLink,{className:"nav-bar-link link--nav",activeClassName:"link--nav-active",to:"/",exact:!0},"Publish"),s.default.createElement(c.NavLink,{className:"nav-bar-link link--nav",activeClassName:"link--nav-active",to:"/about"},"About"),this.props.channelName?s.default.createElement(m.default,{channelName:this.props.channelName,handleSelection:this.handleSelection,defaultSelection:this.props.channelName,VIEW:"VIEW",LOGOUT:"LOGOUT"}):s.default.createElement(c.NavLink,{id:"nav-bar-login-link",className:"nav-bar-link link--nav",activeClassName:"link--nav-active",to:"/login"},"Channel"))))}}]),t}(s.default.Component);t.default=(0,c.withRouter)(y)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(13),f=r(c),d=n(10),p=r(d),m=n(23),h=n(22),g=n(20),y=function(e){function t(){return a(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return l(t,e),i(t,[{key:"render",value:function(){var e=this.props,t=e.defaultDescription,n=e.defaultThumbnail,r=e.siteDescription,a=e.siteHost,o=e.siteTitle,l=e.siteTwitter,i=this.props,u=i.asset,c=i.channel,d=i.pageUri,p=this.props.pageTitle;p=(0,m.createPageTitle)(o,p);var y=(0,h.createMetaTags)(r,a,o,l,u,c,t,n),v=(0,g.createCanonicalLink)(u,c,d,a);return s.default.createElement(f.default,{title:p,meta:y,link:[{rel:"canonical",href:v}]})}}]),t}(s.default.Component);y.propTypes={pageTitle:p.default.string,pageUri:p.default.string,channel:p.default.object,asset:p.default.object},t.default=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),a=n(101),o=function(e){return e&&e.__esModule?e:{default:e}}(a),l=function(e){return{loggedInChannelName:e.channel.loggedInChannel.name}};t.default=(0,r.connect)(l,null)(o.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(4),f=n(9),d=r(f),p=n(8),m=r(p),h=n(102),g=r(h),y=n(104),v=r(y),b=function(e){function t(){return a(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return l(t,e),i(t,[{key:"componentWillReceiveProps",value:function(e){e.loggedInChannelName!==this.props.loggedInChannelName&&this.props.history.push("/")}},{key:"render",value:function(){return s.default.createElement("div",null,s.default.createElement(d.default,{pageTitle:"Login",pageUri:"login"}),s.default.createElement(m.default,null),s.default.createElement("div",{className:"row row--padded"},s.default.createElement("div",{className:"column column--5 column--med-10 align-content-top"},s.default.createElement("div",{className:"column column--8 column--med-10"},s.default.createElement("p",null,"Channels allow you to publish and group content under an identity. You can create a channel for yourself, or share one with like-minded friends. You can create 1 channel, or 100, so whether you're ",s.default.createElement("a",{className:"link--primary",target:"_blank",href:"/@catalonia2017:43dcf47163caa21d8404d9fe9b30f78ef3e146a8"},"documenting important events"),", or making a public repository for ",s.default.createElement("a",{className:"link--primary",target:"_blank",href:"/@catGifs"},"cat gifs")," (password: '1234'), try creating a channel for it!"))),s.default.createElement("div",{className:"column column--5 column--med-10 align-content-top"},s.default.createElement("div",{className:"column column--8 column--med-10"},s.default.createElement("h3",{className:"h3--no-bottom"},"Log in to an existing channel:"),s.default.createElement(g.default,null),s.default.createElement("h3",{className:"h3--no-bottom"},"Create a brand new channel:"),s.default.createElement(v.default,null)))))}}]),t}(s.default.Component);t.default=(0,c.withRouter)(b)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),a=n(24),o=n(103),l=function(e){return e&&e.__esModule?e:{default:e}}(o),i=n(25),u=function(e){return{onChannelLogin:function(t,n,r){e((0,a.updateLoggedInChannel)(t,n,r)),e((0,i.updateSelectedChannel)(t))}}};t.default=(0,r.connect)(null,u)(l.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),c=r(s),f=n(6),d=r(f),p=function(e){function t(e){o(this,t);var n=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={error:null,name:"",password:""},n.handleInput=n.handleInput.bind(n),n.loginToChannel=n.loginToChannel.bind(n),n}return i(t,e),u(t,[{key:"handleInput",value:function(e){var t=e.target.name,n=e.target.value;this.setState(a({},t,n))}},{key:"loginToChannel",value:function(e){var t=this;e.preventDefault();var n={method:"POST",body:JSON.stringify({username:this.state.name,password:this.state.password}),headers:new Headers({"Content-Type":"application/json"}),credentials:"include"};(0,d.default)("login",n).then(function(e){var n=e.success,r=e.channelName,a=e.shortChannelId,o=e.channelClaimId,l=e.message;n?t.props.onChannelLogin(r,a,o):t.setState({error:l})}).catch(function(e){e.message?t.setState({error:e.message}):t.setState({error:e})})}},{key:"render",value:function(){return c.default.createElement("form",{id:"channel-login-form"},c.default.createElement("div",{className:"row row--wide row--short"},c.default.createElement("div",{className:"column column--3 column--sml-10"},c.default.createElement("label",{className:"label",htmlFor:"channel-login-name-input"},"Name:")),c.default.createElement("div",{className:"column column--6 column--sml-10"},c.default.createElement("div",{className:"input-text--primary flex-container--row flex-container--left-bottom"},c.default.createElement("span",null,"@"),c.default.createElement("input",{type:"text",id:"channel-login-name-input",className:"input-text",name:"name",placeholder:"Your Channel Name",value:this.state.channelName,onChange:this.handleInput})))),c.default.createElement("div",{className:"row row--wide row--short"},c.default.createElement("div",{className:"column column--3 column--sml-10"},c.default.createElement("label",{className:"label",htmlFor:"channel-login-password-input"},"Password:")),c.default.createElement("div",{className:"column column--6 column--sml-10"},c.default.createElement("div",{className:"input-text--primary"},c.default.createElement("input",{type:"password",id:"channel-login-password-input",name:"password",className:"input-text",placeholder:"",value:this.state.channelPassword,onChange:this.handleInput})))),this.state.error?c.default.createElement("p",{className:"info-message--failure"},this.state.error):c.default.createElement("p",{className:"info-message"},"Enter the name and password for your channel"),c.default.createElement("div",{className:"row row--wide"},c.default.createElement("button",{className:"button--primary",onClick:this.loginToChannel},"Authenticate")))}}]),t}(c.default.Component);t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),a=n(24),o=n(105),l=function(e){return e&&e.__esModule?e:{default:e}}(o),i=n(25),u=function(e){return{onChannelLogin:function(t,n,r){e((0,a.updateLoggedInChannel)(t,n,r)),e((0,i.updateSelectedChannel)(t))}}};t.default=(0,r.connect)(null,u)(l.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),c=r(s),f=n(26),d=r(f),p=n(6),m=r(p),h=function(e){function t(e){o(this,t);var n=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={error:null,channel:"",password:"",status:null},n.handleChannelInput=n.handleChannelInput.bind(n),n.handleInput=n.handleInput.bind(n),n.createChannel=n.createChannel.bind(n),n}return i(t,e),u(t,[{key:"cleanseChannelInput",value:function(e){return e=e.replace(/\s+/g,"-"),e=e.replace(/[^A-Za-z0-9-]/g,"")}},{key:"handleChannelInput",value:function(e){var t=e.target.value;t=this.cleanseChannelInput(t),this.setState({channel:t}),t?this.updateIsChannelAvailable(t):this.setState({error:"Please enter a channel name"})}},{key:"handleInput",value:function(e){var t=e.target.name,n=e.target.value;this.setState(a({},t,n))}},{key:"updateIsChannelAvailable",value:function(e){var t=this,n="@"+e;(0,m.default)("/api/channel/availability/"+n).then(function(){t.setState({error:null})}).catch(function(e){t.setState({error:e.message})})}},{key:"checkIsChannelAvailable",value:function(e){var t="@"+e;return(0,m.default)("/api/channel/availability/"+t)}},{key:"checkIsPasswordProvided",value:function(e){return new Promise(function(t,n){if(!e||e.length<1)return n(new Error("Please provide a password"));t()})}},{key:"makePublishChannelRequest",value:function(e,t){var n={method:"POST",body:JSON.stringify({username:e,password:t}),headers:new Headers({"Content-Type":"application/json"}),credentials:"include"};return new Promise(function(e,t){(0,m.default)("/signup",n).then(function(t){return e(t)}).catch(function(e){t(new Error("Unfortunately, we encountered an error while creating your channel. Please let us know in Discord! "+e.message))})})}},{key:"createChannel",value:function(e){var t=this;e.preventDefault(),this.checkIsPasswordProvided(this.state.password).then(function(){return t.checkIsChannelAvailable(t.state.channel)}).then(function(){return t.setState({status:"We are publishing your new channel. Sit tight..."}),t.makePublishChannelRequest(t.state.channel,t.state.password)}).then(function(e){t.setState({status:null}),t.props.onChannelLogin(e.channelName,e.shortChannelId,e.channelClaimId)}).catch(function(e){e.message?t.setState({error:e.message,status:null}):t.setState({error:e,status:null})})}},{key:"render",value:function(){return c.default.createElement("div",null,this.state.status?c.default.createElement("div",null,c.default.createElement("p",{className:"fine-print"},this.state.status),c.default.createElement(d.default,{size:12})):c.default.createElement("form",{id:"publish-channel-form"},c.default.createElement("div",{className:"row row--wide row--short"},c.default.createElement("div",{className:"column column--3 column--sml-10"},c.default.createElement("label",{className:"label",htmlFor:"new-channel-name"},"Name:")),c.default.createElement("div",{className:"column column--6 column--sml-10"},c.default.createElement("div",{className:"input-text--primary flex-container--row flex-container--left-bottom span--relative"},c.default.createElement("span",null,"@"),c.default.createElement("input",{type:"text",name:"channel",id:"new-channel-name",className:"input-text",placeholder:"exampleChannelName",value:this.state.channel,onChange:this.handleChannelInput}),this.state.channel&&!this.state.error&&c.default.createElement("span",{id:"input-success-channel-name",className:"info-message--success span--absolute"},"✓"),this.state.error&&c.default.createElement("span",{id:"input-success-channel-name",className:"info-message--failure span--absolute"},"✖")))),c.default.createElement("div",{className:"row row--wide row--short"},c.default.createElement("div",{className:"column column--3 column--sml-10"},c.default.createElement("label",{className:"label",htmlFor:"new-channel-password"},"Password:")),c.default.createElement("div",{className:"column column--6 column--sml-10"},c.default.createElement("div",{className:"input-text--primary"},c.default.createElement("input",{type:"password",name:"password",id:"new-channel-password",className:"input-text",placeholder:"",value:this.state.password,onChange:this.handleInput})))),this.state.error?c.default.createElement("p",{className:"info-message--failure"},this.state.error):c.default.createElement("p",{className:"info-message"},"Choose a name and password for your channel"),c.default.createElement("div",{className:"row row--wide"},c.default.createElement("button",{className:"button--primary",onClick:this.createChannel},"Create Channel"))))}}]),t}(c.default.Component);t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),a=n(7),o=n(107),l=function(e){return e&&e.__esModule?e:{default:e}}(o),i=function(e){var t=e.show;return{error:t.request.error,requestType:t.request.type}},u={onHandleShowPageUri:a.onHandleShowPageUri};t.default=(0,r.connect)(i,u)(l.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(27),f=r(c),d=n(108),p=r(d),m=n(111),h=r(m),g=n(117),y=r(g),v=n(52),b=function(e){function t(){return a(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return l(t,e),i(t,[{key:"componentDidMount",value:function(){this.props.onHandleShowPageUri(this.props.match.params)}},{key:"componentWillReceiveProps",value:function(e){e.match.params!==this.props.match.params&&this.props.onHandleShowPageUri(e.match.params)}},{key:"render",value:function(){var e=this.props,t=e.error,n=e.requestType;if(t)return s.default.createElement(f.default,{error:t});switch(n){case v.CHANNEL:return s.default.createElement(y.default,null);case v.ASSET_LITE:return s.default.createElement(p.default,null);case v.ASSET_DETAILS:return s.default.createElement(h.default,null);default:return s.default.createElement("p",null,"loading...")}}}]),t}(s.default.Component);t.default=b},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),a=n(109),o=function(e){return e&&e.__esModule?e:{default:e}}(a),l=function(e){var t=e.show,n=t.request.id,r=void 0,a=t.requestList[n]||null,o=t.assetList;if(a&&o){r=o[a.key]||null}return{asset:r}};t.default=(0,r.connect)(l,null)(o.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(9),f=r(c),d=n(4),p=n(53),m=r(p),h=function(e){function t(){return a(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return l(t,e),i(t,[{key:"render",value:function(){var e=this.props.asset;if(e){var t=e.claimData,n=t.name,r=t.claimId;return s.default.createElement("div",{className:"row row--tall flex-container--column flex-container--center-center show-lite-container"},s.default.createElement(f.default,{pageTitle:n,asset:e}),s.default.createElement(m.default,null),s.default.createElement(d.Link,{id:"asset-boilerpate",className:"link--primary fine-print",to:"/"+r+"/"+n},"hosted via Spee.ch"))}return s.default.createElement("div",{className:"row row--tall row--padded flex-container--column flex-container--center-center"},s.default.createElement("p",null,"loading asset data..."))}}]),t}(s.default.Component);t.default=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(26),f=r(c),d=n(42),p=function(e){function t(){return a(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return l(t,e),i(t,[{key:"componentDidMount",value:function(){var e=this.props.asset.claimData,t=e.name,n=e.claimId;this.props.onFileRequest(t,n)}},{key:"render",value:function(){var e=this.props,t=e.status,n=e.error,r=e.asset.claimData,a=r.name,o=r.claimId,l=r.contentType,i=r.fileExt,u=r.thumbnail;return s.default.createElement("div",{id:"asset-display-component"},t===d.LOCAL_CHECK&&s.default.createElement("div",null,s.default.createElement("p",null,"Checking to see if Spee.ch has your asset locally...")),t===d.UNAVAILABLE&&s.default.createElement("div",null,s.default.createElement("p",null,"Sit tight, we're searching the LBRY blockchain for your asset!"),s.default.createElement(f.default,{size:12}),s.default.createElement("p",null,"Curious what magic is happening here? ",s.default.createElement("a",{className:"link--primary",target:"blank",href:"https://lbry.io/faq/what-is-lbry"},"Learn more."))),t===d.ERROR&&s.default.createElement("div",null,s.default.createElement("p",null,"Unfortunately, we couldn't download your asset from LBRY. You can help us out by sharing the below error message in the ",s.default.createElement("a",{className:"link--primary",href:"https://discord.gg/YjYbwhS",target:"_blank"},"LBRY discord"),"."),s.default.createElement("i",null,s.default.createElement("p",{id:"error-message"},n))),t===d.AVAILABLE&&function(){switch(l){case"image/jpeg":case"image/jpg":case"image/png":case"image/gif":return s.default.createElement("img",{className:"asset",src:"/"+o+"/"+a+"."+i,alt:a});case"video/mp4":return s.default.createElement("video",{className:"asset video",controls:!0,poster:u},s.default.createElement("source",{src:"/"+o+"/"+a+"."+i}),s.default.createElement("p",null,"Your browser does not support the ",s.default.createElement("code",null,"video")," element."));default:return s.default.createElement("p",null,"Unsupported file type")}}())}}]),t}(s.default.Component);t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),a=n(112),o=function(e){return e&&e.__esModule?e:{default:e}}(a),l=function(e){var t=e.show,n=t.request.id,r=void 0,a=t.requestList[n]||null,o=t.assetList;if(a&&o){r=o[a.key]||null}return{asset:r}};t.default=(0,r.connect)(l,null)(o.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(9),f=r(c),d=n(8),p=r(d),m=n(27),h=r(m),g=n(113),y=r(g),v=n(53),b=r(v),w=n(115),E=r(w),_=function(e){function t(){return a(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return l(t,e),i(t,[{key:"render",value:function(){var e=this.props.asset;if(e){var t=e.claimData.name;return s.default.createElement("div",null,s.default.createElement(f.default,{pageTitle:t+" - details",asset:e}),s.default.createElement(p.default,null),s.default.createElement("div",{className:"row row--tall row--padded"},s.default.createElement("div",{className:"column column--10"},s.default.createElement(y.default,null)),s.default.createElement("div",{className:"column column--5 column--sml-10 align-content-top"},s.default.createElement("div",{className:"row row--padded show-details-container"},s.default.createElement(b.default,null))),s.default.createElement("div",{className:"column column--5 column--sml-10 align-content-top"},s.default.createElement("div",{className:"row row--padded"},s.default.createElement(E.default,null)))))}return s.default.createElement(h.default,{error:"loading asset data..."})}}]),t}(s.default.Component);t.default=_},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),a=n(114),o=function(e){return e&&e.__esModule?e:{default:e}}(a),l=n(12),i=function(e){var t=e.show;return{title:(0,l.selectAsset)(t).claimData.title}};t.default=(0,r.connect)(i,null)(o.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=function(e){return e&&e.__esModule?e:{default:e}}(r),o=function(e){var t=e.title;return a.default.createElement("div",null,a.default.createElement("span",{className:"text--large"},t))};t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),a=n(116),o=function(e){return e&&e.__esModule?e:{default:e}}(a),l=n(12),i=function(e){var t=e.show;return{asset:(0,l.selectAsset)(t)}};t.default=(0,r.connect)(i,null)(o.default)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),u=function(e){return e&&e.__esModule?e:{default:e}}(i),s=n(4),c=function(e){function t(e){r(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.copyToClipboard=n.copyToClipboard.bind(n),n}return o(t,e),l(t,[{key:"copyToClipboard",value:function(e){var t=e.target.dataset.elementtocopy;document.getElementById(t).select();try{document.execCommand("copy")}catch(e){this.setState({error:"Oops, unable to copy"})}}},{key:"render",value:function(){var e=this.props.asset,t=e.shortId,n=e.claimData,r=n.channelName,a=n.certificateId,o=n.description,l=n.name,i=n.claimId,c=n.fileExt,f=n.contentType,d=n.thumbnail,p=n.host;return u.default.createElement("div",null,r&&u.default.createElement("div",{className:"row row--padded row--wide row--no-top"},u.default.createElement("div",{className:"column column--2 column--med-10"},u.default.createElement("span",{className:"text"},"Channel:")),u.default.createElement("div",{className:"column column--8 column--med-10"},u.default.createElement("span",{className:"text"},u.default.createElement(s.Link,{to:"/"+r+":"+a},r)))),o&&u.default.createElement("div",{className:"row row--padded row--wide row--no-top"},u.default.createElement("span",{className:"text"},o)),u.default.createElement("div",{id:"show-share-buttons"},u.default.createElement("div",{className:"row row--padded row--wide row--no-top"},u.default.createElement("div",{className:"column column--2 column--med-10"},u.default.createElement("span",{className:"text"},"Share:")),u.default.createElement("div",{className:"column column--8 column--med-10"},u.default.createElement("div",{className:"row row--short row--wide flex-container--row flex-container--space-between-bottom flex-container--wrap"},u.default.createElement("a",{className:"link--primary",target:"_blank",href:"https://twitter.com/intent/tweet?text="+p+"/"+t+"/"+l},"twitter"),u.default.createElement("a",{className:"link--primary",target:"_blank",href:"https://www.facebook.com/sharer/sharer.php?u="+p+"/"+t+"/"+l},"facebook"),u.default.createElement("a",{className:"link--primary",target:"_blank",href:"http://tumblr.com/widgets/share/tool?canonicalUrl="+p+"/"+t+"/"+l},"tumblr"),u.default.createElement("a",{className:"link--primary",target:"_blank",href:"https://www.reddit.com/submit?url="+p+"/"+t+"/"+l+"&title="+l},"reddit"))))),u.default.createElement("div",{className:"row row--padded row--wide row--no-top"},u.default.createElement("div",{id:"show-short-link"},u.default.createElement("div",{className:"column column--2 column--med-10"},u.default.createElement("span",{className:"text"},"Link:")),u.default.createElement("div",{className:"column column--8 column--med-10"},u.default.createElement("div",{className:"row row--short row--wide"},u.default.createElement("div",{className:"column column--7"},u.default.createElement("div",{className:"input-error",id:"input-error-copy-short-link",hidden:"true"},"error here"),u.default.createElement("input",{type:"text",id:"short-link",className:"input-disabled input-text--full-width",readOnly:!0,spellCheck:"false",value:p+"/"+t+"/"+l+"."+c,onClick:this.select})),u.default.createElement("div",{className:"column column--1"}),u.default.createElement("div",{className:"column column--2"},u.default.createElement("button",{className:"button--primary button--wide","data-elementtocopy":"short-link",onClick:this.copyToClipboard},"copy"))))),u.default.createElement("div",{id:"show-embed-code"},u.default.createElement("div",{className:"column column--2 column--med-10"},u.default.createElement("span",{className:"text"},"Embed:")),u.default.createElement("div",{className:"column column--8 column--med-10"},u.default.createElement("div",{className:"row row--short row--wide"},u.default.createElement("div",{className:"column column--7"},u.default.createElement("div",{className:"input-error",id:"input-error-copy-embed-text",hidden:"true"},"error here"),"video/mp4"===f?u.default.createElement("input",{type:"text",id:"embed-text",className:"input-disabled input-text--full-width",readOnly:!0,onClick:this.select,spellCheck:"false",value:'<video width="100%" controls poster="'+d+'" src="'+p+"/"+i+"/"+l+"."+c+'"/></video>'}):u.default.createElement("input",{type:"text",id:"embed-text",className:"input-disabled input-text--full-width",readOnly:!0,onClick:this.select,spellCheck:"false",value:'<img src="'+p+"/"+i+"/"+l+"."+c+'"/>'})),u.default.createElement("div",{className:"column column--1"}),u.default.createElement("div",{className:"column column--2"},u.default.createElement("button",{className:"button--primary button--wide","data-elementtocopy":"embed-text",onClick:this.copyToClipboard},"copy")))))),u.default.createElement("div",{className:"flex-container--row flex-container--space-between-bottom"},u.default.createElement(s.Link,{className:"link--primary",to:"/"+t+"/"+l+"."+c},u.default.createElement("span",{className:"text"},"Direct Link")),u.default.createElement("a",{className:"link--primary",href:p+"/"+i+"/"+l+"."+c,download:l},"Download"),u.default.createElement("a",{className:"link--primary",target:"_blank",href:"https://lbry.io/dmca"},"Report")))}}]),t}(u.default.Component);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),a=n(118),o=function(e){return e&&e.__esModule?e:{default:e}}(a),l=function(e){var t=e.show,n=t.request.id,r=t.requestList[n]||null,a=void 0;if(r){var o=r.key;a=t.channelList[o]||null}return{channel:a}};t.default=(0,r.connect)(l,null)(o.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(9),f=r(c),d=n(27),p=r(d),m=n(8),h=r(m),g=n(119),y=r(g),v=function(e){function t(){return a(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return l(t,e),i(t,[{key:"render",value:function(){var e=this.props.channel;if(e){var t=e.name,n=e.longId,r=e.shortId;return s.default.createElement("div",null,s.default.createElement(f.default,{pageTitle:t,channel:e}),s.default.createElement(h.default,null),s.default.createElement("div",{className:"row row--tall row--padded"},s.default.createElement("div",{className:"column column--10"},s.default.createElement("h2",null,"channel name: ",t),s.default.createElement("p",{className:"fine-print"},"full channel id: ",n),s.default.createElement("p",{className:"fine-print"},"short channel id: ",r)),s.default.createElement("div",{className:"column column--10"},s.default.createElement(y.default,null))))}return s.default.createElement(p.default,{error:"loading channel data..."})}}]),t}(s.default.Component);t.default=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),a=n(7),o=n(120),l=function(e){return e&&e.__esModule?e:{default:e}}(o),i=function(e){var t=e.show,n=t.requestList[t.request.id],r=n.key;return{channelKey:r,channel:t.channelList[r]||null}},u={onUpdateChannelClaims:a.onUpdateChannelClaims};t.default=(0,r.connect)(i,u)(l.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(54),f=r(c),d=function(e){function t(e){a(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.showNextResultsPage=n.showNextResultsPage.bind(n),n.showPreviousResultsPage=n.showPreviousResultsPage.bind(n),n}return l(t,e),i(t,[{key:"showPreviousResultsPage",value:function(){var e=this.props.channel.claimsData.currentPage,t=parseInt(e)-1;this.showNewPage(t)}},{key:"showNextResultsPage",value:function(){var e=this.props.channel.claimsData.currentPage,t=parseInt(e)+1;this.showNewPage(t)}},{key:"showNewPage",value:function(e){var t=this.props,n=t.channelKey,r=t.channel,a=r.name,o=r.longId;this.props.onUpdateChannelClaims(n,a,o,e)}},{key:"render",value:function(){var e=this.props.channel.claimsData,t=e.claims,n=e.currentPage,r=e.totalPages;return s.default.createElement("div",{className:"row row--tall"},t.length>0?s.default.createElement("div",null,t.map(function(e,t){return s.default.createElement(f.default,{claimData:e,key:e.name+"-"+t})}),s.default.createElement("div",null,n>1&&s.default.createElement("button",{className:"button--secondary",onClick:this.showPreviousResultsPage},"Previous Page"),n<r&&s.default.createElement("button",{className:"button--secondary",onClick:this.showNextResultsPage},"Next Page"))):s.default.createElement("p",null,"There are no claims in this channel"))}}]),t}(s.default.Component);t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(4),l=function(e){var t=e.defaultThumbnail,n=e.claimData,r=n.name,l=n.claimId,i=n.fileExt,u=n.contentType,s=n.thumbnail,c=l+"/"+r+"."+i,f="/"+l+"/"+r;return a.default.createElement("div",{className:"asset-holder"},a.default.createElement(o.Link,{to:f},function(){switch(u){case"image/jpeg":case"image/jpg":case"image/png":case"image/gif":return a.default.createElement("img",{className:"asset-preview",src:c,alt:r});case"video/mp4":return a.default.createElement("img",{className:"asset-preview video",src:s||t,alt:r});default:return a.default.createElement("p",null,"unsupported file type")}}()))};t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),a=n(123),o=function(e){return e&&e.__esModule?e:{default:e}}(a),l=function(e){var t=e.site;return{host:t.host,title:t.title}};t.default=(0,r.connect)(l,null)(o.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(8),f=r(c),d=n(13),p=r(d),m=function(e){function t(){return a(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return l(t,e),i(t,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.host;return s.default.createElement("div",null,s.default.createElement(p.default,null,s.default.createElement("title",null,t," - 404"),s.default.createElement("link",{rel:"canonical",href:n+"/404"})),s.default.createElement(f.default,null),s.default.createElement("div",{className:"row row--padded"},s.default.createElement("h2",null,"404"),s.default.createElement("p",null,"That page does not exist")))}}]),t}(s.default.Component);t.default=m},function(e,t,n){"use strict";var r=function(){function e(e,t){var n=[],r=!0,a=!1,o=void 0;try{for(var l,i=e[Symbol.iterator]();!(r=(l=i.next()).done)&&(n.push(l.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=n(16),o=a.sendGAServeEvent,l=n(125),i=l.determineResponseType,u=l.flipClaimNameAndIdForBackwardsCompatibility,s=l.logRequestData,c=l.getClaimIdAndServeAsset,f=n(126),d=n(127);e.exports=function(e){e.get("/:identifier/:claim",function(e,t){var n=e.headers,a=e.ip,l=e.originalUrl,p=e.params,m=void 0;try{m=f.parseModifier(p.claim).hasFileExtension}catch(e){return t.status(400).json({success:!1,message:e.message})}var h=i(m,n);if("SERVE"!==h)return d(e,t);o(n,a,l);var g=void 0;try{g=f.parseClaim(p.claim).claimName}catch(e){return t.status(400).json({success:!1,message:e.message})}var y=void 0,v=void 0,b=void 0,w=void 0;try{var E=f.parseIdentifier(p.identifier);y=E.isChannel,v=E.channelName,b=E.channelClaimId,w=E.claimId}catch(e){return t.status(400).json({success:!1,message:e.message})}if(!y){var _=u(w,g),C=r(_,2);w=C[0],g=C[1]}s(h,g,v,w),c(v,b,g,w,l,a,t)}),e.get("/:claim",function(e,t){var n=e.headers,r=e.ip,a=e.originalUrl,l=e.params,u=void 0;try{u=f.parseModifier(l.claim).hasFileExtension}catch(e){return t.status(400).json({success:!1,message:e.message})}var p=i(u,n);if("SERVE"!==p)return d(e,t);o(n,r,a);var m=void 0;try{m=f.parseClaim(l.claim).claimName}catch(e){return t.status(400).json({success:!1,message:e.message})}s(p,m,null,null),c(null,null,m,null,a,r,t)})}},function(e,t,n){"use strict";function r(e){var t=e.accept;return t&&t.match(/text\/html/)}function a(e){return e["user-agent"]&&e["user-agent"].match(/Mozilla/)}function o(e){var t=e.accept,n=e.range,r=t&&t.match(/image\/.*/)&&!t.match(/text\/html/)&&!t.match(/text\/\*/),a=t&&n;return r||a}function l(e){return 40===e.length&&!/[^A-Za-z0-9]/g.test(e)}function i(e){return 1===e.length}function u(e){return l(e)||i(e)}function s(e,t,n){return p(e,t).then(function(r){if(r===g)return n.status(307).redirect("/api/claim/get/"+t+"/"+e);var a=r.filePath,o=r.fileType;c.verbose("serving file: "+a);var l={headers:{"X-Content-Type-Options":"nosniff","Content-Type":o||"image/jpeg"}};n.status(200).sendFile(a,l)}).catch(function(e){throw e})}var c=n(1),f=n(36),d=f.getClaimId,p=f.getLocalFileRecord,m=n(35),h=m.handleErrorResponse,g="NO_FILE";e.exports={getClaimIdAndServeAsset:function(e,t,n,r,a,o,l){d(e,t,n,r).then(function(e){return"NO_CLAIM"===e?l.status(404).json({success:!1,message:"no claim id could be found"}):"NO_CHANNEL"===e?l.status(404).json({success:!1,message:"no channel id could be found"}):void s(e,n,l)}).catch(function(e){h(a,o,e,l)})},determineResponseType:function(e,t){var n=void 0;return e?(n="SERVE",r(t)&&(n="SHOW")):(n="SHOW",o(t)&&a(t)&&(c.debug("Show request came from browser but wants an image/video. Changing response to serve..."),n="SERVE")),n},flipClaimNameAndIdForBackwardsCompatibility:function(e,t){if(u(t)&&!u(e)){var n=t;t=e,e=n}return[e,t]},logRequestData:function(e,t,n,r){c.debug("responseType ===",e),c.debug("claim name === ",t),c.debug("channel name ===",n),c.debug("claim id ===",r)}}},function(e,t,n){"use strict";var r=function(){function e(e,t){var n=[],r=!0,a=!1,o=void 0;try{for(var l,i=e[Symbol.iterator]();!(r=(l=i.next()).done)&&(n.push(l.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=n(1);e.exports={REGEXP_INVALID_CLAIM:/[^A-Za-z0-9-]/g,REGEXP_INVALID_CHANNEL:/[^A-Za-z0-9-@]/g,REGEXP_ADDRESS:/^b(?=[^0OIl]{32,33})[0-9A-Za-z]{32,33}$/,CHANNEL_CHAR:"@",parseIdentifier:function(t){a.debug("parsing identifier:",t);var n=new RegExp("([^:$#/]*)([:$#]?)([^/]*)"),o=n.exec(t).map(function(e){return e||null}),l=r(o,4),i=l[0],u=l[1],s=l[2],c=l[3];if(a.debug(i+", "+u+", "+s+", "+c),!u)throw new Error('Check your url. No channel name provided before "'+s+'"');var f=u.startsWith(e.exports.CHANNEL_CHAR),d=f?u:null,p=void 0;if(f){if(!d)throw new Error("No channel name after @.");var m=d.match(e.exports.REGEXP_INVALID_CHANNEL);if(m)throw new Error("Invalid characters in channel name: "+m.join(", ")+".")}else p=u;var h=void 0;if(s){if(!c)throw new Error('No modifier provided after separator "'+s+'"');if(":"!==s)throw new Error('The "'+s+'" modifier is not currently supported');h=c}return{isChannel:f,channelName:d,channelClaimId:h,claimId:p}},parseClaim:function(t){a.debug("parsing name:",t);var n=new RegExp("([^:$#/.]*)([:$#.]?)([^/]*)"),o=n.exec(t).map(function(e){return e||null}),l=r(o,4),i=l[0],u=l[1],s=l[2],c=l[3];if(a.debug(i+", "+u+", "+s+", "+c),!u)throw new Error("No claim name provided before .");var f=u.match(e.exports.REGEXP_INVALID_CLAIM);if(f)throw new Error("Invalid characters in claim name: "+f.join(", ")+".");if(s){if(!c)throw new Error("No file extension provided after separator "+s+".");if("."!==s)throw new Error("The "+s+" modifier is not supported in the claim name")}return{claimName:u}},parseModifier:function(e){a.debug("parsing modifier:",e);var t=new RegExp("([^:$#/.]*)([:$#.]?)([^/]*)"),n=t.exec(e).map(function(e){return e||null}),o=r(n,4),l=o[0],i=o[1],u=o[2],s=o[3];a.debug(l+", "+i+", "+u+", "+s);var c=!1;return u&&(c=!0),{hasFileExtension:c}}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var a=n(0),o=r(a),l=n(38),i=n(17),u=n(39),s=r(u),c=n(2),f=n(4),d=n(18),p=r(d),m=n(43),h=r(m),g=n(55),y=r(g),v=n(128),b=r(v),w=n(14),E=n(129),_=n(7),C=n(13),N=r(C),I=function(e,t){return regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,w.call)(e,t);case 2:case"end":return n.stop()}},n,this)})};e.exports=function(e,t){var n={},r=(0,b.default)(),a=(0,i.applyMiddleware)(r),u=(0,i.createStore)(s.default,a),d=(0,_.onHandleShowPageUri)(e.params),m=I(E.handleShowPageUri,d);r.run(m).done.then(function(){var r=(0,l.renderToString)(o.default.createElement(c.Provider,{store:u},o.default.createElement(f.StaticRouter,{location:e.url,context:n},o.default.createElement(p.default,null,o.default.createElement(h.default,null))))),a=N.default.renderStatic();if(n.url)return t.redirect(301,n.url);var i=u.getState();t.send((0,y.default)(a,r,i))})}},function(e,t){e.exports=require("redux-saga")},function(e,t,n){"use strict";function r(e,t){var n,r,a,o,l,u,s,d;return regeneratorRuntime.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:n=void 0,r=void 0,a=void 0,o=void 0,l=void 0,u=void 0,p.prev=1,s=m.default.parseIdentifier(e),n=s.isChannel,r=s.channelName,a=s.channelClaimId,o=s.claimId,d=m.default.parseClaim(t),l=d.claimName,u=d.extension,p.next=17;break;case 12:return p.prev=12,p.t0=p.catch(1),p.next=16,(0,i.put)((0,c.onRequestError)(p.t0.message));case 16:return p.abrupt("return",p.sent);case 17:if(!n){p.next=21;break}return p.next=20,(0,i.call)(f.newAssetRequest,(0,c.onNewAssetRequest)(l,null,r,a,u));case 20:return p.abrupt("return",p.sent);case 21:return p.next=24,(0,i.call)(f.newAssetRequest,(0,c.onNewAssetRequest)(l,o,null,null,u));case 24:case"end":return p.stop()}},h,this,[[1,12]])}function a(e){var t,n,r,a,o,l,u;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:t=void 0,n=void 0,r=void 0,s.prev=1,a=m.default.parseIdentifier(e),t=a.isChannel,n=a.channelName,r=a.channelClaimId,s.next=13;break;case 8:return s.prev=8,s.t0=s.catch(1),s.next=12,(0,i.put)((0,c.onRequestError)(s.t0.message));case 12:return s.abrupt("return",s.sent);case 13:if(!t){s.next=17;break}return s.next=16,(0,i.call)(d.newChannelRequest,(0,c.onNewChannelRequest)(n,r));case 16:return s.abrupt("return",s.sent);case 17:o=void 0,l=void 0,s.prev=18,u=m.default.parseClaim(e),o=u.claimName,l=u.extension,s.next=29;break;case 24:return s.prev=24,s.t1=s.catch(18),s.next=28,(0,i.put)((0,c.onRequestError)(s.t1.message));case 28:return s.abrupt("return",s.sent);case 29:return s.next=31,(0,i.call)(f.newAssetRequest,(0,c.onNewAssetRequest)(o,null,null,null,l));case 31:case"end":return s.stop()}},g,this,[[1,8],[18,24]])}function o(e){var t,n,o;return regeneratorRuntime.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(t=e.data,n=t.identifier,o=t.claim,!n){l.next=5;break}return l.next=4,(0,i.call)(r,n,o);case 4:return l.abrupt("return",l.sent);case 5:return l.next=7,(0,i.call)(a,o);case 7:case"end":return l.stop()}},y,this)}function l(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,i.takeLatest)(s.HANDLE_SHOW_URI,o);case 2:case"end":return e.stop()}},v,this)}Object.defineProperty(t,"__esModule",{value:!0}),t.handleShowPageUri=o,t.watchHandleShowPageUri=l;var i=n(14),u=n(11),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(u),c=n(7),f=n(130),d=n(132),p=n(21),m=function(e){return e&&e.__esModule?e:{default:e}}(p),h=regeneratorRuntime.mark(r),g=regeneratorRuntime.mark(a),y=regeneratorRuntime.mark(o),v=regeneratorRuntime.mark(l)},function(e,t,n){"use strict";function r(e){var t,n,r,a,l,i,p,m,h,g,y,v,b,w;return regeneratorRuntime.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return t=e.data,n=t.requestType,r=t.requestId,a=t.name,l=t.modifier,d.next=3,(0,o.put)((0,u.onRequestUpdate)(n,r));case 3:return d.next=5,(0,o.select)(c.selectShowState);case 5:return i=d.sent,d.next=8,(0,o.select)(f.selectSiteHost);case 8:if(p=d.sent,!i.requestList[r]){d.next=11;break}return d.abrupt("return",null);case 11:return m=void 0,d.prev=12,d.next=15,(0,o.call)(s.getLongClaimId,p,a,l);case 15:h=d.sent,m=h.data,d.next=24;break;case 19:return d.prev=19,d.t0=d.catch(12),d.next=23,(0,o.put)((0,u.onRequestError)(d.t0.message));case 23:return d.abrupt("return",d.sent);case 24:return g="a#"+a+"#"+m,d.next=27,(0,o.put)((0,u.addRequestToRequestList)(r,null,g));case 27:if(!i.assetList[g]){d.next=29;break}return d.abrupt("return",null);case 29:return y=void 0,d.prev=30,d.next=33,(0,o.call)(s.getShortId,p,a,m);case 33:v=d.sent,y=v.data,d.next=42;break;case 37:return d.prev=37,d.t1=d.catch(30),d.next=41,(0,o.put)((0,u.onRequestError)(d.t1.message));case 41:return d.abrupt("return",d.sent);case 42:return b=void 0,d.prev=43,d.next=46,(0,o.call)(s.getClaimData,p,a,m);case 46:w=d.sent,b=w.data,d.next=55;break;case 50:return d.prev=50,d.t2=d.catch(43),d.next=54,(0,o.put)((0,u.onRequestError)(d.t2.message));case 54:return d.abrupt("return",d.sent);case 55:return d.next=57,(0,o.put)((0,u.addAssetToAssetList)(g,null,a,m,y,b));case 57:return d.next=59,(0,o.put)((0,u.onRequestError)(null));case 59:case"end":return d.stop()}},d,this,[[12,19],[30,37],[43,50]])}function a(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,o.takeLatest)(i.ASSET_REQUEST_NEW,r);case 2:case"end":return e.stop()}},p,this)}Object.defineProperty(t,"__esModule",{value:!0}),t.newAssetRequest=r,t.watchNewAssetRequest=a;var o=n(14),l=n(11),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(l),u=n(7),s=n(131),c=n(12),f=n(56),d=regeneratorRuntime.mark(r),p=regeneratorRuntime.mark(a)},function(e,t,n){"use strict";function r(e,t,n){var r={};n&&(n.id?r.claimId=n.id:(r.channelName=n.channel.name,r.channelClaimId=n.channel.id)),r.claimName=t;var a={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)},o=e+"/api/claim/long-id";return(0,i.default)(o,a)}function a(e,t,n){var r=e+"/api/claim/short-id/"+n+"/"+t;return(0,i.default)(r)}function o(e,t,n){var r=e+"/api/claim/data/"+t+"/"+n;return(0,i.default)(r)}Object.defineProperty(t,"__esModule",{value:!0}),t.getLongClaimId=r,t.getShortId=a,t.getClaimData=o;var l=n(6),i=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";function r(e){var t,n,r,a,o,l,u,s,h,g,y,v,b,w;return regeneratorRuntime.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return t=e.data,n=t.requestType,r=t.requestId,a=t.channelName,o=t.channelId,m.next=3,(0,i.put)((0,c.onRequestUpdate)(n,r));case 3:return m.next=5,(0,i.select)(d.selectShowState);case 5:return l=m.sent,m.next=8,(0,i.select)(p.selectSiteHost);case 8:if(u=m.sent,!l.requestList[r]){m.next=11;break}return m.abrupt("return",null);case 11:return s=void 0,h=void 0,m.prev=12,m.next=15,(0,i.call)(f.getChannelData,u,a,o);case 15:g=m.sent,y=g.data,s=y.longChannelClaimId,h=y.shortChannelClaimId,m.next=26;break;case 21:return m.prev=21,m.t0=m.catch(12),m.next=25,(0,i.put)((0,c.onRequestError)(m.t0.message));case 25:return m.abrupt("return",m.sent);case 26:return v="c#"+a+"#"+s,m.next=29,(0,i.put)((0,c.addRequestToRequestList)(r,null,v));case 29:if(!l.channelList[v]){m.next=31;break}return m.abrupt("return",null);case 31:return b=void 0,m.prev=32,m.next=35,(0,i.call)(f.getChannelClaims,u,s,a,1);case 35:w=m.sent,b=w.data,m.next=44;break;case 39:return m.prev=39,m.t1=m.catch(32),m.next=43,(0,i.put)((0,c.onRequestError)(m.t1.message));case 43:return m.abrupt("return",m.sent);case 44:return m.next=46,(0,i.put)((0,c.addNewChannelToChannelList)(v,a,h,s,b));case 46:return m.next=48,(0,i.put)((0,c.onRequestError)(null));case 48:case"end":return m.stop()}},m,this,[[12,21],[32,39]])}function a(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,i.takeLatest)(s.CHANNEL_REQUEST_NEW,r);case 2:case"end":return e.stop()}},h,this)}function o(e){var t,n,r,a,o,l,u,s;return regeneratorRuntime.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return t=e.data,n=t.channelKey,r=t.name,a=t.longId,o=t.page,d.next=3,(0,i.select)(p.selectSiteHost);case 3:return l=d.sent,u=void 0,d.prev=5,d.next=8,(0,i.call)(f.getChannelClaims,l,a,r,o);case 8:s=d.sent,u=s.data,d.next=17;break;case 12:return d.prev=12,d.t0=d.catch(5),d.next=16,(0,i.put)((0,c.onRequestError)(d.t0.message));case 16:return d.abrupt("return",d.sent);case 17:return d.next=19,(0,i.put)((0,c.updateChannelClaims)(n,u));case 19:case"end":return d.stop()}},g,this,[[5,12]])}function l(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,i.takeLatest)(s.CHANNEL_CLAIMS_UPDATE_ASYNC,o);case 2:case"end":return e.stop()}},y,this)}Object.defineProperty(t,"__esModule",{value:!0}),t.newChannelRequest=r,t.watchNewChannelRequest=a,t.watchUpdateChannelClaims=l;var i=n(14),u=n(11),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(u),c=n(7),f=n(133),d=n(12),p=n(56),m=regeneratorRuntime.mark(r),h=regeneratorRuntime.mark(a),g=regeneratorRuntime.mark(o),y=regeneratorRuntime.mark(l)},function(e,t,n){"use strict";function r(e,t,n){t||(t="none");var r=e+"/api/channel/data/"+n+"/"+t;return(0,l.default)(r)}function a(e,t,n,r){r||(r=1);var a=e+"/api/channel/claims/"+n+"/"+t+"/"+r;return(0,l.default)(a)}Object.defineProperty(t,"__esModule",{value:!0}),t.getChannelData=r,t.getChannelClaims=a;var o=n(6),l=function(e){return e&&e.__esModule?e:{default:e}}(o)},function(e,t,n){"use strict";var r=n(37);e.exports=function(e){e.use("*",function(e,t){r(e,t)})}},function(e,t,n){"use strict";var r=n(136),a=r.logLevel;e.exports=function(e){e.configure({transports:[new e.transports.Console({level:a,timestamp:!1,colorize:!0,prettyPrint:!0,handleExceptions:!0,humanReadableUnhandledException:!0})]}),e.error("Level 0"),e.warn("Level 1"),e.info("Level 2"),e.verbose("Level 3"),e.debug("Level 4"),e.silly("Level 5")}},function(e,t,n){"use strict";var r={logLevel:"debug"};e.exports=r},function(e,t,n){"use strict";var r=n(138).SlackWebHook,a=n(30);e.exports=function(e){var t=a.slackWebHook,n=a.slackErrorChannel,o=a.slackInfoChannel;t?(n&&e.add(r,{name:"slack-errors-transport",level:"warn",webhookUrl:t,channel:n,username:"spee.ch",iconEmoji:":face_with_head_bandage:"}),o&&e.add(r,{name:"slack-info-transport",level:"info",webhookUrl:t,channel:o,username:"spee.ch",iconEmoji:":nerd_face:"}),e.error('Slack "error" logging is online.'),e.info('Slack "info" logging is online.')):e.warn("Slack logging is not enabled because no slackWebHook config var provided.")}},function(e,t){e.exports=require("winston-slack-webhook")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(50),o=r(a),l=n(54),i=r(l),u=n(140),s=r(u),c=n(18),f=r(c),d=n(51),p=r(d),m=n(48),h=r(m),g=n(49),y=r(g),v=n(26),b=r(v),w=n(141),E=r(w),_=n(142),C=r(_),N=n(9),I=r(N),P={ActiveStatusBar:o.default,AssetPreview:i.default,ExpandingTextArea:s.default,GAListener:f.default,InactiveStatusBar:p.default,Logo:h.default,NavBarChannelOptionsDropdown:y.default,ProgressBar:b.default,PublishPreview:E.default,PublishUrlMiddleDisplay:C.default,SEO:I.default};t.default=P},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=r(c),d=n(10),p=r(d),m=function(e){function t(e){o(this,t);var n=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n._handleChange=n._handleChange.bind(n),n}return i(t,e),s(t,[{key:"componentDidMount",value:function(){this.adjustTextarea({})}},{key:"_handleChange",value:function(e){var t=this.props.onChange;t&&t(e),this.adjustTextarea(e)}},{key:"adjustTextarea",value:function(e){var t=e.target,n=void 0===t?this.el:t;n.style.height=0,n.style.height=n.scrollHeight+"px"}},{key:"render",value:function(){var e=this,t=a(this.props,[]);return f.default.createElement("textarea",u({},t,{ref:function(t){return e.el=t},onChange:this._handleChange}))}}]),t}(c.Component);m.propTypes={onChange:p.default.func},t.default=m},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(10),f=r(c),d=function(e){function t(e){a(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={imgSource:"",defaultThumbnail:"/assets/img/video_thumb_default.png"},n}return l(t,e),i(t,[{key:"componentDidMount",value:function(){this.setPreviewImageSource(this.props.file)}},{key:"componentWillReceiveProps",value:function(e){e.file!==this.props.file&&this.setPreviewImageSource(e.file),e.thumbnail!==this.props.thumbnail&&(e.thumbnail?this.setPreviewImageSourceFromFile(e.thumbnail):this.setState({imgSource:this.state.defaultThumbnail}))}},{key:"setPreviewImageSourceFromFile",value:function(e){var t=this,n=new FileReader;n.readAsDataURL(e),n.onloadend=function(){t.setState({imgSource:n.result})}}},{key:"setPreviewImageSource",value:function(e){"video/mp4"!==e.type?this.setPreviewImageSourceFromFile(e):(this.props.thumbnail&&this.setPreviewImageSourceFromFile(this.props.thumbnail),this.setState({imgSource:this.state.defaultThumbnail}))}},{key:"render",value:function(){return s.default.createElement("img",{id:"dropzone-preview",src:this.state.imgSource,className:this.props.dimPreview?"dim":"",alt:"publish preview"})}}]),t}(s.default.Component);d.propTypes={dimPreview:f.default.bool.isRequired,file:f.default.object.isRequired,thumbnail:f.default.object},t.default=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=e.publishInChannel,n=e.selectedChannel,r=e.loggedInChannelName,a=e.loggedInChannelShortId;return t?n===r?l.default.createElement("span",{id:"url-channel",className:"url-text--secondary"},r,":",a," /"):l.default.createElement("span",{id:"url-channel-placeholder",className:"url-text--secondary tooltip"},"@channel",l.default.createElement("span",{className:"tooltip-text"},"Select a channel below")," /"):l.default.createElement("span",{id:"url-no-channel-placeholder",className:"url-text--secondary tooltip"},"xyz",l.default.createElement("span",{className:"tooltip-text"},"This will be a random id")," /")}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),l=r(o),i=n(10),u=r(i);a.propTypes={publishInChannel:u.default.bool.isRequired,loggedInChannelName:u.default.string,loggedInChannelShortId:u.default.string},t.default=a}]);
//# sourceMappingURL=index.js.map