javascript-time-ago 2.5.12 → 2.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +10 -1
  2. package/README.md +462 -316
  3. package/bundle/javascript-time-ago.js +1 -1
  4. package/bundle/javascript-time-ago.js.map +1 -1
  5. package/bundle/javascript-time-ago.min.js +1 -1
  6. package/bundle/javascript-time-ago.min.js.map +1 -1
  7. package/commonjs/FullDateFormatter.js +72 -0
  8. package/commonjs/FullDateFormatter.js.map +1 -0
  9. package/commonjs/FullDateFormatter.test.js +26 -0
  10. package/commonjs/FullDateFormatter.test.js.map +1 -0
  11. package/commonjs/TimeAgo.js +208 -106
  12. package/commonjs/TimeAgo.js.map +1 -1
  13. package/commonjs/TimeAgo.test.js +95 -10
  14. package/commonjs/TimeAgo.test.js.map +1 -1
  15. package/commonjs/steps/getStepMinTime.js +26 -19
  16. package/commonjs/steps/getStepMinTime.js.map +1 -1
  17. package/commonjs/steps/getTimeToNextUpdate.js +10 -2
  18. package/commonjs/steps/getTimeToNextUpdate.js.map +1 -1
  19. package/commonjs/style/twitter.js +2 -3
  20. package/commonjs/style/twitter.js.map +1 -1
  21. package/commonjs/style/twitter.test.js +5 -2
  22. package/commonjs/style/twitter.test.js.map +1 -1
  23. package/full-date-formatter/index.cjs +4 -0
  24. package/full-date-formatter/index.cjs.js +9 -0
  25. package/full-date-formatter/index.d.ts +6 -0
  26. package/full-date-formatter/index.js +1 -0
  27. package/full-date-formatter/package.json +15 -0
  28. package/index.cjs +1 -1
  29. package/index.cjs.js +2 -2
  30. package/index.d.ts +14 -4
  31. package/index.js +3 -1
  32. package/modules/FullDateFormatter.js +67 -0
  33. package/modules/FullDateFormatter.js.map +1 -0
  34. package/modules/FullDateFormatter.test.js +22 -0
  35. package/modules/FullDateFormatter.test.js.map +1 -0
  36. package/modules/TimeAgo.js +208 -107
  37. package/modules/TimeAgo.js.map +1 -1
  38. package/modules/TimeAgo.test.js +95 -8
  39. package/modules/TimeAgo.test.js.map +1 -1
  40. package/modules/steps/getStepMinTime.js +26 -19
  41. package/modules/steps/getStepMinTime.js.map +1 -1
  42. package/modules/steps/getTimeToNextUpdate.js +10 -2
  43. package/modules/steps/getTimeToNextUpdate.js.map +1 -1
  44. package/modules/style/twitter.js +3 -3
  45. package/modules/style/twitter.js.map +1 -1
  46. package/modules/style/twitter.test.js +5 -2
  47. package/modules/style/twitter.test.js.map +1 -1
  48. package/package.json +16 -11
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["javascript-time-ago"]={})}(this,function(t){"use strict";var e="en",r={},n={};function o(){return e}function i(t){return r[t]?t:n[t.toLowerCase()]?n[t.toLowerCase()]:void 0}function u(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).localeMatcher||"lookup";switch(e){case"lookup":case"best fit":return a(t);default:throw new RangeError('Invalid "localeMatcher" option: '.concat(e))}}function a(t){var e=i(t);if(e)return e;for(var r=t.split("-");t.length>1;){r.pop();var n=i(t=r.join("-"));if(n)return n}}var c={af:function(t){return 1==t?"one":"other"},ak:function(t){return 0==t||1==t?"one":"other"},am:function(t){return t>=0&&t<=1?"one":"other"},ar:function(t){var e=String(t).split("."),r=Number(e[0])==t&&e[0].slice(-2);return 0==t?"zero":1==t?"one":2==t?"two":r>=3&&r<=10?"few":r>=11&&r<=99?"many":"other"},ast:function(t){var e=!String(t).split(".")[1];return 1==t&&e?"one":"other"},be:function(t){var e=String(t).split("."),r=Number(e[0])==t,n=r&&e[0].slice(-1),o=r&&e[0].slice(-2);return 1==n&&11!=o?"one":n>=2&&n<=4&&(o<12||o>14)?"few":r&&0==n||n>=5&&n<=9||o>=11&&o<=14?"many":"other"},blo:function(t){return 0==t?"zero":1==t?"one":"other"},br:function(t){var e=String(t).split("."),r=Number(e[0])==t,n=r&&e[0].slice(-1),o=r&&e[0].slice(-2),i=r&&e[0].slice(-6);return 1==n&&11!=o&&71!=o&&91!=o?"one":2==n&&12!=o&&72!=o&&92!=o?"two":(3==n||4==n||9==n)&&(o<10||o>19)&&(o<70||o>79)&&(o<90||o>99)?"few":0!=t&&r&&0==i?"many":"other"},bs:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",o=!e[1],i=r.slice(-1),u=r.slice(-2),a=n.slice(-1),c=n.slice(-2);return o&&1==i&&11!=u||1==a&&11!=c?"one":o&&i>=2&&i<=4&&(u<12||u>14)||a>=2&&a<=4&&(c<12||c>14)?"few":"other"},ca:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=r.slice(-6);return 1==t&&n?"one":0!=r&&0==o&&n?"many":"other"},ceb:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",o=!e[1],i=r.slice(-1),u=n.slice(-1);return o&&(1==r||2==r||3==r)||o&&4!=i&&6!=i&&9!=i||!o&&4!=u&&6!=u&&9!=u?"one":"other"},cs:function(t){var e=String(t).split("."),r=e[0],n=!e[1];return 1==t&&n?"one":r>=2&&r<=4&&n?"few":n?"other":"many"},cy:function(t){return 0==t?"zero":1==t?"one":2==t?"two":3==t?"few":6==t?"many":"other"},da:function(t){var e=String(t).split("."),r=e[0],n=Number(e[0])==t;return 1!=t&&(n||0!=r&&1!=r)?"other":"one"},dsb:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",o=!e[1],i=r.slice(-2),u=n.slice(-2);return o&&1==i||1==u?"one":o&&2==i||2==u?"two":o&&(3==i||4==i)||3==u||4==u?"few":"other"},dz:function(t){return"other"},es:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=r.slice(-6);return 1==t?"one":0!=r&&0==o&&n?"many":"other"},ff:function(t){return t>=0&&t<2?"one":"other"},fr:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=r.slice(-6);return t>=0&&t<2?"one":0!=r&&0==o&&n?"many":"other"},ga:function(t){var e=String(t).split("."),r=Number(e[0])==t;return 1==t?"one":2==t?"two":r&&t>=3&&t<=6?"few":r&&t>=7&&t<=10?"many":"other"},gd:function(t){var e=String(t).split("."),r=Number(e[0])==t;return 1==t||11==t?"one":2==t||12==t?"two":r&&t>=3&&t<=10||r&&t>=13&&t<=19?"few":"other"},he:function(t){var e=String(t).split("."),r=e[0],n=!e[1];return 1==r&&n||0==r&&!n?"one":2==r&&n?"two":"other"},is:function(t){var e=String(t).split("."),r=e[0],n=(e[1]||"").replace(/0+$/,""),o=Number(e[0])==t,i=r.slice(-1),u=r.slice(-2);return o&&1==i&&11!=u||n%10==1&&n%100!=11?"one":"other"},lt:function(t){var e=String(t).split("."),r=e[1]||"",n=Number(e[0])==t,o=n&&e[0].slice(-1),i=n&&e[0].slice(-2);return 1==o&&(i<11||i>19)?"one":o>=2&&o<=9&&(i<11||i>19)?"few":0!=r?"many":"other"},lv:function(t){var e=String(t).split("."),r=e[1]||"",n=r.length,o=Number(e[0])==t,i=o&&e[0].slice(-1),u=o&&e[0].slice(-2),a=r.slice(-2),c=r.slice(-1);return o&&0==i||u>=11&&u<=19||2==n&&a>=11&&a<=19?"zero":1==i&&11!=u||2==n&&1==c&&11!=a||2!=n&&1==c?"one":"other"},mk:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",o=!e[1],i=r.slice(-1),u=r.slice(-2),a=n.slice(-1),c=n.slice(-2);return o&&1==i&&11!=u||1==a&&11!=c?"one":"other"},mt:function(t){var e=String(t).split("."),r=Number(e[0])==t&&e[0].slice(-2);return 1==t?"one":2==t?"two":0==t||r>=3&&r<=10?"few":r>=11&&r<=19?"many":"other"},pl:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=r.slice(-1),i=r.slice(-2);return 1==t&&n?"one":n&&o>=2&&o<=4&&(i<12||i>14)?"few":n&&1!=r&&(0==o||1==o)||n&&o>=5&&o<=9||n&&i>=12&&i<=14?"many":"other"},pt:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=r.slice(-6);return 0==r||1==r?"one":0!=r&&0==o&&n?"many":"other"},ro:function(t){var e=String(t).split("."),r=!e[1],n=Number(e[0])==t&&e[0].slice(-2);return 1==t&&r?"one":!r||0==t||1!=t&&n>=1&&n<=19?"few":"other"},ru:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=r.slice(-1),i=r.slice(-2);return n&&1==o&&11!=i?"one":n&&o>=2&&o<=4&&(i<12||i>14)?"few":n&&0==o||n&&o>=5&&o<=9||n&&i>=11&&i<=14?"many":"other"},se:function(t){return 1==t?"one":2==t?"two":"other"},si:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"";return 0==t||1==t||0==r&&1==n?"one":"other"},sl:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=r.slice(-2);return n&&1==o?"one":n&&2==o?"two":n&&(3==o||4==o)||!n?"few":"other"}};c.as=c.am,c.az=c.af,c.bal=c.af,c.bg=c.af,c.bn=c.am,c.brx=c.af,c.ce=c.af,c.chr=c.af,c.de=c.ast,c.doi=c.am,c.ee=c.af,c.el=c.af,c.en=c.ast,c.et=c.ast,c.eu=c.af,c.fa=c.am,c.fi=c.ast,c.fil=c.ceb,c.fo=c.af,c.fur=c.af,c.fy=c.ast,c.gl=c.ast,c.gu=c.am,c.ha=c.af,c.hi=c.am,c.hr=c.bs,c.hsb=c.dsb,c.hu=c.af,c.hy=c.ff,c.ia=c.ast,c.id=c.dz,c.ig=c.dz,c.ii=c.dz,c.it=c.ca,c.ja=c.dz,c.jgo=c.af,c.jv=c.dz,c.ka=c.af,c.kea=c.dz,c.kk=c.af,c.kl=c.af,c.km=c.dz,c.kn=c.am,c.ko=c.dz,c.ks=c.af,c.ksh=c.blo,c.ku=c.af,c.ky=c.af,c.lb=c.af,c.lkt=c.dz,c.lo=c.dz,c.ml=c.af,c.mn=c.af,c.mr=c.af,c.ms=c.dz,c.my=c.dz,c.nb=c.af,c.ne=c.af,c.nl=c.ast,c.nn=c.af,c.no=c.af,c.nqo=c.dz,c.om=c.af,c.or=c.af,c.pa=c.ak,c.pcm=c.am,c.ps=c.af,c.rm=c.af,c.sah=c.dz,c.sc=c.ast,c.sd=c.af,c.sk=c.cs,c.so=c.af,c.sq=c.af,c.sr=c.bs,c.su=c.dz,c.sv=c.ast,c.sw=c.ast,c.syr=c.af,c.ta=c.af,c.te=c.af,c.th=c.dz,c.ti=c.ak,c.tk=c.af,c.tn=c.af,c.to=c.dz,c.tr=c.af,c.ug=c.af,c.uk=c.ru,c.ur=c.ast,c.uz=c.af,c.vec=c.ca,c.vi=c.dz,c.wae=c.af,c.wo=c.dz,c.xh=c.af,c.yi=c.ast,c.yo=c.dz,c.yue=c.dz,c.zh=c.dz,c.zu=c.am;var f=c;function l(t){return"pt-PT"===t?t:function(t){var e=t.match(s);if(!e)throw new TypeError("Invalid locale: ".concat(t));return e[1]}(t)}var s=/^([a-z0-9]+)/i;function y(t){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(t)}function m(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,p(n.key),n)}}function p(t){var e=function(t,e){if("object"!=y(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==y(e)?e:e+""}var b=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=t.supportedLocalesOf(e);if(0===n.length)throw new RangeError("Unsupported locale: "+e);if(r&&"cardinal"!==r.type)throw new RangeError('Only "cardinal" "type" is supported');this.$=f[l(n[0])]}var e,r,n;return e=t,n=[{key:"supportedLocalesOf",value:function(t){return"string"==typeof t&&(t=[t]),t.filter(function(t){return f[l(t)]})}}],(r=[{key:"select",value:function(t){return this.$(t)}}])&&m(e.prototype,r),n&&m(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function v(t){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v(t)}function h(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function d(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?h(Object(r),!0).forEach(function(e){g(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function g(t,e,r){return(e=j(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function w(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,u,a=[],c=!0,f=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(a.push(n.value),a.length!==e);c=!0);}catch(t){f=!0,o=t}finally{try{if(!c&&null!=r.return&&(u=r.return(),Object(u)!==u))return}finally{if(f)throw o}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return O(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?O(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function S(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,j(n.key),n)}}function j(t){var e=function(t,e){if("object"!=v(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=v(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==v(e)?e:e+""}var P=["second","minute","hour","day","week","month","quarter","year"],A=["auto","always"],T=["long","short","narrow"],D=["lookup","best fit"],k=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=r.numeric,i=r.style,a=r.localeMatcher;if(this.numeric="always",this.style="long",this.localeMatcher="lookup",void 0!==n){if(A.indexOf(n)<0)throw new RangeError('Invalid "numeric" option: '.concat(n));this.numeric=n}if(void 0!==i){if(T.indexOf(i)<0)throw new RangeError('Invalid "style" option: '.concat(i));this.style=i}if(void 0!==a){if(D.indexOf(a)<0)throw new RangeError('Invalid "localeMatcher" option: '.concat(a));this.localeMatcher=a}if("string"==typeof e&&(e=[e]),e.push(o()),this.locale=t.supportedLocalesOf(e,{localeMatcher:this.localeMatcher})[0],!this.locale)throw new Error("No supported locale was found");b.supportedLocalesOf(this.locale).length>0?this.pluralRules=new b(this.locale):console.warn('"'.concat(this.locale,'" locale is not supported')),"undefined"!=typeof Intl&&Intl.NumberFormat?(this.numberFormat=new Intl.NumberFormat(this.locale),this.numberingSystem=this.numberFormat.resolvedOptions().numberingSystem):this.numberingSystem="latn",this.locale=u(this.locale,{localeMatcher:this.localeMatcher})}var e,n,i;return e=t,n=[{key:"format",value:function(){var t=w(M(arguments),2),e=t[0],r=t[1];return this.getRule(e,r).replace("{0}",this.formatNumber(Math.abs(e)))}},{key:"formatToParts",value:function(){var t=w(M(arguments),2),e=t[0],r=t[1],n=this.getRule(e,r),o=n.indexOf("{0}");if(o<0)return[{type:"literal",value:n}];var i=[];return o>0&&i.push({type:"literal",value:n.slice(0,o)}),i=i.concat(this.formatNumberToParts(Math.abs(e)).map(function(t){return d(d({},t),{},{unit:r})})),o+3<n.length-1&&i.push({type:"literal",value:n.slice(o+3)}),i}},{key:"getRule",value:function(t,e){var n,o=(n=this.locale,r[n])[this.style][e];if("string"==typeof o)return o;if("auto"===this.numeric)if(-2===t||-1===t){var i=o["previous".concat(-1===t?"":"-"+Math.abs(t))];if(i)return i}else if(1===t||2===t){var u=o["next".concat(1===t?"":"-"+Math.abs(t))];if(u)return u}else if(0===t&&o.current)return o.current;var a,c=o[(a=t,a<0||0===a&&function(t){return 1/t==-1/0}(a)?"past":"future")];return"string"==typeof c?c:c[this.pluralRules&&this.pluralRules.select(Math.abs(t))||"other"]||c.other}},{key:"formatNumber",value:function(t){return this.numberFormat?this.numberFormat.format(t):String(t)}},{key:"formatNumberToParts",value:function(t){return this.numberFormat&&this.numberFormat.formatToParts?this.numberFormat.formatToParts(t):[{type:"integer",value:this.formatNumber(t)}]}},{key:"resolvedOptions",value:function(){return{locale:this.locale,style:this.style,numeric:this.numeric,numberingSystem:this.numberingSystem}}}],n&&S(e.prototype,n),i&&S(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();k.supportedLocalesOf=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof t)t=[t];else if(!Array.isArray(t))throw new TypeError('Invalid "locales" argument');return t.filter(function(t){return u(t,e)})},k.addLocale=function(t){if(!t)throw new Error("No locale data passed");r[t.locale]=t,n[t.locale.toLowerCase()]=t.locale},k.setDefaultLocale=function(t){e=t},k.getDefaultLocale=o,k.PluralRules=b;var E='Invalid "unit" argument';function N(t){if("symbol"===v(t))throw new TypeError(E);if("string"!=typeof t)throw new RangeError("".concat(E,": ").concat(t));if("s"===t[t.length-1]&&(t=t.slice(0,t.length-1)),P.indexOf(t)<0)throw new RangeError("".concat(E,": ").concat(t));return t}var F='Invalid "number" argument';function I(t){if(t=Number(t),Number.isFinite&&!Number.isFinite(t))throw new RangeError("".concat(F,": ").concat(t));return t}function M(t){if(t.length<2)throw new TypeError('"unit" argument is required');return[I(t[0]),N(t[1])]}function R(t){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},R(t)}function z(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,x(n.key),n)}}function x(t){var e=function(t,e){if("object"!=R(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=R(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==R(e)?e:e+""}var L=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.cache={}}var e,r,n;return e=t,r=[{key:"get",value:function(){for(var t=this.cache,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];for(var o=0,i=r;o<i.length;o++){var u=i[o];if("object"!==R(t))return;t=t[u]}return t}},{key:"put",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=e.pop(),o=e.pop(),i=this.cache,u=0,a=e;u<a.length;u++){var c=a[u];"object"!==R(i[c])&&(i[c]={}),i=i[c]}return i[o]=n}}],r&&z(e.prototype,r),n&&z(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function C(t){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C(t)}function U(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return _(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function $(){return"object"===("undefined"==typeof Intl?"undefined":C(Intl))&&"function"==typeof Intl.DateTimeFormat}function Y(t){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y(t)}function q(t){return function(t){return void 0!==Y(t)&&null!==t&&t.constructor===V}(t)&&(Array.isArray(t.steps)||Array.isArray(t.gradation)||Array.isArray(t.flavour)||"string"==typeof t.flavour||Array.isArray(t.labels)||"string"==typeof t.labels||Array.isArray(t.units)||"function"==typeof t.custom)}var V={}.constructor;var J=60,B=3600,G=86400,H=7*G,K=2630016,Q=31556952;function W(t){switch(t){case"second":return 1;case"minute":return J;case"hour":return B;case"day":return G;case"week":return H;case"month":return K;case"year":return Q}}function X(t){return void 0!==t.factor?t.factor:W(t.unit||t.formatAs)||1}function Z(t){return"floor"===t?Math.floor:Math.round}function tt(t){return"floor"===t?1:.5}function et(t){return et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},et(t)}function rt(t,e){var r,n=e.prevStep,o=e.timestamp,i=e.now,u=e.future,a=e.round;return n&&(n.id||n.unit)&&(r=t["threshold_for_".concat(n.id||n.unit)]),void 0===r&&void 0!==t.threshold&&"function"==typeof(r=t.threshold)&&(r=r(i,u)),void 0===r&&(r=t.minTime),"object"===et(r)&&(r=n&&n.id&&void 0!==r[n.id]?r[n.id]:r.default),"function"==typeof r&&(r=r(o,{future:u,getMinTimeForUnit:function(t,e){return nt(t,e||n&&n.formatAs,{round:a})}})),void 0===r&&t.test&&(r=t.test(o,{now:i,future:u})?0:9007199254740991),void 0===r&&(n?t.formatAs&&n.formatAs&&(r=nt(t.formatAs,n.formatAs,{round:a})):r=0),void 0===r&&console.warn("[javascript-time-ago] A step should specify `minTime`:\n"+JSON.stringify(t,null,2)),r}function nt(t,e,r){var n,o=r.round,i=W(t);if(n=W("now"===e?t:e),void 0!==i&&void 0!==n)return i-n*(1-tt(o))}function ot(t){return ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ot(t)}function it(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function ut(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=ot(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ot(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ot(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function at(t,e,r){var n=r.now,o=r.future,i=r.round,u=r.units,a=r.getNextStep;t=function(t,e){return t.filter(function(t){var r=t.unit,n=t.formatAs;return!(r=r||n)||e.indexOf(r)>=0})}(t,u);var c=function(t,e,r){var n=r.now,o=r.future,i=r.round;if(0===t.length)return;var u=ct(t,e,{now:n,future:o||e<0,round:i});if(-1===u)return;var a=t[u];if(a.granularity){if(0===Z(i)(Math.abs(e)/X(a)/a.granularity)*a.granularity&&u>0)return t[u-1]}return a}(t,e,{now:n,future:o,round:i});return a?c?[t[t.indexOf(c)-1],c,t[t.indexOf(c)+1]]:[void 0,void 0,t[0]]:c}function ct(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=rt(t[n],function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?it(Object(r),!0).forEach(function(e){ut(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):it(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({prevStep:t[n-1],timestamp:r.now-1e3*e},r));return void 0===o||Math.abs(e)<o?n-1:n===t.length-1?n:ct(t,e,r,n+1)}function ft(t,e,r){var n=r.now,o=r.round;if(W(t)){var i=1e3*W(t),u=e>n,a=Math.abs(e-n),c=Z(o)(a/i)*i;return u?c>0?a-c+function(t,e){return(1-tt(t))*e+1}(o,i):a-c+1:-(a-c)+function(t,e){return tt(t)*e}(o,i)}}var lt=31536e9;function st(t,e,r){var n=r.prevStep,o=r.nextStep,i=r.now,u=r.future,a=r.round,c=t.getTime?t.getTime():t,f=function(t){return ft(t,c,{now:i,round:a})},l=function(t,e,r){var n=r.now,o=r.future,i=r.round,u=r.prevStep;if(t){var a=function(t,e,r){var n=r.now,o=r.future,i=r.round,u=r.prevStep,a=rt(t,{timestamp:e,now:n,future:o,round:i,prevStep:u});if(void 0===a)return;return o?e-1e3*a+1:0===a&&e===n?lt:e+1e3*a}(t,e,{now:n,future:o,round:i,prevStep:u});if(void 0===a)return;return a-n}return o?e-n+1:lt}(u?e:o,c,{future:u,now:i,round:a,prevStep:u?n:e});if(void 0!==l){var s;if(e&&(e.getTimeToNextUpdate&&(s=e.getTimeToNextUpdate(c,{getTimeToNextUpdateForUnit:f,getRoundFunction:Z,now:i,future:u,round:a})),void 0===s)){var y=e.unit||e.formatAs;y&&(s=f(y))}return void 0===s?l:Math.min(s,l)}}var yt={};function mt(t){return yt[t]}function pt(t){if(!t)throw new Error("[javascript-time-ago] No locale data passed.");yt[t.locale]=t}var bt={steps:[{formatAs:"now"},{formatAs:"second"},{formatAs:"minute"},{formatAs:"hour"},{formatAs:"day"},{formatAs:"week"},{formatAs:"month"},{formatAs:"year"}],labels:"long"};function vt(t){return vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vt(t)}function ht(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function dt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ht(Object(r),!0).forEach(function(e){gt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ht(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function gt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=vt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=vt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==vt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var wt=dt(dt({},bt),{},{steps:bt.steps.filter(function(t){return"second"!==t.formatAs})}),Ot=[{factor:1,unit:"now"},{threshold:1,threshold_for_now:45.5,factor:1,unit:"second"},{threshold:45.5,factor:J,unit:"minute"},{threshold:150,granularity:5,factor:J,unit:"minute"},{threshold:1350,factor:1800,unit:"half-hour"},{threshold:2550,threshold_for_minute:3150,factor:B,unit:"hour"},{threshold:73800,factor:G,unit:"day"},{threshold:475200,factor:H,unit:"week"},{threshold:2116800,factor:K,unit:"month"},{threshold:27615168,factor:Q,unit:"year"}],St={gradation:Ot,flavour:"long",units:["now","minute","hour","day","week","month","year"]},jt={gradation:Ot,flavour:"long-time",units:["now","minute","hour","day","week","month","year"]};function Pt(t){return t instanceof Date?t:new Date(t)}var At=[{formatAs:"second"},{formatAs:"minute"},{formatAs:"hour"}],Tt={},Dt={minTime:function(t,e){return e.future,(0,e.getMinTimeForUnit)("day")},format:function(t,e){return Tt[e]||(Tt[e]={}),Tt[e].dayMonth||(Tt[e].dayMonth=new Intl.DateTimeFormat(e,{month:"short",day:"numeric"})),Tt[e].dayMonth.format(Pt(t))}},kt={minTime:function(t,e){return e.future?(t-(new Date(new Date(t).getFullYear(),0).getTime()-1))/1e3:(new Date(new Date(t).getFullYear()+1,0).getTime()-t)/1e3},format:function(t,e){return Tt[e]||(Tt[e]={}),Tt[e].dayMonthYear||(Tt[e].dayMonthYear=new Intl.DateTimeFormat(e,{year:"numeric",month:"short",day:"numeric"})),Tt[e].dayMonthYear.format(Pt(t))}};$()?At.push(Dt,kt):At.push({formatAs:"day"},{formatAs:"week"},{formatAs:"month"},{formatAs:"year"});var Et={steps:At,labels:["mini","short-time","narrow","short"]};function Nt(t){return Nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nt(t)}function Ft(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function It(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ft(Object(r),!0).forEach(function(e){Mt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ft(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Mt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Nt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Nt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Nt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Rt=It(It({},Et),{},{steps:[{formatAs:"now"}].concat(Et.steps)});function zt(t){return zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zt(t)}function xt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Lt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?xt(Object(r),!0).forEach(function(e){Ct(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):xt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Ct(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=zt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=zt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==zt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ut=Lt(Lt({},Et),{},{steps:Et.steps.filter(function(t){return"second"!==t.formatAs})});function _t(t){return _t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_t(t)}function $t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Yt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?$t(Object(r),!0).forEach(function(e){qt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$t(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function qt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=_t(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=_t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==_t(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Vt=Yt(Yt({},Ut),{},{steps:[{formatAs:"now"}].concat(Ut.steps)});function Jt(t){return Jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jt(t)}function Bt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Gt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Bt(Object(r),!0).forEach(function(e){Ht(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Bt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Ht(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Jt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Jt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Jt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Kt=Gt(Gt({},Et),{},{steps:Et.steps.filter(function(t){return"second"!==t.formatAs}).map(function(t){return"minute"===t.formatAs?Gt(Gt({},t),{},{minTime:J}):t})}),Qt={steps:[{formatAs:"second"},{formatAs:"minute"},{formatAs:"hour"},{formatAs:"day"},{formatAs:"month"},{formatAs:"year"}],labels:["mini","short-time","narrow","short"]};function Wt(t){return Wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wt(t)}function Xt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Zt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Xt(Object(r),!0).forEach(function(e){te(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function te(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Wt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Wt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Wt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ee=Zt(Zt({},Qt),{},{steps:[{formatAs:"now"}].concat(Qt.steps)});function re(t){return re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},re(t)}function ne(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function oe(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ne(Object(r),!0).forEach(function(e){ie(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ne(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function ie(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=re(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=re(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==re(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ue=oe(oe({},Qt),{},{steps:Qt.steps.filter(function(t){return"second"!==t.formatAs})});function ae(t){return ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ae(t)}function ce(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function fe(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ce(Object(r),!0).forEach(function(e){le(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ce(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function le(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=ae(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ae(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ae(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var se=fe(fe({},ue),{},{steps:[{formatAs:"now"}].concat(ue.steps)});function ye(t){switch(t){case"default":case"round":return bt;case"round-minute":return wt;case"approximate":default:return St;case"time":case"approximate-time":return jt;case"mini":return Qt;case"mini-now":return ee;case"mini-minute":return ue;case"mini-minute-now":return se;case"twitter":return Et;case"twitter-now":return Rt;case"twitter-minute":return Ut;case"twitter-minute-now":return Vt;case"twitter-first-minute":return Kt}}function me(t){return me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},me(t)}function pe(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,u,a=[],c=!0,f=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(a.push(n.value),a.length!==e);c=!0);}catch(t){f=!0,o=t}finally{try{if(!c&&null!=r.return&&(u=r.return(),Object(u)!==u))return}finally{if(f)throw o}}return a}}(t,e)||be(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function be(t,e){if(t){if("string"==typeof t)return ve(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ve(t,e):void 0}}function ve(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function he(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,de(n.key),n)}}function de(t){var e=function(t,e){if("object"!=me(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=me(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==me(e)?e:e+""}var ge,we=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).polyfill;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),"string"==typeof e&&(e=[e]),this.locale=function(t,e){for(var r,n=U(t);!(r=n()).done;){var o=r.value;if(e(o))return o;for(var i=o.split("-");i.length>1;)if(i.pop(),e(o=i.join("-")))return o}throw new Error("No locale data has been registered for any of the locales: ".concat(t.join(", ")))}(e.concat(t.getDefaultLocale()),mt),"undefined"!=typeof Intl&&Intl.NumberFormat&&(this.numberFormat=new Intl.NumberFormat(this.locale)),!1===r?(this.IntlRelativeTimeFormat=Intl.RelativeTimeFormat,this.IntlPluralRules=Intl.PluralRules):(this.IntlRelativeTimeFormat=k,this.IntlPluralRules=k.PluralRules),this.relativeTimeFormatCache=new L,this.pluralRulesCache=new L}var e,r,n;return e=t,r=[{key:"format",value:function(t,e,r){var n;r||(e&&"string"!=typeof(n=e)&&!q(n)?(r=e,e=void 0):r={}),e||(e=wt),"string"==typeof e&&(e=ye(e));var o,i=function(t){if(t.constructor===Date||"object"===me(e=t)&&"function"==typeof e.getTime)return t.getTime();var e;if("number"==typeof t)return t;throw new Error("Unsupported relative time formatter input: ".concat(me(t),", ").concat(t))}(t),u=this.getLabels(e.flavour||e.labels),a=u.labels,c=u.labelsType;void 0!==e.now&&(o=e.now),void 0===o&&void 0!==r.now&&(o=r.now),void 0===o&&(o=Date.now());var f=(o-i)/1e3,l=r.future||f<0,s=function(t,e,r,n){var o=t.now||e&&e.now;return o?"string"==typeof o?o:n?o.future:o.past:r&&r.second&&r.second.current?r.second.current:void 0}(a,mt(this.locale).now,mt(this.locale).long,l);if(e.custom){var y=e.custom({now:o,date:new Date(i),time:i,elapsed:f,locale:this.locale});if(void 0!==y)return y}var m=function(t,e,r){var n=Object.keys(e);return r&&n.push("now"),t&&(n=t.filter(function(t){return"now"===t||n.indexOf(t)>=0})),n}(e.units,a,s),p=r.round||e.round,b=pe(at(e.gradation||e.steps||wt.steps,f,{now:o,units:m,round:p,future:l,getNextStep:!0}),3),v=b[0],h=b[1],d=b[2],g=this.formatDateForStep(i,h,f,{labels:a,labelsType:c,nowLabel:s,now:o,future:l,round:p})||"";return r.getTimeToNextUpdate?[g,st(i,h,{nextStep:d,prevStep:v,now:o,future:l,round:p})]:g}},{key:"formatDateForStep",value:function(t,e,r,n){var o=this,i=n.labels,u=n.labelsType,a=n.nowLabel,c=n.now,f=n.future,l=n.round;if(e){if(e.format)return e.format(t,this.locale,{formatAs:function(t,e){return o.formatValue(e,t,{labels:i,future:f})},now:c,future:f});var s=e.unit||e.formatAs;if(!s)throw new Error("[javascript-time-ago] Each step must define either `formatAs` or `format()`. Step: ".concat(JSON.stringify(e)));if("now"===s)return a;var y=Math.abs(r)/X(e);e.granularity&&(y=Z(l)(y/e.granularity)*e.granularity);var m=-1*Math.sign(r)*Z(l)(y);switch(0===m&&(m=f?0:-0),u){case"long":case"short":case"narrow":return this.getFormatter(u).format(m,s);default:return this.formatValue(m,s,{labels:i,future:f})}}}},{key:"formatValue",value:function(t,e,r){var n=r.labels,o=r.future;return this.getFormattingRule(n,e,t,{future:o}).replace("{0}",this.formatNumber(Math.abs(t)))}},{key:"getFormattingRule",value:function(t,e,r,n){var o=n.future;if(this.locale,"string"==typeof(t=t[e]))return t;var i=t[0===r?o?"future":"past":r<0?"past":"future"]||t;return"string"==typeof i?i:i[this.getPluralRules().select(Math.abs(r))]||i.other}},{key:"formatNumber",value:function(t){return this.numberFormat?this.numberFormat.format(t):String(t)}},{key:"getFormatter",value:function(t){return this.relativeTimeFormatCache.get(this.locale,t)||this.relativeTimeFormatCache.put(this.locale,t,new this.IntlRelativeTimeFormat(this.locale,{style:t}))}},{key:"getPluralRules",value:function(){return this.pluralRulesCache.get(this.locale)||this.pluralRulesCache.put(this.locale,new this.IntlPluralRules(this.locale))}},{key:"getLabels",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];"string"==typeof t&&(t=[t]),t=(t=t.map(function(t){switch(t){case"tiny":case"mini-time":return"mini";default:return t}})).concat("long");for(var e,r=mt(this.locale),n=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=be(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(t);!(e=n()).done;){var o=e.value;if(r[o])return{labelsType:o,labels:r[o]}}}}],r&&he(e.prototype,r),n&&he(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Oe="en";we.getDefaultLocale=function(){return Oe},we.setDefaultLocale=function(t){return Oe=t},we.addDefaultLocale=function(t){if(ge)return console.error("[javascript-time-ago] `TimeAgo.addDefaultLocale()` can only be called once. To add other locales, use `TimeAgo.addLocale()`.");ge=!0,we.setDefaultLocale(t.locale),we.addLocale(t)},we.addLocale=function(t){pt(t),k.addLocale(t)},we.locale=we.addLocale,we.addLabels=function(t,e,r){var n=mt(t);n||(pt({locale:t}),n=mt(t)),n[e]=r},t.default=we,t.intlDateTimeFormatSupported=$,t.intlDateTimeFormatSupportedLocale=function(t){if($())return Intl.DateTimeFormat.supportedLocalesOf(t)[0]},Object.defineProperty(t,"__esModule",{value:!0})});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["javascript-time-ago"]={})}(this,function(t){"use strict";var e="en",r={},n={};function o(){return e}function i(t){e=t}function u(t){if(!t)throw new Error("No locale data passed");r[t.locale]=t,n[t.locale.toLowerCase()]=t.locale}function a(t){return r[t]?t:n[t.toLowerCase()]?n[t.toLowerCase()]:void 0}function f(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).localeMatcher||"lookup";switch(e){case"lookup":case"best fit":return c(t);default:throw new RangeError('Invalid "localeMatcher" option: '.concat(e))}}function c(t){var e=a(t);if(e)return e;for(var r=t.split("-");t.length>1;){r.pop();var n=a(t=r.join("-"));if(n)return n}}var l={af:function(t){return 1==t?"one":"other"},ak:function(t){return 0==t||1==t?"one":"other"},am:function(t){return t>=0&&t<=1?"one":"other"},ar:function(t){var e=String(t).split("."),r=Number(e[0])==t&&e[0].slice(-2);return 0==t?"zero":1==t?"one":2==t?"two":r>=3&&r<=10?"few":r>=11&&r<=99?"many":"other"},ast:function(t){var e=!String(t).split(".")[1];return 1==t&&e?"one":"other"},be:function(t){var e=String(t).split("."),r=Number(e[0])==t,n=r&&e[0].slice(-1),o=r&&e[0].slice(-2);return 1==n&&11!=o?"one":n>=2&&n<=4&&(o<12||o>14)?"few":r&&0==n||n>=5&&n<=9||o>=11&&o<=14?"many":"other"},blo:function(t){return 0==t?"zero":1==t?"one":"other"},br:function(t){var e=String(t).split("."),r=Number(e[0])==t,n=r&&e[0].slice(-1),o=r&&e[0].slice(-2),i=r&&e[0].slice(-6);return 1==n&&11!=o&&71!=o&&91!=o?"one":2==n&&12!=o&&72!=o&&92!=o?"two":(3==n||4==n||9==n)&&(o<10||o>19)&&(o<70||o>79)&&(o<90||o>99)?"few":0!=t&&r&&0==i?"many":"other"},bs:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",o=!e[1],i=r.slice(-1),u=r.slice(-2),a=n.slice(-1),f=n.slice(-2);return o&&1==i&&11!=u||1==a&&11!=f?"one":o&&i>=2&&i<=4&&(u<12||u>14)||a>=2&&a<=4&&(f<12||f>14)?"few":"other"},ca:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=r.slice(-6);return 1==t&&n?"one":0!=r&&0==o&&n?"many":"other"},ceb:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",o=!e[1],i=r.slice(-1),u=n.slice(-1);return o&&(1==r||2==r||3==r)||o&&4!=i&&6!=i&&9!=i||!o&&4!=u&&6!=u&&9!=u?"one":"other"},cs:function(t){var e=String(t).split("."),r=e[0],n=!e[1];return 1==t&&n?"one":r>=2&&r<=4&&n?"few":n?"other":"many"},cy:function(t){return 0==t?"zero":1==t?"one":2==t?"two":3==t?"few":6==t?"many":"other"},da:function(t){var e=String(t).split("."),r=e[0],n=Number(e[0])==t;return 1!=t&&(n||0!=r&&1!=r)?"other":"one"},dsb:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",o=!e[1],i=r.slice(-2),u=n.slice(-2);return o&&1==i||1==u?"one":o&&2==i||2==u?"two":o&&(3==i||4==i)||3==u||4==u?"few":"other"},dz:function(t){return"other"},es:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=r.slice(-6);return 1==t?"one":0!=r&&0==o&&n?"many":"other"},ff:function(t){return t>=0&&t<2?"one":"other"},fr:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=r.slice(-6);return t>=0&&t<2?"one":0!=r&&0==o&&n?"many":"other"},ga:function(t){var e=String(t).split("."),r=Number(e[0])==t;return 1==t?"one":2==t?"two":r&&t>=3&&t<=6?"few":r&&t>=7&&t<=10?"many":"other"},gd:function(t){var e=String(t).split("."),r=Number(e[0])==t;return 1==t||11==t?"one":2==t||12==t?"two":r&&t>=3&&t<=10||r&&t>=13&&t<=19?"few":"other"},he:function(t){var e=String(t).split("."),r=e[0],n=!e[1];return 1==r&&n||0==r&&!n?"one":2==r&&n?"two":"other"},is:function(t){var e=String(t).split("."),r=e[0],n=(e[1]||"").replace(/0+$/,""),o=Number(e[0])==t,i=r.slice(-1),u=r.slice(-2);return o&&1==i&&11!=u||n%10==1&&n%100!=11?"one":"other"},lt:function(t){var e=String(t).split("."),r=e[1]||"",n=Number(e[0])==t,o=n&&e[0].slice(-1),i=n&&e[0].slice(-2);return 1==o&&(i<11||i>19)?"one":o>=2&&o<=9&&(i<11||i>19)?"few":0!=r?"many":"other"},lv:function(t){var e=String(t).split("."),r=e[1]||"",n=r.length,o=Number(e[0])==t,i=o&&e[0].slice(-1),u=o&&e[0].slice(-2),a=r.slice(-2),f=r.slice(-1);return o&&0==i||u>=11&&u<=19||2==n&&a>=11&&a<=19?"zero":1==i&&11!=u||2==n&&1==f&&11!=a||2!=n&&1==f?"one":"other"},mk:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"",o=!e[1],i=r.slice(-1),u=r.slice(-2),a=n.slice(-1),f=n.slice(-2);return o&&1==i&&11!=u||1==a&&11!=f?"one":"other"},mt:function(t){var e=String(t).split("."),r=Number(e[0])==t&&e[0].slice(-2);return 1==t?"one":2==t?"two":0==t||r>=3&&r<=10?"few":r>=11&&r<=19?"many":"other"},pl:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=r.slice(-1),i=r.slice(-2);return 1==t&&n?"one":n&&o>=2&&o<=4&&(i<12||i>14)?"few":n&&1!=r&&(0==o||1==o)||n&&o>=5&&o<=9||n&&i>=12&&i<=14?"many":"other"},pt:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=r.slice(-6);return 0==r||1==r?"one":0!=r&&0==o&&n?"many":"other"},ro:function(t){var e=String(t).split("."),r=!e[1],n=Number(e[0])==t&&e[0].slice(-2);return 1==t&&r?"one":!r||0==t||1!=t&&n>=1&&n<=19?"few":"other"},ru:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=r.slice(-1),i=r.slice(-2);return n&&1==o&&11!=i?"one":n&&o>=2&&o<=4&&(i<12||i>14)?"few":n&&0==o||n&&o>=5&&o<=9||n&&i>=11&&i<=14?"many":"other"},se:function(t){return 1==t?"one":2==t?"two":"other"},si:function(t){var e=String(t).split("."),r=e[0],n=e[1]||"";return 0==t||1==t||0==r&&1==n?"one":"other"},sl:function(t){var e=String(t).split("."),r=e[0],n=!e[1],o=r.slice(-2);return n&&1==o?"one":n&&2==o?"two":n&&(3==o||4==o)||!n?"few":"other"}};l.as=l.am,l.az=l.af,l.bal=l.af,l.bg=l.af,l.bn=l.am,l.brx=l.af,l.ce=l.af,l.chr=l.af,l.de=l.ast,l.doi=l.am,l.ee=l.af,l.el=l.af,l.en=l.ast,l.et=l.ast,l.eu=l.af,l.fa=l.am,l.fi=l.ast,l.fil=l.ceb,l.fo=l.af,l.fur=l.af,l.fy=l.ast,l.gl=l.ast,l.gu=l.am,l.ha=l.af,l.hi=l.am,l.hr=l.bs,l.hsb=l.dsb,l.hu=l.af,l.hy=l.ff,l.ia=l.ast,l.id=l.dz,l.ig=l.dz,l.ii=l.dz,l.it=l.ca,l.ja=l.dz,l.jgo=l.af,l.jv=l.dz,l.ka=l.af,l.kea=l.dz,l.kk=l.af,l.kl=l.af,l.km=l.dz,l.kn=l.am,l.ko=l.dz,l.ks=l.af,l.ksh=l.blo,l.ku=l.af,l.ky=l.af,l.lb=l.af,l.lkt=l.dz,l.lo=l.dz,l.ml=l.af,l.mn=l.af,l.mr=l.af,l.ms=l.dz,l.my=l.dz,l.nb=l.af,l.ne=l.af,l.nl=l.ast,l.nn=l.af,l.no=l.af,l.nqo=l.dz,l.om=l.af,l.or=l.af,l.pa=l.ak,l.pcm=l.am,l.ps=l.af,l.rm=l.af,l.sah=l.dz,l.sc=l.ast,l.sd=l.af,l.sk=l.cs,l.so=l.af,l.sq=l.af,l.sr=l.bs,l.su=l.dz,l.sv=l.ast,l.sw=l.ast,l.syr=l.af,l.ta=l.af,l.te=l.af,l.th=l.dz,l.ti=l.ak,l.tk=l.af,l.tn=l.af,l.to=l.dz,l.tr=l.af,l.ug=l.af,l.uk=l.ru,l.ur=l.ast,l.uz=l.af,l.vec=l.ca,l.vi=l.dz,l.wae=l.af,l.wo=l.dz,l.xh=l.af,l.yi=l.ast,l.yo=l.dz,l.yue=l.dz,l.zh=l.dz,l.zu=l.am;var s=l;function y(t){return"pt-PT"===t?t:function(t){var e=t.match(m);if(!e)throw new TypeError("Invalid locale: ".concat(t));return e[1]}(t)}var m=/^([a-z0-9]+)/i;function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function b(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,v(n.key),n)}}function v(t){var e=function(t,e){if("object"!=p(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==p(e)?e:e+""}var h=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=t.supportedLocalesOf(e);if(0===n.length)throw new RangeError("Unsupported locale: "+e);if(r&&"cardinal"!==r.type)throw new RangeError('Only "cardinal" "type" is supported');this.$=s[y(n[0])]}var e,r,n;return e=t,n=[{key:"supportedLocalesOf",value:function(t){return"string"==typeof t&&(t=[t]),t.filter(function(t){return s[y(t)]})}}],(r=[{key:"select",value:function(t){return this.$(t)}}])&&b(e.prototype,r),n&&b(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}function g(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function w(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?g(Object(r),!0).forEach(function(e){O(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function O(t,e,r){return(e=T(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function S(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,u,a=[],f=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;f=!1}else for(;!(f=(n=i.call(r)).done)&&(a.push(n.value),a.length!==e);f=!0);}catch(t){c=!0,o=t}finally{try{if(!f&&null!=r.return&&(u=r.return(),Object(u)!==u))return}finally{if(c)throw o}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return j(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?j(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function P(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,T(n.key),n)}}function T(t){var e=function(t,e){if("object"!=d(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=d(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==d(e)?e:e+""}var A=["second","minute","hour","day","week","month","quarter","year"],D=["auto","always"],k=["long","short","narrow"],E=["lookup","best fit"],N=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=r.numeric,i=r.style,u=r.localeMatcher;if(this.numeric="always",this.style="long",this.localeMatcher="lookup",void 0!==n){if(D.indexOf(n)<0)throw new RangeError('Invalid "numeric" option: '.concat(n));this.numeric=n}if(void 0!==i){if(k.indexOf(i)<0)throw new RangeError('Invalid "style" option: '.concat(i));this.style=i}if(void 0!==u){if(E.indexOf(u)<0)throw new RangeError('Invalid "localeMatcher" option: '.concat(u));this.localeMatcher=u}if("string"==typeof e&&(e=[e]),e.push(o()),this.locale=t.supportedLocalesOf(e,{localeMatcher:this.localeMatcher})[0],!this.locale)throw new Error("Unsupported locale");h.supportedLocalesOf(this.locale).length>0?this.pluralRules=new h(this.locale):console.warn('"'.concat(this.locale,'" locale is not supported')),"undefined"!=typeof Intl&&Intl.NumberFormat?(this.numberFormat=new Intl.NumberFormat(this.locale),this.numberingSystem=this.numberFormat.resolvedOptions().numberingSystem):this.numberingSystem="latn",this.locale=f(this.locale,{localeMatcher:this.localeMatcher})}var e,n,i;return e=t,n=[{key:"format",value:function(){var t=S(R(arguments),2),e=t[0],r=t[1];return this.getRule(e,r).replace("{0}",this.formatNumber(Math.abs(e)))}},{key:"formatToParts",value:function(){var t=S(R(arguments),2),e=t[0],r=t[1],n=this.getRule(e,r),o=n.indexOf("{0}");if(o<0)return[{type:"literal",value:n}];var i=[];return o>0&&i.push({type:"literal",value:n.slice(0,o)}),i=i.concat(this.formatNumberToParts(Math.abs(e)).map(function(t){return w(w({},t),{},{unit:r})})),o+3<n.length-1&&i.push({type:"literal",value:n.slice(o+3)}),i}},{key:"getRule",value:function(t,e){var n,o=(n=this.locale,r[n])[this.style][e];if("string"==typeof o)return o;if("auto"===this.numeric)if(-2===t||-1===t){var i=o["previous".concat(-1===t?"":"-"+Math.abs(t))];if(i)return i}else if(1===t||2===t){var u=o["next".concat(1===t?"":"-"+Math.abs(t))];if(u)return u}else if(0===t&&o.current)return o.current;var a,f=o[(a=t,a<0||0===a&&function(t){return 1/t==-1/0}(a)?"past":"future")];return"string"==typeof f?f:f[this.pluralRules&&this.pluralRules.select(Math.abs(t))||"other"]||f.other}},{key:"formatNumber",value:function(t){return this.numberFormat?this.numberFormat.format(t):String(t)}},{key:"formatNumberToParts",value:function(t){return this.numberFormat&&this.numberFormat.formatToParts?this.numberFormat.formatToParts(t):[{type:"integer",value:this.formatNumber(t)}]}},{key:"resolvedOptions",value:function(){return{locale:this.locale,style:this.style,numeric:this.numeric,numberingSystem:this.numberingSystem}}}],n&&P(e.prototype,n),i&&P(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();N.supportedLocalesOf=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof t)t=[t];else if(!Array.isArray(t))throw new TypeError('Invalid "locales" argument');return t.filter(function(t){return f(t,e)})},N.addLocale=u,N.addDefaultLocale=function(t){u(t),i(t.locale)},N.setDefaultLocale=i,N.getDefaultLocale=o,N.PluralRules=h;var F='Invalid "unit" argument';function I(t){if("symbol"===d(t))throw new TypeError(F);if("string"!=typeof t)throw new RangeError("".concat(F,": ").concat(t));if("s"===t[t.length-1]&&(t=t.slice(0,t.length-1)),A.indexOf(t)<0)throw new RangeError("".concat(F,": ").concat(t));return t}var x='Invalid "number" argument';function M(t){if(t=Number(t),Number.isFinite&&!Number.isFinite(t))throw new RangeError("".concat(x,": ").concat(t));return t}function R(t){if(t.length<2)throw new TypeError('"unit" argument is required');return[M(t[0]),I(t[1])]}function z(t){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},z(t)}function L(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,C(n.key),n)}}function C(t){var e=function(t,e){if("object"!=z(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=z(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==z(e)?e:e+""}var U=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.cache={}}var e,r,n;return e=t,r=[{key:"get",value:function(){for(var t=this.cache,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];for(var o=0,i=r;o<i.length;o++){var u=i[o];if("object"!==z(t))return;t=t[u]}return t}},{key:"put",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=e.pop(),o=e.pop(),i=this.cache,u=0,a=e;u<a.length;u++){var f=a[u];"object"!==z(i[f])&&(i[f]={}),i=i[f]}return i[o]=n}}],r&&L(e.prototype,r),n&&L(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function _(t){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_(t)}function Y(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return $(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function $(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function q(){return"object"===("undefined"==typeof Intl?"undefined":_(Intl))&&"function"==typeof Intl.DateTimeFormat}function V(t){return V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},V(t)}function J(t){return function(t){return void 0!==V(t)&&null!==t&&t.constructor===B}(t)&&(Array.isArray(t.steps)||Array.isArray(t.gradation)||Array.isArray(t.flavour)||"string"==typeof t.flavour||Array.isArray(t.labels)||"string"==typeof t.labels||Array.isArray(t.units)||"function"==typeof t.custom)}var B={}.constructor;var G=60,H=3600,K=86400,Q=7*K,W=2630016,X=31556952;function Z(t){switch(t){case"second":return 1;case"minute":return G;case"hour":return H;case"day":return K;case"week":return Q;case"month":return W;case"year":return X}}function tt(t){return void 0!==t.factor?t.factor:Z(t.unit||t.formatAs)||1}function et(t){return"floor"===t?Math.floor:Math.round}function rt(t){return"floor"===t?1:.5}function nt(t){return nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nt(t)}function ot(t,e){var r,n=e.prevStep,o=e.timestamp,i=e.now,u=e.future,a=e.round;return n&&(n.id||n.unit)&&(r=t["threshold_for_".concat(n.id||n.unit)]),void 0===r&&void 0!==t.threshold&&"function"==typeof(r=t.threshold)&&(r=r(i,u)),void 0===r&&(r=t.minTime),"object"===nt(r)&&(r=n&&n.id&&void 0!==r[n.id]?r[n.id]:r.default),"function"==typeof r&&(r=r(o,{future:u,getMinTimeForUnit:function(t,e){return it(t,e||n&&n.formatAs,{round:a})}})),void 0===r&&t.test&&(r=t.test(o,{now:i,future:u})?0:9007199254740991),void 0===r&&(n?t.formatAs&&n.formatAs&&(r=it(t.formatAs,n.formatAs,{round:a})):r=0),void 0===r&&console.warn("[javascript-time-ago] A step should specify `minTime`:\n"+JSON.stringify(t,null,2)),r}function it(t,e,r){var n=r.round,o=Z(t),i=Z("now"===e?t:e);if(void 0!==o&&void 0!==i)return o-i*(1-rt(n))}function ut(t){return ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ut(t)}function at(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function ft(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=ut(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ut(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ut(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ct(t,e,r){var n=r.now,o=r.future,i=r.round,u=r.units,a=r.getNextStep;t=function(t,e){return t.filter(function(t){var r=t.unit,n=t.formatAs;return!(r=r||n)||e.indexOf(r)>=0})}(t,u);var f=function(t,e,r){var n=r.now,o=r.future,i=r.round;if(0===t.length)return;var u=lt(t,e,{now:n,future:o||e<0,round:i});if(-1===u)return;var a=t[u];if(a.granularity){if(0===et(i)(Math.abs(e)/tt(a)/a.granularity)*a.granularity&&u>0)return t[u-1]}return a}(t,e,{now:n,future:o,round:i});return a?f?[t[t.indexOf(f)-1],f,t[t.indexOf(f)+1]]:[void 0,void 0,t[0]]:f}function lt(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=ot(t[n],function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?at(Object(r),!0).forEach(function(e){ft(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):at(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({prevStep:t[n-1],timestamp:r.now-1e3*e},r));return void 0===o||Math.abs(e)<o?n-1:n===t.length-1?n:lt(t,e,r,n+1)}function st(t,e,r){var n=r.now,o=r.round;if(Z(t)){var i=1e3*Z(t),u=e>n,a=Math.abs(e-n),f=et(o)(a/i)*i;return u?f>0?a-f+function(t,e){return(1-rt(t))*e+1}(o,i):a-f+1:-(a-f)+function(t,e){return rt(t)*e}(o,i)}}var yt=31536e9;function mt(t,e,r){var n=r.prevStep,o=r.nextStep,i=r.now,u=r.future,a=r.round,f=t.getTime?t.getTime():t,c=function(t){return st(t,f,{now:i,round:a})},l=function(t,e,r){var n=r.now,o=r.future,i=r.round,u=r.prevStep;if(t){var a=function(t,e,r){var n=r.now,o=r.future,i=r.round,u=r.prevStep,a=ot(t,{timestamp:e,now:n,future:o,round:i,prevStep:u});if(void 0===a)return;return o?e-1e3*a+1:0===a&&e===n?yt:e+1e3*a}(t,e,{now:n,future:o,round:i,prevStep:u});if(void 0===a)return;return a-n}return o?e-n+1:yt}(u?e:o,f,{future:u,now:i,round:a,prevStep:u?n:e});if(void 0!==l){var s;if(e&&(e.getTimeToNextUpdate&&(s=e.getTimeToNextUpdate(f,{getTimeToNextUpdateForUnit:c,getRoundFunction:et,now:i,future:u,round:a})),void 0===s)){var y=e.unit||e.formatAs;y&&(s=c(y))}return void 0===s?l:Math.min(s,l)}}var pt={};function bt(t){return pt[t]}function vt(t){if(!t)throw new Error("[javascript-time-ago] No locale data passed.");pt[t.locale]=t}var ht={steps:[{formatAs:"now"},{formatAs:"second"},{formatAs:"minute"},{formatAs:"hour"},{formatAs:"day"},{formatAs:"week"},{formatAs:"month"},{formatAs:"year"}],labels:"long"};function dt(t){return dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dt(t)}function gt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function wt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?gt(Object(r),!0).forEach(function(e){Ot(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):gt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Ot(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=dt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=dt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==dt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var St=wt(wt({},ht),{},{steps:ht.steps.filter(function(t){return"second"!==t.formatAs})}),jt=[{factor:1,unit:"now"},{threshold:1,threshold_for_now:45.5,factor:1,unit:"second"},{threshold:45.5,factor:G,unit:"minute"},{threshold:150,granularity:5,factor:G,unit:"minute"},{threshold:1350,factor:1800,unit:"half-hour"},{threshold:2550,threshold_for_minute:3150,factor:H,unit:"hour"},{threshold:73800,factor:K,unit:"day"},{threshold:475200,factor:Q,unit:"week"},{threshold:2116800,factor:W,unit:"month"},{threshold:27615168,factor:X,unit:"year"}],Pt={gradation:jt,flavour:"long",units:["now","minute","hour","day","week","month","year"]},Tt={gradation:jt,flavour:"long-time",units:["now","minute","hour","day","week","month","year"]};function At(t){return t instanceof Date?t:new Date(t)}var Dt=[{formatAs:"second"},{formatAs:"minute"},{formatAs:"hour"}],kt={},Et={minTime:function(t,e){return e.future,(0,e.getMinTimeForUnit)("day")},format:function(t,e){return kt[e]||(kt[e]={}),kt[e].dayMonth||(kt[e].dayMonth=new Intl.DateTimeFormat(e,{month:"short",day:"numeric"})),kt[e].dayMonth.format(At(t))}},Nt={minTime:function(t,e){return e.future?(t-(new Date(new Date(t).getFullYear(),0).getTime()-1))/1e3:(new Date(new Date(t).getFullYear()+1,0).getTime()-t)/1e3},format:function(t,e){return kt[e]||(kt[e]={}),kt[e].dayMonthYear||(kt[e].dayMonthYear=new Intl.DateTimeFormat(e,{year:"numeric",month:"short",day:"numeric"})),kt[e].dayMonthYear.format(At(t))}};q()?Dt.push(Et,Nt):Dt.push({formatAs:"day"},{formatAs:"week"},{formatAs:"month"},{formatAs:"year"});var Ft={steps:Dt,labels:["mini","short-time","narrow","short"]};function It(t){return It="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},It(t)}function xt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Mt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?xt(Object(r),!0).forEach(function(e){Rt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):xt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Rt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=It(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=It(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==It(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var zt=Mt(Mt({},Ft),{},{steps:[{formatAs:"now"}].concat(Ft.steps)});function Lt(t){return Lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lt(t)}function Ct(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Ut(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ct(Object(r),!0).forEach(function(e){_t(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ct(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _t(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Lt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Lt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Lt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Yt=Ut(Ut({},Ft),{},{steps:Ft.steps.filter(function(t){return"second"!==t.formatAs})});function $t(t){return $t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$t(t)}function qt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Vt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?qt(Object(r),!0).forEach(function(e){Jt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):qt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Jt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=$t(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=$t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==$t(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Bt=Vt(Vt({},Yt),{},{steps:[{formatAs:"now"}].concat(Yt.steps)});function Gt(t){return Gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gt(t)}function Ht(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Kt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ht(Object(r),!0).forEach(function(e){Qt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ht(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Qt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Gt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Gt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Gt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Wt=Kt(Kt({},Ft),{},{steps:Ft.steps.filter(function(t){return"second"!==t.formatAs}).map(function(t){return"minute"===t.formatAs?Kt(Kt({},t),{},{minTime:G}):t})}),Xt={steps:[{formatAs:"second"},{formatAs:"minute"},{formatAs:"hour"},{formatAs:"day"},{formatAs:"month"},{formatAs:"year"}],labels:["mini","short-time","narrow","short"]};function Zt(t){return Zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zt(t)}function te(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function ee(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?te(Object(r),!0).forEach(function(e){re(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):te(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function re(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Zt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Zt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Zt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ne=ee(ee({},Xt),{},{steps:[{formatAs:"now"}].concat(Xt.steps)});function oe(t){return oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oe(t)}function ie(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function ue(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ie(Object(r),!0).forEach(function(e){ae(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ie(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function ae(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=oe(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=oe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==oe(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var fe=ue(ue({},Xt),{},{steps:Xt.steps.filter(function(t){return"second"!==t.formatAs})});function ce(t){return ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ce(t)}function le(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function se(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?le(Object(r),!0).forEach(function(e){ye(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):le(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function ye(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=ce(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ce(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ce(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var me=se(se({},fe),{},{steps:[{formatAs:"now"}].concat(fe.steps)});function pe(t){switch(t){case"default":case"round":return ht;case"round-minute":return St;case"approximate":default:return Pt;case"time":case"approximate-time":return Tt;case"mini":return Xt;case"mini-now":return ne;case"mini-minute":return fe;case"mini-minute-now":return me;case"twitter":return Ft;case"twitter-now":return zt;case"twitter-minute":return Yt;case"twitter-minute-now":return Bt;case"twitter-first-minute":return Wt}}function be(t){return be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},be(t)}function ve(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,u,a=[],f=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;f=!1}else for(;!(f=(n=i.call(r)).done)&&(a.push(n.value),a.length!==e);f=!0);}catch(t){c=!0,o=t}finally{try{if(!f&&null!=r.return&&(u=r.return(),Object(u)!==u))return}finally{if(c)throw o}}return a}}(t,e)||he(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function he(t,e){if(t){if("string"==typeof t)return de(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?de(t,e):void 0}}function de(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ge(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,we(n.key),n)}}function we(t){var e=function(t,e){if("object"!=be(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=be(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==be(e)?e:e+""}var Oe=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).polyfill;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),"string"==typeof e&&(e=[e]),this.locale=function(t,e){for(var r,n=Y(t);!(r=n()).done;){var o=r.value;if(e(o))return o;for(var i=o.split("-");i.length>1;)if(i.pop(),e(o=i.join("-")))return o}throw new Error("No locale data has been registered for any of the locales: ".concat(t.join(", ")))}(e.concat(t.getDefaultLocale()),bt),"undefined"!=typeof Intl&&Intl.NumberFormat&&(this.numberFormat=new Intl.NumberFormat(this.locale)),!1===r?(this.IntlRelativeTimeFormat=Intl.RelativeTimeFormat,this.IntlPluralRules=Intl.PluralRules):(this.IntlRelativeTimeFormat=N,this.IntlPluralRules=N.PluralRules),this.relativeTimeFormatCache=new U,this.pluralRulesCache=new U}var e,r,n;return e=t,r=[{key:"format",value:function(t,e,r){var n,o=this;r||(e&&"string"!=typeof(n=e)&&!J(n)?(r=e,e=void 0):r={}),e||(e=St),"string"==typeof e&&(e=pe(e));var i,u=function(t){if(t.constructor===Date||"object"===be(e=t)&&"function"==typeof e.getTime)return t.getTime();var e;if("number"==typeof t)return t;throw new Error("Unsupported relative time formatter input: ".concat(be(t),", ").concat(t))}(t),a=this.getLabels(e.flavour||e.labels),f=a.labels,c=a.labelsType,l=r.round||e.round,s=Date.now();void 0!==e.now&&(i=e.now),void 0===i&&void 0!==r.now&&(i=r.now),void 0===i&&(i=s);var y,m=function(t){var n=t.now,i=(n-u)/1e3,a=r.future||i<0,s=function(t,e,r,n){var o=t.now||e&&e.now;return o?"string"==typeof o?o:n?o.future:o.past:r&&r.second&&r.second.current?r.second.current:void 0}(f,bt(o.locale).now,bt(o.locale).long,a);if(e.custom){var y=e.custom({now:n,date:new Date(u),time:u,elapsed:i,locale:o.locale});if(void 0!==y)return{getText:function(){return y},getTextRefreshDelay:function(){throw new Error('`getTimeToNextUpdate: true` feature is not supported by legacy "styles" that have a `custom` function')}}}var m=function(t,e,r){var n=Object.keys(e);return r&&n.push("now"),t&&(n=t.filter(function(t){return"now"===t||n.indexOf(t)>=0})),n}(e.units,f,s),p=ve(ct(e.gradation||e.steps||St.steps,i,{now:n,units:m,round:l,future:a,getNextStep:!0}),3),b=p[0],v=p[1],h=p[2];return{getText:function(){return o.formatDateForStep(u,v,i,{labels:f,labelsType:c,nowLabel:s,now:n,future:a,round:l})||""},getTextRefreshDelay:function(){var t=mt(u,v,{nextStep:h,prevStep:b,now:n,future:a,round:l});if("number"==typeof t)return r.getTimeToNextUpdateUncapped?t:Pe(t)}}},p=m({now:i}),b=p.getText,v=p.getTextRefreshDelay;return r.getTimeToNextUpdate?[b(),v()]:r.refresh?(function t(){y=function(t,e){return setTimeout(t,Pe(e))}(function(){var e=m({now:i+(Date.now()-s)}),n=e.getText,o=e.getTextRefreshDelay;r.refresh(n()),t(o())},arguments.length>0&&void 0!==arguments[0]?arguments[0]:6e4)}(v()),[b(),function(){clearTimeout(y)}]):b()}},{key:"formatDateForStep",value:function(t,e,r,n){var o=this,i=n.labels,u=n.labelsType,a=n.nowLabel,f=n.now,c=n.future,l=n.round;if(e){if(e.format)return e.format(t,this.locale,{formatAs:function(t,e){return o.formatValue(e,t,{labels:i,future:c})},now:f,future:c});var s=e.unit||e.formatAs;if(!s)throw new Error("[javascript-time-ago] Each step must define either `formatAs` or `format()`. Step: ".concat(JSON.stringify(e)));if("now"===s)return a;var y=Math.abs(r)/tt(e);e.granularity&&(y=et(l)(y/e.granularity)*e.granularity);var m=-1*Math.sign(r)*et(l)(y);switch(0===m&&(m=c?0:-0),u){case"long":case"short":case"narrow":return this.getFormatter(u).format(m,s);default:return this.formatValue(m,s,{labels:i,future:c})}}}},{key:"formatValue",value:function(t,e,r){var n=r.labels,o=r.future;return this.getFormattingRule(n,e,t,{future:o}).replace("{0}",this.formatNumber(Math.abs(t)))}},{key:"getFormattingRule",value:function(t,e,r,n){var o=n.future;if(this.locale,"string"==typeof(t=t[e]))return t;var i=t[0===r?o?"future":"past":r<0?"past":"future"]||t;return"string"==typeof i?i:i[this.getPluralRules().select(Math.abs(r))]||i.other}},{key:"formatNumber",value:function(t){return this.numberFormat?this.numberFormat.format(t):String(t)}},{key:"getFormatter",value:function(t){return this.relativeTimeFormatCache.get(this.locale,t)||this.relativeTimeFormatCache.put(this.locale,t,new this.IntlRelativeTimeFormat(this.locale,{style:t}))}},{key:"getPluralRules",value:function(){return this.pluralRulesCache.get(this.locale)||this.pluralRulesCache.put(this.locale,new this.IntlPluralRules(this.locale))}},{key:"getLabels",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];"string"==typeof t&&(t=[t]),t=(t=t.map(function(t){switch(t){case"tiny":case"mini-time":return"mini";default:return t}})).concat("long");for(var e,r=bt(this.locale),n=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=he(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(t);!(e=n()).done;){var o=e.value;if(r[o])return{labelsType:o,labels:r[o]}}}}],r&&ge(e.prototype,r),n&&ge(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Se="en";Oe.getDefaultLocale=function(){return Se},Oe.setDefaultLocale=function(t){Se=t},Oe.addDefaultLocale=function(t){je&&Oe.getDefaultLocale()!==t.locale&&console.warn("[javascript-time-ago] You're adding \"".concat(t.locale,'" as the default locale but you have already added "').concat(Oe.getDefaultLocale(),'" as the default locale. "').concat(t.locale,'" is the default locale now.')),je=!0,Oe.addLocale(t),Oe.setDefaultLocale(t.locale)};var je=!1;function Pe(t){return Math.min(t,Te)}Oe.addLocale=function(t){vt(t),N.addLocale(t)},Oe.locale=Oe.addLocale,Oe.addLabels=function(t,e,r){var n=bt(t);n||(vt({locale:t}),n=bt(t)),n[e]=r};var Te=2147483647;function Ae(t){return Ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ae(t)}function De(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ke(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ne(n.key),n)}}function Ee(t,e,r){return e&&ke(t.prototype,e),r&&ke(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ne(t){var e=function(t,e){if("object"!=Ae(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ae(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ae(e)?e:e+""}var Fe=function(){function t(e){De(this,t);var r="object"===("undefined"==typeof Intl?"undefined":Ae(Intl))&&"function"==typeof Intl.DateTimeFormat;this.formatter=r?new Intl.DateTimeFormat(e,xe):new Ie}return Ee(t,[{key:"format",value:function(t){return this.formatter.format(function(t){if("number"==typeof t)return new Date(t);return t}(t))}}]),t}(),Ie=function(){function t(){De(this,t)}return Ee(t,[{key:"format",value:function(t){return String(t)}}]),t}();var xe={weekday:"long",day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"};t.FullDateFormatter=Fe,t.default=Oe,t.intlDateTimeFormatSupported=q,t.intlDateTimeFormatSupportedLocale=function(t){if(q())return Intl.DateTimeFormat.supportedLocalesOf(t)[0]},Object.defineProperty(t,"__esModule",{value:!0})});
2
2
  //# sourceMappingURL=javascript-time-ago.min.js.map