1 line
127 KiB
JavaScript
1 line
127 KiB
JavaScript
|
!function(c,M){"use strict";"object"==typeof module&&module.exports?module.exports=M(require("moment")):"function"==typeof define&&define.amd?define(["moment"],M):M(c.moment)}(this,function(z){"use strict";var M,p={},a={},i={},e={};z&&"string"==typeof z.version||R("Moment Timezone requires Moment.js. See https://momentjs.com/timezone/docs/#/use-it/browser/");var c=z.version.split("."),A=+c[0],b=+c[1];function n(c){return 96<c?c-87:64<c?c-29:c-48}function o(c){var M=0,A=c.split("."),b=A[0],o=A[1]||"",z=1,p=0,a=1;for(45===c.charCodeAt(0)&&(a=-(M=1));M<b.length;M++)p=60*p+n(b.charCodeAt(M));for(M=0;M<o.length;M++)z/=60,p+=n(o.charCodeAt(M))*z;return p*a}function O(c){for(var M=0;M<c.length;M++)c[M]=o(c[M])}function q(c,M){var A,b=[];for(A=0;A<M.length;A++)b[A]=c[M[A]];return b}function r(c){var M=c.split("|"),A=M[2].split(" "),b=M[3].split(""),o=M[4].split(" ");return O(A),O(b),O(o),function(c,M){for(var A=0;A<M;A++)c[A]=Math.round((c[A-1]||0)+6e4*c[A]);c[M-1]=1/0}(o,b.length),{name:M[0],abbrs:q(M[1].split(" "),b),offsets:q(A,b),untils:o,population:0|M[5]}}function d(c){c&&this._set(r(c))}function N(c){var M=c.toTimeString(),A=M.match(/\([a-z ]+\)/i);"GMT"===(A=A&&A[0]?(A=A[0].match(/[A-Z]/g))?A.join(""):void 0:(A=M.match(/[A-Z]{3,5}/g))?A[0]:void 0)&&(A=void 0),this.at=+c,this.abbr=A,this.offset=c.getTimezoneOffset()}function f(c){this.zone=c,this.offsetScore=0,this.abbrScore=0}function L(c,M){for(var A,b;b=6e4*((M.at-c.at)/12e4|0);)(A=new N(new Date(c.at+b))).offset===c.offset?c=A:M=A;return c}function W(c,M){return c.offsetScore!==M.offsetScore?c.offsetScore-M.offsetScore:c.abbrScore!==M.abbrScore?c.abbrScore-M.abbrScore:c.zone.population!==M.zone.population?M.zone.population-c.zone.population:M.zone.name.localeCompare(c.zone.name)}function X(c,M){var A,b;for(O(M),A=0;A<M.length;A++)b=M[A],e[b]=e[b]||{},e[b][c]=!0}function l(){try{var c=Intl.DateTimeFormat().resolvedOptions().timeZone;if(c&&3<c.length){var M=i[B(c)];if(M)return M;R("Moment Timezone found "+c+" from the Intl api, but did not have that data loaded.")}}catch(c){}var A,b,o,z=function(){var c,M,A,b=(new Date).getFullYear()-2,o=new N(new Date(b,0,1)),z=[o];for(A=1;A<48;A++)(M=new N(new Date(b,A,1))).offset!==o.offset&&(c=L(o,M),z.push(c),z.push(new N(new Date(c.at+6e4)))),o=M;for(A=0;A<4;A++)z.push(new N(new Date(b+A,0,1))),z.push(new N(new Date(b+A,6,1)));return z}(),p=z.length,a=function(c){var M,A,b,o=c.length,z={},p=[];for(M=0;M<o;M++)for(A in b=e[c[M].offset]||{})b.hasOwnProperty(A)&&(z[A]=!0);for(M in z)z.hasOwnProperty(M)&&p.push(i[M]);return p}(z),n=[];for(b=0;b<a.length;b++){for(A=new f(u(a[b]),p),o=0;o<p;o++)A.scoreOffsetAt(z[o]);n.push(A)}return n.sort(W),0<n.length?n[0].zone.name:void 0}function B(c){return(c||"").toLowerCase().replace(/\//g,"_")}function t(c){var M,A,b,o;for("string"==typeof c&&(c=[c]),M=0;M<c.length;M++)o=B(A=(b=c[M].split("|"))[0]),p[o]=c[M],i[o]=A,X(o,b[2].split(" "))}function u(c,M){c=B(c);var A,b=p[c];return b instanceof d?b:"string"==typeof b?(b=new d(b),p[c]=b):a[c]&&M!==u&&(A=u(a[c],u))?((b=p[c]=new d)._set(A),b.name=i[c],b):null}function s(c){var M,A,b,o;for("string"==typeof c&&(c=[c]),M=0;M<c.length;M++)b=B((A=c[M].split("|"))[0]),o=B(A[1]),a[b]=o,i[b]=A[0],a[o]=b,i[o]=A[1]}function T(c){t(c.zones),s(c.links),E.dataVersion=c.version}function m(c){var M="X"===c._f||"x"===c._f;return!(!c._a||void 0!==c._tzm||M)}function R(c){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(c)}function E(c){var M=Array.prototype.slice.call(arguments,0,-1),A=arguments[arguments.length-1],b=u(A),o=z.utc.apply(null,M);return b&&!z.isMoment(c)&&m(o)&&o.add(b.parse(o),"minutes"),o.tz(A),o}(A<2||2==A&&b<6)&&R("Moment Timezone requires Moment.js >= 2.6.0. You are using Moment.js "+z.version+". See momentjs.com"),d.prototype={_set:function(c){this.name=c.name,this.abbrs=c.abbrs,this.untils=c.untils,this.offsets=c.offsets,this.population=c.population},_index:function(c){var M,A=+c,b=this.untils;for(M=0;M<b.length;M++)if(A<b[M])return M},parse:function(c){var M,A,b,o,z=+c,p=this.offsets,a=this.untils,n=a.length-1;for(o=0;
|