pleroma/priv/static/packs/containers/media_container.js

2 lines
398 KiB
JavaScript
Raw Normal View History

2019-06-26 12:06:28 -07:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{100:function(e,t,n){"use strict";n.r(t),n.d(t,"timeAgoString",function(){return w}),n.d(t,"default",function(){return k});var a,r,o,u=n(0),i=n(2),s=n(6),l=n(1),f=n(15),c=n(3),d=n.n(c),h=n(7),p=Object(h.f)({just_now:{id:"relative_time.just_now",defaultMessage:"now"},seconds:{id:"relative_time.seconds",defaultMessage:"{number}s"},minutes:{id:"relative_time.minutes",defaultMessage:"{number}m"},hours:{id:"relative_time.hours",defaultMessage:"{number}h"},days:{id:"relative_time.days",defaultMessage:"{number}d"},moments_remaining:{id:"time_remaining.moments",defaultMessage:"Moments remaining"},seconds_remaining:{id:"time_remaining.seconds",defaultMessage:"{number, plural, one {# second} other {# seconds}} left"},minutes_remaining:{id:"time_remaining.minutes",defaultMessage:"{number, plural, one {# minute} other {# minutes}} left"},hours_remaining:{id:"time_remaining.hours",defaultMessage:"{number, plural, one {# hour} other {# hours}} left"},days_remaining:{id:"time_remaining.days",defaultMessage:"{number, plural, one {# day} other {# days}} left"}}),m={hour12:!1,year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"},g={month:"short",day:"numeric"},b=1e3,_=6e4,v=36e5,y=864e5,w=function(e,t,n,a){var r=n-t.getTime();return r<1e4?e.formatMessage(p.just_now):r<7*y?r<_?e.formatMessage(p.seconds,{number:Math.floor(r/b)}):r<v?e.formatMessage(p.minutes,{number:Math.floor(r/_)}):r<y?e.formatMessage(p.hours,{number:Math.floor(r/v)}):e.formatMessage(p.days,{number:Math.floor(r/y)}):t.getFullYear()===a?e.formatDate(t,g):e.formatDate(t,Object(f.a)({},g,{year:"numeric"}))},k=Object(h.g)((o=r=function(r){function e(){for(var e,t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return e=r.call.apply(r,[this].concat(n))||this,Object(l.a)(Object(i.a)(e),"state",{now:e.props.intl.now()}),e}Object(s.a)(e,r);var t=e.prototype;return t.shouldComponentUpdate=function(e,t){return this.props.timestamp!==e.timestamp||this.props.intl.locale!==e.intl.locale||this.state.now!==t.now},t.componentWillReceiveProps=function(e){this.props.timestamp!==e.timestamp&&this.setState({now:this.props.intl.now()})},t.componentDidMount=function(){this._scheduleNextUpdate(this.props,this.state)},t.componentWillUpdate=function(e,t){this._scheduleNextUpdate(e,t)},t.componentWillUnmount=function(){clearTimeout(this._timer)},t._scheduleNextUpdate=function(e,t){var n=this;clearTimeout(this._timer);var a,r,o=e.timestamp,i=new Date(o).getTime()-t.now,s=function(e){switch(e){case"second":return b;case"minute":return _;case"hour":return v;case"day":return y;default:return 2147483647}}((a=i,(r=Math.abs(a))<_?"second":r<v?"minute":r<y?"hour":"day")),l=Math.abs(i%s),f=i<0?Math.max(1e4,s-l):Math.max(1e4,l);this._timer=setTimeout(function(){n.setState({now:n.props.intl.now()})},f)},t.render=function(){var e,t,n,a,r=this.props,o=r.timestamp,i=r.intl,s=r.year,l=r.futureDate,f=new Date(o),c=l?(e=i,t=f,n=this.state.now,(a=t.getTime()-n)<1e4?e.formatMessage(p.moments_remaining):a<_?e.formatMessage(p.seconds_remaining,{number:Math.floor(a/b)}):a<v?e.formatMessage(p.minutes_remaining,{number:Math.floor(a/_)}):a<y?e.formatMessage(p.hours_remaining,{number:Math.floor(a/v)}):e.formatMessage(p.days_remaining,{number:Math.floor(a/y)})):w(i,f,this.state.now,s);return Object(u.a)("time",{dateTime:o,title:i.formatDate(f,m)},void 0,c)},e}(d.a.Component),Object(l.a)(r,"defaultProps",{year:(new Date).getFullYear()}),a=o))||a},103:function(e,t,n){"use strict";n.r(t);var a=n(11);n.d(t,"setLocale",function(){return a.setLocale}),n.d(t,"getLocale",function(){return a.getLocale})},12:function(e,t,n){var a;!function(){"use strict";var i={}.hasOwnProperty;function s(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)&&n.length){var r=s.apply(null,n);r&&e.push(r)}else if("object"===a)for(var o in n)i.call(n,o)&&n[o]&&e.push(o)}}return e.join(" ")}e.exports?(s.default=s,e.exports=s):void 0===(a=function(){return s}.apply(t,[]))
2018-08-12 06:29:30 -07:00
//# sourceMappingURL=media_container.js.map