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

3 lines
702 KiB
JavaScript
Raw Normal View History

2020-05-19 23:55:14 -06:00
/*! For license information please see media_container.js.LICENSE.txt */
(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{100:function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},101:function(e,t,a){"use strict";var n=a(22),r=a(0),i=(a(9),a(6),a(8)),o=a(3),s=a.n(o),l=a(113),f=a.n(l);var c=["opacity","backgroundOpacity"],u=function(e){Object(i.a)(a,e);var t;t=a;function a(){return e.apply(this,arguments)||this}return a.prototype.render=function(){var e=this.props,t=e.style,a=e.defaultStyle,n=e.children;return Object.keys(t).forEach((function(e){var n;c.includes(e)||(t[e]=a[e]="object"==typeof(n=t[e])&&n&&"val"in n?n.val:n)})),Object(r.a)(f.a,{style:t,defaultStyle:a},void 0,n)},a}(s.a.Component);t.a=n.p?u:f.a},102:function(e,t,a){"use strict";a.r(t),a.d(t,"timeAgoString",(function(){return _})),a.d(t,"default",(function(){return v}));var n,r,i,o=a(0),s=a(2),l=(a(9),a(6),a(8)),f=a(1),c=a(10),u=a(3),d=a.n(u),h=a(7);var p=Object(h.f)({today:{id:"relative_time.today",defaultMessage:"today"},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=864e5,_=function(e,t,a,n,r){void 0===r&&(r=!0);var i=a-t.getTime();return i<b&&!r?e.formatMessage(p.today):i<1e4?e.formatMessage(p.just_now):i<7*b?i<6e4?e.formatMessage(p.seconds,{number:Math.floor(i/1e3)}):i<36e5?e.formatMessage(p.minutes,{number:Math.floor(i/6e4)}):i<b?e.formatMessage(p.hours,{number:Math.floor(i/36e5)}):e.formatMessage(p.days,{number:Math.floor(i/b)}):t.getFullYear()===n?e.formatDate(t,g):e.formatDate(t,Object(c.default)({},g,{year:"numeric"}))},v=Object(h.g)((i=r=function(e){Object(l.a)(a,e);var t;t=a;function a(){for(var t,a=arguments.length,n=new Array(a),r=0;r<a;r++)n[r]=arguments[r];return t=e.call.apply(e,[this].concat(n))||this,Object(f.a)(Object(s.a)(t),"state",{now:t.props.intl.now()}),t}var n=a.prototype;return n.shouldComponentUpdate=function(e,t){return this.props.timestamp!==e.timestamp||this.props.intl.locale!==e.intl.locale||this.state.now!==t.now},n.componentWillReceiveProps=function(e){this.props.timestamp!==e.timestamp&&this.setState({now:this.props.intl.now()})},n.componentDidMount=function(){this._scheduleNextUpdate(this.props,this.state)},n.componentWillUpdate=function(e,t){this._scheduleNextUpdate(e,t)},n.componentWillUnmount=function(){clearTimeout(this._timer)},n._scheduleNextUpdate=function(e,t){var a=this;clearTimeout(this._timer);var n=e.timestamp,r=new Date(n).getTime()-t.now,i=function(e){switch(e){case"second":return 1e3;case"minute":return 6e4;case"hour":return 36e5;case"day":return b;default:return 2147483647}}(function(e){var t=Math.abs(e);return t<6e4?"second":t<36e5?"minute":t<b?"hour":"day"}(r)),o=Math.abs(r%i),s=r<0?Math.max(1e4,i-o):Math.max(1e4,o);this._timer=setTimeout((function(){a.setState({now:a.props.intl.now()})}),s)},n.render=function(){var e=this.props,t=e.timestamp,a=e.intl,n=e.year,r=e.futureDate,i=t.includes("T"),s=new Date(t),l=r?function(e,t,a,n){void 0===n&&(n=!0);var r=t.getTime()-a;return r<b&&!n?e.formatMessage(p.today):r<1e4?e.formatMessage(p.moments_remaining):r<6e4?e.formatMessage(p.seconds_remaining,{number:Math.floor(r/1e3)}):r<36e5?e.formatMessage(p.minutes_remaining,{number:Math.floor(r/6e4)}):r<b?e.formatMessage(p.hou
2018-08-12 07:29:30 -06:00
//# sourceMappingURL=media_container.js.map