1 line
137 KiB
JavaScript
1 line
137 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){for(var a=[],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(){for(var c,M,a=(new Date).getFullYear()-2,A=new t(new Date(a,0,1)),o=[A],b=1;b<48;b++)(M=new t(new Date(a,b,1))).offset!==A.offset&&(c=function(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}(A,M),o.push(c),o.push(new t(new Date(c.at+6e4)))),A=M;for(b=0;b<4;b++)o.push(new t(new Date(a+b,0,1))),o.push(new t(new Date(a+b,6,1)));return o}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(){try{var c=Intl.DateTimeFormat().resolvedOptions().timeZone;if(c&&3<c.length){var M=z[B(c)];if(M)return M;S("Moment Timezone found "+c+" from the Intl api, but did not have that data loaded.")}}catch(c){}for(var a,A,o=L(),b=o.length,p=function(c){for(var M,a,A=c.length,o={},b=[],p=0;p<A;p++)for(M in a=e[c[p].offset]||{})a.hasOwnProperty(M)&&(o[M]=!0);for(p in o)o.hasOwnProperty(p)&&b.push(z[p]);return b}(o),n=[],i=0;i<p.length;i++){for(a=new l(s(p[i])),A=0;A<b;A++)a.scoreOffsetAt(o[A]);n.push(a)}return n.sort(u),0<n.length?n[0].zone.name:void 0}function B(c){return(c||"").toLowerCase().replace(/\//g,"_")}function X(c){var M,a,A,o;for("string"==typeof c&&(c=[c]),M=0;M<c.length;M++)o=B(a=(A=c[M].split("|"))[0]),p[o]=c[M],z[o]=a,function(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}(o,A[2].split(" "))}function s(c,M){c=B(c);var a,A=p[c];return A instanceof f?A:"string"==typeof A?(A=new f(A),p[c]=A):n[c]&&M!==s&&(a=s(n[c],s))?((A=p[c]=new f)._set(a),A.name=z[c],A):null}function m(c){var M,a,A,o;for("string"==typeof c&&(c=[c]),M=0;M<c.length;M++)A=B((a=c[M].split("|"))[0]),o=B(a[1]),n[A]=o,z[A]=a[0],n[o]=A,z[o]=a[1]}function T(c){X(c.zones),m(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 E(c){return E.didShowError||(E.didShowError=!0,S("moment.tz.zoneExists('"+c+"') has been deprecated in favor of !moment.tz.zone('"+c+"')")),!!s(c)}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=s(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.
|