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